Browsing Posts published by SWAT

Gisteren ging ik bij een vriendin langs, bij wie ik een tijd geleden Ubuntu geïnstalleerd had. Ze vertelde me dat haar fotoalbumsoftware niet werkte onder Ubuntu. Reden genoeg om  even langs te gaan om te kijken of ik haar uit de brand kon helpen. Zowel Kruidvat als Hema biedt fotoalbumsoftware aan, zodat men offline zijn albums kan samenstellen en deze vervolgens bij hen kan bestellen. Hema biedt software aan die enkel onder Windows werkt en Kruidvat biedt software aan die zowel werkt onder Linux, Windows als Mac. Alle Linux gebruikers kunnen het beste terecht bij het Kruidvat.

De Linux fotoalbumsoftware van het Kruidvat hoeft niet als root geïnstalleerd te worden en bevat een installatie script (Perl) wat vervolgens de juiste software-bestanden download en ‘installeert’. Het is helaas geen proper .deb of .rpm pakket en je moet een EULA accepteren, maar het draait wel native onder Linux en dus Ubuntu.

A few months ago I received my Guruplug server plus, but I only just had time to finish the configuration. Basically it is a small Linux server, equipped with an Marvell 1.2 Ghz (ARM) processor, 512MB of RAM, 512MB of NAND flash, 2 gigabit ethernet ports, wireless, bluetooth, 1x eSATA, 2x USB and 1x microSD. And yes, this is the successor of the Sheevaplug.

Currently my Guruplug is acting as the replacement for my ancient home server (Pentium 450Mhz, 512 MB RAM), which has now been taken offline. I was quite stubborn, since I wanted to do the configuration and installation “my way”. This is what I did:

  1. Build and configure the Debian root filesystem using debootstrap (note: make sure your fstab and partitions are set correctly).
  2. Copy the root filesystem to the microSD (in my case: Transcend 16GB microSD, class 6, with wear-leveling). Test if it works, by using the pre-installed kernel and your custom root filesystem.
  3. Cross-compile a minimal custom kernel (2.6.35-rc3) on another machine (in my case: a quadcore AMD machine). You do not want reboots during your kernel compilation or want to wait a long time before it is finished. Native support for the Guruplug has been added to the kernel since 2.6.35!
  4. Update uBoot, so it will correctly recognize/run the original kernel and the custom kernel.
  5. Test the custom kernel by putting it on a FAT16 partition on a USB stick (or TFTP server), before permanently writing it to the NAND flash. Unfortunately uBoot did not work with the ext filesystem (ext2load) or from the microSD.

Guruplug pros:

  • Low price
  • Low power consumption
  • Silent operation
  • Debian pre-installed
  • Dual gigabit ethernet, dual USB, WLAN, eSATA and bluetooth in one tiny box

Guruplug cons:

  • CPU heat dissipation. The plug suddenly reboots (probably thermal shutdown) when it gets too hot, which is very nasty. There are some creative solutions on the forum, which will void your warranty!
  • WLAN. The wireless chip still is not supported by the kernel, so you will need the Marvell kernel module (uap8xxx.ko) and tool (uaputl) which are shipped with the Guruplug.
  • uBoot. Default uBoot version does not support loading the kernel from ext filesystems or the microsd card (but it works from TFTP, USB and NAND flash), but it can easily be updated.

Every once in a while, you buy a piece of hardware which is officially not “supported” on Linux (according to the vendor). Since I have to do presentations regularly, I finally decided to buy a “presenter” to aid me and make my presentation look even better. After reading several reviews about the Logitech presenter R800 and seeing a couple of comments that it appeared to work on the Mac OS, my mind was made up. I picked it up today, immediately hooked it up to my Ubuntu Karmic (9.10, 2.6.31 kernel) desktop and  it was recognized as:

046d:c52d Logitech, Inc.

