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.

2018-01-09 · James McDonald

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)....

2017-10-03 · James McDonald

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....

2017-04-05 · James McDonald

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

2015-07-03 · James McDonald

Useful Haskell Learnings

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

2013-08-03 · James McDonald