James McDonald

Stuff I wrote about things

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. Read more →

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. Read more →

Vag klokke

I localised my awesome fuzzyclock.py script to Norwegian language and, uh, regional time-reading standards. Behold the glory of vagklokke.py! 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. Read more →

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. Read more →

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. Read more →