Ubuntu / Gnome and USB mass storage upper case

Sometimes it is annoying that ubuntu / Gnome opens USB mass storage devices such as sticks or cardreaders vfat partitions in uppercase by default. In order to change this adapt the mount settings in gconf path /system/storage/default_options/vfat/mount_options. gconf can be configured with the command line gconftool-2 or the graphical gconf-editor.

The gconf default setting for vfat is “shortname=mixed”. Just change it to “shortname=lower”. See also mount (8) manpage.

Regular expressions in VIM

An issue I often stumble across in VIM is the regular expression syntax (or “patterns” in VIM speak).

The main difference to other regular expression implementations is that some special meta-character have to be escaped to give them their special meaning. Its just the other way around; usually you would escape them to match the character itself.

Example: To match one ore more occurences of a digit you would normallry would write “\d+”. But in VIM you have to write “\d\+d” instead. This is also true for “\?” and “\{\}” patterns. See vim documenatation for more such patterns.

The behaviour can slightly be modified with the magic option.

pam_userdb

pam_userdb ist ein pam-Modul, welches die Authentifizierunsgdaten in einer Hash-db ablegt. Im Zusammenhang mit vsftpd wird es gerne als Account-Datenbank für virtuelle User benutzt.

Eine Konfiguration kann dann beispielsweise so aussehen:

auth required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_users
account required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_users

Die Datei vsftpd_users ist im Dateisystem dabei als vsftpd_users.db abgelegt. Die meisten Implementierungen fügen von sich aus an den Datei-Namen ein “db” an und können mit Dateinamen-Angaben inklusive “db” nicht umgehen. Ein solcher Fall kann auch vorliegen, wenn im Log die folgende Meldung zu sehen ist:pam_userdb[759]: user_lookup: could not open database `/etc/vsftpd/vsftpd_users.db'

vsftpd_users.db wird dabei mit folgendem Befehl aus vsftpd_users.txt erzeugt: db_load -T -t hash -f vsftpd_users.txt vsftpd_users.dbvsftpd_users.db besteht dabei aus Eintragen der Form

Username1
Password1
Username2
Password2

Work related to Courier-Server

I wrote this article originally back in 2005 and updated it the last time on 2007-10-14. It was originally available at http://www.georglutz.de/wiki/CourierServer.  The information you find below might be rather outdated now and I don’t plan to work on it further, but I put it in the blog for archival purposes on this particular date – Georg in June 2011.

Continue reading “Work related to Courier-Server”

apcupsd under RHEL/CentOS

The following is a quick’n dirty HOWTO for installing apcupsd under Redhat Enterprise Linux / CentOS 4 as it is not really trivial.

  • untar the tarball
  • cd to the newly created directory apcupsd-x.y.z
  • call configure to build the appropriate Makefile for the platform
  • copy the tarball to whereever your _topdir resides, e.g. /home/user/rpm/SOURCES
  • copy the file Release\_Notes also to /home/user/rpm/SOURCES and create there a zipped tarball named Release_Notes-x.y.z-r.tar.gz (versions numbers must match those defined in apcupsd.spec)
  • call rpmbuild -ba –define “build\_rhel4 1” –define “build\_usb 1” apcupsd.spec
  • install it and adjust /etc/apcupsd.conf to your needs.

Important point: You must assure that after a system shutdown when mains power comes back, your computer starts automatically. In my case this has not happend. I had to tweak manually /etc/init.d/halt to not issue a “halt -p” (-p stands for power down). Its enough to comment out the line which extends the HALTARGS variable.