Powered By Blogger

Dienstag, 25. Mai 2021

How to get MediaWiki running after upgrade from Debian 9 to Debian 10

My wiki on wiki.mkcs.at is a LXC container which was so far running Debian 9 and its host is also running Debian 9. I already set up a new host running Debian 10 (buster) and of course the containers running on it should run the same OS version.

After I copied the container from the old to the new host, everything was still working fine. But after I upgraded to Debian 10, suffering began, followed by some hours of tinkering. I would like to safe you that time and share my experiences.


The first service that failed to start was Apache. This could be seen directly in the output of apt full-upgrade:

apache2.service: Failed to set up mount namespacing: Permission denied

apache2.service: Failed at step NAMESPACE spawning /usr/sbin/apachectl: Permission denied

apache2.service: Control process exited, code=exited, status=226/NAMESPACE

As I read here, these two lines in /lib/systemd/system/apache2.service fix that problem:

PrivateTmp=false
NoNewPrivileges=yes

These commands then start Apache:

systemctl daemon-reload

systemctl start apache2.service

 

The next service that failed to start was mariadb and this was the one that was hard to fix. dpkg --list | grep -i mariadb showed that mariadb wasn't installed at all, so I installed it using apt install default-mysql-server. However, after installation, it did not run and systemctl status mysql showed

mariadb.service: Failed to set up mount namespacing: Permission denied

mariadb.service: Failed at step NAMESPACE spawning /usr/bin/install: Permission denied

mariadb.service: Control process exited, code=exited, status=226/NAMESPACE

The error was similar to the one I had with Apache but I could not quickly find a simple solution. Many search results on Google pointed to solutions with Proxmox or LXD that helped me to slightly understand the cause of the problem (somehow, AppArmor is preventing access) but not a solution. As I have seen in the output of dmesg, mariadb was not the only application that did not work:

audit: type=1400 audit(1621946328.497:5424): apparmor="DENIED" operation="mount" info="failed flags match" error=-13 profile="lxc-container-default-cgns" name="/" pid=4240 comm="(install)" flags="rw, rslave"

audit: type=1400 audit(1621946331.481:5425): apparmor="DENIED" operation="mount" info="failed flags match" error=-13 profile="lxc-container-default-cgns" name="/" pid=4241 comm="(vnstatd)" flags="rw, rslave"

On my LXC wiki page I once noted to add a line "lxc.aa_profile = unconfined" if strange permission problems occur in the container, but LXC then refused to start the container:

confile.c: parse_line: 2312 Unknown configuration key "lxc.aa_profile"

So, the option must have renamed in LXC 3. This page showed the right option:

lxc.apparmor.profile = unconfined

And finally mariadb was working again.


The next challenge was to get MediaWiki running. It first complained that it was missing "mbstring" and "xml" modules, so I installed them using apt -y install php-mbstring php-xml. Then I figured out that php7.3 and php7.3-mysql were not installed and I installed them too (apt -y install php7.3 php7.3-mysql). Next, MediaWiki complained it could not connect to the database:

no viable database extension found for type 'mysql'

The problem was that two versions of the mysql library were installed, as dpkg -S mysqlnd.so showed:

php7.0-mysql: /usr/lib/php/20151012/mysqlnd.so
php7.3-mysql: /usr/lib/php/20180731/mysqlnd.so

dpkg --list | grep "php7.0" showed that several packages belonging PHP 7.0 were still installed, so I removed them using apt remove php7.0 php7.0-cli php7.0-common php7.0-json php7.0-mysql php7.0-opcache php7.0-readline.


Finally I tested my wiki by logging in, modifying an article and see if it occurs in the "Recent changes" page. Everything worked smoothly. 😀

Donnerstag, 7. Januar 2021

SSL_ERROR_RX_RECORD_TOO_LONG after upgrading Apache on Debian

Recently I upgraded a Debian server from Debian 8 (jessie) to Debian 9 (stretch) which also caused Apache to be upgraded from version 2.4.10 to 2.4.25. After the upgrade, when trying to connect to the web site using HTTPS, Firefox showed an error message with the code "SSL_ERROR_RX_RECORD_TOO_LONG". This error message is quite confusing, I thought that there would be something wrong with the certificate or the code that handles TLS. After searching a little bit in the Web, I figured out that Apache is actually serving HTTP on port 443 which doesn't work of course. The page that helped me was

https://community.letsencrypt.org/t/ssl-error-rx-record-too-long-on-debian-9-apache-2/123371

The command apachectl revealed that Apache was only aware of the virtual host configuration to serve on HTTP:

apachectl -t -D DUMP_VHOSTS
VirtualHost configuration:
*:80                   x.y.z (/etc/apache2/sites-enabled/000-default.conf:3)

It's interesting that Apache can't detect this misconfiguration somehow. Who wants to run a HTTP server on port 443 anyway?

Once I was aware of the problem, I tried to find out why it didn't read the virtual host configuration using TLS. The filename was /etc/apache2/sites-enabled/001-default-ssl and it worked fine with Apache 2.4.10 on Debian 8. So I took a look at /etc/apache2/apache2.conf and made a diff with the old configuration file. Then I saw this:

< IncludeOptional sites-enabled/*.conf
---
> Include sites-enabled/

While the old configuration told Apache2 to just read any file in sites-enabled/, the new configuration only processes files with ".conf" at the file name's end (which is clever IMHO). So what I had to do was to remove all the wrong links in sites-enabled, rename the configuration files in sites-available and add them again using "a2ensite". Finally, my web site was working again using HTTPS.

Samstag, 7. November 2015

NetBSD 7 and XFCE in VirtualBox; lighttpd in NetBSD

As I found out in my last post about NetBSD 7 RC 3, there have been some problems with it and I wanted to try it out in VirtualBox. Finally, I have done that yesterday and I saw that NetBSD 7 performs quite well in VirtualBox. However, at first it was also not possible to set another background picture. The reason for that was that "xfdesktop" - which manages the desktop in XFCE - wasn't installed (which I have expected it to do when issued "pkgin install xfce"). The package's name in NetBSD is " xfce4-desktop". I tried to let it install by pkgin, but that failed, which showed me some lines in /var/db/pkgin/pkg_install-err.log:

---Nov 06 20:40:55: installing xfce4-desktop-4.12.3...
pkg_add: no pkg found for 'tdb>=1.2.10', sorry.
pkg_add: Can't install dependency tdb>=1.2.10


I installed that package "tdb" and afterwards, xfce4-desktop could be installed.  Since that moment it's possible to set another background picture in XFCE.

Other IMHO useful packages I installed:

firefox icedtea-web xpdf nmap iftop libreoffice-5* xfce4-screenshooter xfce4-weather* xfce4-cpugraph* xfce4-battery* xfce4-systemload-plugin gnome-screensaver gnome-audio gnome-backgrounds gnome-system-monitor gnome-system-tools xfce4-thunar sysupgrade sudo

For some experiments I also installed: lighttpd tuxpaint

Most of these packages worked, except gnome-system-monitor. gnome-about worked after I installed "py27-gtk". It's wise to start gnome-screensaver-settings once to setup the screen saver.

lighttpd didn't work after installing it. Unfortunately, pkgin doesn't copy any files necessary to actually run lighttpd (like apt-get does on Debian). This can be done with these commands:
cp -v /usr/pkg/share/examples/rc.d/lighttpd /etc/rc.d/
cp -v /usr/pkg/share/examples/lighttpd/lighttpd.conf /etc/lighttpd/

/etc/lighttpd/lighttpd.conf should be reviewed. Using

service lighttpd start

lighttpd can be started. Using

mkdir -p /srv/www/htdocs

it is possible to create the directory where files are being searched, unless this setting has not been changed in lighttpd.conf (see variable "server.document-root"). In my case, lighttpd now only serves files via IPv6, which can be seen if "netstat -f inet6 -a" is executed:

Active Internet6 connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
tcp6       0      0  *.http                 *.*                    LISTEN
tcp6       0      0  *.x11                  *.*                    LISTEN
tcp6       0      0  *.ssh                  *.*                    LISTEN
tcp6       0      0  *.sunrpc               *.*                    LISTEN
udp6       0      0  fe80::1%lo0.ntp        *.*                  
udp6       0      0  localhost.ntp          *.*                  
udp6       0      0  2001:470:1f0b:2e.ntp   *.*                  
udp6       0      0  fe80::a00:27ff:f.ntp   *.*                  
udp6       0      0  *.ntp                  *.*                  
udp6       0      0  *.*                    *.*                  
udp6       0      0  *.1023                 *.*                  
udp6       0      0  *.sunrpc               *.*                  


If "inet" is used instead of "inet6", no "http" is listed.

Freitag, 21. August 2015

First look at NetBSD 7 RC 3 and XFCE

The NetBSD team released RC 3 of NetBSD 7 this week and I was just too curious about its progress, so I downloaded both the i386 and x86_64 ISOs. I set it up in a virtual machine that I virtualised using Qemu 2.0.0 on my Xubuntu 14.04 system. First I had some trouble with the installer. I unaccidently selected a wrong option and then cancelled with Ctrl+C. Although I finished the installation normally, the system didn't boot correctly but dropped me on a shell with the hint, that /etc/rc.conf would contain RC_CONFIGURED=NO. I had no clue at that time how to solve that, especially how to mount the root filesystem read/write. In the meantime I found out that it isn't that hard: "mount -u -w /" would do the trick.

However, I just started the installation again (which is really fast and takes just a few minutes) but I had yet another problem: When trying to setup pkgin, that failed because it said it couldn't download something from "http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/7.0_RC3/". In fact, that directory doesn't exist. I realised that there is path to "7.0" (without the "_RC3") and changed the path accordingly. The installer warned me that at least one package was build for RC 2 rather than RC 3 but I decided to accept this and the installation went fine.

After installing the "usual suspicous" packages (bash, nano), I installed XFCE and was very delighted that it made a huge jump from version 4.6 in NetBSD 6 to 4.12 in NetBSD 7. A first trial was a little bit disappointing: The performance was quite poor, the mouse pointer disappeared and appeared again continuously and there was a background with vertical black and white stripes in contrast to what was set up in the settings dialog.

Figure 1: XFCE 4.12 in NetBSD 7 RC 3 with wrong background

To demonstrate this, I made a short, two minutes video.

If I have the change to do it, I will try installating NetBSD 7 RC 3 inside VirtualBox and see if it performs better there.

Montag, 13. April 2015

"No space left on device" while executing apt-get/dpkg: it's just inodes...

Today I wanted to install some software using "apt-get install", when it suddenly reported that there was no space left on a device. df -h reported me, that my root file system was almost full, so I looked what I could do and finally moved some big files to another partition. Although my system had then plenty enough free disk space, "apt-get" kept reporting low disk space. So I asked DuckDuckGo and Google for help and got it: Apparently even a file system with enough free space can be full - if it ran out of inodes! df -i then showed me, that almost 100% of all inodes were used. So I was curious what caused those troubles. On [1] I found a quite useful command which I even "pimped" a little bit:

$ for i in /*; do echo $i has `find $i | wc -l` files; done

which outputs something like

/bin has 153 files
/boot has 262 files

and so on.
Or use

$ for i in /*; do echo `find $i | wc -l` files in $i; done

if you would like to have the numbers first:

153 files in /bin
262 files in /boot


Piping the output to "sort -n" does sorting, but you have to wait for the command to complete:

$ for i in /var/*; do echo `find $i | wc -l` files in $i; done | sort -n
1 files in /var/crash
1 files in /var/local

...
600 files in /var/log
11066 files in /var/lib


Using that command, I found out that "/usr" has many files, so I replaced "/*" by "/usr/*" and figured out that /usr/src was the really bad directory on the file system. I didn't notice yet that removing a Linux kernel doesn't remove the according headers. This must be done manually. To see all currently installed header packages, it's possible to use

$ dpkg --list | grep linux-headers

Those packages have really huge numbers of files! For Linux 3.2.0-80, there are two directories in /usr/src: "linux-headers-3.2.0-80" and "linux-headers-3.2.0-80-generic" which together have 22042 (!) files! And I had 28 of those on my system...

Conclusion: After "apt-get remove linux-headers-3.2.0-24 linux-headers-3.2.0-25-generic linux-headers-3.2.0-26-generic..." I had 167098 free inodes, which should be safe for the upcoming weeks. In future, I will monitor this value to avoid troubles.

[1] http://www.ivankuznetsov.com/2010/02/no-space-left-on-device-running-out-of-inodes.html

Freitag, 27. März 2015

Moving Active Directory integrated DNS zones from Windows 2000 Server to bind9

Since some weeks I am in the act of moving services from my virtual Windows 2000 server to my Ubuntu 12.04 machine. The first step was moving all files out of it so they are saved on my Ubuntu machine.

This post is about moving the Active Directory integrated DNS zones from Windows 2000 to bind9. First, a little bit about my current setup: 192.168.1.1, named speedy, offers DHCP and DNS services, while 192.168.1.2, named gspdc, offers Active Directory services and therefore also acts as a DNS server. Requests belonging the AD integrated domain (greatsoft.local) are forwarded from speedy to gspdc. This KB article from Microsoft shows an easy way to get all AD integrated DNS zones in files so that they could be processed by bind9. The easy trick is to simply convert those zones to "primary zone files": Afterwards, they are saved in the default DNS directory (that is normally %WINDIR%\System32\DNS). To get them to Ubuntu, I use SMB, so I first activated sharing the directory as "dns". On Ubuntu, I mounted the share:

root@speedy:/mnt # mount -t cifs //192.168.1.2/dns temp -o username=Administrator

Then I copied the files to /etc/bind9:

root@speedy:/mnt # cp -v temp/*dns /etc/bind

To make the database file names compliant with the standard of bind9, I renamed all of them and gave them a "db." prefix like all other database files have.

Until that moment, I used forwarding in bind9 to get DNS requests for *.virtual, *.greatsoft.local (AD integrated) and reverse DNS requests belonging 192.168.0.0/16 being resolved by Windows 2000.

root@speedy:/etc/bind # cat named.conf.gspdc
zone "greatsoft.local" {
    type forward;
    forwarders { 192.168.1.2; };
};

zone "virtual" {
    type forward;
    forwarders { 192.168.1.2; };
};

zone "168.192.in-addr.arpa" {
    type forward;
        forwarders { 192.168.1.2; };
};


That's not necessary any more: now the zone files are available in /etc/bind. In that directory, I edited named.conf and commented out the reference to named.conf.gspdc. The replace these zones, I created three files: named.conf.greatsoft.local, named.conf.virtual and named.conf.192.168.1.x.subnet which have contents like the following:

root@speedy:/etc/bind # cat named.conf.greatsoft.local
zone "greatsoft.local" {
        type master;
        file "/etc/bind/db.greatsoft.local.dns";
};


In contrast to the previous situation, I now have separate files for every /24 of 192.168.0.0/16, so reverse DNS queries for 192.168.1.0/24 are resolved by a different file than those for 192.168.2.0/24. I think that's easier to manage, because otherwise the zone database file could get too large.

Next task it to add those new named.conf.* files to the main configuration file, named.conf:

include "/etc/bind/named.conf.192.168.1.x.subnet";
include "/etc/bind/named.conf.greatsoft.local";
include "/etc/bind/named.conf.virtual";


Now it's time to restart bind9 by "service bind9 restart" and troubles finally begin. A simple "nslookup www.mkcs.at.virtual 192.168.1.1" just returns "** server can't find www.mkcs.at.virtual: SERVFAIL". But a "host -t TXT test.virtual" returns the text that I entered for it once (just for test purposes, as the name suggests), the same is true for my test entries for "test.test.virtual" (type A) and "eee1.test.virtual" (type AAAA). Using "grep named /var/log/syslog | tail -30" I found an interesting line:

/etc/bind/greatsoft.local.dns:33: gc._msdcs.greatsoft.local: bad owner name (check-names)

That is line 33 of file greatsoft.local.dns:

gc._msdcs               600     A       192.168.1.2

It's yet unclear to me why this causes an error. However, that entry was used by Active Directory, which I am about to deactivate, so I can relinquish entries like that. After uncommenting this line and the following lines that belong to that entry "gc._msdcs", I use

service bind9 reload

to tell bind9 it should reload its configuration and voilà, it works (tested from a client PC in my network):

michael@michimain1404:~$ host -t A www.mkcs.at.virtual
www.mkcs.at.virtual is an alias for w3mkcs.greatsoft.local.
w3mkcs.greatsoft.local has address 192.168.1.64

That's it! The final steps in deactivating that old (virtual) system will be shutting it down, (finally!) uninstalling VMware and then move it to a safe place in case I still need some data from it.

If anyone has suggestions for me how to improve that process, just let me know, I'd be curious!

Samstag, 12. April 2014

Rusch Wanduhr von IKEA mit eigenem Ziffernblatt

Vor vielen Jahren hatten wir uns mal beim IKEA die Wanduhr "Rusch" gekauft. Seit Dezember 2012 hing sie in unserem Badezimmer. Die öfters Mal feuchte Luft hat jedoch scheinbar dem Ziffernblatt nicht so gut getan. In den letzten Wochen wurde das Ziffernblatt immer mehr spröde und fing nach und nach an, sich aufzulösen.

Daher habe ich kurzerhand in LibreOffice Draw ein neues Ziffernblatt entworfen, was ganz einfach war: Der Durchmesser des Ziffernblatts beträgt 18 cm, also habe ich in Draw einen Kreis mit 18 cm Durchmesser gemacht, mit einem radialen Farbverlauf gefüllt und die Ziffern von "1" bis "12" in Schriftgröße 44 entsprechend positioniert. In die Mitte habe ich noch ein liebes Foto von Tobias und Jana gegeben. Dann noch ausgedruckt und ausgeschnitten: Fertig war das Ersatzziffernblatt. :-)

Nun war es noch notwendig, dieses in die Uhr zu bekommen: Auf der Rückseite der Uhr sind 3 Einkerbungen, die man mit einem Schlitzschraubendreher leicht öffnen kann, sodass sich die Verdeckung der Uhr ablöst. Tobias hat mir dann geholfen, das alte Ziffernblatt so gut wie möglich rauszubekommen. Es waren nur mehr hunderte Brösel. ;-) Dann habe ich vorsichtig zuerst den Sekundenzeiger, dann den Minutenzeiger und zum Schluss den Stundenzeiger abgenommen und zur Seite gelegt. Das neue Ziffernblatt habe ich mittig positioniert und dann einfach hineingedrückt. Dann habe ich die Zeiger wieder auf die entsprechende Vorrichtung gedrückt, die Abdeckung raufgedrückt, die Batterie wieder eingesetzt und die Uhr gestellt.

Und so sieht das Ganze aus:


Nun haben wir im Badezimmer wieder eine aktuelle Uhrzeit. :-)

Montag, 27. Januar 2014

New at Google Hangouts: Talk to a bot

Some weeks ago, some"one" called "Johnnie Sengvilay" contacted me at Google Hangouts:


As I am an open person and almost always like to talk to other people, I answered. That some"one" seemed to be a girl, seeking for a boy. So I thought: 1. I am rather too old for her 2. Possibly, I am rather too far away from her 3. Most important: I've got a family already. So the best thing seemed to me to tell her that somehow (not too directly, I don't want to be considered rude):


But she didn't answered my question but instead told me she felt "naughty" and wanted to have some fun. But how would she be able to have "fun" with me? After I told her that I don't need "more fun", she sent me a link to a JPG file. I didn't open it, because from that moment on, I thought that something would be wrong here. In the following days and weeks, she contacted me several times:


Yesterday I thought I would answer again and see if this was a bot:


Ah, I write "bed" and "it" writes something about "bed" back. Now, how to test for a bot simply? Just write something context sensitive, a "cheap" bot that wasn't programmed that good cannot react accordingly to that:


Ah! It writes back something that hasn't to do with what I wrote. Obviously, that bot became 2 years older in a month. ;-) Let's test again:


Okay. :-) Now there was no doubt: I was talking to a bot!


After writing some garbage, I thought it would be a good idea to tell the bot that I knew about it. Since then, there was no other message. :-) It seems that it reacts to the word "bot" or it understands "EOD".

Basically, writing such chat bots is a quite interesting and challenging discipline. They were around some years ago also on IRC and ICQ. Swedish music artist "Basshunter" even wrote a song about such a bot ("Boten Ana").

Freitag, 9. August 2013

Testing Windows 8.1 aka Windows Blue and Visual Studio 2013 Preview

Recently, I downloaded an evaluation build of Windows Blue and Visual Studio 2013 Preview in order to test both of them.

First, some words to Windows 8.1: All annoyances that affect me are still present, like what Microsoft calls "Modern UI" and switching around between that "Modern UI" and the desktop. I couldn't find a method to show the seconds in the clock (must be quite complicated to program *fg*), extra-complicated way just to view the current IP addess and many more. I am tired to count all of them - would Microsoft change anything? No, they wouldn't. At the beginning, I used Internet Explorer, but on blogger.com I got so many errors that I decided to install Firefox.

On the other side, Visual Studio 2013 Preview makes me delighted. Unfortunately, I never had the time to test VS 2012, so what I actually see are the differences between VS 2010 and VS 2013. The first thing that attracted my attention was C++/CX (component extensions) that enables you writing C++ programs targeting Windows Runtime. Unfortunately, in FILE | New | Project... there is no template for C++/CX console applications. I found a template for that, but it doesn't work in VS 2013 Preview:

Figure 1: Error message when trying to install CxxWinRTTemplate

However, it isn't that difficult to write C++/CX console applications. In the "New Project" dialog, select Visual C++ / Win32 / Win32 Console Application. Click "Next" various times, it's okay to leave the settings or change them as needed. Now we tell Visual Studio that we want to program against CX, so we open the project's properties page and navigate to "Configuration Properties", "C/C++", "General" and change "Consume Windows Runtime Extension" to "Yes". Next, we navigate to "All options" and set "Enable Minimal Rebuild" to "No". Last but not least we change "Additional using# Directories" to

C:\Program Files (x86)\Windows Kits\8.1\References\CommonConfiguration\Neutral;C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1\ExtensionSDKs\Microsoft.VCLibs\12.0\References\CommonConfiguration\neutral;%(AdditionalUsingDirectories)

This website was helpful for that. You need the using# staff in order to include Windows.winmd and Platform.winmd.

Then you can start writing your first C++/CX console program. :-) Of course, mine was to the traditional "Hello World" program:

#include "stdafx.h"
//#using <Windows.winmd> // not required in this case
#using <Platform.winmd>
using namespace Platform;

[MTAThread]
int main(Platform::Array^ args)
{
    Platform::String^ message("Hello");
    message = Platform::String::Concat(message, " World!");
    Platform::Details::Console::WriteLine(message);
    return 0;
}


Of course, C++/CX offers many more possibilities and allows a modern programming style that let the borders between C# und C++ melt. If I find something that I like very much, I'll report it.

Mittwoch, 26. Juni 2013

Urlaub in Ca' Savio (VE, Italien) (4./5./6. Tag)

Am 4. Tag unseres Urlaubs waren wir in der Früh wieder beim Meer. Zu Mittag hat Astrid Nudeln mit Thunfischsauce gemacht.

Mmmmh, lecker!

Jana hat nach dem Mittagessen ein kleines Mittagsschläfchen gemacht, während Astrid mit Tobias eine tolle Fahrt auf einem Piratenschiff (inklusive Angriff auf ein anderes Piratenschiff) gemacht hat. Dort wurde viel getanzt und gesungen.

Piratenschiff "Jolly Roger"

Tobias auf der "Jolly Roger"

Am Abend fuhren wir alle gemeinsam wieder nach Jesolo, und dieses Mal suchten wir gleich ein Fahrrad. Wir strampelten 1 Stunde lang durch Jesolo und verdienten uns unser Abendessen redlich. Tobias meinte dann: "Ich habe schon einen Eistee- und Lasagnehunger!" Sein Wunschmenü bekam er natürlich, er war ja auch sehr aktiv an diesem Tag und hat alles aufgegessen. Trotzdem war bei Tobias, Jana, Nina und Lara noch Platz für eine Kugel Eis.

Am 5. Tag war es nicht so heiß wie an den anderen Tagen und auch die Luftfeuchtigkeit war spürbar geringer, sodass wir in der Früh nicht einmal die Klimaanlage brauchten. Trotzdem war das Wetter wunderschön, wenngleich es auch recht windig war. Am Meer waren die Wellen etwas höher als in den Tagen davor und das Meer war um einiges kälter (aber mit geschätzten 20 - 22 °C immer noch recht angenehm). Die etwas besser aushaltbaren Temperaturen haben wir dann genutzt, um mit dem Schiff nach Venedig zu fahren und uns dort ein bisschen was anzuschauen. Wir waren dann auch gleich in Venedig Abendessen und auch ein Eis durfte natürlich nicht fehlen.

Der 6. Tag unseres Urlaubs in Italien war dann leider auch schon der Letzte. In der Früh mussten wir schnell frühstücken und den Schlüssel abgeben. Um kurz vor 9 Uhr sind wir dann nach Jesolo gefahren, um dort das Aquarium und Terrarium anzusehen, wo wir Fische, Krokodile, Pinguine und Schlangen gesehen haben. Gekocht hat für uns McDonald's, dann sind wir noch einkaufen gegangen (haufenweise Nudeln, Tomaten, Getränke) und um 13 Uhr 45 Richtung Heimat aufgebrochen. Dabei haben wir scheinbar unendlich lange Autoschlangen gesehen, Zigtausende wollten an Meer (hauptsächlich Italiener). Um circa 15 Uhr 45 haben wir die Staatsgrenze überquert und im selben Moment hat es zum Regnen begonnen, sodass aus unseren Plänen, beim Wörthersee eine kurze Pause einzulegen, leider nichts wurde. Wir kamen dann auf der B 317 sogar in ein richtiges Unwetter, das Autofahren war alles andere als angenehm. Bei der Grenze zwischen Kärnten und der Steiermark wurde das Wetter aber wieder besser und nach einem kurzen Halt beim Hofer in Scheifling kamen wir dann um 18 Uhr 15 endlich zu Hause an.

Dienstag, 25. Juni 2013

Urlaub in Ca' Savio (VE, Italien) (2./3. Tag)

Am 2. Tag unseres Urlaubs war ich in der Früh beim Auto etwas holen und habe überrascht festgestellt, dass es im Auto - im Gegensatz zu unserem Caravan - sehr kühl war. Am Vormittag waren wir abermals im Meer, aber auch in einem Schwimmbad am Campingplatz. Dieses ist mit einem Piratenschiff im Bad selbst ausgestattet, wo es zwei kleine Rutschen ins Becken, Wasserpumpem zum Erzeugen von Fontänen sowie einen sich regelmäßig automatisch leerenden Wasserkübel gibt. Am Abend waren wir dann noch am Spielplatz.

Unser Caravan

Am 3. Tag ist Tobias in der Früh, so wie an jedem Tag, gleich mal zu Nina und Lara gelaufen, um "Guten Morgen" zu sagen. Dann sind wir gleich runter zum Meer gegangen, um viele schöne Muscheln zu sammeln.

Jana und ich beim Muschelnsammeln

Am Nachmittag sind wir dann ins Sea Life Centre nach Jesolo gefahren, was den Kindern natürlich sehr gut gefallen hat. Danach waren wir noch einkaufen und sind dann in Jesolo zum "Beach Grill" Abendessen gegangen. Dort hat's für die Kinder gratis einen kleinen Eistee gegeben. Tobias hat natürlich - wie immer - Lasagne bestellt. Dann wollten wir noch Rad fahren gehen, aber leider war es bereits so spät, sodass alle Räder verliehen waren. Dafür durften die Kinder noch mit kleinen Autos fahren, was ihnen nicht nur Riesenspaß machte, Tobias hat sich sogar ganz gut als Autofahrer gemacht. Natürlich haben wir dann noch alle ein gutes Eis gegessen.

Montag, 24. Juni 2013

Urlaub in Ca' Savio (VE, Italien) (1. Tag)

Am Sonntag, 16.06.2013 war es soweit: Um 21 Uhr habe ich das Leihauto, mit dem wir nach Italien gefahren sind, geholt. Leider mussten wir beim Einbau unseres DVD-Players feststellen, dass die Zigarettenanzünder keinen Strom liefern. So mussten wir die geplante Abfahrtszeit (4:15) verschieben, um in Villach das Problem lösen zu lassen. Wir fuhren am Montag um 5 Uhr 5 in Leoben weg, um 7 Uhr 5 waren wir beim McDonalds in der Maria-Gailer-Straße, wo wir mal alle aufs Klo gingen und uns eine Kleinigkeit fürs Frühstück holten. Dann fuhren wir zum ÖAMTC, der gleich um die Ecke war, der uns jedoch mit Hinweis auf die Garantie des Fahrzeugs zum Škoda-Händler schickte, der glücklicherweise auch nur wenige Minuten Fahrzeit entfernt war. Dort wurde dann die Sicherung ausgetauscht und Tobias und Jana konnten die Wickie-DVD ansehen und ich mein Handy aufladen. Um 8 Uhr 10 fuhren wir wieder auf die Autobahn auf. In Italien hatte es um 8 Uhr 45 schon 28 °C. Um kurz nach 10 Uhr sind wir dann in Cessalto von der Autobahn abgefahren und schließlich um 10 Uhr 55 am Campingplatz angekommen.

Der Schlüssel zum Maxi Caravan war leider noch nicht da, weswegen wir erst mal zum Meer gingen. Den Kindern hat das natürlich gefallen. Um 12 Uhr bekamen wir dann den Schlüssel und es ging ans Auspacken der Koffer. Dann hatten wir natürlich alle schon einen großen Hunger, den wir am Campingplatz im Restaurant stillten. Wir bestellten Lasagne und Pizza, womit wir unsere Bäuche füllten. Danach gingen wir ins Meer baden. Am Abend kamen dann auch unsere Freunde mit ihren Kindern und wir gingen gemeinsam zum Abendessen. Abermals bestellte Tobias Lasagne. Als ich ihn fragte, wie die Lasagne geschmeckt hat, antwortete er: "Sehr lecker! Ein bisschen leckerer als in Leoben." Scheinbar muss ich noch an meinem Lasagnerezept arbeiten. ;-)

Donnerstag, 16. Mai 2013

Switching keyboard layout in X11

There are three keyboard layouts that are in use on my computers:
1. Most time I need the German keyboard layout, because German is my native language.
2. Once in a while I like to use the English one because some characters like '[', '{' (which are used often in programming) and so on are easier to access.
3. Sometimes I need the Russian keyboard layout because I learn Russian and need to write texts in Russian.

In XFCE, it is possible to set up keyboard layouts and switch between them by clicking the corresponding entry in the settings dialog, but if you have to switch very frequently, that is quite annoying. In Windows, there is a keyboard shortcut for switching and also in Gnome it is possible to set that up. However, in XFCE there is only a setting for switching the input method, but none for switching the keyboard layout (at least in version 4.10 that I use in Xubuntu 12.10). But finally I found a solution, that is really simple:

As root, create a file named 65Xkbmap in /etc/X11/Xsession.d with the following contents:

setxkbmap -option grp:alt_shift_toggle,grp_led:scroll at,gb,ru

This would allow switching the keyboard layouts at (German), gb (English) and ru (Russian) by pressing "alt" and "shift" (left or right one - doesn't matter). To see which keyboard layout is currently active, a plug-in can be added to the XFCE panel.

Dienstag, 7. Mai 2013

Trying Debian kFreeBSD Squeeze

Recently I tried out Debian kFreeBSD Squeeze as a VirtualBox guest. It ships with FreeBSD 8.1, which is quite old (according to Distrowatch it has been released in July 2010) but not unusual for Debian, because its stable branch uses "well tested" software. I confess that I am good in Linux but just a beginner in FreeBSD. ;-)

The installation process went quite smooth as usual for Debian. I partitioned the virtual disk in a root and a /home partition. If I recall correctly, the installation took about an hour. I also installed the XFCE desktop. Unfortunately, the screen resolution could not be set higher than 800x600. There are VirtualBox guest additions for FreeBSD, but not on the built-in virtual CD, they must be installed via ports. I did not have an idea how to install ports on Debian kFreeBSD, googling did not yield helping results and I didn't want to invest too much time in that. There is a package "virtualbox-ose-guest-source", maybe that could be used somehow.

XFCE 4.6.2 in Debian kFreeBSD running FreeBSD 8.1


IPv6 works basically, but DHCPv6 doesn't. "dhclient -6" never returns. So the interface has only one IPv6 address assigned via router advertisements.

The system takes about half a minute until I can see the login screen. Now there are 3.1 GB used on the root partition.

Other problems that occured:
  • Trying to start Synaptic fails - it asks for the password (tried both the root password and that of my "normal" user), but Synaptic never appears. However, it is possible to do a "su" on the terminal and then type "synaptic" to start it.
  • Restarting the system from GDM doesn't work (just does nothing).
  • Logging in as root doesn't work in GDM (might be disabled for security reasons - I am certain that can be changed in some configuration file).
  • I browsed the web a little bit with Epiphany, but then it suddenly stopped working. Also Iceweasel doesn't work reliably. Restarting the system did not help. After trying around a bit, I found out that all IPv6-enabled sites don't work, but those only serving via IPv4 work perfectly.
  • ZFS is not installed by default, but there is a package "zfsutils"
Conclusion: Although there were some problems (some of them are my fault, maybe), Debian kFreeBSD looks promising to me. The possibility to use APT and its related tools like Synaptic is fascinating. The system runs fast and stable.


Epiphany and Iceweasel

Sonntag, 5. Mai 2013

Some years ago I noted a few lines in my wiki to "transfer" an installation of an operating system that uses APT from one system to another ("system" doesn't denote a "machine" but simply an installation of some operating system). Yesterday, I used this to transfer the installation from Xubuntu 12.04 x86 to Xubuntu 12.04 x64. Interestingly, it happend that there were a lot of "i386" packages installed. You can see this if you grep "386" from "dpkg --list". Results could be like this:

ii  6tunnel:i386                                                0.11rc2-5                                           TCP proxy for non-IPv6 applications

To replace these packages with their (in my case) amd64 counterparts, it is first necessary to remove those i386-packages:

apt-get remove `dpkg --list | grep "386" | cut -d' ' -f3 | tr '\n' ' '`

Explanation: List all packages that contain 386 in their name and take only that name, replace all line feeds with spaces and send the results to apt-get.

Next, let's write all packages that should be reinstalled to a file:

dpkg --list | grep "386" | cut -d' ' -f3 | sed 's/:i386/ /g' | grep -v ^lib | tr '\n' ' ' > new_packages

(possibly, that could be optimized to grep all lines not beginning with lib and containing 386 in one statement rather than two statements)

We can then review the file (maybe there are packages we don't need any more). After that, we issue

apt-get install `cat new_packages`

and apt-get installs the requested packages.

Freitag, 5. April 2013

Repairing dpkg after connection dropped and preventing that in the future

Recently I was logged in to my server via SSH, as suddenly the connection (UMTS network) dropped. The last command I ran was apt-get upgrade. Unfortunately, SSH does not resume a lost connection. When I issued apt-get upgrade again, I got an error that /var/cache/debconf/config.dat would be locked by another process. To solve that, it is possible to use the fsuer command:

fuser -v /var/cache/debconf/config.dat

The locking process can be killed with "kill -9 PID".

To prevent things like that happen in the future, I then installed "screen". When I log into my SSH server, I run screen and then work. If the connection drops again, I connect to my SSH server and say "screen -r" to get back to my previous session. Very useful. :-)

Montag, 4. März 2013

Read/Write data using Redis with Node JS

Today is Redis day. ;-) Now I wrote a small JavaScript app for Node JS that can query and change a key:

var http = require('http');
var redis = require('redis'),
        client = redis.createClient();
var url = require('url');

console.log('talktoredis started!');

http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/html'});
  var testvalue = '';
  query = url.parse(req.url,true).query;
  client.get("testkey", function (err, reply) {
    testvalue = reply.toString();
    console.log('testvalue = ' + testvalue);
    res.write('Node.JS talks to Redis');
    res.write('Key "testkey" has value "' + testvalue + '".
');
    res.write('newvalue = "' + query.newvalue + '"
');
    res.write('Turn on ');
    res.write('Turn off');
    res.write('');
    res.end();
  });
  if (query.newvalue == 'on' || query.newvalue == 'off') {
    client.set("testkey", query.newvalue);
  }
}).listen(8000);


Together with my bash script written earlier this evening I can now use a web browser to change the behavior of a shell script.

A demonstration video was uploaded at YouTube.

EDIT: The source code isn't shown here correctly because it contains HTML tags. I uploaded the script here: https://www2.mkcs.at/temp/node_redis/talktoredis.js 

Get values from redis server from bash

Getting values from a redis server is also possible in (bash) shell scripts. On Github, I found a project providing two files (redis-bash-lib and redis-bash-cli) which enable such functionality. I wrote a small script that monitors a key for changes and writes a message to the screen, if the monitored key changes:

#!/bin/bash
SOMEVAR=''
OLDVAR=''
while /bin/true; do
    SOMEVAR=`redis-bash-cli -h localhost GET testkey`;
    if [ "$SOMEVAR" != "$OLDVAR" ]
    then
        echo "Value has changed from $OLDVAR to $SOMEVAR";
    fi
    OLDVAR=$SOMEVAR;
    sleep 1;
done;


Just open a terminal, start "redis-cli" und enter "set testkey perhaps", "set testkey again" or any other values and see how the script reacts to that change.

You could use redis server to exchange commands between some other software and your script. The script could evaluate the value and execute commands.

Freitag, 7. September 2012

First Look At NetBSD 6.0 RC 1

I am just fascinated! While my first look at NetBSD 6.0 Beta 2 was not so much exciting because it made me still angry that I had to use vi and edit a file in order to be able to use pkg_src (what I think almost everyone would like to do), NetBSD 6.0 RC got a real boost! In the installation process, just elect to install "pkgin" and elect to setup pkg_src. Although it was a bit frustrating that ftp.netbsd.org wasn't accessable via IPv6 and that the IPv4-server of ftp.netbsd.org always interrupts transfers (so downloading a few megabytes lasted very long), everything went smoothly. After the first boot, I commanded

pkgin install nano

and confirmed that I would like to download nano and a few seconds later, nano was installed and it worked. :-) That is how things should work! Because I don't like /bin/sh so much, I also installed bash using "pkgin". Really, I am delighted! :-) The only negative point is that "chsh" uses vi, but may be there is a way to change that. My favorite desktop XFCE is installed with the package "xfce4-desktop". Packages "xfce4-session", "xfce4-mousepad", "xfce4-settings", "xfce4-wm-themes" and "xfce4-utils" are highly recommended. After editing /etc/X11/xinit/xinitrc like describes in Chapter 9 of the NetBSD documentation it is possible to start XFCE using startx.

Donnerstag, 2. August 2012

Google Toolbar in Firefox 14.0.1

I just update Firefox from 13 to 14.0.1 and after I applied the trick described earlier this year, I was disappointed that it didn't work any more. First, I thought that Mozilla has changed its API too much so that Google Toolbar doesn't work any more. But I googled for a solution and found one in a few seconds:

http://www.philognosie.net/index.php/forum/message/2255/

And it worked! :-)