James McDonald

Stuff I wrote about things

Update expiry of GPG keys with separate master key

It’s nice and cosy and secure to have a separate GPG master key as described in many articles, for example https://wiki.debian.org/Subkeys. It’s also a good idea to set expiry dates on these keys so that if all else fails, at least they will only work for so long. But that means that every expiry interval you need to update the expiry dates to keep using the keys. And of course, like me, you totally remember how to do that a year (or a month, or 10 minutes) later. Read more →

Single node Kubernetes setup with kubeadm and cert-manager

These are essentially my notes on setting up a single-node Kubernetes cluster at home. Every time I set up an instance I have to dig through lots of posts, articles and documentation, much of it contradictory or out-of-date. Hopefully this distilled and much-abridged version will be helpful to someone else. This follows https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/ for the initial cluster setup. You should look there for more detail. I strongly recommend that you read about the various projects and verify that this information is still valid. Read more →

First impressions of FOSDEM

It’s big. Really big. Just looking at the timetable is daunting, let alone choosing which talks to attend. People come to FOSDEM from everywhere. I don’t think I’ve ever heard such a wide selection of languages at the same place. It really brings home just how massive FOSS is, and how many people care about it. Venue I’ve never been to Brussels before. If there’s one regret about my FOSDEM trip, it’s that I didn’t have more time to spend in this beautiful city which appears to be full of fun, friendly people. Read more →

Passmenu pass frontend for macOS

I use pass for all my password-storage needs. It’s a simple shell wrapper around GPG and git and it works really nicely. On Linux, I use the passmenu dmenu script to quickly look up passwords and copy them to the clipboard, and I was very much missing that feature on my Mac. So being that sort, I learned some Swift and some Cocoa and made a little tool to do just that. Read more →

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 https://github.com/SchumacherFM/wordpress-to-hugo-exporter, which appears to do a bloody good job, including making all the old URLs match up. So that was super easy. Read more →

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

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 →

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 " 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 →