Tuesday, December 8, 2009

Move Any Mountain

I recently found out that Sgurr nan Ceannaichean (which was added to Munro's Tables in 1981) has been resurveyed at 913.4m, which means it has moved from being a small Munro to being a big Corbett. This means it is now 0.35% easier to complete the Munros and also that I am 1 closer to completing the Corbetts.

I climbed this mountain on 10th May 1999 with 5 friends (Hi Dave, Dave, Mark, Conrad & Sam), and at the time it was my 200th Munro. I carried a flask of Whisky up to celebrate the summit. On this walk we also bagged Moruisg, which at 928m is still considered a Munro.

Wednesday, September 9, 2009

Nines In A Line

It's 09:09:09 09/09/09 (nearly!), and to celebrate I'm going to try and take nine photos containing nine things each. I have set up a new group on Flickr called Nine Things - if you'd like to join in post your photos of nine things there. Extra credit if you manage to get a photo at 09:09:09 (in your local timezone).

Apologies for the short notice. I only thought of it when I got up this morning - but I've got a year a month a day an hour a minute and a second to get ready for Ten Things day.

Thursday, August 13, 2009

Harrumble! "Bleak Expectations" Series 3

I have recently been re-enjoying the first two series of the rather excellent Bleak Expectations, and was pleased to find that a third series was recorded by the BBC in June. The air date is yet to be announced.

Tony Head is apparently returning as the evil Mr. Gently Benevolent, despite being killed at the end of the first series. And again at the end of the second series.
In the new Series Three - coming soon to Radio 4 - all seems well in the life of Pip Bin. His evil guardian Mr Gently Benevolent has been killed again and he has found true love with his wife Ripely and true happiness with his beloved family and friends. Everything is properly splendid, and surely for the duration of series 3 it will continue that way, won't it? No! Because in a ghastly incident at a seance the spirit of the evil Mr Benevolent reappears to wreak more havoc on everything that is noble, Victorian and English!

I can't wait.

Friday, July 31, 2009

Scripting OS X

One of the nice things about Mac OS X is that you can interact with many of the applications using external scripts. The main issue is what scripting language you use to write your scripts in. The obvious choice is, of course, AppleScript, but while it makes it easy to interact with the applications it isn't as functional at text or date manipulation as a traditional scripting language, such as Perl.

A few years ago I was pleased to find there was a Perl module available called Mac::Glue that would let you talk to applications in OS X without having to use AppleScript. I had downloaded the AppleScript guide from Apple and had tried to use it, honest. But having used Perl nearly every waking hour over the previous 7 years I had a fair amount of expertise locked up in Perl and in a short time, with the help of Mac::Glue, I was able to knock up a quick script to help me organise my iPhoto library, and later I added scripts that I used with other applications.

Perl, however, is not an officially supported scripting language for OS X, and in OS X 10.5 both Ruby and Python were supported by Apple for scripting OS X. I decided that Ruby was the cooler of the two languages to use as it's a bit like Perl rewritten by a Smalltalk geek (that and I have always had a reservation about Python's use of syntactic whitespace), so in 2008 I dabbled a bit by rewriting my iPhoto script in Ruby using RubyOSA and was pleasantly suprised to find that it ran quite a lot faster.

That was all fine and dandy, and I transitioned from OS X 10.4 on my PowerBook G4 to OS X 10.5 on my MacBook without a glitch. Until Apple released OS X 10.5.7, at which point my RubyOSA scripts stopped working, so I went back to using Perl and Mac::Glue.

Recently I have wanted to export playlists from iTunes to the memory stick from my phone (or sometimes to a USB stick or just to a directory), something that iTunes doesn't seem that keen on (unless optical media is involved). And I have also been looking for a suitable programming language for my 10 year old nephew (who has just got a netbook for his birthday - Hi, Matthew!) to learn. So, bolstered by a comment on Slashdot that had mentioned it only takes a couple of hours to learn, I put away my irrational dislike of Python and decided to give it a go. And sure enough I was able to knock up a script, very straightforwardly, that did exactly what I wanted.

