One of the things about I love most is it’s flexibility. This may astonish some but I am gaming on my Linux system for approximately 15 years by now. Situation for improved a lot lately but it was always possible to keep myself distracted 😉

So one of the games I just love to play is XCOM (UFO series). I don’t think I skipped any part and Terror From The Deep will always have a special place in my heart. Anyway, when XCOM was relaunched and eventually ported to Linux by Feral Interactive in 2014 I thought I couldn’t have been happier. Firaxis Games topped this in 2016 with XCOM2 and Feral Interactive once more got the job for the port.

Sadly with all the expansion sets it takes quite a toll on the required hardware. Huge fan of all sliders on maximum and see how it goes and while my box can mostly keep up I notice that I run out of RAM towards the end of the game fast and my machine starts swapping. I’ve 16GB RAM and this game eats it away like children their candy.

I’ve got additional 4GB of swap installed on slow spinning rust disks (legacy) so I notice the moment it starts swapping like hitting a wall. After another frustrated restart of the game I paused for a moment. I don’t know why this games needs so much RAM and frankly I don’t even care. Maybe I’m spoiled nowadays since stuff tends to “just work”.

So I decided to throw more power at it but RAM is expensive and I usually have enough of it for my daily work (or other games). I did get a decent SSD (Solid State Disk) recently tho so it’s to my rescue:

swapoff -a
fallocate -l 16G /games/swapfile
mkswap /games/swapfile
swapon /games/swapfile

…and that’s it. I stopped my previous slow swap partition(s), created a new swapfile of 16GB size on my SSD, formatted it as swap partition and activated it. Now I tabbed back into my game and enjoyed the rest of the evening. Let it swap. The SSD can keep up with it. Not minding a few more seconds during loading screens 😀 I’m considerung to add the activation sequence to my “gaming mode” script.

I’m dabbling in for some years by now when I decided to go full electric in 2016. My reasons didn’t change much and it’s time for reflecting on the topic.

The beginning was rough for various reasons. Our local car dealer f*cked up so we shred the initial offer. When we looked around for another dealer we got a recommendation 50km away from home. This one knew his trade, the car and enough of this brand new internet tech to send us a new contract within the hour. Impressed by this we finally ordered our ZE40 .

Fun didn’t last long tho. We were simply unlucky with the AC/DC converter. It was busted within days and we didn’t see the shiny new car for another ~three weeks.

That was kinda disappointing and I worried for several weeks whether this was really a good decision. There was however no further trouble after this incident for years. I started to get to know the car better due to my daily commuting, experienced various recharging challenges, poked around on the car’s CAN bus, installed a charger at home and… bought another .

This time a used ZE model from 2014 with the smaller battery. It was meant to replace our T3 van, that did see daily action until that for shopping, local errands and family taxi. Today it’s mostly used by my wife and parents-in-law leaving their old ICE car to rust as well. This unplanned acquisition was a direct result of our experiences with the ZE40.

It’s like a virus and spreads. Once you try there is no going back. are plain fun, elegant quiet and there is this tingling sensation of experiencing the future early. I tinkered a lot on my combustion cars, especially the vans, in my life. And I don’t miss a thing. Whenever I’m back in an traditional ICE car it feels like yesterday. It’s noisy, everything shakes and rattles and it smells of fumes.

It’s a great bonus that there are no fumes emitted at the eye height of my children.

Beko Pharm

This isn’t even about environment considerations. It’s a great bonus that there are no fumes emitted at the eye height of my children, of course. I won’t go into the regulars’ table talk about the negative aspects of . They apply to any mobility and “alternate facts” on this topic are debunked on various scientific essays on the net. We all know that cars are and will never be “good” for the environment. We’re countryside. This is as good as it gets.

So yeah, as I mentioned we’re in the countryside. Black Forest to be specific. We get snow here. And this is another plus for the . While the old 2014 edition has apparently ~5° less heating capabilities Renault really did their homework starting with the next editions. The older one could really need a seat heater while the new one has enough power that this is no issue. Both don’t need ice scraping though. Pre-heating (or pre-cooling in the summertime) is key here. This can be done by timer, remote, or, if you feel really lucky, by app. This is luxury!

The had to prove itself as transporter as well. It is simply amazing what can be loaded into this small car. It’s an underestimated space miracle. Especially when the backseats are removed (or at least folded down). I wasn’t sure I could fit everything inside on my first trip to Ikea. So I had to go inside twice to get the rest from the list 😀

