Archives for the Month of Juni, 2011

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 […]

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”;}’ 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 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. 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.