Power up the terminal

OhMyZSH is a gorgeus enhancement to the standard shell, with better tab-completion and visual feedback.

Installing the vanilla version is as easy as:
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"


Max OS X, change directory where screenshots are saved

First you can create a new directory, then to change the system setting:
defaults write com.apple.screencapture location /path/to/screenshots/

Finally to make the change immediately available:
killall SystemUIServer

The picture below is an example.
terminal commands to change screenshot folder in OS X

Syntax highlight in Keynote presentations

Syntax highlight in Keynote

When preparing slides with a lot of code inside having a proper syntax highlighter is mandatory, and hacks like taking screenshots don’t work both for the useless amount of bytes wasted and for the inability to correct mistakes later on.

You can install highlight via Brew:

brew install highlight

then simply:

highlight -O rtf input_file.php | pbcopy

pbcopy is a supercool utility that grab the standard input and copies it into the clipboard (yes, there’s pbpaste too).

Remove duplicate items from “Open with…” menu in Mac OS X (10.5 to 10.8)

ImageWhen your “Open with…” menu in Mountain Lion becomes weirdly crowded by duplicated items (can be MUCH worst than the picture) open the Terminal (it’s in the Application folder, or just type “terminal” in SpotLight), then paste the command below and hit enter (note that there is NO space before “Frameworks”:

/System/Library/Frameworks/CoreServices.framework/ Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user

DMG 2 ISO via Terminal: no need for any tool

If you downloaded a Mac image (.dmg file) and you need to open or burn from a Windows/Linux machine, you can easily convert it to the very common .iso format. Open the terminal and type this command:

 hdiutil convert /path/to/filename.dmg -format UDTO -o /path/to/savefile.iso

Note that this tool appends an extra .cdr extension to the file, but just rename it – even via terminal with:

mv /path/to/savefile.iso.cdr /path/to/savefile.iso

and you are done!

iTunes small pop-up with song title

UPDATE (September 2012): After last iTunes update this feature makes dock crashing. See this thread.


Via this post i found a gorgeous trick. I always wanted a pop-up notification displaying the current song title (when changing track, for just a few seconds). I used a Growl plug-in in Snow Leopard, but now it’s possible to enable a similar feature in Lion just with a comman line trick via the Terminal.

defaults write com.apple.dock itunes-notifications -bool TRUE;killall Dock

Then start iTunes and try playing a track. Neat, eh? The pop-up fades away after a few seconds. To add the iTunes icon to the pop-up window, type the following into a Terminal window:

defaults write com.apple.dock notification-always-show-image -bool TRUE;killall Dock

To deactivate the pop-up at a later date, quit iTunes again, then open a Terminal window and type the following two lines:

defaults delete com.apple.dock itunes-notifications
defaults delete com.apple.dock notification-always-show-image;killall Dock