Debian Package Dependency Graphing

While cleaning up some package dependencies I’ve stumbled upon debtree. Have a look, it’s worth it. Generates pretty picture. The policy manual may come in handy as well.

VBoxAdm 0.1.15

I’ve just uploaded VBoxAdm 0.1.15. It includes another set of major refactorings. Please be careful when upgrading and watch your logfiles closely for any errors that may occur. Especially the Vacation module was refactored.

The time when the project will leave it’s alpha stage is drawing closer. VBoxAdm is now running on several largish sites under my direct administrative control, so I’ve got plenty of possiblities for some real-world testing. Several other migrations/installations are planned for the near future. Once it has proven sufficiently stable on these mailservers I’ll announce the the end of the alpha phase and enter beta testing.

Stay tuned!

Squid – HTTPS broken w/o tcp_outgoing_address

If you happen to run a squid inside a Linux-Vserver you should make sure that you’ve set tcp_outgoing_address to the primary IP of the vserver or you’ll encounter strange issues resulting in https not working from within the vserver:

1310903352.277      0 1.2.3.4 TCP_MISS/500 0 CONNECT bugzilla.redhat.com:443 user NONE/- -

GIT: Rewriting commit history – change author and email

Quicklink: How to change author and email in the whole commit History: http://theelitist.net/git-change-revision-author/

Memcache Sessions may cause zend_mm_head corrupted in PHP5

PHP5 (5.3.3 in this case) may break in very supprising ways if the Memcached configured as a session handler goes awry.

In my case there was a webserver (Apache2 + mod_php5) w/ two memcached configured as session handler. One of those memcached got stuck and didn’t properly reply to request. This shouldn’t happen but whats even worse was that PHP5 just “died” with the following error in the syslog:

vs-www-s01 suhosin[32504]: ALERT – zend_mm_head corrupted at 0x7fc2f41a2090 (attacker ’10.1.2.3′, file ‘/var/www/index.php’)

This resulted in empty pages delivered to the browser.

After fixing the memcached everything was fine again.

Perl UTF-8 Checklist aka Surviving the Perl Unicode Madness

Some time ago, when I wrote the first version of this post I thought I had mastered UTF-8/Unicode with Perl and MySQL. Sadly I was very, very wrong. So I had to revisit the topic and I’d like to share my findings in the hope that they can save some coders from going nuts.

First you should read “Why does modern Perl avoid UTF-8 by default?” on Stackoverflow, especially the top-voted answer. It is the best ressource on UTF-8 and Perl I’ve found so far.

The next stop would be “UTF8, Mysql, Perl and PHP” on gyford.com. Pay special attention on the “utf8::decode( $var ) unless utf8::is_utf8( $var );” part. However I’d suggest using Encode::decode and Encode::is_utf8 instead. The imporant lesson to take away here is that you still may need to “decode” the bytes coming from the database into Perls internal UTF-8 representation. Once Perl knows its dealing with UTF-8 it will probably handle them correctly. Unfortunately sometimes the conditional decode doesn’t work … in this cases you can try to decode the data w/o checking if it is already in UTF-8 first. Brave new world …

If you still need more advice I suggest the following links, in this order:

Number of Host headers in a TCPDump

One-Liner: Get the number of Host: headers from a TCPDump:

ngrep -I /tmp/tcpdump | grep "Host:" | perl -e'while(<>){if(m/\.\.Host: (.*?)\.\./){$h{$1}++}};for $h(keys%h){print"$h - $h{$h}\n";}'

VMWare ESXi – Commandline Tools

Rebooting VMWare ESXi VMs from the Hypervisor Shell:

vim-cmd vmsvc/getallvms
vim-cmd vmsvc/power.reboot NN

Mount KVM Images

Want to mount a KVM image?

losetup /dev/loop0 foo.img
kpartx -av /dev/loop0
mount /dev/mapper/loop0p1 /mnt
...
unmount /mnt
kpartx -dv /dev/loop0
losetup -d /dev/loop0

via 1.

VBoxAdm: Mailinglist and API

A short status update regarding VBoxAdm.

Mailinglist

Finally I’ve created a Mailinglist: http://www.vboxadm.net/support.html#mailinglist

Refactoring

I’ve been refactoring the Code for a while to turn it more into a MVC-Shape. This means separating the Model from the Controller (former VBoxAdm::Frontend, now VBoxAdm::Controller::Frontend). The ultimate goal of this work is to support code reuse and support for multiple ways to manipulate the data. Once the Model classes are stable I’ll finish the command line interface as well as the HTTP-API. This will provide three ways to modify the underlying data:

  • Web Frontend
  • HTTP-API (no REST for now, maybe later)
  • CLI

The Mailarchive is postponed for the time being.

Auto Configuration

Most Mailclients, like Outlook, Thunderbird and KMail, support a way of client auto-configuration. When setting up a new mail account they request a certain URL derived from the mail address and if they find an XML document with the expected information there they’ll use this information to set the correct username, mailserver and protocols. Support for this was added recently. There is even support for the weird way MS Outlook does this. However Outlook support is, so far, based solely on the documentation on Technet. Due to the lack of a Outlook license I wasn’t able to test it. Please provide feedback.

Future Work

After the refactoring, API and CLI are finished I’m going to look into the Mailarchive again. After that I’ll look into Quota Support, Mailman integration and I’d like to find a way to get the Postfix Logs into the database to ease support work. Having the Log in the database in a parsed format – no raw syslog to db – would make support request more easy to handle. No more need to log into the server and grep through the mail.log.

Further feature request are always welcome. Please direct any ideas and comments to the mailinglist at vboxadm@vboxadm.net.