Needless to say that excursions are also absolutely no problem. My website is proof of this since various articles and galleries here are the result of trips we used the for. Winter, summer, weather, distance, whatever. Chargers or outlets are everywhere, and in most cases we stopped because of the kids needing a break or when we arrived at our destination, and not because the car needed a recharge. So while we ate, or checked out cool locations, the car recharged having nothing better to do at such times anyway. We never stranded and while we carefully watched the available miles and capacity in the beginning we basically stopped caring about this at all. We know it’s always enough [for us].

Battery lifetime. It’s a gamble. I know the datasheets, the promises, the waranty. As a programmer and tinkerer I poke at such things. So here is today’s values for the SoH (State of Health) for our batteries:

  • ZE 22 kWh (rented) 39.086 km 97% SoH
  • ZE40 41 kWh (bought) 31.392 km 97% SoH

That is within the expected degrading curves and I’m not worrying too much about this. Just checking it regulary with the CanZE app in the hope to find broken cells early. Usually it’s bad luck if this happens at all. Otherwhise the batteries are doing a decent job here and it’ll probably be years before my 41 kWh battery will see it’s second life as buffer storage. Especially since I didn’t drive nearly as much as anticipated. My work situation changed and I got a lot of home office reducing the need to commute greatly.

So yeah, after several years and plenty of commuted miles to the office, customers, excursions and trips I’d never go back to an ICE. This was the right decision and even cheaper in the long run compared to any of my old cars. The ZOEs are up for any daily challenge for a family of four and even some occasional car sharing.

And yet – sometimes I’m reminded that this is “just” a french car. Seals of the cooling system e.g. suck (and this coolant is freaking expensive). The software, connectivity services (app) and especially the shipped TomTom is/are awful. That includes the scheduled ripoff for programming the RDKS each time. The headlights are really bad and from all EVs I tried over the last years the ZOE has the worst speedup, antenna, power usage and fewest assistants. Cruise control is decent tho. There are better cars. Better EVs. Mayhap even the new ZE50 out now.

Went for a walk with my family today. What was meant as a short walk resulted in an two hours excursion. The forest is an awesome place to be in autumn. While not yet frozen over the winter it’s still rich of life and beautiful colours.

Even the continious rainfall could not ruin this. We had good jackets [that could not quite keep up with my medieaval Pileus (hat)] and boots. Such a long walk was also quite an adventure for the children who somehow managed all of this without [the usual] complaining =)

Visited the horticultural show in Heilbronn 74072 / Germany. It’s amazing how the city could look with more green here and there… and way less cars.

An electric mobil parcel station beside a charging station.

There were a few things of particular interest for me. The first thing is that is is obviously possible to have bees within a city and _many_ people walking right next to the beehive without angering the bees. Didn’t know this is possible.

Bee hives right next to people visiting the show. Some could even be opened to check on the bees.

Next was this FarmBot. It’s a opensource CNC farming machine that basically anyone with some skill can rebuild. It uses some 3d printed assets but the rest is kinda off the shelf stuff. Sadly I got no good picture of it since this late in the year it was not in use any more but the website has all the fancy presentations:

https://farm.bot/

Unexcepted was a group of people on rafts demonstrating the historic trade of Timber Rafting. I’m not sure but I think this particular group is also from Schiltach that I visited several times before. Nice icing 🙂

Historic Timer Rafting

I’m surprised that I found interesting stuff at all. Not much into gardening so it was a pleasant surprise to find so many points of interest on the show. We were even short of time in the end without seeing all of it. Sadly it’s the end of the season so there won’t be further chances for this. Was a great day and I finally did see the finished Experimenta from the outside. Last time I visited it was still under construction.

https://www.buga2019.de/de/index.php

tl,dr: `systemctl suspend`

Sometimes I let my pc play music at night. Spotify still didn’t manage to implement a sleep function (even gorram Audible has this – and chances are the app crashes way before anyway).

I usually use `shutdown -h 60` or similar. Suspend tho? That’s another story. Hint: “suspend” is a bash builtin and not what you’d expect 😉

Looks like this changed (again) from `pm-suspend` to… systemd:

> sleep 1h; systemctl suspend

No sudo. yw.

