Kategorien: Ubuntu, Planet Ubuntu



Es ist schon erstaunlich, wenn eine IE5 Installation unter Ubuntu von 2006-06-18 immer noch läuft.

Hatte das damals mit ie4linux installiert, wenn ich mich recht erinnere - und wine packt es einfach weiterhin, auch wenn ich es jahrelang nicht genutzt habe (und weiterhin nicht nutzen werde).

Von Daniel in Ubuntu, computer21.04.10 German (DE) E-Mail


Easy DNS wildcard setup for local domains using dnsmasq

When doing web development you'll often have domains/hostnames like hahler.local (instead of hahler.de).

Having a separate hostname for a lot of projects will result in some inconvenience though: you have to setup those.
Until recently, I was adding them to /etc/hosts (or the counterpart on Windows), like so: hahler.local whissip.local

This however does not allow wildcards (like *.hahler.local), and having something like *.local would be much easier to maintain (no adding to this file for a new setup/project).

dnsmasq to the rescue!

dnsmasq is a lightweight DNS forwarder and I was using it already to cache DNS queries locally, for faster browsing etc. Since it answers my DNS lookups already, it should be able to make *.local work for me.

I've created a simple file /etc/dnsmasq.d/my-local with just a single line:



And after restarting dnsmasq, *.local gets resolved to

Instead of "local" you can (and should probably) use another domain, like "dev" instead, because using "local" conflicts with Avahi/mdns, but this can get solved as follows:
Avahi/mdns defaults to ".local" as its TLD and therefore you have to adjust the "hosts" line in /etc/nsswitch.conf and put "dns" (which is dnsmasq in this case) before mdns4_minimal (which is avahi in this case), or remove the NOTFOUND=return, so that "dns" would get used even when mdns4_minimal returns NOTFOUND (which it apparently does for requests in its domain (typically ".local") it does not know anything about):


hosts:          files dns mdns4_minimal [NOTFOUND=return] mdns4
By Daniel in Ubuntu, Snippets04/13/10 English (US) Email


Convert etckeeper repository from Bazaar to Git

Quite a while ago I've installed etckeeper and changed the configuration to use Bazaar as its backend for myself (and sponsored/helped with a patch to change the default in Ubuntu).

However, already the first comment asked me why I would be using you Bazaar, if Git was that much faster (and required less space).

At that time I've thought, that Bazaar would catch up, and they (luckily) have done so in some areas, but Git is still a lot faster.

Therefore I've decided to change the repository from bzr to git. I've done so on my home machine and will do so on my dedicated server boxes in the next days, so it's a not only a recommendation but also documentation.

Howto convert a bzr repository to git (etckeeper)

Open a root shell, then you should export $GIT_DIR first:

export GIT_DIR=/etc/.git

The following will then convert /etc from a bzr to a git repository ("fast-export" is included in bzr-fastimport - you may have to install this first):

bzr fast-export --export-marks=$GIT_DIR/bzr.mark /etc | git fast-import --export-marks=$GIT_DIR/git.mark

After this (which will take a while depending on your history) you want to adjust the VCS setting in etckeeper.conf  (uncomment VCS=git and comment VCS=bzr):

sed -i -r -e s/'#\s*(VCS="git)"'/'\1'/ -e s/'VCS="bzr"'/'# \0'/ /etc/etckeeper/etckeeper.conf

I don't remember correctly, but the Git repository was not really setup correctly in the end - but the following fixed it:

etckeeper init


I've done some benchmarking, comparing "$DVCS status" against each other. This will look if there are any files modified in the current tree, and it's what etckeeper does before and after upgrading (IIRC).
The following shows the commands with cold and warm caches (I've cleared the disk caches when changing to a new set).

What you can see is not only that "git status" is twice as fast with a cold cache (and even more with a warm one), but also that bzr takes even more time to print a single line of "It sure does!".

$ sudo time git st
0.01user 0.04system 0:05.61elapsed 1%CPU (0avgtext+0avgdata 0maxresident)k
29232inputs+688outputs (113major+1605minor)pagefaults 0swaps
$ sudo time git st
0.02user 0.02system 0:00.06elapsed 59%CPU (0avgtext+0avgdata 0maxresident)k
16inputs+688outputs (0major+1716minor)pagefaults 0swaps

$ sudo time bzr st
0.14user 0.06system 0:11.74elapsed 1%CPU (0avgtext+0avgdata 0maxresident)k
17840inputs+8outputs (36major+3750minor)pagefaults 0swaps
$ sudo time bzr st
0.16user 0.03system 0:00.32elapsed 62%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+3787minor)pagefaults 0swaps

$ sudo time bzr rocks
It sure does!
0.20user 0.05system 0:08.19elapsed 3%CPU (0avgtext+0avgdata 0maxresident)k
17392inputs+8outputs (34major+3422minor)pagefaults 0swaps
$ sudo time bzr rocks
It sure does!
0.16user 0.01system 0:00.20elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+3458minor)pagefaults 0swaps

