Monthly Archive for Juni, 2009

Perl DBI is not thread-safe!?

Recently I encountered the warning “Use of uninitialized value in null operation during global destruction” when working with DBI and threads, although DBI was not used inside the threaded code it did apparently have side-effects. The solution to this was to disconnect from the DB before entering the threaded code and reconnecting after all threads were launched.

Filtern ist keine Lösung

filtern_ist_keine_loesung

Stopp!

spd_stopp2

VMWare on Debian (64bit)

Since VMWare made their Server available at no cost this has risen to be an highly interesting alternative for virtualisation. Anyone can download it from their website and get serials for free. This is highly mature software and is rather easy to install. However, on 64-bit Systems there are a few caveats. If you happen to have the problem that VMWare won’t accept your serials, than you have to install the ia32-libs package. Also see the comments on this howto.

When you did successfully install VMWare, you probably want to provide your VMs with network connecitivity. There are several ways to achieve this and the approach depends on how you use your servers.

Interface Aliases: http://www.derkeiler.com/Mailing-Lists/securityfocus/focus-linux/2002-01/0094.html

Routing: Use Host-only network

1
2
3
4
5
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o eth0 -j MASQUERADE
iptables -A INPUT -i vmnet1 -s 192.168.2.0/24 -j ACCEPT
iptables -A FORWARD -i eth0 -o vmnet1 -j ACCEPT
iptables -A FORWARD -o eth0 -i vmnet1 -j ACCEPT
iptables -t nat -I PREROUTING -p tcp -d <external -ip> -i eth0 --dport </external><external -port> -j DNAT --to <internal -ip>:</internal><internal -port></internal></external>

Connection Tracking Stats

Get a list of ips with the most tracked connections:

cat /proc/net/ip_conntrack | awk ‘{ print $4; }’ | sort | uniq -c -d | sort -n -r

Sum the size of your logfiles

Find out how much space is occupied by your logfiles. Usefull in /var/log et al.

find . -type f -name “*.log” -size +2048 -exec du -s {} \; | awk ‘{ SUM += $1; } END { print SUM/1024/1024 }’

Synchronizing Amarok and Rhythmbox Metadata

Sometimes the world is cruel. Although most of the applications I use from day to day are open source its not easy to exchange metadata between those programs. Sometimes I switch my music player. Usually I switch between Amarok and Rhythmbox. But since I heavily rely on the Metadata, especially my song ratings, this can get very frustrating. Most of the metadata is stored within the MP3 files but the most important ones are not. After some searching around it looked like there is no proper solution to synchronize the metadata of my favourite music players. There are some approaches to import the music library from iTunes but it looks like nobody did ever want to do a two-way synchronization between Amarok and Rhythmbox.

After looking at the metadata formats (XML for Rhytmbox, MySQL for Amarok) I did start my own synchronization script. Right now it is working but needs some more polishing or it could eat your kittens.

Grab the script from Bifröst.

A day with GIT

After using CVS a short time and SVN for several year I’ve finally seem to have found a proper SCM/RCS. I’ve spent some hours reading the Git User’s Manual, the Gitturorial, the Git SVN Crash Course as well as several Man pages. It really looks like I’ve found an SCM that is cappable of what I expect from it. Of course time has to proove if it is less problematic than SVN – at least – sometimes is.