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.
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.
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.
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 highlightedlocalPATTERN=$1if[ -z "$1"];thenecho"Usage: color <pattern>"echo"Description: Greps input with --color=always -E 'PATTERN|\$' "echo"Example: echo \"hello world\" | color \"world\""return1fi grep --color=always "$PATTERN\|\$"}
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.
Many of my scripts work with temporary files, usually relative to the scripts directory1,
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.
In many CI/CD workflows interfacing with Hashicorp Vault is required.
However, their CLI (or better called unified binary1) is stupidly big with more than 400MB
and they seem to have no interest in making it any smaller2.
This is often a undesired size increase, especially when optimizing for pull and run time in CI/CD.
This note outlines a solution that brings us down from 400MB+ on disk for vault to about 300KB using curl and jq.
Notes
| 2024-06-04
(updated 2025-10-25)
| 2 min read
#renovate-bot
When using Renovate it can sometimes be required
to run a specific manager only on a sub-set of the matching files.
Naively you might expect this to be achieved by overwriting the fileMatch property of the manager.
However this is not possible, as this property gets merged together,
effectively meaning we can only append to it, not replace it.
What I found working is an approach using either includePaths or ignorePaths, depending on the situation.
Most of these should work the same with any OCI compliant client.
Tested with podman and docker, unless otherwise indicated.
# Run container interactivelypodman run -it IMAGE:TAG SHELL
# With auto removing the container on exitpodman run -it --rm IMAGE:TAG SHELL
# With current working dir mounted to containerpodman run -it -v ${PWD}:/tmp/host-dir/ IMAGE:TAG SHELL
# Detaching from the interactive session# Keybinding: Ctrl+P, then Ctrl+Q# Attaching to a containerpodman attach "ID OR NAME"
Often times we need the current date (and time) when scripting inside bash or other shells.
For example when creating a backup file or writing to a log.
Notes
| 2024-02-20
(updated 2025-10-25)
| 1 min read
#ansible
Sometimes it is useful to wait for a port to be closed, for example when updating an app that can’t always properly be shut down using other Ansible modules.
This can easily be achieved using the ansible.builtin.wait_for or ansible.builtin.win_wait_for module.
My preferred minimalistic CSS framework, which is usually enough for small websites and even simple SaaS apps.
It feels like a super power to write almost plain HTML and get something that looks presentable,
supports dark mode and has just enough components to cover most use cases for me.
Often times when writing scripts I want to reference files in the same directory,
but keep the script portable in case it is part of a git repository being checked out somewhere else
or just the folder getting moved.
Notes
| 2023-11-16
(updated 2025-10-25)
| 1 min read
#django#python
Sometimes, mostly when throwing together a quick idea or MVP, it can be useful to just register all models with the admin
and leave proper customization for later.
Notes
| 2023-09-17
(updated 2025-10-25)
| 1 min read
#django#python
Django’s CSRF protection is usually a great thing,
but when building (API) endpoints meant to be accessed by scripts/third parties it gets in the way of that.
To me, a backend heavy developer, HTMX is the frontend framework I like to use because:
It does not feel like a JavaScript framework at all, but more like an extension of the HTTP/HTML model
It allows me to write interfaces that feel responsive and modern to users while still doing all the heavy lifting in my backend with the tools I’m used to
It works with my mental model, which is heavily based on the request-response cycle