Did you know `ncdu`? I’m using this for years to find out where all my precious disk space is lost. Unlike other solutions it works in a terminal and this way even on remote servers… or gorram mobile phones always short on anything.

Having trouble with your recently updated Zarafa 7.2 installation? Can’t connect via imap? Seeing something like this in your gateway log?

CreateProfileTemp(): ConfigureMsgService failed 80040115: network error

You already make sure that

* your zarafa-server binds to 0.0.0.0
** server_bind = 0.0.0.0
** server_tcp_enabled = yes
* your gateway points to localhost
** server_socket = http://localhost:237/zarafa

And your config worked just fine before? Still have no idea what’s going on? Well, take a look at lsof -i tcp:236 and notice that you’ll only get TCP *:237 (LISTEN) on IPv4 for the zarafa-server.

Now check your ifconfig lo for inet6 entries:

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask>:255.0.0.0
inet6 addr: ::1/128 Scope:Host

And your /etc/hosts will probably point to this as well:

127.0.0.1 localhost.localdomain localhost
::1 localhost

So this is what happens: zarafa-gateway looks up localhost, reads IPv6, tries to connect to ::1 port 237 and gets nothing. Here is your 0x80040115 (MAPI_E_NETWORK_ERROR) network error.

Use server_socket = http://127.0.01:237/zarafa and you’ll be fine.

Well done Zarafa. How about binding to IPv6 as well? Nothing in the manpage on this. Don’t tell me that the server isn’t IPv6 ready while the gateway is.

#80040115

Hint: Do *never* use the UNIX socket as server_socket in the zarafa-gateway config. You may open login to the accounts without valid password if you do so. Check the manual. Seriously.

This is how I import my deadlines for tickets from our Jira bugtracker to our Zarafa ical gateway (running on localhost only but since I’ve a real account I could easily install a crontab for this for my system user).

Notes:

– The script makes use of phyton as well
– The script makes use of the Jira rest api (needs to be enabled)
– The script makes use of the (free) JIRA Calendar Plugin (https://marketplace.atlassian.com/plugins/com.atlassian.jira.ext.calendar/versions#b20107)
– The script uses a hardcoded filter id 10100. The filter must be created by the Jira user before. In my case it’s simply a filter that returns all projects I’m assigned to.
– The calendar used (e.g. “Jira”) must be manually created by the Zarafa user before and will be overwritten everytime the script runs! (Do not use default calendar)
– Dunno how to check whether ICS file loaded fine so run it manually and check whether new items show up in the calendar 🙂

It can probably easy adapted to other ics servers as well. I run this all 15 minutes during working days making use of crontab.


#!/bin/bash
JIRAUSER="changeme"
JIRAPASS="changeme"
JIRAICS="$HOME/jira.tmp.ics"
JIRAURL="jira.example.com"
#secure folder with e.g. umask 077
JIRACOOKIE="$HOME/.cookies/jira.cookie"
ZARAFAUSER=="changeme@example.com"
ZARAFAPASS=="changeme"
#
#Do NOT use default "Calendar", ICS will OVERWRITE it!
#Create an OWN calendar for Jira entries ONLY!
#
ZARAFACALENDAR="Jira"
if [ -f "$JIRAICS" ]; then
rm "$JIRAICS"
fi
if [ ! -f "$JIRACOOKIE" ]; then
JIRATEST=`/usr/bin/curl -s -u "$JIRAUSER":"$JIRAPASS" --cookie-jar "$JIRACOOKIE" "https://$JIRAURL/rest/api/2/user?username=$JIRAUSER" -s | python -mjson.tool | grep -oP "(?<=\"name\": \")[^\"]+"`
else
JIRATEST=`/usr/bin/curl -s --cookie "$JIRACOOKIE" "https://$JIRAURL/rest/api/2/user?username=$JIRAUSER" -s | python -mjson.tool | grep -oP "(?<=\"name\": \")[^\"]+"`
fi
if [ "$JIRATEST" != "$JIRAUSER" ]; then
echo "Error getting Jira username $JIRAUSER"
rm "$JIRACOOKIE"
exit -1
fi
/usr/bin/curl -s --cookie "$JIRACOOKIE" --output "$JIRAICS" "https://$JIRAURL/plugins/servlet/calendar?searchRequestId=10100&dateFieldName=duedate&showVersions=true" || exit $?
if [ -f "$JIRAICS" ]; then
/usr/bin/curl -s -u "$ZARAFAUSER":"$ZARAFAPASS" -T "$JIRAICS" "http://localhost:8080/ical/$ZARAFAUSER/$ZARAFACALENDAR"
rm "$JIRAICS"
fi

OwnCloud könnte mal richtig toll werden. Im Moment ändert sich jedoch alle naselang die Webseite, das Aussehen, die Funktionen.. also alles. Da auch ständig Sicherheitslücken bekannt werden, und einen Patch den nächsten jagt, sollte man hier stets auf die neuste Version achten.

Dazu gibt es im Adminbereich eine schöne Funktion, welche einem anzeigt ob man die aktuelle Version hat. Das wollten wir nun automatisch wissen, um uns nicht ständig auf der Admin-Seite einloggen zu müssen.

Die Funktion von der Seite stellt OC_Updater::check() aus lib/updater.php. Dabei wird ein String zusammen aus Version, Installationsdatum, letztes Updatedatum und Update-Kanal erstellt.

Die Daten werden dabei mit “x” separiert. Auch der Versionsstring ist durch das “x” in major, minor und nochmalminor getrennt. Aus Version “4.90.4” wird zum Beispiel “4x90x4”.

Ich habe keine Ahnung ob es da eine offizielle API Doku für gibt (Owncloud hat gerade die ganze Webseite umstruktuiert und viele Suchmaschinentreffer gehen gerade ins Leere), doch habe ich folgendes (im Moment) beobachten können:
– So lange die Anzahl der erwarteten “x”e im String ist, spuckt der Server also eine Antwort aus.
– Ist in der XML-Antwort keine Version angegeben ist alles ok.
– Ist ein Versionsstring angegeben unterscheidet sich die aktuelle Version mit der empfohlenen aus dem “Update-Kanal” (wobei auch hier “stable” als “default”-Kanal gegeben scheint)

So genügt zum Beispiel der String “4x90x4xxxx” für einen Request.

Achtung: Major-Versionssprünge werden nicht als neue Version angekündigt. 4.90.4 wird z.b. als aktuell gewertet, auch wenn bereits 5.0.0 verfügbar ist.

Und so sieht das ganze als schneller Hack für ein Nagios Script aus:

#!/bin/bash
#Reminder: Nagios return codes: 0 OK, 1 WARN, 2 CRIT, 3 UNKNOWN
#Reminder2: Full “featured” version request example: http://apps.owncloud.com/updater.php?version=5x0x0x1356382022.183×1363606253.8263xstablex

VER=`grep version /pfad/zur/owncloud/config/config.php | sed ‘s/[^0-9.]*//g’`

if [[ “${#VER}” > 0 ]]; then
#Replace all matches of . with x
VERSNIPPED=${VER//./x}
APPURL=”http://apps.owncloud.com/updater.php?version=””$VERSNIPPED””xxxx”

NEWVER=`wget -qO – “$APPURL” | grep “” | sed ‘s/[^0-9.]*//g’`

if [[ $? == 0 ]];then
if [[ ${#NEWVER} > 0 ]]; then
echo “New version: $NEWVER”
exit 2
else
echo “Version $VER is up to date”
exit 0
fi
else
echo “Could not wget version request from apps.owncloud.com”
exit 2
fi
else
echo “Could not parse local version from config.php”
exit 3
fi

..funktioniert vermutlich so nur ein paar Monate. Das Prinzip ist aber klar 🙂

I always wondered how I could easily read several variables at once from some program I execute from bash. Usually I simply read all values to a single variable and do a barrel roll (for each) on it or I execute the program in question several times with slightly tweaked parameters. That’s all not so nice for performance critical scripts. So I usually try to read as much as possible with as less as possible program calls from within a script.

Well, this is a snipped I developed today that is much easier by simply making use of read and “<<<

read iUID iGID <<< `awk -v username="$USERNAME" -F ":" '$0 ~ "^"username":x:" {print $3" "$4}' /etc/passwd`

I’m also passing a variable down to awk used in a regular expression. Please notice that this does only work when $IFS is a single space (default).

if [[ $iUID =~ ^[0-9]+$ ]] && [[ $iGID =~ ^[0-9]+$ ]]; then

And here I can even validate both values easily as integers using a regular expression.

Bash is so damn powerful once you get the basics 🙂 Ah and yes I am aware that awk can do the integer check itself but I’m just not there.. yet 😉