Archive for May, 2012

Xorg: Different options for different keyboards

So I have this esoteric problem that I have 2 totally different keyboards. The Happy Hacking Pro 2 (HHK) and the Realforce 103U. The happy hacking has a special, SUN inspired layout with the control key where standard keyboards usually have their caps. My Realforce 103U has a standard US layout. I am big fan of the old SUN layout and cannot type on keyboards that have the CTRL key on the usual position.

The problem: If I plug in my Realforce, I want to have the CAPS remapped to CTRL. If I plug in my Happy Hacking, it should stay the way it is!
Solution: Xorg Udev Matching

So in recent Xorg versions you can use udev matchings to select the options for a particular keyboard. On my Fedora 16, I added the following file:

$ vim /etc/xorg.conf.d/01-realforce.conf
Section "InputClass"                                                                                             
  Identifier	"Realforce"                                          
  MatchProduct 	"Realforce 103U"
  Option	"XkbLayout"	"us,de"                                              
  Option	"XkbOptions"	"grp:menu_toggle,ctrl:swapcaps"

Done. If I plug in my Realforce I have the ctrl and caps key swapped!

Bonus: As the win key on my HHK is right of the alt key I better switch ALT and WIN on my Realforce, too:

Option "XkbOptions" "grp:menu_toggle,ctrl:swapcaps,altwin:swap_lalt_lwin"

Canonical Way to Build PHP 5.4 on Solaris 11

You need gnu-coreutils installed.
$ wget -O php.tar.bz2
$ tar xvjf php.tar.bz2
$ cd php-5.4.3
$ ./configure \
--with-apxs2=/usr/apache2/2.2/bin/apxs \
--prefix=/usr/php/5.4 \
[other options]
$ gsed -ibak 's,\-mt,,' Makefile
$ gsed -i.bak 's,\-i \-a \-n php5 libphp5\.la,-i -n php5,' Makefile
$ make -j4
$ sudo make install
$ vim /etc/apache2/2.2/conf.d/php5.2.conf
..change stuff to
$ svcadm restart apache22

Worked for me so far.