Browsing Posts published in April, 2010

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`