While this works consider using a different file format better suited for configuration.
Read more…
the proc virtual filesystem
Notes
| 2025-09-19
(updated 2025-10-25)
| 1 min read
#container
#linux
#sysadmin
Usually at least one of those is present on any system
- top
- htop / another top variant
- ps
But sometimes the usual suspects are not available, especially in minimal containers.
But there is another, more low level, way that works: /proc
This is a virtual filesystem provided by the kernel about running processes.
So to mirror something like this:
$ ps aux |grep sleep
5 root 0:00 sleep 1000
21 root 0:00 sleep 10000000
36 root 0:00 grep sleep
We could do:
Read more…
Notes
| 2025-09-16
(updated 2025-10-25)
| 1 min read
#k8s
#kustomize
Kubernetes resources have quite a lot of lists in them and replacing an item in such lists is quite easy
using kustomize patches with op: replace.
Replacing a specific list item safely however is not as obvious as the order of items could change,
leading to a technically valid but practically incorrect manifest.
Read more…
Notes
| 2025-09-08
(updated 2025-10-25)
| 1 min read
#seo
There are loads of better ways to do this using Google Search Console / Bing Webmaster Tools / ahrefs and similar tools.
Arguably these might be a bit too much for a small side project or a curious quick check,
so this is how I do it. The same syntax works for both Google and Bing.
Read more…
Notes
| 2025-07-02
(updated 2025-10-25)
| 1 min read
#git
Git is hard: screwing up is easy, and figuring out how to fix your mistakes is fucking impossible.
Git documentation has this chicken and egg problem where you can’t search for how to get yourself out of a mess,
unless you already know the name of the thing you need to know about in order to fix your problem.
Oh Shit, Git!?! is a collection of these situations, in plain English, and how to resolve them.
Notes
| 2025-07-02
(updated 2025-10-25)
| 2 min read
#caddy
Building custom domains for your SaaS is not always easy, especially when certificates get involved.
With Caddy it becomes very easy!
Read more…
Posts
| 2025-06-12
(updated 2025-10-24)
| 1 min read
#guest-apperance
#nginx
I had the pleasure of joining Dave McAllister, Senior Open Source Technologist for NGINX,
on the NGINX Community Chats to talk about tech playground.
Read more…
Notes
| 2025-05-07
(updated 2025-10-25)
| 1 min read
#bash
#grep
#productivity
Colorize a pattern in the given input using a neat regex and colorization hack in grep
($ matching all lines but not being able to be highlighted).
color () {
# Color highlight the pattern in the incoming stream, writing to stdout
# This effectively matches our PATTERN andy any "$" (line end)
# But only our PATTERN can be highlighted, line end characters aren't actually there to be highlighted
local PATTERN=$1
if [ -z "$1" ]; then
echo "Usage: color <pattern>"
echo "Description: Greps input with --color=always -E 'PATTERN|\$' "
echo "Example: echo \"hello world\" | color \"world\""
return 1
fi
grep --color=always "$PATTERN\|\$"
}
Notes
| 2025-04-17
(updated 2025-10-25)
| 1 min read
#k8s
#tools
kubeswitch (lazy: switch) is the single pane of glass for all of your kubeconfig files. Caters to operators of large scale Kubernetes installations. Designed as a drop-in replacement for kubectx.
I’m using it for all my cluster-switching needs.
Notes
| 2025-04-14
(updated 2025-10-25)
| 1 min read
#git
#pip
#python
Install a pip package from a git repo, using a specified git reference:
Read more…
Notes
| 2025-04-13
(updated 2025-10-25)
| 1 min read
#tools
Hand-drawn 2D & 3D illustrations, icons and animations.
Incredibly high quality illustrations.
I use them in a bunch of places, especially on landing pages and in presentations
that just need that little “extra” thing.
Notes
| 2025-02-28
(updated 2025-10-25)
| 1 min read
#bash
#dns
#troubleshooting
DNS is something so fundamental to most of our systems functioning that it’s often overlooked in initial troubleshooting,
it’s also incredibly hard to troubleshoot if it’s only intermittently failing.
Read more…
Notes
| 2025-02-26
(updated 2025-10-25)
| 1 min read
#gitlab
Read more…
Notes
| 2025-02-23
(updated 2025-10-25)
| 1 min read
#bash
#microservices
#scripting
Doing local development on a bunch of interconnected services I often want to start multiple long running server processes.
This is the basic script I use for that.
Read more…
Notes
| 2025-02-17
(updated 2025-10-25)
| 1 min read
#k8s
#tools
When working with multiple Kubernetes clusters and namespaces switching context can be a chore.
For this I enjoy using kubectx and kubens.
They can be installed using kubectl krew.
kubectl krew install ctx
kubectl krew install ns
I’ve since switched to [[kubeswitch]], which works much nicer for me.
Notes
| 2025-01-02
(updated 2025-10-25)
| 1 min read
#django
#python
I often find myself replacing an existing MVP based on static html with a Django app,
or just needing to preserve some old URL scheme.
This is the code I use to do that:
from django.shortcuts import redirect
def redirect_view(request, redirectable, permanent=True):
return redirect(redirectable)
Which can then be used like this:
from django.urls import path
from . import views
urlpatterns = [
path("old-url/", views.redirect_view, {"redirectable": "new_view"}),
path("some-thing/", views.redirect_view, {"redirectable": "some_thing_new", permanent=False}),
]
Notes
| 2024-09-03
(updated 2025-10-25)
| 1 min read
#bash
#linux
#scripting
Many of my scripts work with temporary files, usually relative to the scripts directory,
while at the same time using set -e to exit as soon as something fails.
In this scenario the script leaves behind these temporary files by default, which is not desirable.
We can however do a proper cleanup using the trap concept.
Read more…
More Posts