If you're a UNIX command line geek and you'd like to give it a go you can download from the link below. Obviously you'll need the Python appscript library for it to work.
The script currently supports the following actions:
  • list-playlists [<pattern>]
    This lists the playlists in iTunes (that optionally match the specified pattern). The playlists listed include the names of the enclosing folders, and are prefixed by an integer index for easy reference (especially useful if you have multiple playlists with the same name). Also displayed is a track count, the duration of the playlist and the cumulative size of the files in the playlist.
  • export-playlist <playlist> [<dir>]
    This exports media from the specified playlist to specified directory (or the current directory if none is specified). You can specify the playlist either as the playlist name (along with enclosing folders) as, or the playlist index, both of which are printed out by list-playlists. The directory will be created, if it doesn't exist. The filenames for the exported media are generated from the track numbers in the playlist, along with the track name, and have punctuation and spaces removed or translated to make them more friendly.
  • export-current-playlist [<dir>]
    If you are currently listening to something in iTunes this will export the current playlist to the specified directory (or the current directory if none is specified).
  • help
    List the available actions, along with brief descriptions.
So you can use it like this:
% itunes list-playlists never
[282] CDs > Nirvana > Nevermind (12trk 42m31s 61.4MB)
[547] Compilations > 16. Never Give In (2008) (28trk 1h33m15s 127.4MB)
% itunes export-playlist 547 /Volumes/JIM\'S\ W380I/music/compilations/never_give_in
Exporting: "Compilations > 16. Never Give In (2008)" -> /Volumes/JIM'S W380I/music/compilations/never_give_in
Creating directory: /Volumes/JIM'S W380I/music/compilations/never_give_in
[ 1] "Changed Daily" -> 01-changed_daily.mp3
[ 2] "It's A Fine Day" -> 02-its_a_fine_day.mp3
[ 3] "Road To Nowhere" -> 03-road_to_nowhere.mp3
[ 4] "To Get Down" -> 04-to_get_down.mp3
[ 5] "Teenage Dirtbag" -> 05-teenage_dirtbag.mp3
[ 6] "Gay Bar" -> 06-gay_bar.mp3
[ 7] "Voodoo Child" -> 07-voodoo_child.mp3
[ 8] "Games Without Frontiers" -> 08-games_without_frontiers.mp3
[ 9] "Overload (Original Edit)" -> 09-overload.mp3
[10] "Best Of You" -> 10-best_of_you.mp3
[11] "19-2000 (Soulchild Remix)" -> 11-19-2000.mp3
[12] "Come On Home" -> 12-come_on_home.mp3
[13] "National Express" -> 13-national_express.mp3
[14] "Some Girls" -> 14-some_girls.mp3
[15] "Turning Japanese" -> 15-turning_japanese.mp3
[16] "All The Small Things" -> 16-all_the_small_things.mp3
[17] "Flagpole Sitta" -> 17-flagpole_sitta.mp3
[18] "Sk8er Boi" -> 18-sk8er_boi.mp3
[19] "Get Over It" -> 19-get_over_it.mp3
[20] "Thrillseeker" -> 20-thrillseeker.mp3
[21] "Single Girl" -> 21-single_girl.mp3
[22] "Sale Of The Century" -> 22-sale_of_the_century.mp3
[23] "P.V.C." -> 23-pvc.mp3
[24] "Take Me Out" -> 24-take_me_out.mp3
[25] "Scream" -> 25-scream.mp3
[26] "Underwater Love" -> 26-underwater_love.mp3
[27] "Green Bird" -> 27-green_bird.mp3
[28] "Changed Pandimensionally" -> 28-changed_pandimensionally.mp3

Note that I have a symlink to itunes from itunes.py, so I can point the itunes command to whichever implementation of the script is currently in favour.

