Electricmonk

Ferry Boender

Programmer, DevOpper, Open Source enthusiast.

Blog

Category: programming

Re: The shell and its crappy handling of whitespace

I saw an interesting article on The Universe of Discourse about The shell and its crappy handling of whitespace. I’m about thirty-five years into Unix shell programming now, and I continue to despise it. The shell’s treatment of whitespace is a constant problem. The fact that for i in *.jpg; do cp $i /tmp done […]

An Ansible safeguard

At my work, we use ansible to provision all kinds of things, from servers to monitoring. Ansible is very powerful, but with great power comes great responsibility. One downside of automating many things with ansible is that you could also accidentally destroy a lot of things with a single wrong command. In a perfect world […]

Sla (Simple Little Automator 🥗) v1.1 now supports long rule descriptions

Version 1.1 of the Simple Little Automator adds the ability to have long descriptions for build rules. For example: install () { # Install sla # Install sla to $PREFIX (/usr/local by default). # # You can specify the prefix with an environment variable: # # $ PREFIX=/usr sla install # Set the prefix PREFIX=${PREFIX:-/usr/local} […]

sla: The Simple Little Automator

I’m tired of using Make and its arcane syntax. 90% of the projects I write or deal with don’t require any kind of incremental compilation, but that’s all any build system talks about. That, and how insanely fast it is. The drawback is usually that you need to install several terabytes of dependencies, and then […]

multi-git-status can now do a “git fetch” for each repo.

Just a quick note: My multi-git-status project can now do a “git fetch” for each repo, before showing the status. This fetches the latest changes in the remote repository (without changing anything in your local checked out branch), so that mgitstatus will also show any “git pull”s you’d have to do. 

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 […]

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