Useful Links: September 2012

A list of items I’ve come across recently that I found potentially useful, interesting, or just plain funny:

  • Rubular – Ruby regular expression editor and tester (via Kristian Brimble)
  • Classic Shell for Windows – Expose hidden features in modern Windows versions (via Scott Hanselman)
  • Traveline NextBuses – Useful mobile website for searching bus timetables
  • Baking Pi – Free operating systems development course for the Raspberry Pi

Useful Links: August 2012

A list of items I’ve come across recently that I found potentially useful, interesting, or just plain funny:

Handling camera raw images on old versions of OS X

I use Adobe Lightroom for most of my digital photography workflow but as our family takes more and more pictures on a variety of cameras, other family members need to process images – and I’m not letting them near my Lightroom catalogue!

As we tend to use iPhoto every year to product yearbooks, calendars, etc., the solution we decided on was for me to copy unprocessed images over onto an old Mac Mini, which is running OS X 10.6 (Snow Leopard) with iPhoto (still version 6, part of the iLife suite shipped with OS X 10.4, which was what originally installed on the Mini).

Old software doesn’t support raw formats

All seemed good until I we tried to import the the first batch of photos that I’d sent over. iPhoto was happy with JPGs but didn’t like the raw images (.NEF from my Nikon D700 and .NRW from my Nikon P7100). Apple’s advice on supported digital camera RAW formats for OS X 10.6 suggested that the D700 should be OK (presumably not with old versions of iPhoto – one forum post suggested I’d need at least iPhoto ’08) but that I needed to install the Digital Camera RAW Compatibility Update 3.9 for the P7100, which would also need me to upgrade to iPhoto 11 (v9.3.2). The iPhoto upgrade was no big deal (£10.49 in the Mac App Store)  but it will only run on OS X 10.7.4 or later.  Lion is no longer in the Mac App Store but OS X 10.8 (Mountain Lion) is (and it’s only £13.49). Unfortunately, Lion and Mountain Lion will not run on Core Solo or Core Duo Macs (like my Mini).

I refuse to buy a new Mac for this – the whole point of the exercise was to provide a fit-for-purpose solution using the kit we already have – and a new machine doesn’t come into that (heck, I might as well just put Photoshop Elements on my wife’s Windows laptop), so it was back to the drawing board.

If my combination of OS X and iPhoto won’t read my raw files, I’ll just need to batch convert them to something else first…

Compiling and installing dcraw on OS X

Dave Coffin’s dcraw is a Linux utility for raw file conversion and I decided to use that on the Mac Mini but it needs a bit of work to get it installed. I found a blog post that describes the process to get the latest version of dcraw working on OS X 10.7 (Lion) but the process is slightly different for earlier versions of OS X.

First up, I installed Apple’s developer tools – XCode.  These are found on the operating system DVD for OS X 10.6 (in the Optional Installs folder) but are a free load from the Mac App Store for 10.7 and later. I did register for a developer account and started downloading version 3.2.6 but then realised that it was a 4.1GB download and retrieving the DVD from the loft was easier. After installing XCode from the DVD, I updated to 3.2.6 using the OS X Software Update utility although other versions of OS X might have a slightly different XCode upgrade process.

The Unix Command Line tools are an install option on XCode 3.2.6 (they can be downloaded from inside XCode from version 4 onwards) but, once these were installed, the next step was to download and install MacPorts.  Again, there are different versions according to the release of OS X in use but I downloaded the .DMG for OS X 10.6 and then kicked off a Terminal session.

Once in Terminal, I entered the following commands:

su admin
sudo port install dcraw

following which MacPorts did all of the work to download and install dcraw and all of its dependencies.

Batch converting raw images on the Mac

With dcraw installed, there are many options for processing images but the basic syntax may be found by opening Terminal and typing:


Camera Hacker has some examples of dcraw use but I used the following commands to bulk convert batches of .NEF and .NRW files to .TIFF format:

dcraw -a -w -v -T *.NEF
dcraw -a -w -v -T *.NRW

One final tweak before import the files to iPhoto was to set the file dates to match the camera timestamp (without this, iPhoto seemed to think that the images were taken on the day they were imported):

dcraw -z *.tiff

The resulting files were ready to import to iPhoto for family use, with no risk to the master copies that are stored on my MacBook.

Streaming Spotify to remote speakers using Airfoil

Much of the music I play these days comes from Spotify but there are times when I’d really like to stream my music to some speakers on the other side of the house that are plugged into an Apple Airport Express.

