Ferry Boender

Programmer, DevOpper, Open Source enthusiast.


Category: programming

direnv: Directory-specific environments

Over the course of a single day I might work on a dozen different admin or development projects. In the morning I could be hacking on some Zabbix monitoring scripts, in the afternoon on auto-generated documentation and in the evening on a Python or C project. I try to keep my system clean and my projects […]

SSL/TLS client certificate verification with Python v3.4+ SSLContext

Normally, an SSL/TLS client verifies the server's certificate. It's also possible for the server to require a signed certificate from the client. These are called Client Certificates. This ensures that not only can the client trust the server, but the server can also trusts the client. Traditionally in Python, you'd pass the ca_certs parameter to the […]

Lurch: a unixy launcher and auto-typer

I cobbled together a unixy command / application launcher and auto-typer. I've dubbed it Lurch. Features: Fuzzy filtering as-you-type. Execute commands. Open new browser tabs. Auto-type into currently focussed window Auto-type TOTP / rfc6238 / two-factor / Google Authenticator codes. Unixy and composable. Reads entries from stdin. You can use and combine these features to […]

multi-git-status can now hide repos that don't need attention

I've added an "-e" argument to my multi-git-status project. It hides repositories that have no unpushed, untracked or uncommitted changes. Without "-e": And with the "-e" argument:

Understanding Python's logging module

I'm slightly embarrassed to say that after almost two decades of programming Python, I still didn't understand its logging module. Sure, I could get it to work, and reasonably well, but I'd often end up with unexplained situations such as double log lines or logging that I didn't want. >>> requests.get('https://www.electricmonk.nl') DEBUG:requests.packages.urllib3.connectionpool:Starting new HTTPS connection […]

Merging two Python dictionaries by deep-updating

Say we have two Python dictionaries: { 'name': 'Ferry', 'hobbies': ['programming', 'sci-fi'] } and { 'hobbies': ['gaming'] } What if we want to merge these two dictionaries such that "gaming" is added to the "hobbies" key of the first dictionary? I couldn't find anything online that did this already, so I wrote the following function […]

HTTP Error 429 on Reddit

Getting HTTP error 429 when trying to call Reddit APIs or .json endpoints? Try changing your User Agent header to something else. Reddit bans based on user agent.

How to solve RPMs created by Alien having file conflicts

I generate release packages for my software with Alien, which amongst other things converts .deb packages to .rpm. On Fedora 24 however, the generated RPMs cause a small problem when installed with Yum: Transaction check error: file / from install of cfgtrack-1.0-2.noarch conflicts with file from package filesystem-3.2-20.el7.x86_64 file /usr/bin from install of cfgtrack-1.0-2.noarch conflicts […]

Reliable message delivery with Mosquitto (MQTT)

I was looking for a message queue that could reliably handle messages in such a way that I was guaranteed never to miss one, even if the consumer is offline or crashes. Mosquitto (MQTT) comes very close to that goal. However, it wasn't directly obvious how to configure it to be as reliable as possible So this […]

Ansible-cmdb v1.19: Generate a host overview of Ansible facts.

I've just released ansible-cmdb v1.19. Ansible-cmdb takes the output of Ansible's fact gathering and converts it into a static HTML overview page containing system configuration information. It supports multiple templates (fancy html, txt, markdown, json and sql) and extending information gathered by Ansible with custom data. This release includes the following bugfixes;: Always show stack trace on error and […]

The text of all posts on this blog, unless specificly mentioned otherwise, are licensed under this license.