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

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

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

November 9, 2020

Kubernetes Intro 2: Deployments

In the last post we talked about pods, which are the basic work unit in Kubernetes. Pods are ephemeral, and they may stop running for any number of reasons: node failure, preemption by a higher-priority workload, internal error, etc. When a pod stops, it doesn’t restart on its own. For this, you need a deployment. A deployment is a level above a pod. Whereas a pod is a (relatively) “tangible” thing in the cluster, a deployment is more like a standing order....

November 9, 2020