Welcome to my blog where I write about things that interest me, stuff that was hard to figure out, and sometimes just to show off. I hope you find something interesting.

Recent Blog Posts

Migrating Raspberry Pi From Sd Card to Usb

07 Dec 2020 , tagged: raspberrypi

I’ve been running my Kubernetes cluster on Raspberry Pis for about a year now. Overall the cluster is stable and needs little attention and by now many useful and important services are now running on it. With more reliance on these services I need to ensure that the cluster doesn’t fail from preventable errors. One of the common failure modes for Raspberry Pis are sdcards. They are not very fast, they are of limited size, and worst, they tend to fail.

read more →

Building Docker Containers for ARM with buildx

03 Jan 2020 , tagged: Docker, buildx, ARM

I’ve spent some time over the holidays building a Kubernetes cluster running on raspberry pis. One issue I ran into was that not all docker images I wanted to run were available for arm/linux. Luckily there’s a useful tool called buildx that extends Docker to build containers for different platforms and architectures using quemu and binfmt. ARM has a blog post that details the steps needed to build images. The steps are:

read more →

zsh Autocompletion Caveat

23 Aug 2019 , tagged: zsh, Go, Golang

I spent a good hour trying to get a custom completion script working while porting my app Harbormaster to Cobra. It would and would not work. I retried writing the file, restarting the shell and it would just not offer any completions. Eventually I stumbled upon a innocent looking post on Github that held the solution: remove the .zcompdump file which holds the cached completions. So I ran rm ~/.zcompdump && compinit and everything works as expected.

read more →

awk Cheat Sheet

26 Mar 2019 , tagged: awk, unix, cheat sheet

I needed to crunch some data quickly and decided awk was the right tool to do so. But every time I use awk, I have to go read the manual, so I decided it’s time for a cheat sheet. Structure of an awk script # Comments begin with a pound sign BEGIN { # Instructions run before the main loop FS = ";" # Set a Field Separator } # Each line of input is applied against all the following # regular expressions and runs the instructions in the # block: /^$/ { print "An empty line" } END { # Instructions run after the main loop } Invoke awk with a script like so:

read more →