As I don't care about other people's opinion about what I am blogging about, there will be no comments. If you really think, you need to send me some information: klaus (dash) blog {at} (guess the domain!).
a small POP3-server in bash
Inspired by a tweet about an HTTP-server in bash, I remembered a pop3-server in bash, I saw a few years ago. I couldn't find it anymore, so I reimplemented it myself :-)
It's very basic, but seems to work.
I only checked it with Thunderbird.
Installation
Download the file pop3d below, put it somewhere (e.g /tmp), install fortunes and initd.
inetd
put this line in your /etc/inetd.conf
pop3 stream tcp nowait nobody /tmp/pop3d pop3d
now pop your localhost and have fun!
German makes bash act strange
When LANG is set to de_DE.UTF-8, the globbing in bash is case-insensitive, which is very confusing.
Example:
First we look at the LANG variable.
kumbach@dualprinzip ~ % echo $LANG
de_DE.UTF-8
Now we start bash (I normally use zsh) and enter the directory /tmp/test with two files, FOO and foo.
kumbach@dualprinzip ~ % bash
kumbach@dualprinzip: ~ $ cd /tmp/test
kumbach@dualprinzip: /tmp/test $ ls
foo FOO
Everything looks pretty normal so far, no we try ls with globbing:
kumbach@dualprinzip: /tmp/test $ ls [a-z]*
foo FOO
WHAT? Why is it matching FOO?
kumbach@dualprinzip: /tmp/test $ exit
Now we try it with LANG=C, where bash is behaving as expected.
kumbach@dualprinzip ~ % LANG=C bash
kumbach@dualprinzip: ~ $ cd /tmp/test
kumbach@dualprinzip: /tmp/test $ ls [a-z]*
foo
kumbach@dualprinzip: /tmp/test $
btw.: zsh does not have this strange behaviour.
Conclusion
Be careful when using globbing in scripts, even if you set LANG=C inside your script, the interpreter itself might run in another environment, so globbing will still be German.
This does not happen if LANG is set to en_US.UTF-8, so it seems not to be a UTF-8 issue, just a German problem (and maybe other languages).
The Problem
Ubuntu has a very annoying bug with font-rendering and Firefox: All the fonts in Firefox are blurry, no matter which hinting you choose. I saw this behaviour in 9.10 and 10.04-rc:

The Solution
delete /etc/fonts/conf.d/10-hinting-slight.conf and restart your Firefox, the ugly fonts are propper now!
# rm /etc/fonts/conf.d/10-hinting-slight.conf

That's not really propper...
No, deleting a symlink in /etc is not really propper. As soon as somebody tells me a propper solution to this, I will post it here, too. Normally I don't use Ubuntu, so I personally will not seek for a better solution here. I could file a bugreport, but I you need a launchpad-account for this, which is something I definitively don't want.
Update
There are is an unassigned bugreport about this, with an even dirtier solution.
Scenario
Imagine you are in an environment where there is no real internet! The only way to access the outer world is through 80/tcp and 443/tcp (because these are "the internet-ports"), maybe with a transparent proxy or you need to "know" the proxy and enter it in all your applications.
This is a very common scenario in so called guest-networks/wifis, where someone with a lot of certifications was told, that all other ports are evil and should be blocked.
We all know that ports are never evil (except maybe for 25/tcp), so we know that almost any service can be bound to almost any port, so why not bind sshd on port 443, so we can access/tunnel everything we need from everywhere? - Unfortunatelly most of us only have one IP per machine (may Santa Clause bring us IPv6!) and most most of us still want to use HTTPS for some other things.
The Solution - sslh
The solution is sslh, a ssl/ssh-multiplexer which allows you to have SSH and HTTPS on the same port. You put it in front of your webserver and it redirects the requests. Very easy to setup and the version in Debian Squeeze is easily backported to Lenny.
Possibilities
- git+ssh instead of the crappy webdav-PITA
- SSH port-tunneling for other services
- even full SSL-VPN with recent OpenSSH (haven't tried yet)
My new fun project is in beta-state now: http://spambitches.org
Have fun!
I decided to create an additional Debian repository, all the packages are from Lenny, but a little bit enhanced/patched.
deb http://www.sozial-inkompetent.de/debian/ lenny-enriched main non-free contrib
deb-src http://www.sozial-inkompetent.de/debian/ lenny-enriched main non-free contrib
For the start I have two Packages:
ion3
I just added mod_xinerama.
xserver-xorg-input-synaptics
In one of the zillion of Ubuntu-forums (I don't know which one anymore) I found a patch to have "VertMultiplier" and "HorizMultiplier" options to change the ratio of X and Y to have a more pleasant touchpad. I backported it to the version in Debian Lenny.
I use
Option "VertMultiplier" "60"
for my Lenovo IdeaPad S10e.
The touchpad in the IdeaPad is much to fast and the scrolling area is much to wide, so I had to reconfigure the synaptics driver in xorg.conf. I also enabled SHMConfig, so I can reconfigure it while while X is running. Unfortunatelly the multitouch-feature doesn't work (yet).
Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "SHMConfig" "1"
Option "RightEdge" "500"
Option "HorizEdgeScroll" "0"
Option "HorizScrollDelta" "0"
Option "AccelFactor" "0.0015"
Option "MinSpeed" "0.025"
Option "MaxSpeed" "0.065"
Option "VertScrollDelta" "400"
EndSection
I hope one day to get the multitouch working and maybe find out how to setup different horizontal and vertical speeds.
After updating the wireless-driver to a more recent version (12/31/2008, I had 12/30/2008 before!) and the kernel panics are gone. Also SSH still works after 2h. Yippie!
I use the IdeaPad now for 4 days and I'm still happy with it. It was sold with Suse Linux Enterprise Desktop, so most of the hardware works out of the box in Debian Lenny.
Wireless (BCM4312)
I had to fight with the wireless card, it only works with the closed-source driver from the broadcom website. And as all closed-source drivers suck, this one does too: I have to wait a few minutes to turn on the wireless network after a reboot, or my kernel will PANIC. - Yes! Great! I can live with that for a while, as I don't have to reboot very often: suspend2ram works perfectly.
Touchpad (Synaptics)
The touchpad is twice as wide as high, but it seems it doesn't know that, because it is twice as fast on the vertical-axis as on the horizontal-axis. This feels very strange. Why didn't they just use a TrackPoint...?
Soundcard (snd-intel-hda)
The sound itself is good and works out of the box. I still haven't found out how to use the microphone, I can't set it as the capure-device. If I can't find it out myself, I have to write the SLED-image back (of course I made a backup before installing Debian!), and look what they have done to get it to work.
Update: I installed the most recent ALSA-drivers (1.0.18a), and now it works.