Code Archive

Magnifying glass I wanted to generate word statistics for a big amount of files, so I wrote this script. What it does is to remove special characters from filenames, and to split the filename into words. The extension is thrown away. more

Architecture The split (1) tool is quite useful, but it doesn't recognize quoted fields. This is my solution to this problem. more

Debian 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

Glasses 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

Yachts 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

Magnifying glass 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

i3 window manager 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

i3 window manager 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

Silence 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

DjangoPythonBitcoinTuxDebianHTML5 badgeSaltStackUpset confused bugMoneyHackerUpset confused bugX.OrggitFirefoxWindowMakerBashIs it worth the time?i3 window managerWagtailContainerIrssiNginxSilenceUse a maskWorldInternet securityPianoFontGnuPGThunderbirdJenkinshome-assistant-logo