2010-08-26 (#) 1 week ago
I like nice images, usually photographs I made myself or interesting images from the Transmission Gallery which has a great set of transmission wallpapers.I collect a few in a directory, and there is an easy way to show these on an X background when you use xscreensaver anyway:
$ xscreensaver-getimage -directory background -rootThis will select a random image from directory 'background' and display it on the root window.
2010-05-12 (#) 3 months ago
After a discussion in which I got to quote the Reply-To munging considered harmful I upgraded Ubuntu on my laptop and noticed Thunderbird 3.0.4 recognizes mailing list headers and gives 'Reply', 'Reply all' and 'Reply list' headers depending on what would be correct. Finally!
2010-05-04 (#) 4 months ago
Ok, this one was new to me:-bash: ./storscript: /bin/bash: bad interpreter: Text file busyHow? the script was copied using scp and there was a hanging sshd (something about a not 100% reliable network).
2010-03-30 (#) 5 months ago
Mirjam recently bought a new laptop and installed Linux on it (sofar nothing special) but we thought it would be nice if mail from the laptop would work from anywhere in the world. Using the information from Relaying with TLS in Sendmail, ubuntu sendmail and a bit of my own thinking this was not very hard. By default ubuntu hides the entire sendmail certificate creation and signing process, and I needed 'better' certificates signed by my own certificate authority. For the client side:root@machiavelli:/etc/mail/tls# openssl req -new -key sendmail-common.key -out sendmail-client.csr You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [NL]: State or Province Name (full name) [Utrecht]: Locality Name (eg, city) [Utrecht]: Organization Name (eg, company) [idefix.net]: Organizational Unit Name (eg, section) []: Common Name (eg, YOUR name) []:machiavelli.idefix.net Email Address []:koos@machiavelli.idefix.net Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []:Next I signed this csr using the idefix.net CA, and put the resulting client certificate back in /etc/mail/tls/sendmail-client.crt. On the client, /etc/mail/submit.mc had to be changed to use tls and talk directly to the right machine:FEATURE(`msp', `postbode.idefix.net', `MSA') include(`/etc/mail/tls/starttls.m4')dnlNow for the server side I also generated a csr for the name postbode.idefix.net and signed it. I changed /etc/mail/sendmail.mc to do this correctly:include(`/etc/mail/tls/starttls.m4')dnl dnl # dnl # fix debian weird choice define(`confTLS_SRV_OPTIONS', `')dnlAnd updated the /etc/mail/access map to relay based on the data from the idefix.net certificate:# SSL magic CERTIssuer:/C=NL/ST=Utrecht/L=Utrecht/O=idefix.net/OU=Certificate+20Authority/CN=idefix.net+20CA/emailAddress=hostmaster@idefix.net RELAYTesting it was harder from home which is normally a trusted network.. it just lost that role for a few minutes. And I noticed that when I use mail -v it will ask the upstream mailhost to also be verbose. As noted in the linked article logging is sparse. One hint in the headers of the relayed mail is:Received: from machiavelli.idefix.net (wireless-machiavelli.idefix.net [IPv6:2001:888:1011:1:21f:e1ff:fe45:2894]) by kzdoos.xs4all.nl (8.14.2/8.14.2/Debian-2build1) with ESMTP id o2UKFH9 X002890 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for XXXXXXXXXXXXXXX; Tue, 30 Mar 2010 22:15:18 +0200
2010-03-19 (#) 5 months ago
I walked in this morning at work with some people looking at me expectingly. About the third person was nice enough to explain: home directories and mail were unavailable. A quick look showed me that the home directory server was waiting for the ldap server and the ldap server showed a kernel panic on the console. Strangely enough the root ldap object was still available so the monitoring system did not notice it.
Anyway, server systems should not wait for the systems administrator after a panic in my opinion, they should be available. So I looked it up, and indeed: Linux Kernel panic reboot explains how simple it is to change this setting. So I changed all servers at work to give up after a panic and reboot. That should help availability. I'm not interested in the intimate details of a panic, I want working ldap. Yes, as several people noted to me, there are ways in which this can lead to a reboot-loop, for example when the panic is file-system related. I'll take that risk when it will 'fix' all other problems.unix - linux - storage unixfoo is good at linux and netapp knowledge. I browsed it for a while and found lots of interesting stuff.
2010-03-18 (#) 5 months ago
Handy unix utility which I had a hard time remembering today: watch. For some reason this is part of procps /proc file system utilities. I used watch to keep an eye on the number of USB storage devices seen by a computer because I was busy hooking up 28 of them at a time to 4 USB hubs and sometimes things were flaky, resulting in the famous usb 7-3.3: device not accepting address 83, error -32. The solution was to unplug and replug the USB device. Trying another hub helped too.$ watch 'lsusb -t 2>&1| grep -c 0x090c'This showed the number of USB storage devices (of the type I used) detected so I could plug them in and see whether detection went right.
2010-03-04 (#) 6 months ago
After a bit of searching I managed to get my Dell Latitude D630 laptop to use the audio buttons in fvwm.
2010-02-09 (#) 6 months ago
I did some serious web services programming (in perl) and updated the scripts powering the Friday Afternoon URL page to post new urls via Twitter on Friday. You can follow @fridayaftURL to get a weekly dose of Friday afternoon stuff from all over the web. The urls are now stored in a (postgresql) database and on Friday a script runs which searches for new urls and posts them to Twitter using the Twitter api. When urls need to be shortened it uses the ln -s_ web service to shorten them.
2010-01-06 (#) 7 months ago
I tried to use the --filter option in rsync but I was a bit baffled by the syntax and the manpage is nice but I couldn't understand. I wanted certain directories completely, other directories default excluded and certain files in one directory but not all. After some trail and error and talking to the teddybear:rsync -rvv --progress /home/koos/rsyncsource/ /home/koos/rsyncdest --filter='merge /home/koos/rsyncfilter'And in the filter file name things to include and exclude:+ /wel/ - /niet/ + /random/file - /random/*And the result is what I want:$ ~/bin/testrsync building file list ... [sender] showing directory wel because of pattern /wel/ [sender] hiding directory niet because of pattern /niet/ [sender] hiding file random/niet because of pattern /random/* [sender] showing file random/file because of pattern /random/file 7 files to consider delta-transmission disabled for local transfer or --whole-file random/ random/file 0 100% 0.00kB/s 0:00:00 (xfer#1, to-check=4/7) wel/ wel/file1 0 100% 0.00kB/s 0:00:00 (xfer#2, to-check=2/7) wel/file2 0 100% 0.00kB/s 0:00:00 (xfer#3, to-check=1/7) wel/file4 0 100% 0.00kB/s 0:00:00 (xfer#4, to-check=0/7) total: matches=0 hash_hits=0 false_alarms=0 data=0 sent 319 bytes received 126 bytes 890.00 bytes/sec total size is 0 speedup is 0.00Now to do this on a filesystem with 151000 files.
2009-12-11 (#) 8 months ago
It's that xsnow time of year. I wanted to compile it for our students and staff to use and found a major Makefile and a real Imakefile (remember those?):$ wc Makefile Imakefile 957 2413 26799 Makefile 7 21 172 ImakefileTrying to find the 'real' problem I managed to reduce all that to:xsnow: xsnow.o toon_root.o gcc -o xsnow xsnow.o toon_root.o -lm -lXpm -L/usr/X11R6/libimake gave us somewhat overkill Makefiles...
2009-11-10 (#) 9 months ago
Going old-school today: I wrote a sed script to massage grub.conf to add a windows partition on a second disk. Searching google for has this been done before yields loads of page with handholding on how to add windows by hand to a grub.conf generated by anaconda but no simple 'automated' solution. I am always in favor of letting the computer do the boring work. But a bit of thinking and testing and now sed does the job:if [ -b /dev/sdb1 ]; then cp /boot/grub/grub.conf /boot/grub/grub.conf.pre sed -e 's/timeout=5/timeout=30/' -e '/hiddenmenu/a\ title Windows XP (Service Pack 3)\ rootnoverify (hd1,0)\ map (hd0) (hd1)\ map (hd1) (hd0)\ makeactive\ chainloader (hd1,0)+1 ' -e '/hiddenmenu/d' < /boot/grub/grub.conf.pre > /boot/grub/grub.conf fiEverybody knows sed -e 's/../../' but I had to look up 'insert', 'append' and 'delete'.
Update 2009-11-12: Changed insert to append because the previous version inserted windows multiple times with multiple linux kernels. Once is enough. Also moved it from the post-install instructions to the post-reboot script so linux is fully configured before windows gets booted.
2009-09-28 (#) 11 months ago
Actual progress in windows printing: windows 2008 with office 2003 will give a warning message about trying to print an A4 document on a printer with Letter as default format. Fixed it by selecting the right papersize for the printer, no letter paper in this building. No PC LOAD LETTER on the printer display!
2009-09-18 (#) 11 months ago
The tapedrive-with-changer on the homeserver found itself in a wedged state with at the bottom of the dmesg output:[105715.017656] ch 0:0:1:1: Attempting to queue a TARGET RESET message [105715.017658] CDB: 0x1b 0x20 0x0 0x0 0x2 0x0 [105715.017663] ch 0:0:1:1: Command not found [105715.017664] aic7xxx_dev_reset returns 0x2002 [105718.936191] target0:0:1: FAST-10 SCSI 10.0 MB/s ST (100 ns, offset 15)And still no access to the scsi tape drive. But, there is a bigger hammer nowadays named sg_reset which can fix this:# mt -f /dev/nst0 status /dev/nst0: Input/output error # sg_reset -b /dev/sg0 sg_reset: starting bus reset sg_reset: completed bus reset # mt -f /dev/nst0 status SCSI 2 tape drive: File number=0, block number=0, partition=0. Tape block size 0 bytes. Density code 0x25 (DDS-3). Soft error count since last status=0 General status bits on (41010000): BOT ONLINE IM_REP_ENand it's back, not needing a reboot. The list of options says it all:Usage: sg_reset [-b] [-d] [-h] [-V] DEVICE where: -b attempt a SCSI bus reset -d attempt a SCSI device reset -h attempt a host adapter reset -V print version string then exit {if no switch given then check if reset underway} To reset use '-d' first, if that is unsuccessful, then use '-b', then '-h'
2009-08-24 (#) 1 year ago
More than one visitor of my homepage saw an intricate XML parsing error and not the page you all want to see. I never saw the problem myself but my best guess sofar is that the twitter rss feed was malformed, because that is the only XML parsing happening for the page. I fetch the twitter feed automatically every 6 hours, but sometimes twitter is a bit overloaded and probably gives an internal error page (the famous fail whale) and not the valid rss feed.Solution: Fetch the file to a temporary file, run the parser on it and when the parser does not fail, copy it to where the webserver reads it:
#!/bin/sh wget -O wwwdata/twitter.rss.pre -o /dev/null http://twitter.com/statuses/user_timeline/19301166.rss perl -MXML::RSS -e 'my $rss=new XML::RSS; $rss->parsefile("wwwdata/twitter.rss.pre");' if [ "$?" = "0" ]; then cp wwwdata/twitter.rss.pre wwwdata/twitter.rss fi
2009-07-02 (#) 1 year ago
So, who is this nobody user anyway? Porting account-management scripts from Centos linux to ubuntu made strange problems show. A short check found interesting differences. After asking around on irc and trying some things I found quite a choice:
Centos linux:nobody:x:99:99:Nobody:/:/sbin/nologin nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologinUbuntu linux:nobody:x:65534:65534:nobody:/nonexistent:/bin/shFreeBSD 6.1:nobody:*:65534:65534:Unprivileged user:/nonexistent:/usr/sbin/nologinSolaris:nobody:x:60001:60001:Nobody:/:Interesting is that creating a file as root on a solaris nfs client will create it as 65534:0. Data Ontap:pw_name = nobody pw_passwd = pw_uid = 65535, pw_gid = 65535
2009-06-03 (#) 1 year ago
Computers are better at... doing what you program to, not what you want. There is still an older computer running which once hosted my mailman mailinglists for several domains. I shut down mailman on that machine and migrated the lists. But mailman was never removed from the startup files and the machine rebooted today, resulting in three years of mailman monthly reminders mailed at once. So if you were looking why you got old mailman reminders from virtualbookcase, this is why.
2009-03-31 (#) 1 year ago
From time to time it annoyed me that the double-click selection in XTerm/UXTerm on the Ubuntu desktop differed from what I was used to before: 1 click is a letter, 2 clicks is a word, 3 clicks is a line. The definition of 'word' seemed to differ a lot with mine, I want to be able to select parts separated by @ and : characters. Inspired by xterm Regex Matching for Cut Selection by Sean ReifschneiderI tried with 'regex' but that did not work as I wanted, because extending a selection fails unexpectedly in that mode. Solution: updating the definition of a 'word' by modifying the XTerm*charClass. My current settings:XTerm*on4Clicks: line XTerm*on3Clicks: regex [^ \n]+ XTerm*on2Clicks: word XTerm*charClass:That's a tab in the regex: now I can use triple-click to select a url, e-mail address or something likewise all at once, and double-click selects a word in the way I like it. Duplicated for class UXTerm.
2008-12-01 (#) 1 year ago
Stuff computers are better at: shutting down at the wanted time. Just a simple:root@hostname:~# at 23:01 warning: commands will be executed using /bin/sh at> shutdown -h now at> <EOT> job 3 at Mon Dec 1 23:01:00 2008 root@hostname:~#The <EOT> was were I pressed ctrl-d. You might say "why not shutdown -h 23:01 ?". Well, your users will be bothered by the announcements between now and the shutdown time.
2001-08-01 (#) 9 years ago
If you like mutt you might want to have a look at my .muttrc to see how I configured it.