Wed, 08 Mar 2006

Swiss keyboards and Debian


My laptop has a Swiss German keyboard, and it runs Debian. It also has a Caps Lock key right next to the A key where the Control key should really be. So I have the following in my .xsession file to set the correct keyboard layout and to turn the Caps Lock key into a Control key:

xkbsel 'xfree86(de_CH)'
setxkbmap -option ctrl:nocaps

This was working fine until a little while ago when my backspace key turned into a delete key. This was particularly annoying because I have configured my delete key to send ^Ap which is the screen code to move to the previous window. I also lost the ability to type []{}#~ and \ which makes programming in Perl difficult, @ which makes it hard to send mail, and | which makes all sorts of command line operations difficult.

It turns out that somehow xkbsel had been removed. Well, I know how. I did an aptitude dist-upgrade and didn't pay sufficient attention to everything it told me before I hit Y. Or more accurately, Y, then Yes, then Y and then Yes again, as seems to be necessary these days.

So reinstalling that package put my keyboard back into a usable state. But running setxkbmap then gives me a German layout instead of Swiss German:

$ setxkbmap -v 10 -option ctrl:nocaps
Setting verbose level to 10
locale is C
Applied rules from xfree86:
model:      pc105
layout:     de
options:    ctrl:nocaps
Trying to build keymap using the following components:
keycodes:   xfree86+aliases(qwertz)
types:      complete
compat:     complete
symbols:    pc/pc(pc105)+pc/de+ctrl(nocaps)
geometry:   pc(pc105)

and explicitly specifying a Swiss German layout results in the following error:

$ setxkbmap -v 10 de ch ctrl:nocaps
Setting verbose level to 10
locale is C
Warning! Multiple definitions of keyboard layout
         Using command line, ignoring X server
Applied rules from xfree86:
model:      pc105
layout:     de
variant:    ch
options:    ctrl:nocaps
Trying to build keymap using the following components:
keycodes:   xfree86+aliases(qwertz)
types:      complete
compat:     complete
symbols:    pc/pc(pc105)+pc/de(ch)+ctrl(nocaps)
geometry:   pc(pc105)
Error loading new keyboard description

I really don't feel up to fixing this at the moment, so I've gone back to having an annoyingly placed Caps Lock key which I keep pressing at inopportune moments.

[/unix] permanent link

Sun, 05 Mar 2006

Configuring Gallery


I use Gallery to display my photos. I am still running version 1. I generally work by using an old version of galleryadd.pl to upload image directories to gallery into a top level Pending folder that no one else can see. There I work on the albums before moving them to other places where they are more generally available.

A little while ago the "Move Album" page stopped working. The dropdown selection was not fully populated with all the albums, and the "Move Album" and "Cancel" buttons were missing.

I eventually got around to investigating what was happening. It turns out PHP was running out of memory. There were messages such as

Allowed memory size of 8388608 bytes exhausted (tried to allocate 177 bytes)

in the apache error.log file.

I fixed the problem by adding the following line to the .htaccess file for Gallery, which on Debian is found at /etc/gallery/htaccess

php_value memory_limit 4500000000

which bumps the memory up from about 8MB to about 4.5GB. Overkill? Maybe. But I have enough swap space, and that should hopefully allow me to create zip files for the albums (which gallery does for you) and they'll be of a suitable size to burn to dvd.

The other thing I always do after Debian upgrades Gallery for me is edit config.php (found at /usr/share/gallery/config.php in Debian) and change PhotoAlbumURL and AlbumDirURL to be relative URLs. Otherwise, for some reason I don't fully understand, Gallery runs extremely slowly for me this side of my firewall.

(Note that I have had to write PhotoAlbumURL and AlbumDirURL even though the actual variable names start with a lower case letter in each case. This seems to be some problem related to kwiki. Simply adding an exclamation mark in front of each variable does not help, even though it is needed for the way I have written the variable names. Does anyone know the solution to this problem? Note that the answer is probably not "don't use kwiki" unless it is accompanied by information on what to use instead.)

Why the Gallery developers don't get rid of the check that those URLs cannot be relative is beyond me. I presume they are saving users from themselves, but I dislike software that thinks it knows better than me.

[/software/gallery] permanent link




September 2017
Sun Mon Tue Wed Thu Fri Sat