Thursday, August 20, 2009

"Unix is the best screwdriver ever built"

Unix is now 40 years old, if measured from August 1969 when Ken Thompson decided to spend a month while his wife was away by writing the core of what became Unix.

The BBC has a nice article by Mark Ward on Unix's history, ending with a quote
"Unix is the best screwdriver ever built," said Dr Salus.
that echoes the theme of Neal Stephenson's "In the Beginning was the Command Line" that compared Unix to a Hole Hawg drill.

Tuesday, August 11, 2009

Amazon MP3 downloads from Linux: clamz

Amazon.com offers quite competitively priced full album DRM-free mp3 downloads. You can purchase and download individual mp3 songs without requiring additional software. But they do require you to install and use their Amazon MP3 Downloader software in order to purchase and download the albums, which are of course better value for money as long as you want most or all of the album.

To their credit they provide their software not only for MS Windows (XP and Vista) and Mac OSX (10.4 and higher), but also for Linux (Debian 4, Ubuntu 8.10, Fedora 9, OpenSUSE 11.0).

Sadly if you're using a version of Linux other than those supported you may have trouble: the Fedora 9 amazonmp3.rpm will not install under Fedora 11 (although vwbusguy provides a work-around for Fedora 10).

Luckily there is another option: a command line tool called clamz (vwbusguy has produced Fedora 11 RPMs of clamz). Attempt to purchase the mp3 album from amazon as normal and once it offers you the chance to open or save the .amz file choose "save to disk" instead. Then run clamz on the .amz file, e.g.
clamz -d ./ AmazonMP3-*.amz
If you don't use the official amazon downloader you do have to jump through some hoops to get the *.amz file that clamz uses:
  • Select the album you wish to purchase and click the "Buy MP3 album with 1-Click" button.
  • A page appears asking you to install the Amazon MP3 Downloader application, presenting links to Windows, OSX and Linux versions. At the bottom of this page is a small link saying that if you've already installed the application you need to enable it in your browser and offering a link to do so. Click that link.
  • You are redirected back to the web page for the album.
  • Click the "Buy MP3 album with 1-Click"button again.
  • A new window appears asking if you really want to purchase this album. Click OK.
  • A dialog window will appear offering options to "Open with" and "Save as". Save the *.amz file its offering you.
  • Go to the command line and run clamz on the amz file.
  • Note that you can only run clamz ONCE on any *.amz file.
One thing that is slightly worrying about this is what happens if the download fails? If Amazon thinks you've downloaded the album they wont let you download the files again.

[Updated 10/20/09.]