If you don't like the " > " separator used to indicate playlist folders you can change the SEP variable in the script to whatever you prefer.

One day I may learn to do GUI scripting in OS X and put an interface on to it.

The only problem I did have was with Unicode characters. Although my terminal is set to use UTF-8 and the $LANG variable is set accordingly, Python kept blowing up when it encountered playlists or folders with non-ASCII characters in. So I did a bit of jiggery-pokery in the script that seemed to sort it out for me. When I am more familiar with Python I may come up with a better solution.

Feel free to use this script, and also to pass any comments on to me, although it works for me as I intended so I'm unlikely to put a great deal of effort into maintenance. Bear in mind it is my first Python script (and I happen to like 2 space indents). I'm hoping that it will continue to work when OS X 10.6 (Snow Leopard) is released in September (and even OS X 10.5.8 which is likely to come even sooner).

Tuesday, June 30, 2009

Using a Garmin Foretrex 101 with an Apple MacBook

In my previous post I wrote about the process that led to my purchase of a Garmin Foretrex 101 handheld GPS unit (or wearable personal navigator as it says on the box). This post provides some more detail of how I am using it with an Apple MacBook.

The first problem is how to connect the GPS to the MacBook. It would be nice if the GPS unit had Bluetooth capability so that you could wirelessly transfer data direct to the MacBook. But it doesn't. Instead it has a serial connection - which is absent from every computer I've bought this decade. After some poking around on the Internet I found that there were several serial/USB converter cables available. Garmin list one as an accessory for the Foretrex 101, but it gives a list price of £33.99. Instead I plumped for a cable from Amazon, supplied by iBox Ltd, with postage it came to the grand total of £4.70.

The converter cable arrived after a couple of days - well ahead of the main Amazon order which included the GPS unit itself. The cable itself was slightly different from the one in the photo on the Amazon page, in that although the actual 9-pin serial connector itself was male, it had screws to secure the connection instead of hexagonal sockets. Fortunately I was able to liberate a pair of hexagonal nuts from an old serial extension cable to make sure it stayed firmly connected to the serial plug.

