Skip to main content

Posts

How to make java point to right version of java on your Mac ?

A usual problem on mac where the even after upgrading or installing the latest version of Java, when queried in command line for java version it still refers to the old version of java. something like below : $ java -version java version "1.7.0_79" Java(TM) SE Runtime Environment (build 1.7.0_79-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode) This is because the /usr/bin/java is pointing to   /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java on the system.    $ ls -la `which java` /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java This is because  Oracle's installer puts java inside the   /Library/Internet Plug-Ins/JavaAppletPlugin.plugin . And it doesn't overwrite  /usr/bin/java. So to fix this we have remove the existing soft link to old java and point it to new java binary. which can be done by performing following steps. ...

How to fix broken python module easy_install on mac ?

           Easy Install is a python module ( easy_install ) bundled with  setuptools  that lets you automatically download, build, install, and manage Python packages. Sometimes due wrong installations easy_install might get corrupted and fail to install any package afterwords. You might see errors like below when you try to install any modules Traceback (most recent call last):   File "/usr/local/bin/easy_install", line 7, in     from setuptools.command.easy_install import main   File "/Library/Python/2.7/site-packages/setuptools/__init__.py", line 12, in     import setuptools.version   File "/Library/Python/2.7/site-packages/setuptools/version.py", line 1, in     import pkg_resources   File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 72, in     import packaging.requirements   File "/Library/Python/2.7/site-packages/packaging/requireme...

Calculating hash(md5, sha1...) of a hex string in Python

To calculate hash of hex string in python: In [ 1 ]: import hashlib In [ 2 ]: import binascii In [ 3 ]: hex_string = '3082010a0282010100c3dfee03290fb01e3a4887c5ce0630dcdd8495bfb568b1f61cb8fa8294545b74f06facd215933c53babdd4d066dcb2a713740b9a018c8e0d5fbe1c2a7c793d317c69590c6a34cb1758fd1ff00f36d757c97371d08e9e9efcad1bf6fc8a0c03972296870ad825fa81000fee7aa79c2bcfab0e92d67d3d429d9a25cd6087e3139b17ce1809a6bf83d5ef40ff8e4532412adc15c63eff4eadd264860cb61b381e4f0e8a9e19cf7e39fefdfe9904b1aafe54f12289b930e341dd12b5a41eca1ae9d3556e6c7860a162652a31e256a7fa5720b4cbeb32fa65b67eb0610c6857dfe775d71de5aeb041d7ea0a7c5f335d678280b30dd014e16b37290c4c56d20df737850203010001' In [ 4 ]: hashlib.md5(binascii.unhexlify(hex_string)).hexdigest() Out[ 4 ]: '0c6f3dd3d5d896e0f3f49dfae0437ba1' In [ 6 ]: hashlib.sha1(binascii.unhexlify(hex_string)).hexdigest() Out[ 6 ]: 'fc6d7e7925e18c5bed6314ea112a230948cfde75' In [ 7 ]: hashlib.sha256(...

How to extract signing certificates from macOS binary files

Code signing is a macOS security technology that you use to certify that an app was created by you. Once an app is signed, the system can detect any change to the app—whether the change is introduced accidentally or by malicious code. As Apple Developer site says ( click here for more details  on code signing) : code signing allows the operating system to: Ensure that a piece of code has not been altered since it was signed.  The system can detect even the smallest change, whether it was intentional (by a malicious attacker, for example) or accidental (as when a file gets corrupted). When a code signature is intact, the system can be sure the code is as the signer intended. Identify code as coming from a specific source (a developer or signer).  The code signature includes cryptographic information that unambiguously points to a particular author. Determine whether code is trustworthy for a specific purpose.  Among other things, a developer can use a ...

How to fix "This copy of the Install OS X Mavericks application can't be verified. It may have been corrupted or tampered with during downloading." message and install Mavericks or older operating system versions of OS X on VmWare Fusion application

It is very annoying to see  the message  "This copy of the Install OS X Mavericks application can't be verified. It may have been corrupted or tampered with during downloading."   when you try to install old releases of Apple OS X operating systems such as Mountain Lion, Mavericks, Yosemite etc. If you are trying to install OS X Mavericks as virtual machine in VMWare fusion or in physical system, then follow below steps to successfully install the operating system. In VMWARE Fusion. Create a OSX Mavericks VM by attaching OSX Mavericks Installer to the virtual machine. Do not Poweron the virtual machine. If powered on automatically after 1st step above then poweroff the VM. Open Virtual Machine Settings, Goto Advanced Section. Un check "Synchronize Time" setting. Start the Virtual Machine to install the OSX Mavericks. In the OSX Installer app , Launch Terminal.app. Set the system date to old date as  date 102613152013 ( Oct/26/2013 13:15). Quit...

What is com.apple.Dont_Steal_Mac_OS_X (7.0.0) kext is doing on OS X systems ?

When you run kextstat command to see the list of kernel extensions loaded in the system, you might come across kext named com.apple.Dont_Steal_Mac_OS_X (7.0.0) being loaded all the time. You might me wondering what is the role of this kernel extension.  com.apple.Dont_Steal_Mac_OS_X  prevents OS X from being used on non approved Intel hardware – as OS X is licensed only for use of approved Apple Intel hardware. This kext is used to control software piracy of OSX on non Apple supported hardwares. Hence its role is to detect and fail the OSX installation on non apple certified hardwares.