Disposable VMs With QEMU and Cloud Images

If you’ve ever found yourself doing Linux network or kernel work, running a container image for experimentation just isn’t good enough. The answer is usually to make a VM. In the past, setting up a new VM with something like VirtualBox or VMware Workstation could take several minutes of waiting and manual steps, making it hard to repeatedly start from an absolutely blank slate. However, there is a solution for near-instant creation of VMs. QEMU lets you create VMs quickly and with very little overhead, and it is very automatable and command-line friendly. You can create disposable VMs with QEMU by using cloud images, which are designed to be run without any OS installation required. ...

August 8, 2025

Setup Autocomplete in Homebrew for Linux

Homebrew is a package manager for macOS and Linux. Its packages are generally up to date, and there is a wide selection of developer tools, especially for cloud work. When you install a program with Homebrew, the shell definitions for tab completion are also installed. However, they may not immediately be available in your terminal without some minor, addition configuration. The Homebrew shell completion page gives instructions for how to get tab completion working. ...

June 4, 2024

Resize an Image in Go

The following Go program will open an image, resize it to be 300 pixels wide with a variable height that preserves the aspect ratio, and write the result to a new file. The intent of this is to be used for a photo-sharing application where the user will see a photo gallery with lots of thumbnails. The width is more important than height when displaying images in a browser. A fixed width allows for more predictability in making columns of pictures, for instance, and it is easier to design for both desktop and mobile use. ...

November 11, 2023

Setup Squid Deb Proxy

You may find yourself in a situation where you need to cache, but not mirror, Apt packages on your network. To do this, you have two main options: apt-cacher-ng or squid-deb-proxy. I have tried both and found that squid-deb-proxy works better for me; it is easier to set up, and it handles concurrent connections better, such as when updating many machines on the network at the same time. To install: ...

July 3, 2023

Kafka Notes

Apache Kafka is a message queuing system…A very large, very complex message queuing system! Here are my rough notes on getting started, rules, vocabulary etc. This is not an in-depth tutorial; instead, it’s a brief reference on the basics. It is outlined based on Stephane Maarek’s excellent introduction to Kafka. Quick Start Download the latest Zookeeper and Kafka (they are bundled together). Both are services. Zookeeper runs on port 2181 by default. Kafka depends on Zookeeper and runs on port 9092. ...

November 19, 2020

Executive Summary of Containers

Below is a message I sent to an executive-level person when asked about containerization. I omitted some technicalities (for instance, containers are not just zip files–they’re compressed layers conforming to the Open Container Initiative specs), but the details are good enough for someone who sees a new technology every five minutes and needs to keep up with it all without knowing every little detail. Conceptually, a container is just a zip file with a program and all of that program’s dependencies inside. That’s it! When you run a container, you’re just running a program. Don’t let the marketers tell you that it’s anything magical. ...

November 12, 2020

Kubernetes Intro 3: Services

In the last post, we talked about deployments, which are great for persistence–sort of. The problem is that, when a pod is restarted, it gets restarted with, most likely, a different IP address inside the cluster. This makes it impossible for other things in the cluster to know how to get to that pod! Pods come and go, and their IP addresses change…So what good does that do us if we’re expecting a pod to always be available to some other part of the cluster or even to a user outside the cluster? Answer: not much. ...

November 9, 2020