A few months ago I found out how to do this, using a nifty piece of software from Rogue Amoeba, called Airfoil.  For just $25, Airfoil will stream audio to other Macs and PCs running the Airfoil Speakers companion app or to an Airport Express, Apple TV or other supported receivers.

I did find a few gotchas along the way though:

  • Airfoil will only recognise the same devices as iTunes and iTunes will recognise the same Airport Express as AirPort Utility. It took several reboots to get AirPort Utility to recognise my Airport Express (although things seem to have settled down since).
  • When adjusting the volume/pause/play etc. there is a short delay before the changes take effect (due to latency in the network) – so this is unlikely to work for live DJing (it was fine for my 40th birthday party a few months ago though!).
  • Spotify has a nasty habit of duplicating itself when it upgrades, leaving a copy in ~/Applications as well as in /Applications.  To resolve this, delete the old version of Spotify in /Applications and move the new version from ~/Applications to /Applications. Restart Spotify and Airfoil should, once again, be happy to take Spotify as a source application.  This has happened several times now, each time Spotify release a new client app although it could be a side effect of me running as a Standard User and not an Administrator (as all users should!).

Storing Arduino code in the cloud

Earlier this week I blogged about some of the stuff I’d been doing with Arduino and I mentioned that my code is up on GitHub. What I didn’t mention is how it got there…

I use the Arduino IDE on a netbook running Ubuntu Linux (other development tools are available) and, a few weeks ago, I stumbed across an interesting-sounding hack to store sketches (Arduino code) in the cloud. The tool to make this happen is David Vondle’s Upload and Retrieve Source project. There’s a good description in Dave’s blog post about the project that clears up parts I struggled with (like: the location of the gistCredentials.txt file, used to store your GitHub credentials and which is found in the ~/.arduino folder on my system; and that you also need the username to be included in a comment inside the sketch).  Of course, you’ll need to create an account at GitHub first but you don’t need to know anything about the various git commands to manage source code once you have created the account.

The only downside I’ve found (aside from plain text passwords) is that there is only one project for each Arduino – if you re-use the Arduino with another circuit, the new sketch will be stored in the same gist (although the version control will let you retrieve old sketches, if you know which is which)


Registering MSCOMCTL.OCX on Windows 7 (x64) to run the FLAC Front End

I’ve mentioned before that iTunes mangled my MP3 library and then a multiple disk failure on my ReadyNAS took it away completely and, eventually, I will re-rip the hundreds of CDs that (thankfully) I still have in my loft…

In the meantime, I’ve been researching (aka asking followers on Twitter) what’s the best way to re-rip my music and the general consensus was to rip as Free Lossless Audio Codec (FLAC) and then convert to MP3 as required:

@ Haven't we done this before? Encode to FLAC and use dBpoweramp Music Converter to change to anything else
Garry Martin

A couple of weeks ago, I downloaded FLAC from Sourceforge but the installer gave an error message, complaining that it failed to register MSCOMCTL.OCX (on my Windows 7 x64) system.

Neil C. Obremski describes the problem in his 2008 blog post and the problem file is a Visual Basic 6.0 control which, not surprisingly, Microsoft no longer ships with Windows. Whilst there are unofficial downloads available, Microsoft also makes the Visual Basic 6.0 Common Controls (MSCOMCTL.OCX and COMCTL32.OCX) available as free downloads but they are contained in a .EXE file that didn’t want to play ball either.

No problem, 7-Zip opened the .EXE and I successfully extracted the file I wanted, copying it to C:\Windows\SysWOW64 on my machine.

Following this, I dropped into a command prompt (running as an administrator) and typed:

regsvr32 mscomctl.ocx

With the OLE control extension (.OCX) registered, I was able to run the FLAC front end (although I actually used dBpoweramp instead… it’s tremendously powerful and the CD ripper setup guide helped me to get going).

Fighting with competing eBook standards

Last year, I was involved in the production of Fujitsu’s White Book of Cloud Security (continuing the series after the White Book of Cloud Adoption) and earlier today I was sent copies in eBook form.  I emailed them to my Kindle (app), only to find that Amazon doesn’t support .EPUB format books.  Whilst I understand why Amazon might like its own content to appear in a different format, not supporting the .EPUB standard for people to add their own content seems strange (and I’m not alone in thinking this – Jason Perlow wrote about Amazon’s lack of support for .EPUB back in 2010).

Thankfully, it’s pretty simple to convert between .EPUB and MOBI formats, using freely available software (Calibre) – as  highlighted on Twitter by James Williams (@LoneGunmanUK) and Travis Atkinson (@TravisWhayne). It’s a bit of a sledgehammer to crack a nut (I don’t need an eBook library – just a conversion tool) but it’s undoubtably powerful and it seemed to do the job for me.

