HPC @ Uni.lu

High Performance Computing in Luxembourg

Mac OS X Install

Installation notes of Mac OS X Mountain Lion

It may not be the best place to share these notes yet as it might interest some of our numerous Mac users of the UL HPC platform…

Pre-requisites: System Preferences

Previous notes on Snow Leopard, to be adapted:

  • Open “System Preference” (in the dock), go to Security / Firewall: click on the lock and start the Firewall
  • In the Apple menu (top left), select “Software Update” and install the latest updates (you will probably have to restart)
  • Clean the dock with unnecessary applications:
  • In Dock, activate Magification
    • In Expose & Spaces, configure the active screen corner (in my case, “top left”: All Windows, “bottom left: Desktop”) then go to Spaces, select “Enable Spaces” and “Show Spaces in menu bar”. I use also “ALT Arrow Keys” to switch between spaces
  • In Trackpad, select for One finger “Tap to click”, “dragging” and “Secondary click”. Ensure “Secondary Tap” is checked for Two Fingers
  • In Security / General, check the “Require password 5 seconds after sleep or screen saver begins” and “Require a password to unlock each System Preferences pane”. Disable automatic login and remote control infrared receiver.
  • In Security / FileVault, set a master password and turn on Filevault. Use the secure erase for the setup of FileVault
  • In Keyboard / Keyboard Shortcuts, uncheck Spaces except the “Activate Spaces” shortcut then select “Application Shortcuts” on the left panel. I like to use the same combination “CTRL + Arrow Keys” to move between the tabs of Terminal or Safari. Click on the “+” button and for All Applications, on the menu title “Select Next Tab” (beware: case matters) and the keyboard shortcut “CTRL + right arrow”. Repeat for the menu title “Select Previous Tab”, this time with the sequence “CTRL + left arrow”.
  • In BlueTooth, disable it (unless you plan to use a wireless mouse)
  • In Sharing, click on the lock to prevent further changes
  • In Software Update, check for updates Daily
  • In Language & Text, select the Text tab and disable the automatic spelling check (I found it very aggressive)

In Finder, run Applications / Utilities / Keychain Access, go into the Preferences menu and check “Show Status in Menu bar”. It permits to lock the screen on demand.

In Safari, open the Preferences and in the “General” section, uncheck the option “Open safe files after downloading”


Shell configuration

  • Configure YADR
  • Configure the color themes for iTerm2:
  • If you use an Apple keyboard over USB, you’ll discover that by default, the numeric keypad sends function key codes. You can turn that off by selecting the “xterm with numeric keypad” preset in Preferences > Profiles > Keys

You can also install Go2Shell to open terminal is the viewed directory in Finder. Run the following to configure it to open in iTerm2:

$> open -a Go2Shell --args config


Download and install XCode using the App Store.

Also remember to install the command-line tools: For this, go to XCode's Preferences > Downloads

Finder stuff

Open Finder, Drag the Download folder and your homedir to the sidebar.

In Finder Menu, select Preferences.

  • In General, select all checkboxes for the items to be shown on the Desktop.
  • In Sidebar, under Devices, check “your MacBook Pro” and uncheck “iDisk”; under “Shared”, uncheck “Back to My Mac” and “Bonjour Computers”
  • In Advanced, check “Empty Trash Securely” Make the Library folder visible from the finder:

      $> chflags nohidden ~/Library


Unix applications

  • ManOpen
  • Homebrew (need App Store » Xcode) tips
    • Activate also Homebrew Dupes to duplicate software provided by OS X, though may provide more recent or bugfix versions.

        $> brew tap homebrew/dupes
  • X11
  • RVM (need X11), tips
    • to install the ri documentation locally:

      	$> rvm docs generate-ri
    • to avoid the message Neither sha256sum nor shasum found in the PATH when running rvm (hint):

        $> brew install	coreutils
        $> sudo ln -s /usr/local/bin/gsha256sum /usr/local/bin/sha256sum
        # OR 
        $> sudo chmod +x /usr/bin/shasum
  • YADR

Then you can install via HomeBrew:

	$> brew install wget macvim bash-completion git tig  git-flow  mercurial stow task htop gnuplot

This corresponds to:

And upgrade the local version of rsync (2.6.9) with the latest one (3.0.x) by

$> brew install homebrew/dupes/rsync
$> mkdir ~/__IMPORT__

You’ll end with the version 3.0.9 which will facilitate the inheritance of Mac when importing your data from your previous Mac.

Note on data import: Once the SSH connection is active (System Preferences / Sharing / Remote Login restricted to your user), initiate the synchonization from your old Mac to preserve Mac OS extended attributes as follows:

$> rsync -avz -NHAX --protect-args --fileflags --force-change --update /Users/./<oldlogin> <newlogin>@<newIP>:__IMPORT__/



For the Perl business, install cpan and more precisely cpanplus

    $> cpan 
    CPAN is the world-wide archive of perl resources. It consists of about
	300 sites that all replicate the same contents around the globe. Many
	countries have at least one CPAN site already. The resources found on
	CPAN are easily accessible with the CPAN.pm module. If you want to use
	CPAN.pm, lots of things have to be configured. Fortunately, most of
	them can be determined automatically. If you prefer the automatic
	configuration, answer 'yes' below.
	Autoconfiguration complete.
	commit: wrote '/Users/svarrette/.cpan/CPAN/MyConfig.pm'
	Terminal does not support AddHistory.

	cpan shell -- CPAN exploration and modules installation (v1.9456)
	Enter 'h' for help.

	cpan[1]> install CPANPLUS

Now you can use cpanplus which is more convenient to later uninstall packages:

	$> cpanp
	CPANPLUS::Shell::Default -- CPAN exploration and module installation (v0.9133)
	*** Please report bugs to <bug-cpanplus@rt.cpan.org>.
	*** Using CPANPLUS::Backend v0.9133.  
	*** ReadLine support available (try 'i Term::ReadLine::Perl').
	*** Type 'p' now to show start up log
	Did you know...
	The documentation in CPANPLUS::Module and CPANPLUS::Backend is very useful
	CPAN Terminal> install Term::ReadLine::Perl Data::Dumper Getopt::Long Pod::Usage Term::ANSIColor Text::BibTeX Tie::IxHash

You might also consider perlbrew


$> brew install gfortran openmpi


MacVim, that normally has already been installed by

$> brew install macvim

TextMate, or TextMate 2, its free (GPLv3) version

$> brew install ragel boost multimarkdown hg ninja proctools
$> git clone https://github.com/textmate/textmate.git
$> cd textmate
$> git submodule update --init
$> builddir=./build ./configure && builddir= && ninja

You can then copy ./build/Applications/TextMate/TextMate.app into your Applications folder


Grab a latest version of Aquamacs, version 3.x to get the Retina ready version.

Preliminary to the usage of my config:

It appears impossible to make ECB work the way I wanted so I let it as is. I’m now refactoring my config to facilitate its usage.



  • GitX (L). Once installed, run it, click on its icon on the dock and select the menu GitX / Enable Terminal Usage. Then in the preferences, go to the Updates section and Check for Updates Daily.
    • This is a Fork of the original GitX yet the above version is better for cherrypick etc.
  • Versions
  • SourceTree

System applications


  • OSXFuse as MacFUSE is no longer being maintained.
    • You’ll have to check the the “install MacFUSE compatibility layer” option during the installation process
    • Install also SSHFS
    • Install this Macfusion2 version for (1) retina ready icon and (more importantly) (2) SSHFS working GUI
    • NTFS: either consider the Tuxera drivers, either the Commercial (fast) the Open-source (slow) one.


Install encfs via homebrew:

$> mv /usr/local/lib/pkgconfig/fuse.pc /usr/local/lib/pkgconfig/fuse.pc.old
$> brew install encfs
$> brew link --overwrite --dry-run fuse4x   # Eventually if you got a warning 
$> brew link --overwrite fuse4x
$> brew install encfs
$> brew info fuse4x-kext

Install the kernel extensions:

$> sudo /bin/cp -rfX /usr/local/Cellar/fuse4x-kext/0.9.2/Library/Extensions/fuse4x.kext /Library/Extensions
$> sudo chmod +s /Library/Extensions/fuse4x.kext/Support/load_fuse4x

Ensure that you are able to mount an EncFS directory:

$> cd /tmp
$> mkdir .crypt vault
$> encfs /tmp/.crypt /tmp/cvault

Then you can install the EncFS Plugin for Macfusion



You’ll have to recompile it completely to avoid paying on the App Store version.


In a nutshell:

$> brew install hg
$> mkdir -p ~/devel/repos/
$> cd ~/devel/repos
$> export LC_ALL="en_US.UTF-8"
$> hg clone https://code.google.com/p/growl/
$> cd growl
$> hg tags | sort
$> hg update "Growl.app 2.0b9"

Now open Growl.xcodeproj in Xcode. You have to disable the Code Signing property. To do that, once the project open, select the target Growl.app, go to the menu Build Settings and under the Code Signing property, elect “Don’t sign Code”. Repeat that for all targets.

Also, under the Growl project, still in build settings, go to the Apple LLVM compiler 4.1 Preprocessing section, and remove the BETA=1 macro from the preprocessors macros (otherwise, you’ll have a reminder to rebuild after 21 days).

You’ll have to repeat that for all the targets to generate the app (under Products/ - right click on the generated target and select Reveal in Finder) and move it to your Applications/ folder.


You’ll probably want also to build HardwareGrowler:

$> hg tags | sort
$> hg update "HardwareGrowler 2b3"

Open with Xcode Extras/HardwareGrowler/HardwareGrowler.xcodeproj, repeat the code signing business and generate the App.


See this page

ALternative: terminal-notifier

$> gem install terminal-notifier
$> terminal-notifier -message "Go to OSXDaily.com, it's the best website ever" -title "osxdaily.com" -open "http://osxdaily.com"

Adding new Growl notification style

Get it, unzip and double-click on the *.growlstyle file. My styles:


So now you have Messages to deal with Jabber, Google talk etc. To get also interaction with MSN, consider Cocoon.

Otherwise, go back to Adium.

  • Use this tip to auto-join a conference room on startup. Example in my case:

      tell application "Adium"
          GetURL "xmpp://hpc-users@conference.im.csc.uni.lu?join"
          GetURL "xmpp://hpc-sysadmins@conference.im.csc.uni.lu?join"
          GetURL "xmpp://hpc-notifications@conference.im.csc.uni.lu?join"
          GetURL "xmpp://teambouvry@conference.im.csc.uni.lu?join"
          GetURL "xmpp://notifications@conference.jabber.grid5000.fr?join"
          GetURL "xmpp://dev@conference.jabber.grid5000.fr?join"
          GetURL "xmpp://support@conference.jabber.grid5000.fr?join"
      end tell

Personnal configuration of Adium Preferences / Appearance:

  • Dock icon yellow
  • Color theme: Decay 2.0
  • List Layout: Concise
  • Window Style: Regular Window
  • Opacity: 70%
  • Automatic Sizing: check for both fit
  • Maximum Width: 300%


If you use the official app, it is not Retina ready and obtain a very crappy rendering. In the mean time of a release for a new version, you can use this patched version.


  • VMWare fusion 5
  • VirtualBox
  • Vagrant, that you can install as a Ruby gem:

      $> rvm gemset list                                                                                                                                                                                                                 
          => (default)
      $>rvm gemset create vagrant                                                                                                                                                                                                 
          gemset created vagrant	=> /path/to/.rvm/gems/ruby-1.9.3-p286@vagrant
      $> rvm use gemset vagrant                                                                                                                                                                                                      
      $> gem install vagrant


Create the directory ~/Library/texmf/tex/latex/local/ to put your local *.sty files

$> mkdir -p ~/Library/texmf/tex/latex/local/
$> cd ~/Library/texmf/tex/latex/local/
$> wget http://www.iro.umontreal.ca/~pift6266/A06/isolatin1.sty

Tsocks, Proxy SOCKS and VNC server

Install tsocks.

$> brew tap adamv/alt
$> brew install --HEAD tsocks

Now edit the file /usr/local/etc/tsocks.conf such that you end with the following content:

$> cat /usr/local/etc/tsocks.conf                                                                                                                                                     	# This is the configuration for libtsocks (transparent socks)
# Lines beginning with # and blank lines are ignored
# This sample configuration shows the simplest (and most common) use of
# tsocks. This is a basic LAN, this machine can access anything on the 
# local ethernet (192.168.0.*) but anything else has to use the SOCKS version
# 4 server on the firewall. Further details can be found in the man pages,
# tsocks(8) and tsocks.conf(5) and a more complex example is presented in 
# tsocks.conf.complex.example

# We can access 192.168.0.* directly
#local =

# Otherwise we use the server
#server =

#### Start Seb's customization
server_type = 5
server_port = 1080
server      =

Now you have to install the extension FoxyProxy Standard of Firefox,

  • Create a new profile (check DNS search)
  • Select SoCKS v5, proxy Socks
  • add URL pattern: * (whitelist)

Test it:

$> ssh -C -D 1080 supervision.gaia   # -D to activate a Proxy SOCKS 

Now you should be able to access http://supervision on Firefox (the name supervision used here is resolved on supervision.gaia )

To be able to use VNC server:

$> brew install tiger-vnc

Run a VNC server on the remote server

(supervision.gaia)$> vncserver -geometry 1366x768

New 'X' desktop is supervision.gaia-cluster.uni.lux:1

Starting applications specified in /var/lib/localadmin/.vnc/xstartup
Log file is /var/lib/localadmin/.vnc/supervision.gaia-cluster.uni.lux:1.log

And from your local machine, connect to it via (use the IP of the machine running the VNC server):

$> tsocks vncviewer -Shared=1 -PreferredEncoding=Raw -NoJPEG

Note that I ended with a black screen, thus the below alternative.

VNC alternative (TightVNC)

Install the TightVNC Java Viewer into your bin/ directory:

$> cd ~/bin
$> mkdir tightvnc-2.6_javabin 
$> cd tightvnc-2.6_javabin
$> wget http://www.tightvnc.com/download/2.6/tvnjviewer-2.6-bin.zip
$> unzip tvnjviewer-2.6-bin.zip
$> cd ~/bin
$> ln -s tightvnc-2.6_javabin tightvnc_javabin

Then configure your local java to use a local SOCKS Proxy on port 1080:

  • Open System Preferences / Java
  • In the Java Control Panel, go to the General, Network Settings and check “Use proxy server”
    • address:
    • port: 1080

Now you can runit, for instance with the following script:

#! /bin/bash
# Run VNC Viewer on the remote server assuming an SSH Proxy SOCKS exist on localhost:1080


# Check for options
while [ $# -ge 1 ]; do
    case $1 in
        -1) VNCPORT=5901;;
        -2) VNCPORT=5902;;
        -3) VNCPORT=5903;;
        -4) VNCPORT=5904;;
        -5) VNCPORT=5905;;
            cat <<EOF
Usage: $0 [-1|-2|-3|-4|-5] <sitename>
Open a VNC viewer on the monitoring server of the size <sitename> ('gaia' by default)
Kind of equivalent to:
    tsocks vncviewer <ip_site_server>:[1|2|3|4|5]
            exit 0;;

# Associate the remote IP address of the server to access on the selected site 
case $SITE in
    chaos) IP_SUPERVISION='10.XX.XX.XX';;
    gaia)  IP_SUPERVISION='10.YY.YY.YY';;
    *)     echo "Unrecognized site ${SITE}";
        exit 1;;

# Run the VNC viewer


  • Disable the netbios protocol daemon: tips
  • Synchronize your Google Calendar using Calendar 7.0 (instructions- last thread)
    • Open Calendar / Preferences / Accounts; press + to add a new CalDAV account
    • Account type: Manual
    • Name: Firstname.LastName (adapt accordingly i.e. your gmail address without @gmail.com)
    • Password: xxxxx (adapt accordingly to your google password)
    • Server: https://www.google.com/calendar/dav/YOUREMAIL@DOMAIN.COM/user. Replace YOUREMAIL@GMAIL.COM with the email address that you use to log in to Calendar. Make sure to include the @gmail.com portion in this section.

Printer driver

Most of the drivers are directly downloaded by the software update.


Restore missing features

Mac Mail overlapping from addresses

From time to time, Mac mail presents the from address overlapping on the next line. Example:


One fix, related here, consist of running (after quitting Mail):

$> sudo atsutil databases -remove