Things you can grab. My current CV, or at least the most recently updated version thereof.

About this Site

A place where I occasionally write about things if I have the time or inclination.

Let's Get Static

I migrated this site to use static generation, specifically with Hugo. I’ve been thinking about doing so for a while, but switching seemed like it would be a giant hassle. I exported from Wordpress with, which appears to do a bloody good job, including making all the old URLs match up. So that was super easy.

Docker swarm monitoring

I’ve seen a bunch of posts lately about how to set up Docker swarm monitoring with tools like cAdvisor and node_exporter which advise running them like this: docker service create --mode global -p 9100:9100 ... That will indeed run one container on each swarm node, but it has a subtle problem. When you connect to host:9100, the ingress network routing will connect you to a random instance each connection (for swarm routing values of random).

Git post-receive hook for Puppet control repo updates

I made a fairly simple post-receive hook setup to automatically update my Puppet master when I push changes to my control repo. I keep the repo in gitolite, so I wanted to use a regular git hook rather than web hook magic (or even magicer Puppet Enterprise Code Manager magic). My control repo itself is based on the puppetlabs control-repo on github. Essentially the idea is that every branch in the repo becomes a Puppet environment on your master, complete with automatically updated modules based on a Puppetfile.

Function for bash or zsh to generate SSL requests and certificates

Rather than memorising annoying OpenSSL options, stick this in your profile, edit the ‘SUBJ’ bit, and you’ll be generating keys with ease. # Generate an SSL key and a signing request or self-signed certificate sslcert() { cn=$1 # The prefix for the certificate's subject, eg # SUBJ="/C=GB/ST=Edinburgh/L=Edinburgh/O=Widget Co" SUBJ="<<< SET THIS BIT >>>" if [ -z "$cn" -o "$cn" = "-h" ]; then echo "usage: $0 <common name> [csr|crt]" >&2 echo "

Useful Haskell Learnings

isSexyPerson x = if x == "Oda" then x ++ " is indeed sexy!" else "The sexiness of " ++ x ++ " is unknown." Most useful.

Import Things tasks into Apple’s Reminders

OK, so I was making a list of things to do today, but then I decided that having created them in Things, I wanted to move them to Apple’s Reminders. Don’t ask – I’m a task list fetishist. A neat trick you can do with Cultured Code’s Things is to select a bunch of tasks and drag them to a text editor, which will create one line per task with any note appended in brackets.

Vag klokke

I localised my awesome script to Norwegian language and, uh, regional time-reading standards. Behold the glory of! A little terminal in the top right of my screen now proudly proclaims: <br /> Datoen er 2012-11-13<br /> Klokka er fem på elleve<br /> It was fun to work out how to handle “x på/over halv” without too many horrible range conditions. I haven’t bothered to remove stale things like ‘tjuefem’ from the minute list, because it ain’t broke.

Hardcoded GNOMEish composition

From Ubuntu docs about the Compose key at The compose key sequences used by Gnome are derived from the X compose tables of XFree86 version 4.0 with further modifications to provide a Gnome standard for all locales. They are hard coded into the program in source file gtk+-2.10.7/gtk/gtkimcontextsimple.c Digging into the current Debian gtk+ source verifies this: <br /> /* This file contains the table of the compose sequences,<br /> * static const guint16 gtk_compose_seqs_compact[] = {}<br /> * IT is generated from the compose-parse.

Diablo III EU “Error 33” Fix

If you had the Diablo III beta installed, you might come across error 33 “ is down for maintenance” while trying to log in. This is because there is an old registry setting pointing at the US rather than EU login server. Take a look in HKEY_CURRENT_USER\Software\Blizzard Entertainment\\D3. I solved this by deleting the entire ‘Blizzard Entertainment’ key. From orbit, just to be sure. Works like a charm.

How to find our flat

As our building is a bit of a maze, we thought it would be useful to tell you how to find the flat. There are two exciting ways to get here, but this is the easiest to follow. First, go to Øvre Storgate 1B. You can find it with Google Maps. Press buzzer 4A. Wait for the nice people to let you in. You find yourself in a hallway. There is a welcoming door here.

Get off of my iCloud

Like several people I know, I have two AppleID accounts for personal use. I have one that I set up back when an iPod was my only Apple gadget and they first opened the iTunes Store. This has all my (large number of) iTunes purchases associated with it. I also have a MobileMe account that I set up a while later when I first bought a Mac, which I now largely use for the me.

Linux locale problems over ssh from a Mac

Most users of Debian/Ubuntu have at some time seen these annoying messages: <br /> perl: warning: Setting locale failed.<br /> perl: warning: Please check that your locale settings:<br /> LANGUAGE = (unset),<br /> LC_ALL = (unset),<br /> LC_CTYPE = "UTF-8",<br /> LANG = "en_GB.UTF-8"<br /> are supported and installed on your system.<br /> perl: warning: Falling back to the standard locale ("C").<br /> There are a variety of causes – usually locales not being generated properly or incorrect environment variables.

Invert mouse scroll wheel in Debian

I’ve been using the beta of MacOS X Lion for a few weeks now, and after a few days of initial annoyance I’ve grown to really like the inverted sense of the scroll wheel. I recall when I first got one, in fact, and found the direction downright confusing. This seems to have been an easy behaviour to unlearn. My desktop box at work runs Debian, and I wanted the same behaviour there to stop me getting split-brain and dribbling a lot.


I would appear to have accidentally stirred up the norsktwitterredet. I’d better write something here in case they look.

Gah, not another bloody blog

I felt the need for a place to put the occasional rant that’s longer than 140 characters. This may not happen very often, but it’ll happen here if you’re interested in that sort of thing.