Skip to main content

Posts

Showing posts with the label Hack

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 disable default certificate verification in Python 2.7.9 and above permanently on Mac?

Python from 2.7.9 and above now verifies the SSL certificate prior establishing the connection to server. This might cause problem in few servers which do not support certificate validation yet. In these circumstances the HTTPS connection requests fails due to new changes in python. For more information on the new changes please read more at :  https://www.python.org/dev/peps/pep-0476/ . This link describes the ways to establish ssl connection without certificate verification. In my case i was not using the httplib modules API directly hence i had to find out a crude approach to disable the SSL certificate  verification. I would not recommend the below change unless it is really required to do it as you might be opening a set of vulnerabilities as specified in this article .  However the below sample code tells you how disable SSL certificate  verification completely on your system.  1. Open Terminal 2. Open with sudo privileges the following file [...