OSX Lion JAVA_HOME

Apple’s OS Lion has a pretty neat trick for handling the JAVA_HOME variable


Chill:bin rus$ /usr/libexec/java_home
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

which is super awesome as you can simply do


Chill:bin rus$ export JAVA_HOME=$(/usr/libexec/java_home)
Chill:bin rus$ echo $JAVA_HOME
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

to make sure you have the correct $JAVA_HOME set up, every time!

I’ve added this commend to my ~/.profile file so that whenever I open a new terminal, the $JAVA_HOME variable gets set correctly!

Take Screenshot Mac

To take a screenshot on a Mac you can use the following simple keyboard shortcuts:

To save a screenshot to the desktop on a Mac

  • Command-Shift-3 : Take a screenshot of the Mac screen, and save it as a file on the desktop.
  • Command-Shift-4 : Hold down the mouse button and select an area of the Mac screen to save a screenshot of that area as a fiile on the desktop.
  • Command-Shift-4 : Press the space key and then click a window to take a screenshot of that window and save it as a file on the desktop.

To save a screenshot to the clipboard on a Mac

  • Command-Control-Shift-3 : Take a screenshot of the Mac screen, and save it to the clipboard.
  • Command-Control-Shift-4 : Hold down the mouse button and select an area of the Mac screen to save a screenshot of that area to the clipboard.
  • Command-Control-Shift-4 : Press the space key and then click a window to take a screenshot of that window to the clipboard.

 

Canon EOS Utility On A Mac Without A CD

Canon have a fantastic little app, which works on both Windows and Mac, called EOS Utility, which among other things allows you to do time lapse photography!

I lost my CD ages ago, because you know … everyone knows that all responsible companies let you download support tools from their website ..

Unfortunately no one informed Canon of this amazing new way of thinking, and they only let you download an update for the EOS Utility application, which throws a massive hissy fit if you try to install it on a machine that doesn’t already have it installed!

After a lot of Googling (that’s now a verb .. get in line behind Hoover!) I found this awesome site :

Cracking Canons EOS Utility For Mac at the Hacker Blog!

With just a few mouse clicks you can tweak the Mac EOS Utility updater to act as an installer!

Thanks Hacker Blog!!

Python support for SSL and HTTPS is not installed

I wanted to give Google’s new Go language a try which requires checking out the source code with Mercurial.

Mercurial was installed from ports on my Mac with


sudo port install mecurial

But checking out the code threw an error.


Chill:~ rus$ hg clone -r release https://go.googlecode.com/hg/ $GOROOT
abort: Python support for SSL and HTTPS is not installed
Exception exceptions.AttributeError: "'httpsrepository' object has no attribute 'urlopener'" in > ignored

After some hunting I found the answer is to install the python socket ssl library from ports


Chill:~ rus$ sudo port install py25-socket-ssl
---> Fetching py25-socket-ssl
---> Verifying checksum(s) for py25-socket-ssl
---> Extracting py25-socket-ssl
---> Configuring py25-socket-ssl
---> Building py25-socket-ssl
---> Staging py25-socket-ssl into destroot
---> Installing py25-socket-ssl @2.5.4_0
---> Activating py25-socket-ssl @2.5.4_0
---> Cleaning py25-socket-ssl

Which then let me check out the source for Go!


Chill:~ rus$ hg clone -r release https://go.googlecode.com/hg/ $GOROOT
requesting all changes
adding changesets
adding manifests
adding file changes
added 3976 changesets with 16799 changes to 2931 files
updating working directory
1640 files updated, 0 files merged, 0 files removed, 0 files unresolved

Now it’s time to compile 😀