Monday, September 29, 2008

OpenSuse 11

So far the new version seems to work very well.

I updated to KDE 4.1.

The trick with Alt-Gr No-Dead Key is now built in. No need for own keyboard table anymore.

Setting brightness was a big pain. The add to modprobe.conf.local:
options thinkpad-acpi brightness_enable=1
blacklist video

and in /usr/share/hal/fdi/information/10freedesktop/10-laptop-panel-hardware.fdi
setting laptop_panel.brightness_in_hardware to false

Saturday, September 13, 2008

SSH ProxyCommand without netcat

The ProxyCommand is very useful when hosts are only indirectly accessible. With netcat it is relative strait forward:
ProxyCommand ssh {gw} netcat -w 1 {host} 22

Here {gw }and {host} are placeholders for the gateway and the host.

But it is also possible when netcat is not installed on the gateway:
ProxyCommand ssh {gw} 'exec 3<>/dev/tcp/{host}/22; cat <&3 & cat >&3;kill $!'

The /dev/tcp is a built-in feature of standard bash. The files don't exist. To check whether bash has this feature built-in use run cat < /dev/tcp/google.com/80 on the gateway. To make sure that bash is used, use:
ProxyCommand ssh {gw} "/bin/bash -c 'exec 3<>/dev/tcp/{host}/22; cat <&3 & cat >&3;kill $!'"

And it even works together with ControlMaster.

(Updated on Oct 22 to include kill to clean up background cat)
(Updated on Mar 3 2011 to make placeholders more clear and explain /dev/tcp)

Sunday, May 4, 2008

Linux: Connecting projector without X restart

Because projector usually have a different resolution then high resolution laptop LCDs one has to change the resultion of the X Server after connecting the projector. This used to require an X server restart. With RandR 1.2 this is possible without. It does not work with Xgl though. Thus to use compiz with it one has to use Aiglx (which in turn requires to change the video plug-ins). One can set the resolution either with xrandr or more comfortable with krandrtray under KDE.

Thinkpad T61 Hotkeys for OpenSuse 10.3

To get the hotkeys working for the T61 under OpenSuse 10.3 I added to /usr/lib/hotkey-setup/thinkpad_hotkey_handler for switching on off the toupad:
4104) HOTKEY="Fn+F8"
/usr/bin/synclient TouchpadOff=$[! `/usr/bin/synclient -l|grep TouchpadOff|/usr/bin/awk '{print $3}'`]
ACTION="toggle touchpad"
;;

for changing the screen brighness:
4112) HOTKEY="Fn+Home"
ACTION="brighter display"
echo up > /proc/acpi/ibm/brightness
;;
4113) HOTKEY="Fn+End"
ACTION="darker display"
echo down > /proc/acpi/ibm/brightness
;;

and to suspend when closing the lid:
20481) HOTKEY="close lid"
ACTION="suspend"
powersave -u
;;

International character without dead keys

For typing international characters the US-International keyboard layout is very convenient. The disadvantage is that the so called dead keys are very inconvenient for programming where a lot of keys ', `, " are used. Thus I created a variant which uses the second Alt as the US international but does not use the dead keys. This way I do not have to switch between standard US for programming and US international for internal text.

For any Unix with X you create this variant by adding to /usr/share/X11/xkb/symbols the following:

> partial alphanumeric_keys
> xkb_symbols "intl-nodeadkeys" {
>
> name[Group1]= "U.S. English - International (without dead keys)";
>
> include "us(basic)"
>
> // Alphanumeric section
> key { [ grave, asciitilde,dead_grave, dead_tilde ] };
> key { [ 1, exclam, exclamdown, onesuperior ] };
> key { [ 2, at, twosuperior, dead_doubleacute ] };
> key { [ 3, numbersign, threesuperior, dead_macron ] };
> key { [ 4, dollar, currency, sterling ] };
> key { [ 5, percent, EuroSign ] };
> key { [ 6, asciicircum, onequarter, dead_circumflex ] };
> key { [ 7, ampersand, onehalf, dead_horn ] };
> key { [ 8, asterisk, threequarters, dead_ogonek ] };
> key { [ 9, parenleft, leftsinglequotemark, dead_breve ] };
> key { [ 0, parenright, rightsinglequotemark, dead_abovering ] };
> key { [ minus, underscore, yen, dead_belowdot ] };
> key { [ equal, plus, multiply, division ] };
>
> key { [ q, Q, adiaeresis, Adiaeresis ] };
> key { [ w, W, aring, Aring ] };
> key { [ e, E, eacute, Eacute ] };
> key { [ r, R, registered, registered ] };
> key { [ t, T, thorn, THORN ] };
> key { [ y, Y, udiaeresis, Udiaeresis ] };
> key { [ u, U, uacute, Uacute ] };
> key { [ i, I, iacute, Iacute ] };
> key { [ o, O, oacute, Oacute ] };
> key { [ p, P, odiaeresis, Odiaeresis ] };
> key { [ bracketleft, braceleft, guillemotleft, guillemotleft ] };
> key { [bracketright, braceright, guillemotright,guillemotright ] };
>
> key { [ a, A, aacute, Aacute ] };
> key { [ s, S, ssharp, section ] };
> key { [ d, D, eth, ETH ] };
> key { [ k, K, oe, OE ] };
>
> key { [ l, L, oslash, Ooblique ] };
> key { [ semicolon, colon, paragraph, degree ] };
> key { [ apostrophe, quotedbl, dead_acute, dead_diaeresis ] };
>
> key { [ z, Z, ae, AE ] };
> key { [ c, C, copyright, cent ] };
> key { [ n, N, ntilde, Ntilde ] };
> key { [ m, M, mu, mu ] };
> key { [ comma, less, ccedilla, Ccedilla ] };
> key { [ period, greater, dead_abovedot, dead_caron ] };
> key { [ slash, question, questiondown, dead_hook ] };
> key { [ backslash, bar, notsign, brokenbar ] };
>
> include "level3(ralt_switch)"
> };

Friday, May 2, 2008

Myrinet and Tau

To use Tau with Myrinet Mpich one needs to give:
-mpilibrary="-lmyriexpress -Lpath"

In my case for helics the full configure is:

./configure -pdt=/home/thor2/rschulz/software/pdt -prefix=/home/thor2/rschulz/software/tau -c++=g++ -cc=gcc -fortran=gfortran -mpi -mpiinc=/opt/mpich-mx/1.2.7..5/gcc-4.1.2/include/ -mpilib=/opt/mpich-mx/1.2.7..5/gcc-4.1.2/lib/ -PROFILE -mpilibrary="-lmyriexpress -L/opt/mx/1.2.4/kernel-2.6.22.9/lib64"