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.

gallery2 and password plugin

With recent version of gallery2 (at least with 2.3) password protected albums do not work anymore. This means that after entering the correct password the user sees a blank page instead of being logged in and forwarded to the gallery.

I found a post in gallery’s forum describing this issue. There seems to be a problem with SSL/Cookie-Handling. The captcha plugin is also concerned.

However the quick fix presented by valiant works for me:

but there's a easy fix:
just add GalleryCoreApi::requireOnce('modules/core/classes/GalleryTranslator.class'); right before line 780 in modules/core/classes/GallerySession.class.

Unfourtunately up to now (2009-05-10) the fix is not yet included in trunk.

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

Suchen offener Perforce-Dateien unter Windows

Alle Dateien, die unter Perforce auf die Platte gesynced werden und nicht lokal geändert wurden, haben ein Read-Only-Flag. Ausnahme: Gebranchte Dateien in einer CL, die lokal nicht geändert wurden.

Um auch ohne Perforce-Anbindung rauszufinden, welche Dateien gerade lokal geändert wurden, kann man also nach Dateien suchen, die kein Read-Only-Flag mehr haben. Unter Windows geht das so:

dir /b /d /s /a-r-d Client-Root-Verzeichnis

Wie gesagt, wenn man Dateien in einer Branch-CL offen hat, erscheinen die hier nicht!