I'll update this post when scripting for the update of my various OpenVZ containers, but the basic information should stand.

From now on, I will save 5+ seconds on any "aptitude safe-upgrade". Hopefully this multiplies somehow, so the time investment into this post pays back.. ;)


Kubuntu Karmic Koala freigegeben

Source: http://en.wikipedia.org/wiki/File:Friendly_Female_Koala.JPG

Ubuntu 9.10 AKA "Karmic Koala" wurde heute freigegeben.
Mal wieder ein Release, an dem ich nicht soo sehr aktiv mitgewirkt habe, aber immerhin eines, dessen Bugs mich am Ende sehr geplagt haben.

Eine Übersicht der neuen Features gibt es auf ubuntu.com.

Auch Planet Ubuntu ist voller Screenshots und Release-Posts, u.a. deswegen von mir jetzt auch nicht viel mehr.. ;)

Zum Download geht es hier - und wer lieber Kubuntu (basierend auf KDE 4.3) möchte, geht hier entlang.

Das Bild ist von Quartl / Wikipedia.

Von Daniel in Ubuntu29.10.09 German (DE) E-Mail
Schlagworte: , , ,


HAL configuration for Kingsis Peripherals Evoluent VerticalMouse 3

To configure my Kingsis Peripherals Evoluent VerticalMouse 3, I've added the following fdi (HAL configuration info) to /etc/hal/fdi/policy/evoluent-verticalmouse3.fdi:


<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
    <match key="info.capabilities" contains="input.mouse">
      <match key="input.product" string="Kingsis Peripherals  Evoluent VerticalMouse 3">
        <merge key="input.x11_driver" type="string">evdev</merge>
        <merge key="input.x11_options.Emulate3Buttons" type="string">no</merge>
        <merge key="input.x11_options.EmulateWheelButton" type="string">0</merge>
        <merge key="input.x11_options.ZAxisMapping" type="string">4 5</merge>
        <merge key="input.x11_options.ButtonMapping" type="string">1 2 2 4 5 6 7 3 8</merge>

The most important part (for me) here is ButtonMapping: by default only the wheelbutton triggers middle click, but since it's rather hard to press (and I use it often for pasting), I've mapped it to the middle button on the right side, too.
Also, the thumb button becomes "Back" (in browsers) and the lowest button on the right triggers the context menu.

Update: This was meant to included in Ubuntu Karmic (see bug 451729), but then got removed again (not everybody liked it).

Update^2: for udev (which is used solely since Ubuntu Lucid), I've transformed it into the following file (which you can store as /etc/udev/rules.d/90-local-xorg.rules):


ACTION!="add|change", GOTO="xorg_local_end"
KERNEL!="event*", GOTO="xorg_local_end"
ENV{ID_INPUT_MOUSE}!="1", GOTO="xorg_local_end"
ENV{ID_MODEL}!="Evoluent_VerticalMouse_3", GOTO="xorg_local_end"
ENV{x11_options.ZAxisMapping}="4 5"
ENV{x11_options.ButtonMapping}="1 2 2 4 5 6 7 3 8"

(see also https://wiki.kubuntu.org/X/InputConfiguration for more information)

Update^3: This is bugged in Ubuntu Lucid.



Link: http://getpopfile.org/

POPFile lets you easily handle your POP/IMAP email incoming folders and filters your mails into "buckets".

It allows more than the usual "spam" / "ham" buckets - you can use it to filter by language, too.

I have quite a special email setup, and it says currently:

Messages classified:   108,230
Classification errors: 2,948
Accuracy:              97.27% 

My buckets are: b2evo, backscatter, bugs, jedit, logspam, newsletter, personal, server, spam, traffic-watch, ubuntu, ubuntu-ack

Training messages into new buckets is as easy as moving them into another folder, when using IMAP - the POPFile process will recognize the movement and re-train this message.

If you're still using POP3, POPFile is a nice application anyway (it can be used as a proxy), but please consider switching to IMAP for your own sake.


Improving dpkg/apt performance

Thanks to Antti-Juhani Kaijanaho I could improve the performance of dpkg/apt on my old Ubuntu system (upgraded since I've started using Linux/Ubuntu in 2005):

I've written a small script, according to Antti-Juhani's post:

# via http://antti-juhani.kaijanaho.fi/newblog/archives/521

if [ "$(id -u)" != "0" ]; then
echo "You must be root."
exit 1

dpkg --clear-avail
dpkg --forget-old-unavail

My results show that /var/lib/dpkg has gone from 195M down to 154M and calling apt-get upgrade (not a good test probably) went down from 10.024s to 5.764s (after dropping all caches, of course - "echo 3 | sudo tee /proc/sys/vm/drop_caches").


This should get considered to be done during Ubuntu upgrades.

By Daniel in Ubuntu, Snippets2009-05-08 English (EU) Email