I tested a couple of presentations with evince (pdf) and openoffice.org impress (odp) and the buttons work perfectly! The available buttons are: next, previous, start/end presentation and blank presentation screen. Furthermore there is an on/off button, a laserpointer button (a frickin’ laser!) and two buttons to set the timer for the vibrating alarm. I still have to test it in the field, but I already know that this was the an extremely good buy.

My Monday morning started with debugging a SuSE Linux Enterprise Server 10 SP3 (x86_64) server with Open Enterprise Server 2 and with several IP aliases (virtual IP’s). The  NetStorage login was very slow, about 60 seconds! I started increasing the loglevel of apache and took a peak /var/log/apache/error_log and found:

[Mon Apr 26 10:46:04 2010] [debug] ssl_engine_io.c(1786): OpenSSL: I/O error, 5 bytes expected to read on BIO#555555889900 [mem: 5555558ac350]
[Mon Apr 26 10:46:04 2010] [info] [client 192.168.1.3] (70014)End of file found: SSL input filter read failed.

There was no service interruption, the websites were being served and the messages were only on the debug/info level. So this could not be an OpenSSL issue. All services had an IP based configuration, so the problem could not be DNS lookups. Then I remembered and checked that OpenSLP was also active and being used, so it was time to inspect /etc/slp.conf and I saw that net.slp.interfaces was not explicitly set. So I set net.slp.interfaces in /etc/slp.conf to the primary (real) IP address:

net.slp.interfaces = 192.168.1.5

That did the trick. Logging in now takes about 8 seconds, which is normal for NetStorage, since the login script needs to completely run prior to finishing the login sequence.

This week I am teaching the LPI 101 course again and we covered the shadow file today (amongst other topics). I gave the students the exercise to manually edit the shadowfile and let an account expire on 01-01-2011. The manpage of shadow(5) stipulates that the account expiration date has to be “expressed as the number of days since Jan 1, 1970″. One of my students asked me how to calcuate this. I did not immediately know the answer and I did not want to use rely on any online date/time converter, so I went looking for a satisfactory solution.

1. Find the UNIX time / Epoch of the date in question

date -d ‘2011-01-01′ +%s

Remember that these are seconds since 01-01-1970.

2. Calculate the number of days since 01-01-1970.

echo `date -d ‘2011-01-01′ +%s` / 86400 | bc

A day is 60 * 60 * 24 = 86400 seconds. Notice how ‘bc’ will always be rounding down the number of days.

3. Perform a ‘normal’  round up or down for the number of days

UNIXTIME=`date -d ‘2011-01-01′ +%s` ; printf “%.0f\n” `echo “scale=1; $UNIXTIME / 86400″ | bc`

Talked with Vincent today and he told me that his webserver got traffic from a weird .ee website and that is was requesting a certain image very often. Apparently the website contains a reference (in their CSS) to a picture on his website. This is absurd and dispicable, so his decided to replace the requested image with a totally Not Suitable For Work image. Just in case the site admin ‘fixes’ his error, I took the liberty of making a screenshot. Enjoy!

If you use the Zarafa webaccess (6.40, but apparently also 6.30) on Ubuntu 9.10, apache2 will nicely segfault and you will not be able to access your webmail. Upside: the mobile server will keep functioning. Even Fedora has this problem and it was tracked down to an error in PHP. I do not want to compile my own software to work around this issue, since I am lazy and I use a package manager for a reason! I quickly found the least nasty workaround for this issue in this post on the Zarafa forums.I replace /usr/lib/apache2/modules/libphp5.so (from karmic’s 5.2.10) with the libphp5.so from the 5.2.6 libapache2-mod-php5 package. At least the file will still be managed by dpkg and thus updated/upgraded if neccessary. As Ubuntu 10.04 is just around the corner, I will suggest the owner to does not update libapache2-mod-php5 until he upgrades to 10.04.

Just when you think you have seen it all,  you experience something new. This happened when SSH’ing to a server which authenticates against an LDAP server:

The source of the problem was a configuration error in libnss-ldap.conf