ads' corner

Advent of Code 2020: "Report Repair" - Day 1

Started “Advent of Code” with the kid, the kid is polishing the Python (and English) skills. I thought I better do this in SQL.


Django: Change or translate the app name in the admin menu

Let’s say I have a Django app users. The admin menu shows this as category Users. That’s ok, but if the website users speak another language I want this name translated. Also I’m not necessarily using Users as name in the admin menu as section name, but can use something more descriptive. Website Users, as example.


Django: Remove default entries from admin menu

The Django administration site comes with a couple of default entries, depending on which apps and middleware is installed.


Huginn: Monitor changes in websites

The Huginn software is not only good for monitoring Twitter feeds, it can also be used to monitor websites for changes.


Django: disable inline option to add new referenced objects

The Django Web Framework makes it quite easy to add new referenced objects in the admin menu.


Volkswagen Golf 8

Vor einer Weile standen wir vor dem Problem dass wir ein neues Auto brauchen.

Zu den Gründen warum wir dann doch ab und zu ein Auto brauchen, und warum es kein Elektroauto geworden ist, steht mehr am Ende des Artikels.

Nachdem feststand, dass wir ein neues Auto brauchen, haben wir eine Weile gesucht, Probe gefahren, Autohäuser besucht ect. Manches hat uns nicht gefallen, bei manchen Autohäusern sind wir auf unfreundliche Verkäufer gestoßen, manche haben sich nie wieder gemeldet. Der größte Teil war jedoch in Ordnung. Letztendlich hatten wir eine Liste von drei verschiedenen Angeboten, und haben uns dann für einen Golf 8 (Modell 2021, in schwarz, ganz wichtig, mit Schiebedach, auch ganz wichtig) entschieden.


Search objects based on a specific criteria (Key:name:etymology) in JOSM

This posting is mainly a reference for myself, because I was looking for this specific issue a couple times.

OpenStreetMap (OSM) is a map of the world, created by anyone who wants to contribute. It so happens that data might be missing (just go and add it, if you see that something is not on the map). It also happens that someone adds too much data.


Add a Google Calendar to openHAB

openHAB can integrate Google Calendars. The functionality is kind of limited, it can only see the current and the next calendar event, but in my case that is enough. More about the use case in another blog post.


git pre-commit Hooks

A very common use case for hooks in git is a pre-commit hook. This hook is used to verify the to-be-committed data before it is added to the repository.


openHAB: faster loading of rules files

openHAB rules files are lazy loaded. When a rule is used the first time, the entire rule file is loaded and compiled, which apparently is single-threaded and takes a couple seconds. Even on a reasonable powerful Rasperry Pi 4. This happens both after restarting openHAB and after changing the rules file. It also means that whatever the rule in question is supposed to do has to wait a couple seconds when requested for the first time. Imagine you have a light switch, enter a room, press the switch, and it takes 5-10 seconds until the light comes on.

To work around this problem, I add a piece of code in all rules files which triggers an immediate action right after loading the file. This way the rules file is already pre-loaded (which again takes a couple seconds, but likely at a time when the rule is not needed right now).