ads' corner

Using Makefiles to build PostgreSQL

For a long time I was using a Makefile to quickly build, start, stop and then wipe a predefined PostgreSQL version. That comes handy if you just want to test something on an older version, without actually installing the software. Everything happens in a single directory, even a different port is assigned.


if-up and if-down scripts with systemd

Everybody likes systemd, right? Well, not everybody. Who thought it might be a good idea to replace existing init systems with something which is big, monolithic, and not even feature complete?

A simple task: execute a script when an interface comes up, or goes down.

In the old days, on Debian or Ubuntu, one just added pre-up and post-down scripts in /etc/network/interfaces. But now, that file is gone, or empty. Ubuntu comes with netplan, which nobody else seems to use - luckily. NetworkManager is not used all the time, so one can’t depend on that either. And systemd does not have an option to do something simple like taking care of interfaces coming up and down. You can write yourself a target, but that only fires for the first time, not every time.


Mauerweglauf 2018 - VP 23

Seit 2011 findet jedes Jahr der Mauerweglauf statt, bei dem die Läufer einmal komplett um das ehemalige Westberlin herum laufen. Insgesamt rund 160 km - oder 100 Meilen. Die Strecke zu absolvieren ist für sich schon gesehen eine beeindruckende Leistung! Am letzten Wochenende (11./12. August) fand der 2018er Lauf statt.

Die Läufer brauchen unterwegs Verpflegung, daher organisieren verschiedene Gruppen und Sportvereine entlang der Strecke Verpflegungsposten. Die meisten Sachen werden vom Veranstalter gestellt, einige wenige wichtige Sachen fehlen jedoch. Der Rundendreher e.V. hat an der B96 in Glienicke/N. den Verpflegungspunkt 23 unterhalten, und die Läufer mit heißen und kalten Getränken, frischem Obst, Essen, Salz, Strom und auch Sitzmöglichkeiten sowie einigen Liegen versorgt.

Da dieses Jahr entlang des Uhrzeigersinns gelaufen wurde, hatten wir einen der Posten ziemlich am Ende der Strecke. Von uns aus waren es nur noch 18 km zum Ziel. Die ersten Läufer kamen gegen 17 Uhr bei uns an (11 Stunden nach dem Start), und dann ging es bis zum nächsten Morgen um 9 Uhr weiter. Nächstes Jahr wird wieder andersherum gelaufen, dann sind wir recht früh am morgen dran und nach wenigen Stunden ist alles vorbei.


Pushover app on Huawei Android phones

While diving deeper into my openHAB installation, the need for notifications on mobile phones came up. After some research, I settled with Pushover, which provides Android and iOS apps, as well as Desktop notifications. openHAB Rules have support for Pushover, and everything works well together.

Except when Android decides to kill apps, because they sit idle and do nothing. It so happens on my Huawei phone that notifications are delivered to the device, but no popup shows up. Only when I open the up, suddenly all the messages are there. The Pushover FAQ has an entry for this, even for Huawei phones, but it is outdated.

After another research it turns out, that the battery management in Android is at fault - but it can be disabled.


Flixbus, Berlin, Alt-Tegel

Die Flixbus Haltestelle Alt-Tegel in Berlin ist etwas kompliziert zu finden. Die Buchungsbestätigung sagt “Berlin (U Alt-Tegel)”, das ist aber nicht die Bushaltestelle die der Flixbus verwendet. Und in der vorab versendeten E-Mail mit dem Link zur Karte findet sich nur “Karolinenstraße 13507 Berlin Germany” als Adresse - das ist reichlich ungenau.


openHAB: redirect port 8080 to port 80

The openHAB Raspberry image, by default, listens on port 8080. After using the image for a while, it became quite boring to always add the port to the URL. Quickly I decided to redirect port 80 to port 8080, and make my life easier.

Not sure how much work that is in the openHAB settings, I settled with redirecting or forwarding the port 80 to port 8080.


Notification when washing machine or dryer are finished, with openHAB

As part of my home automation project, I wanted the washing machine and the dryer to send notifications when they are finished. Both machines are in a separate room, and their alarm beeps are hard to hear in the other parts of the flat. Also because of the noise both machines make during operation, the door is usually closed.

After checking several options how to interact with the washing machine and the dryer (from listening to the audio signals to having light sensors glued over the status led, open the frame and install something inside, and a small cam with picture recognition), I settled with measuring the power consumption. Next step: find the right kit.


Add a FRITZ!Box to openHAB, using Ansible

Next step on my way to add home automation: the FRITZ!Box. Mostly for the current IP-address, and call information.

After some research it became obvious that more manual work is required, hence again something which can be automated.


Update openHAB Things configuration using Ansible

In my earlier openHAB blog posts I automated the installation of extensions and linking of Channels to Items. Another problem I’m facing is the configuration of items. Again, that’s very easy in the UI - if you are willing to click through the list of Items, and manually do all the steps.

Among other things I’m using the binding-yahooweather and the binding-ipp bindings, and the first one needs configuration before it can work properly. For the second one, it righly discovered a laser printer in our network, but occasionally when openHAB requests the status information, this spins up an internal disk in the printer. Therefore it is feasible to increase the time between checks - it’s just the number of outstanding print jobs anyway. Doesn’t matter if someone reacts 5 or 15 minutes later, if the problem was not discovered instantly.


Auto-approve and link certain inbox items in openHAB using Ansible

After starting to look into openHAB, and automate the installation with Ansible, I discovered that there is an API, but the main focus of the documentation and examples clearly is on using the UI and don’t automate the installation. It takes some time to figure out the details. In my last blog post I automated the installation of extensions/bindings, and ended with running a rediscover scan.

Now it’s time to see if there are new items in the inbox, and possibly auto-approve and link them in Ansible.