A driver is needed to get the converter cable to work with Mac OS X (I'm running OS X 10.5.7 on my MacBook), and a mini-CD was provided with the cable, although you can't use it in a slot loading drive like the MacBook has. The driver needed for OS X is in /Prolific/PL2303X/MacOS-X/PL2303_1.2.1.dmg. Although I went to the Prolific web site and downloaded the slightly newer 1.2.1r2 driver.

You can check that the converter cable uses the Prolific PL2303X chipset by plugging it in and going to System Profiler and checking Hardware > USB section for a device called USB-Serial Controller. It should have a Vendor ID of 0x067b (Prolific Technology, Inc) and a Product ID of 0x2303. Once the driver is installed and the cable is connected there is a new serial device called usbserial, which shows up as /dev/cu.usbserial and /dev/tty.usbserial.

As I was still waiting for the GPS to arrive I tested that the cable was working by plugging in a serial trackball that I had and running od /dev/tty.usbserial in a Terminal. Output appeared when I moved the trackball or clicked a button, so it was looking promising.

The actual GPS unit itself arrived a couple of days later, along with the serial cable. Although the cable is listed on the Amazon site as "Garmin PC Cable (Forerunner 201 & Foretrex 201)" it works fine with the Foretrex 101 too.

At first I didn't much care for the idea of it being wrist mounted. Some of the reviews I had read online claimed the Foretrex 101 was no bigger than a watch. It is a lot bigger than any watch I've ever had, but it is surprisingly light. With batteries installed it weighs in at just under 100g, whereas my watch weighs 80g. And it does seem to function well on your wrist, and if you really want to know the time (and date) it's there in a tiny font on top of the Main Menu page. Or you can select it as one of the readouts on the useful Trip Computer page. After a couple of experiments of putting it in my pocket I attached the wrist strap and now I always use it on my wrist.

Loading data from the GPS to the MacBook is quite straightforward using a GPS utility such as LoadMyTracks. First you need to plug the 2.5mm plug of the serial cable into the GPS. The port is hidden behind a little weatherproof rubber flap. Make sure the plug is pushed in all the way. Then plug the USB cable into the MacBook, turn the GPS unit on and fire up LoadMyTracks. You should select "Garmin Serial" from the dropdown and "usbserial" as the serial port to use, then make sure the GPS unit is turned on and click "Acquire". The application will prompt you for a location to save the data in and will show a progress bar as it transfers the data. The GPS unit will beep and display "Transfer Complete" once the process is done. The data can be saved as a KML file to use with Google Earth, or a GPX file for a variety of uses. I am currently loading GPX files into TrailRunner to keep a log of my GPS tracks.

The GPX data can also be used for geotagging photos using a utility such as GPSPhotoLinker. The best way I have found to geotag photos for use with Apple iPhoto '08 is do this is as follows:
  • Synchronise the clock of your digital camera with the GPS before you start.
  • Take your GPS with you when you take photos.
  • When you get back - before you load them into iPhoto - first make sure the clock on the camera is still synchronised to the GPS. If it isn't just take a photo of the clock on the GPS screen, and then you can use the time difference when tagging the photos.
  • Plug the memory card with the photos on into the Mac, and quit iPhoto (if it starts automatically).
  • Use GPSPhotoLinker to geotag the photos on the memory card. You can use the application to timeshift the photos (if you forgot to sync the camera in the first place), and to check the location you are tagging with before you actually tag the photo.
  • Unmount the card from Finder to make sure the tags are written out to the media.
  • Re-insert the card to the Mac and then import the photos into iPhoto.
Note that with iPhoto '08 you need to geotag the photos before importing them, but once they are imported you should be able to see the location data by bringing up the "Photo Info" window (the GPS data is in the "Exposure" section). You can also select "Show File" to bring up the image file in Finder, open the file with Preview, and then use "Tools > Inspector" to display the GPS data (and then you can click on the "Locate" button to view the location in Google Maps).

For general use the Foretrex should be set to "Garmin" on the Settings > Set Interface > I/O Format page, although you can get it to stream GPS data direct to a Mac utility such as GPSUtility by setting it to "NMEA". (Although I have yet to find a use for this).

Friday, June 19, 2009

(Now) I Know (Where I'm Going) Our Kid

Every few years over the last decade or so I have considered getting a GPS and/or SatNav unit, but after spending a while investigating the options my interest has always petered out. Part of me thinks that a GPS is unnecessary and if you know what you're doing a decent map should suffice. Indeed, I have managed to complete my round of the Munros without recourse to such electronic gadgets.

But that was before Google Earth. Having spent some time trying to remember the exact routes of all my Munro walks and recreate them in Google Earth as KML files I have come round to thinking, not what a useful aid to navigation a GPS would be, but what a lot of time it would save me if I could just dump a GPS track log and generate KML files from that. It would also be a positive boon in geotagging photos. In theory you can simply synchronise your digital camera's clock to the GPS before you set out on a walk (or take a photo of the GPS clock screen and sort out any time differential later) and then use the GPS track log to determine where you were when any particular photo was taken. Certainly beats messing around trying to place photos on your Flickr map after the event.

The path to actually getting a GPS started when I was casually leafing through a flier from Maplin there was a product on it called a GPS Travel Tracker. It was £40 and promised to "record and trace your journey using GPS technology". Caroline suggested I could get one for my upcoming birthday. It was interesting, but didn't appear to have any sort of display. What use is a GPS if it can't actually tell you where you are? I found Maplin were selling a similar model with a display for £70 (Holux GPSport 245), but it looked like it would only give your location as latitude/longitude - which might be quite useful if I was an 18th century mariner, but not so handy for using with my collection of OS maps.

For only £10 more I could get a Garmin eTrex H - the same model that I'd used in Norway to verify our location on our snowshoeing trek. Admittedly it was somewhat larger, but it can report positions on OS and WGS-84 maps, it can also do waypoints and routes, and I can vouch for its operability whilst wearing gloves in a blizzard.

My further investigations on Garmin handheld GPS units revealed that the units I had been looking at 6 years ago (such as the Geko 201) were still available, but now slightly cheaper. The development of the handheld GPS appeared to have followed two distinct paths. Firstly the handheld form factor has been retained, but screens have got bigger, become colour (and touch sensitive in some cases), maps from internal memory or SD cards can be displayed, allowing turn-by-turn navigation functionality like SatNavs. Some of them have even got cameras in. And they can cost several hundred pounds.

Meanwhile the smaller form factor, which started with the Foretrex wrist mounted series, has turned into the Forerunner series, which have finally shrunk down to watch size, and contain all sorts of functionality aimed at avid runners. But after having downloaded and read some of the manuals it wasn't clear that you could actually get a useful map grid reference out of them. So, in spite of their small form factor, they may not be that useful to me after all.

I decided I should get all an all-singing all-dancing handheld that could do everything I might possibly ask of it. I'd be able to use it for navigation on the hill, and as a SatNav in the car.

The next morning I awoke realising that everything I had decided the previous day was rubbish. What I needed was a small, light device that wouldn't be too much hassle to take with me anywhere (so I can use it's data for geotagging photos). It should be waterproof and have a display that can tell me where I am on a map, and I should be able get the data off it and on to my MacBook. That was about it. I decided if I wanted any more I could buy a separate SatNav system, which would have the added advantage that Caroline would be able to use the SatNav to meet me with the car at the end of a walk, while I had the GPS with me.

So, I settled on the Foretrex series, which I first looked at in 2005 and are still available. They are a wrist mounted version of the larger Garmin handheld GPS's and weigh 78g and are waterproof. The choice is between the 101 model (which takes 2 AAA batteries) and the 201 model (which has an internal Li-ion battery and comes with a integrated charger/serial data cable cradle, is a slightly different colour). The 201 is £20 more, but by the time you've added in the cost of a data cable and some batteries to the 101 they are almost the same price.

The major drawback with both units is that they come with a serial interface, which even when it was introduced was clearly a technology that had got a bit long in the tooth. But a bit of Googling led me to believe I could get a serial/USB converter cable for a few quid (or £34 if you buy it direct from Garmin), that would let me connect the device to my MacBook over USB. (This post has got quite long enough, so the serial/USB story will be a different post).

So, I plumped for the 101 as it has replaceable batteries. Although the 201 is a completely sealed unit - and so is probably more waterproof - I have a few qualms about how well the internal Li-ion will cope in a few years as they do deteriorate over time with use. With the 101 I can just bung in new batteries as I need, and if I end up going on a multi-day trek I can carry enough spare batteries to last for the entire time.

I ordered the unit from Amazon (£89), along with a data cable (£11) and a serial/USB converter cable (£5). I shall write up my experiences of using it with my MacBook for logging routes and geotagging photos in a separate post.

Interestingly, as I write this, Garmin seem to have updated the Foretrex line with some new models. The 301 and 401, which seem much the same as the 101/201, except the package is slightly narrower, the units have a more up-to-date GPS receiver, have slightly longer running times on a pair of AAA batteries and sport a USB connection. The 401 model has an electronic compass and a barometric altimeter. They are due to be available in Q3 2009, pricing is to be announced.

Update 2009-07-16: Amazon now has the Foretrex 301 and 401 units available for pre-order (due on the 20th July 2009), priced at £170 and £200 respectively.

Oh, for the uninitiated, the title of the post refers to The Shirehorses spoof of The Seahorses "Love Is The Law". For those that have been missing Mark & Lard since their last Radio 1 show five years ago, there is plenty of their material on YouTube.

Sunday, June 7, 2009

Thumping Good Stuff

Macaroni Penguins have become the proud owners of a new PA system. We have just purchased a pair of Tapco Thump TH-15A powered speakers. This means that the rather excellent Mackie SRM350 speakers that we have been using for the past few years can now be repurposed as stage monitors, so that when we play we can now hear what the rest of the band is doing. (For better or for worse).

We took delivery of them on Friday and on Saturday we tried them out when we played the 2009 Dursley Rugby Club Beer Festival, and judging by the audience reaction they could certainly hear what was going on OK. And so could we, so everyone is happy.

One minor drawback though - according to this promotional video, cat owners might want to refrain from bringing their pets to our future gigs.

Monday, March 16, 2009


Am I the only one who finds it alarming how much of the feel of Peter Serafinowicz's Mactini spoof the new iPod Shuffle has?

Thursday, March 12, 2009

Hamish And Dougal Entendres

Fans of Graeme Garden and Barry Cryer's ISIHAC spin off - Hamish and Dougal: You'll Have Had Your Tea - will be pleased to hear that the first series is currently being repeated on BBC Radio 7 on Thursday evenings.

The first episode is currently available on the BBC's iPlayer.

Friday, March 6, 2009

Dog Park

To celebrate the launch of Teasel's Dog Blog I've dusted off GarageBand and recorded a version of the song Dog Park, which has been going through my head when taking Teasel out for a walk.

Current version: 2009-03-06 12:31 mix.

I may update this to newer versions if I redo some of the parts and/or remix it.

Monday, March 2, 2009

It's A Dog's Life

Before we collected Teasel I got her allocated a blog address. Now I have finally found time to post to her blog. I have retroactively added posts from Teasel's time with us.

The blog is accessible at teaseldog.blogspot.com, if you like you can start from the first post, and follow the Newer Post links to step through the posts chronologically.

Wednesday, February 11, 2009


To celebrate Darwin's 200th birthday, Bristol Zoo is allowing anyone with a beard (real or not) into the Zoo for free on the morning of 12th February 2009.

Fortunately Macaroni Penguins rendition of ZZ Top's Sharp Dressed Man gives me all the necessary equipment required for a free visit to the zoo to see if our namesakes have been enjoying the recent snow. (Photo: Macaroni Penguins Gig 36, December 2003 - our first ever performance of Sharp Dressed Man).

More details of the offer on the Bristol Zoo site.

"Every gull's crazy 'bout a shark dressed man"

Thursday, January 22, 2009

New Things Come To Those That Wait...

... and wait and wait.

It seems my white MacBook is not destined to be the last of it's kind. Apple have quietly refreshed the white MacBook by giving it a slightly slower CPU (2.0GHz vs. 2.1GHz), an extra 1GB of RAM (2GB vs. 1GB), a faster bus (1066MHz vs. 800MHz) and posher GPU (NVIDIA GeForce 9400M vs. Intel GMA X3100). FireWire 400 is still there.

They've bumped up the price from £704 to £719, but it's still £210 cheaper than the cheapest aluminium MacBook. Which seems like quite a premium to pay for glass trackpad, a metal box and a funky new video port (and the removal of FireWire, of course). Oh, and the LED backlight (which means better battery life). But maybe the aluminium MacBooks will be seeing their own update to justify the price difference before too long.

The MacBook page on the UK Apple Store currently has the new specs (and price), but they don't seem to have made it to the main MacBook page (on the UK site) yet.

Slightly miffed that after waiting a year, if I'd waited a few more months I could have had almost the same machine with a newer GPU (which will presumably cope better with future OS X upgrades) and a copy of iLife '09 (I'd quite like to see the geo-tagging in iPhoto), but I guess I'll have to be happy with my faster CPU (2.4GHz) and ability to output composite video (although having bought a TV with DVI input, this is now less of an issue for me).

But it's good to see that Apple still think there is a market for reasonably priced laptops.