Loading iTunes library from command line

Having separated iTunes libraries for different setups (e.g., media center, local music, remote playlists) is a powerful way to organize your media library and share resources among different devices (e.g., iPhone synchronization), but it can be painful. While it is possible to load a different iTunes library by opening iTunes and pressing “Alt” at the same time, this is not optimal. Ideally, we would write a script to pass iTunes the library it should load at launch time (e.g., open /Applications/iTunes.app –load-library=$LIBRARY_PATH). However, to the best of my knowledge, the iTunes API does not expose this – which I honestly do not understand. Googling for a workaround I could not find a good/complete solution, so I made my own. Here you have the setup and the scripts that implement it.

Continue reading

Recover command line after upgrading Mac OS – Installing Command Line Tools (Lion & Mountain Lion)

I love Apple and use my MB Pro for everything, from my personal everyday: mail, calendars, Facebook, etc. However, each time a new version of Mac OS is released, the SO moves further and further from Unix, and therefore from “standards”.

One of the consequences of this -among others- is that the known in linux OS as /bin moves around, making our .bashrc (yes, we do have that in Mac OS too) useless every time we upgrade. Since trying to add to the $PATH all the different folders each upgrade moves around is extremely painful, here it is an useful tip to recover the system commands from the terminal (e.g. git, gcc, javac, etc). (Please note that your own scripts, commands and binaries will remain the same and totally accessible as log as they are part of your $PATH).

Continue reading