Code Archive
The split (1) tool is quite useful, but it doesn't recognize quoted fields. This is my solution to this problem.
more
On Debian-based systems /lib/modules tends to fill up with obsolete files. The reason is that kernel packages have to be purged to remove those files, and that doesn't happen while normal upgrade/remove operations. This script is my solution to this problem. Deletion is disabled by default, verify the output of …
more
I often want to mock reading from a file when writing unit tests in Python, and I always struggle to find the right solution again. So I'm posting it on my own blog in the hope of finding it later 🤣 My solution is to return a StringIO object from …
more
I didn't want to download the AWS CLI client over and over, so I wrote a tiny wrapper script to run it in a docker container. I don't use it a lot as setting up shell completions is a pain, but it can be useful.
more
I use find on a network filesystem and pipe the output to rofi for a nice menu, but the list of files got longer and longer over time and getting the results took too long. I looked around and couldn't find a solution I liked a lot so I wrote …
more
I recently switched to py3status to populate my i3bar. I had several scripts I wanted to call that generate some output for the bar. Below is an example how this can be accomplished.
more
I use i3 with i3bar and sometimes I use external displays. When I do, I want to the systray to be on my primary monitor. I use the script below to reconfigure i3 on the fly.
more
Django models are usually created with a get_absolute_url method, but Wagtail pages don't have one. On this site I mix Wagtail pages with other Django models and needed an url without a domain in some places, below is the solution I'm using right now. Most methods to get a page … more
While interacting with gnupg on Debian/Ubuntu it is often necessary to input a passphrase. I found the most reliable way to do this from the command line is to use gpg-agent and configure the pinentry tool to be command line based. This may break GUI apps though that need a …
more
I tried to look this up yesterday but couldn't find any current numbers for the size of the testnet blockchain. So here are my stats, with txindex enabled.
more