Incidentally, on my iPad, the .MOBI files viewed in the Kindle app seem to have better results than the .EPUBs in Apple iBooks (which seemed to resize some graphics to the point of illegibility).

Useful Links: March 2012

A list of items I’ve come across recently that I found potentially useful, interesting, or just plain funny:

Some useful stuff to install on a Linux machine

Last year, I decided to take my netbook out of hibernation and install Ubuntu Linux (11.04) on it. It still doesn’t get used much (the iPad is just so much easier than a netbook – except perhaps for typing) but before I blow it away and install something else… like Windows 8, or Android perhaps… I wanted to capture a few notes from the bits and pieces I installed.

Apologies if these notes are not much use to anyone else but, then again, they might be handy for someone…

Command Line Twitter client (Twidge)

I’ve previously highlighted the existence of Twidge and it’s a useful tool to install on a Linux box. Ubuntu Manual has outlined the steps for installing Twidge on Linux (specifically Ubuntu) but the basic steps are:

Update the sources list:

sudo gedit /etc/apt/sources.list

and add the following lines:

deb squeeze main
deb-src squeeze main

then install the package:

sudo apt-get update
sudo apt-get install twidge

From this point on, twidge --help and twidge lscommands should tell you all you need to know.

Password manager (LastPass)

LastPass works with a variety of Linux browsers so just head on over to the download page and follow the instructions.

File sync (Dropbox)

Dropbox has Linux packages for a variety of Linux distros (download and then double-click on the installer) and of course there’s the option to compile from source too.  The download page also includes command line instructions and a script for controlling Dropbox from the command line but I haven’t tried that yet…

Music (Spotify)

There isn’t a fully-supported Spotify client for Linux but, because so many of their devs use it, there is a “preview version” available. More details are available on Spotify’s previews page but the basic steps are:

Update the sources list:

sudo gedit /etc/apt/sources.list

and add the following lines:

deb stable non-free
deb-src stable non-free

Optionally, verify the package with

sudo apt-key adv --keyserver --recv-keys 4E9CFF4E

Either way, install the package with:

sudo apt-get update
sudo apt-get install spotify-client-qt

I’ve not had any problems, but I did spot Ross Warren’s post about Spotify on Linux crashing at startup.  If this happens, then you might need to clear the cache:

rm -r ~/.cache/spotify

Mobile communications

The last items is probably not that useful to other people but I managed to get an O2 3G dongle working (Sierra Wireless Compass 889). Unfortunately, Sierra Wireless have updated their website and the Linux support has gone AWOL… but I found some information on a third party website suggesting that Sierra Wireless submits driver updates and patches to the public Linux distribution found at Using Network Connections, I was able to create a mobile broadband connection with the following settings:

  • Number: *99#
  • Username: o2web
  • Password: password
  • APN:

Obviously, these settings will vary according to the carrier but many providers are included in the New Mobile Broadband Connection “wizard” (is it called a wizard on Linux?), so it may just be a case of picking the appropriate carrier, billing plan and APN.

Running Spotify and other apps as background tasks on an iPhone 3G

I like shiny toys as much as the next geek, but I don’t have an iPhone 4 for two reasons: firstly, I’ve spent far too much money on an iPad (so I have much less use for a smartphone); and, secondly, I consider iPhone upgrades to be evolutionary rather than revolutionary so my existing iPhone 3G has some life in it yet (even though the case has some nasty cracks and I may need to replace the back soon).

Given that my 3G needs to soldier on for a while, I’d like to be able to use it’s full technical capabilities, rather than being governed by Apple’s marketing decisions – and one feature I’m missing is being able to a run third party applications in the background. For example, I would like to use Spotify instead of the built-in iPod app whilst Runkeeper is tracking my rather slow progress at pounding the pavements of Buckinghamshire.

Luckily for me, even though Apple doesn’t allow multitasking with iOS 4 on the iPhone 3G, there are some clever hackers that have made it possible:

  • First up, you need to allow the iPhone to run apps that are not available from the Apple AppStore. This is commonly known as “jail breaking” the device and there are various methods evolving as Apple tightens up the security on the device – is probably the easiest way for people who haven’t yet upgraded to iOS 3.2.2 or 4.0.2.
  • The next step is to install the Backgrounder app, using Cydia (the package manager installed by the jailbreak process). Backgrounder is customisable and includes an FAQ with usage details but the basic principle is to start the app you’d like to run in the background (e.g. Spotify), then activate Backgrounder.
  • Now, when you leave the first app and switch to run something else (e.g. Runkeeper), the first app should keep on running.