Entries from October 2008 ↓

Easier to read man pages

The man utility is an ancient and good way of documenting command line tools in Unix.  The downside is that it will display it in some sort of Unix pager, and I can never figure out how to go back up a page.  This can be a pain when you are going through a ton of switch descriptions, and you pass the one you want to read.  The only alternative is to exit, reload, and then try to stop on the right page.  This script (below the fold) I put together will keep a copy in PDF form and open it in preview.  The caching feature is nice because the conversion can be a bit slow at times (Note you’ll have to set your own location for the cached man pages) Update: hitting ‘u’ does a page up when reading man pages in terminal, but I still find the indexed searching and extra formatting nice in Preview.

Continue reading →

They are trying

I really do believe Apple is trying to do the right thing

Bizarre post from Ringo

Been a fan of the Beatles most of my life, but this video post from Ringo is sad and strange.

Setting Default Apps, duti calls

I had always intended this blog to have some technical tips in the mix, but haven’t written up many, so here is one.

I manage an OS X environment at a school. We installed a new phone system that could email voicemail files as WAV files, and I wanted a way to set the default application that launches when these were double clicked from iTunes to Quicktime.  This sort of thing is handled by launch services and can’t be manipulated by the defaults command.  Andrew Mortensen (of the Radmind crew) to the rescue with a command line tool he wrote: duti.

This can be called a number of way, but I wanted to run it from a login script.  It has to be run as the user whose settings you want to change, but loginscripts run as root, so one needs to call the actual binary as sudo.

 

echo ‘com.apple.quicktimeplayer com.microsoft.waveform-audio all’ | sudo -u $1 /usr/local/bin/duti

 

Another great tip embedded in the man page for the utility is a way to get a list of all of the identifiers for launchservices:

 

locate lsregister -dump | grep ‘[[:space:]]uti:’ | awk ‘{ print $2 }’ | sort | uniq