I started looking at decentralised/federated tools some years ago, but other than Matrix I didn’t use any of them until recently. Then this February I joined the Fediverse (federated universe) by spinning up my own Mastodon instance. I’m not going to lie, this place is pure awesome …
read more-
-
Emotional bursts
This is a reaction of mine to a post in which a father talks about an emotional burst he had when his daughter did something nasty. He had hard times processing it, at the end turning his anguish to a blog post. Unfortunately, the post is unavailable since then (i …
read more -
Add SysAdmin day to Emacs Calendar
I’m a SysAdmin since 1998. Maybe a bit earlier, if you count managing our home computer. This means SysAdmin Day is also celebrating me. However, my Emacs Calendar doesn’t show it for some reason.
The solution is pretty easy:
read more(add-to-list 'holiday-other-holidays '(holiday-float 7 5 -1 "SysAdmin Day") t …
-
Category-based logging with Flask
I’m in a team who are developing a Flask-based web application, which uses logging extensively. For a while now it spews out a lot of lines so the need arose to index them in ElasticSearch, and more importantly, to search through them for auditing purposes. This latter user story …
read more -
Rename automatically named foreign keys with Alembic
I have recently messed up my Alembic migrations while modifying my SQLAlchemy models. To start with, I didn’t update the auto-generated migration files to name the indexes/foreign keys a name, so Alembic used its own naming scheme. This is not an actual problem until you have to modify …
read more -
Finding non-translated strings in Python code
When creating multilingual software, be it on the web, mobile, or desktop, you will eventually fail to mark strings as translatable. I know, I know, we developers are superhuman and never do that, but somehow I stopped trusting myself recently, so I came up with an idea.
Right now I …
read more -
Slugify in Python 3
Today I needed a function to create a slug (an ASCII-only representation of a string). I went Googling a bit, and found an excellend Flask snippet. Problem is, it is designed for Python 2, so I came up with a Python 3 version.
read moreimport re from unicodedata import normalize …
-
Add Python docstring to the beginning of anything in Emacs
Now that I write Python code for a living, I write a lot of functions, classes, and modules. What I still tend to forget, and also find tedious, is adding docstrings. Unlike many developers, writing documentation is not an enemy of mine, but it usually comes to my mind when …
read more -
Get account data programatically from id-manager
I recently started using id-manager. It is a nice little package that can store your passwords, encrypting them with GPG. My original reason was to store my GitHub access token for github-notifier, but it soon turned out, it’s not that easy.
id-manager is a nice package when it comes …
read more -
Edit file as another user in Emacs
I have recently found this article by Bozhidar Batsov on opening the current file as root. I barely use tramp for sudo access, but when I do, I almost never use root as the target user. So I decided to fix it for my needs.
read more(defun open-this-file-as-other-user (user) "Edit current …