Eclipse CDT language mappings
Eclipse/CDT fails to parse some file? You don”t see anything wrong with it, neither does the compiler? Still CDT underlines parts or all of a file to mark a parse error? The most probable cause is that your file has a file extension that CDT associates with the C language, but it contains some bits of C++.
To solve this problem the CDT offers a feature called language mapping which allows you to override the default for a given file type. This can be done for a single file, for the project or for the whole workspace.
For a single file, right click on a file in the project browser -> select Properties -> C/C++ General -> Language Mappings. The dialog also offers some shortcut to do it on project or workspace level.
Integrating the NetworkManager with aiccu
I am using the service of SixXS to connect my laptop with the IPv6 internet. They provide an utility called aiccu to setup the tunnel. Getting it to work is really painless. Just do an “apt-get install aiccu”, configure your SixXS username and password and your done.
The aiccu package provides a traditional startup script which is placed in /etc/init.d and is added to the different run levels. Files on the different levels are executed in alphabetical order. The name of the aiccu script ensures that it is run after the network has been brought up. So as long as the networking on your system is statically configured through /etc/network/interfaces everything is fine.
Unfortunately i am (as most probably other desktop users also) using the NetworkManager to handle my network connections. This means that at the time that the aiccu startup script is run there is no network available which will make the tunnel setup fail.
What i would like to do is to run the aiccu script every time the NetworkManager has established a connection so that the tunnel is re-established. Fortunately NetworkManager provides a way to do this. It will run (in alphabetical order) all the scripts placed in /etc/NetworkManager/dispatcher.d/. The scripts are passed two variables, the interface name and if it is going up or down. The scripts are run as root.
Copy this script to /etc/NetworkManager/dispatcher.d/99aiccu to integrate aiccu with the NetworkManager. It should work with KDE and Gnome.
#!/bin/bash
IF=$1
ACTION=$2
if [ "$ACTION" == "up" ]; then
/etc/init.d/aiccu restart
fi
if [ "$ACTION" == "down" ]; then
/etc/init.d/aiccu stop
fi
Kubuntu 9.10 DNS/network troubles
After installing Kubuntu 9.10 RC1 networking became kind of flaky. It somehow worked but everything was slow and unpredictable. It was most visible while browsing the web. Some pages where loading for ages (5+ minutes), some never finishing to load at all while others were just fine after some initial delay. This problem was not only visible in firefox but also in konqueror.
I started wireshark to have a look on what was actually going on. It showed that my computer was sending DNS queries to my local DSL router (SpeedPort W303V; an ISP provided blackbox). This DSL router also works as a local DNS-cache which it is advertising via DHCP. This explains why the DNS queries are sent to the DSL router. The traffic log showed further that requests for A records (IPv4) were properly answered but requests asking for AAAA records (IPv6) were never blessed with a reply. The missing answer was triggering some retry mechanism which was resending the AAAA record request a few times. Only after this mechanism timed out, the browser was actually starting to load a page.
This nicely explains why some pages were loading fine after some initial delay (all content on one server) while others were loading forever (complex sites were a lot of addresses need to be resolved to load all content). It also explains why firefox and konqueror were both affected, DNS resolving is typically handled by the libc.
The DNS cache in my DSL router is apparently not handling requests for IPv6 address records. So far i was not able to figure out what exactly has changed between Kubuntu 9.04 and 9.10. Just replacing the /etc/resolv.conf with a version pointing to an external DNS server solved the problem for now.
Apart from that Kubuntu 9.10 looks very promising. A lot of the KDE4 problems which plagued me in 9.04 are gone.