Thursday, March 31, 2011

Eclipse plug-in in Groovy

Because I couldn't find it anywhere else, here the steps to create a Groovy Eclipse plug-in:
1) Create Java Eclipse Plugin project
2) Convert to Groovy project
3) add org.codehaus.groovy to Require-Bundle or add
Import-Package: groovy.lang,

This is all. At least for an extremely simple example this works great. I haven't tested anything complicated yet.

Tuesday, January 5, 2010

Revert serveral git commits

A small git trick I just learned:

To undo a single bad commit "git revert" is great.
But it is tedious to do this for many.
For that the best is:
git diff HEAD {last-good-id} | git apply

Before doing this check the logs of all commits which will be undone, with:
git log {last-good-id}..

Hope this helps someone else.

Thursday, November 12, 2009

Dell Studio 1557 (Mobile Core i7) with (k)ubuntu

I currently don't have time to write a long post. But I got my new Dell Studio laptop 1557 with Core i7 and so far I'm happy. Besides some problem with suspend, everything works with linux and the performance is great. E.g. compiling is >2x faster than on my 2 year old Core2 Duo.

To get the hardware working on Linux:

install: bcmwl-kernel-source, bcmwl-modaliases
bcmwl needed to make wireless work. After install either reboot or remove sbb, b43 b44 and then load wl.

install: fglrx-amdcccle, fglrx-kernel-source, fglrx-modaliases, xorg-driver-fglrx
With the open-source graphic card driver the 3D Desktop does not work and more important the fan runs on full speed because the powermanagement of the graphic card does not work correctly. Restart X-Server.

options snd-hda-intel model=dell-m6
to /etc/modprobe.d/alsa-base.conf. Reboot or reload module.

Other hardware (e.g. camera) works out of the box.

Resume from Suspend does not always work (in ~4/5 cases it works). This is really annoying. Please write in the comment if you know how to fix that.
Keyboard: the sound volume special keys don't work.(

The suspend problem is still not fixed. This is very annoying. More details at:
As I wrote their: I suggest to write to Dell. Hopefully there are enough people writing so that Dell lets ATI know they should fix it.

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/ 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"
powersave -u