256 color terminals
While the rest of the techworld is getting excited about their aero, quartz or compiz 32bit color 3D desktop, I reached a less impressive milestone today:
From now on I use a 256 color terminal ;-). Actually I looked into this earlier, but since gnome-terminal and screen didn't support it back then (maybe upstream, but not in my distro), I enabled support just today.
Excellent documentation on this topic is already available on multiple places, but to summarize for myself:
.screenrc attrcolor b ".I" termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' defbce "on" startup_message off .bash_profile set TERM xterm-256color; export TERM .vimrc set t_Co=256 colorscheme=asudark
For vim you need a special colorscheme (gvim colorschemes do not work). My vim hacked 256 colors scheme, which work better with a transparent background then the original, is available here.
[Permalink] -- Filed under: [linux]
Ubuntu Hardy Heron
Today I installed Ubuntu Hardy Heron on a desktop computer. I am pretty distro/desktop agnostic (see my ten year anniversary post), but since Debian Etch is a bit old for a desktop and Hardy Heron has Long Term Support (I do not want to update/fix a computer every half year!!) Ubuntu was my choice.
There are unlimited gnome improvements which I don't care about, but some things stand out for me in this release.
- Firefox 3 is much better than 2. The memory improvements and the renewed linux (gtk) focus helps. And luckily you can disable the stupid new urlbar in about:config with browser.urlbar.maxRichResults = 0 .
- The way non-free installation for media-playback, video drivers and browser plugins is handled, is sweet! The installation of this software is painless here. I even got a nice 64-bit(!) Java firefox plugin, which I was unable to install in Debian (thanks redhat/icedtea).
- And most important: the colors in the gnome-terminal are smoothened. Now that is what _I_ call eye candy. Less work and much more satisfaction than the integrated compiz.real ;-).
So thanks again for all free software developers!
[Permalink] -- Filed under: [web] [personal] [linux]
Helping the environment
A lot of work is done in making linux suspend work better. For me it works perfect (from linux kernel 2.6.20 or so). Therefore I wanted to go a step further and let my class A, heavy power-using receiver switch off when my desktop computer suspends (to ram). And switch back on when my computer wakes up. The motivation is that I only listen music via my computer.
To achieve this I bought the Gembird Silver Shield, a USB-switchable power adapter. I was prepared to do some nice USB snooping and C programming to get this device working in linux, but (un)fortunately there was already a working utility for this device.
Configuration for suspend/hibernate is not so easy and documentation is sparse for the user mode utilities. Since it took me more than the usual googling I will summarize my conclusions here for later use. First the gnome-screensaver measures the idle time. After this timeout is expired the gnome-power-manager starts to measure his own timeout (so before suspend the two times will stack). When the gnome-power-manager times out it will look at the Inhibit flag. If there is no inhibiting (for example my rhythmbox pushes Inhibiting, because I do not want to suspend when music is playing) your computer will suspend.
Since a custom script should be added to switch the power-switch off via usb with sispmctl the suspend-backend is important. Gnome power manager can use multiple backends to go to suspend mode. This works via hal (the hardware abstraction layer). Configuration for this is in /usr/share/hal/information. HAL is responsible for calling the suspend-backend. The default suspend-backend on my machine is pm-utils. (which can be tested with pm-(suspend/hibernate/power-save etc.). I also have a package called hibernate (which can also suspend, confusing isnt' it?). A third one is suspend2 (which can also hibernate....). These backends have different ways of adding custom hooks.
To add a hook to hibernate I added a file called local in /etc/hibernate/scriptlets.d/. The API is as follows (ugly in my book):
# -*- sh -*-
UsbPowerSocketDown() {
/usr/bin/sispmctl -f1
}
UsbPowerSocketUp() {
/usr/bin/sispmctl -o1
}
AddUsbOptions() {
AddSuspendHook 10 UsbPowerSocketDown
AddResumeHook 10 UsbPowerSocketUp
return 0
}
AddUsbOptions
Pm-utils has a much nicer API. To add a custom hook add a file to /etc/pm/sleep.d . This uses init style ordering. So look in /usr/lib/pm-utils/sleep.d/ for a proper number. I needed to talk to the usb-bus AFTER the modules were loaded, so a number lower than 50. So I added /etc/pm/sleep.d/10usbpoweroptions with content like this:
#!/bin/bash
case $1 in
suspend)
/usr/bin/sispmctl -f1
;;
resume)
sleep 1
/usr/bin/sispmctl -o1
;;
esac
After all this fiddling it works like a charm! Now hopefully one standard will emerge; because how to achieve the same result with KDE I don't know. I had to manually patch rhythmbox to change calling (via dbus) the Inhibit method from org.gnome.powermanager to org.freedesktop.powermanagement (because i used a wrong combination of versions..), so this suggests a move in the right direction.
[Permalink] -- Filed under: [music] [linux] [science]
Qemu/kvm and xorg screen resolution
Fast virtualization is cheap nowadays on linux. Just apt-get install kvm on a recent kernel and VT-enabled processor and you are ready to run all kind of different os-es on your host. No more recompiling the vmware kernel modules *again* or fiddling with xen-modified kernels and difficult networking setups. Yeah!
One problem I encountered was getting a decent resolution (f.g. 1280x1024 or higher) in the guest xserver (xorg). Google was not really helpful this time so therefore I post this note for future reference. Qemu emulates two kind of video cards, standard is a cirrus, -std-vga provides you with a vesa one. Vesa was not able to help me (garbled screen), so using the (default) cirrus emulator is the way to go for a linux guest.
The trick was in changing the monitor sync and refresh rates, autodetection did not work properly (in my centos 4.0 guest). So here is my working snippet of /etc/X11/xorg.conf:
Section "Device" Identifier "Generic Video Card" Driver "cirrus" EndSection Section "Monitor" Identifier "Generic Monitor" Option "DPMS" HorizSync 28-64 VertRefresh 43-60 EndSection
[Permalink] -- Filed under: [linux]
10 years GNU/Linux
I am using
GNU/Linux for 10 years! As a celebration I made a white chocolate cake (recept) with tux on it. Thanks to all the volunteers for this great
combination of free software. In the past I have used all major distributions, nowadays I am stuck
with Debian. In fact I am rather distro-agnostic, if it
runs xterm, screen, vim, mplayer, gcc and mutt I am happy. Pro is the nice Debian philosophy,
con the fact that is has not incorporated SElinux yet. So perhaps I will switch in the next 10 years
again?
Sidenote for R. Stallman: when i am using gnu/linux 25 years I promise to make a gnu cake :-D.
[Permalink] -- Filed under: [linux]

