Updates from MD1032 Toggle Comment Threads | Keyboard Shortcuts

  • MD1032 5:03 pm on August 31, 2012 Permalink  

    collectd libvirt plugin build dependencies 

    When configuring collectd using ./configure –prefix=/usr/local –enable-libvirt , the modules section that’s displayed after configuring on my machine shows:

    libvirt . . . . . . . no (dependency error)

    The solution here is to install the libxml2-dev package in addition to libvirt-dev, since that is needed by collectd to parse the XML VM configuration stanzas that libvirt provides.

  • MD1032 3:43 pm on June 11, 2012 Permalink  

    Airport Extreme: update dynamic hostname through BIND 

    If you are the owner of an Apple Airport Extreme base station, you may have wondered if it is possible to assign a static hostname to your dynamically changing ADSL IP address. Many other routers offer this feature through one of the popular dynamic DNS services such as DynDNS. Apple however decided not to support the proprietary interfaces of those commercial services, but instead use a generic approach as described in RFC 2136 Dynamic Updates in the Domain Name System (DNS UPDATE).

    Here’s how you can use this feature.


    • Apple Airport Extreme Base Station
    • Airport Utility version 5.6 (the DNS update feature is not accessible in 6.0+)
    • a domain name where you can choose your own nameserver (most domain sellers allow this)
    • a (Linux) server running BIND9 on a static IP address


    • for this setup I assume that your Linux box has the static hostname mybox.com on IP address The domain name you want to use for your airport extreme is airport.mydomain.com. This means mydomain.com is owned by you and has its nameserver set to mybox.com.
    • Install BIND version 9 on your Linux server (e.g. “sudo apt-get install bind9”) and create a zone file for your domain. You can put it in /etc/bind/zones/mydomain.com.db and make it look like this:
    $ORIGIN .
    $TTL 86400	; 1 day
    mydomain.com		IN SOA	mybox.com. mailaddress.gmail.com. (
    				2012060524 ; serial
    				28800      ; refresh (8 hours)
    				7200       ; retry (2 hours)
    				864000     ; expire (1 week 3 days)
    				86400      ; minimum (1 day)
    			NS	mybox.com.
    			MX	10 mydomain.com.
    $ORIGIN mydomain.com.
    *			A
    $ORIGIN _dns-sd._udp.mydomain.com.
    b			PTR	mydomain.com.
    db			PTR	mydomain.com.
    dr			PTR	mydomain.com.
    lb			PTR	mydomain.com.
    r			PTR	mydomain.com.
    $ORIGIN _udp.mydomain.com.
    _dns-update		SRV	0 0 53 mybox.com.
    • google for some BIND tutorials if you need more information on the zone file configuration
    • make sure port 53 UDP is open in your Linux box’s firewall
    • create a RNDC key. This is the “password” used to update your DNS zone. Run “rndc-confgen -a -c /etc/bind/rndc.key”
    • add the following to your /etc/bind/named.conf.local:
    include "/etc/bind/rndc.key";
    zone "mydomain.com" {
          type master;
          file "/etc/bind/zones/mydomain.com.db";
          update-policy {
            grant rndc-key name airport.mydomain.com A;
    • ensure that your zone file and the named.conf.local have permissions -rw-r–r– and are owned by root, group bind.
    • on Ubuntu 12.04 I had to edit the file /etc/apparmor.d/usr.sbin.named and change the line “/etc/bind/zones/** r,” to “/etc/bind/zones/** rw,”
    • restart apparmor and bind
    • check the syslog for any bind errors
    • if you’ve just changed the nameserver of domain.com to mybox.com, it may take 24h or more for this update to reach your provider’s DNS cache
    • check your nameserver configuration with “dig”. “dig a domain.com” should give you an answer section with your Linux box’s IP address. “dig ns domain.com” should return mybox.com. “dig PTR b._dns-sd._udp.domain.com” should return domain.com.
    • when everything works as expected, we can now configure Airport Extreme. Open “Airport Utility 5.6”, choose the “base station” tab and click “Edit…”. Configure it as in the screenshot below. The password is the “secret” as mentioned inside your rndc.key file. Enter it without the quotes.
    • click “Done” and “Update”. Your Airport Extreme should update the DNS A record for airport.domain.com every 15 minutes. In your syslog it looks like this:

    Jun 11 07:15:07 alderaan named[31953]: client updating zone 'domain.com/IN': deleting rrset at 'airport.domain.com' A
    Jun 11 07:15:07 alderaan named[31953]: client updating zone 'domain.com/IN': adding an RR at 'airport.domain.com' A

    • you can now reach your home network from anywhere through the hostname “airport.domain.com”. Success!!
    • belkone 8:21 am on September 14, 2014 Permalink

      Hi, I know, that article is from 2012, but should it works right now? When I try to setup dns using your solution I have in logs: named[5798]: client xx.xx.xx.xx#61698: update ‘zzz.zzz.zzz/IN’ denied. Can you tell me what am I doing wrong?

    • Liviu P. 5:14 am on September 29, 2015 Permalink

      Very interesting article. I can confirm it works but i think BIND is not giving back the right answer to apple airport router since the router sends DNS update very very often (5 times a minute). I think the answer should contain ttl value (lease time) but i didn’t figure out how to do that with BIND and i wrote my own dns server.

    • Sanigo 2:25 am on May 19, 2016 Permalink

      It is a good article, and it did work! But i have the same problem as Liviu, the router sends update too frequently. I have no idea about this.

  • MD1032 4:31 pm on May 14, 2012 Permalink  

    Script to convert a SYMPA mail archive to mbox format (sympa2mbox) 

    Export the mail archive using the SYMPA web interface, extract the zipfile and run the following script over the mail directory. You need to have “formail” installed.

    # This scripts takes a sympa email archive and converts it into a
    # single mbox file
    function die()
    	echo "$1"
    # ensure arguments are passed
    [ -z "$path" ] && die "Pass archive directory as first argument."
    [ -z "$dest" ] && die "Pass destination mbox file name as second argument."
    # sanity checking
    [ ! -d "$path" ] && die "Can't find '$path'"
    touch "$dest" || die "Can't write to '$dest'"
    # we rely on directories being name in alpha order oldest -> newest 
    for dir in $(ls "$path"); do
    	if [ -d "$path/$dir" ]; then
    		echo -n "Working on $path/$dir..."
    		files=$(ls "$path/$dir" | sort -n)
    		for file in $files; do
    			formail -ds < $path/$dir/$file >> $dest
    		echo "done"
  • MD1032 3:40 pm on May 4, 2012 Permalink  

    Remove failing VMs in OpenStack 

    Occasionally OpenStack VMs fail to spawn or fail to terminate and cannot be removed from the VM list. Deleting the VM using the command line or web interface has no effect, they are stuck in the “spawning” or “deleting” state. To get rid of these zombie entries I remove them from the database using the following bash script (pass the machine UUID as parameter):

    mysql -uroot -ppassword << EOF
    use nova;
    DELETE a FROM nova.security_group_instance_association AS a INNER JOIN nova.instances AS b ON a.instance_id=b.id where b.uuid='$1';
    DELETE FROM nova.instance_info_caches WHERE instance_id='$1';
    DELETE FROM nova.instances WHERE uuid='$1';

    • jhalter 3:16 pm on May 13, 2012 Permalink

      Thanks, this saved me a lot of time!

    • askstack 6:41 am on May 16, 2012 Permalink

      thanks! I spend at least 4 hours on this problem.

    • davidpc 12:39 am on May 23, 2012 Permalink

      thanks for sharing!

    • love_essex 1:05 pm on October 25, 2012 Permalink

      thanks a lot

    • jeff 2:13 pm on October 26, 2012 Permalink

      thank you!

    • Max 11:10 pm on November 8, 2012 Permalink

      Thank you very much! Helped a lot

  • MD1032 6:20 pm on March 31, 2012 Permalink  

    Force library refresh on Nook Simple Touch 

    If you have rooted a Nook Simple Touch e.g. using http://forum.xda-developers.com/showthread.php?t=1343143, you may want to run some scripts to download some books directly onto your device. The problem is that these books you saved to /media or /sdcard only show up in the library after you reboot the Nook.

    To force a library refresh, create a script containing the line

    busybox killall vold

    of course you need to have busybox installed through Google Play and you have to run this script with root permissions.

  • MD1032 2:34 pm on March 20, 2012 Permalink  

    RAID5 array of 6 SSDs Performance Evaluation 

    I’ve got six Crucial m4 SSDs with 256GB in a RAID5 array, resulting in 1.2TB useable disk space.The SSDs are connected via SATA3 to a Gigabyte 990FX UD7 board. I’m running 64bit Ubuntu 11.10 server.

    The following two articles offer some good ideas on performance tuning the SSD RAID:

    The chuck size on /dev/md127 is 512k, which is the default in Ubuntu and suits the 512k erase block size of the Crucial m4 disks. I’ve decided to partition the disks with “gdisk”, using a GPT. The partition starts at sector 2048 to align with the SSD chunk size. The filesystem is ext4, using 4k block size and 128 blocks stride, which again matches the 512k EBS. There is no need to pass any special options to mkfs.ext4, it was all autodetected.

    I’m using the following optimizations in /etc/rc.local:

    md=`ls -l /dev/disk/by-id/md-uuid-f70a5a71:577d6424:8ca4b9cf:265a61a3 | 
    awk '{ print $NF }' | sed -e 's/[/\.]//g'`
    echo 32768 >  /sys/block/$md/md/stripe_cache_size
    blockdev --setra 4096 /dev/$md
    for s in $SSD
      NODE=`ls -l $s | awk '{ print $NF }' | sed -e 's/[/\.]//g'`
      echo noop > /sys/block/$NODE/queue/scheduler

    Make sure /etc/rc.local is run by bash, not sh. The block device scheduler for the SSDs is set to “noop”, since there is no seek time on the SSD.

    Here are some benchmarks:

    root@localhost:/mnt/ssd# dd of=file.bin if=/dev/zero bs=1G count=10
    10+0 records in
    10+0 records out
    10737418240 bytes (11 GB) copied, 20.4972 s, 524 MB/s
    root@localhost:/mnt/ssd# dd if=file.bin of=/dev/null
    20971520+0 records in
    20971520+0 records out
    10737418240 bytes (11 GB) copied, 16.53 s, 650 MB/s

    650MB/s read speed is not too bad!

    Probably add GRUB_CMDLINE_LINUX_DEFAULT=”bootdegraded=true” to /etc/default/grub to allow the array to boot in degraded state.

    Note that there is no TRIM support for software raid5 yet (only levels 0,1,10 as of Linux 3.3), but support for levels 4,5,6 is in the making. Until then, a regular wipe of all SSDs may allow for steady performance.

  • MD1032 5:56 pm on November 21, 2011 Permalink  

    How I built my custom Mac 

    Here’s a list of the parts:

    Intel Core i7 2600K $335.00
    Corsair Vengeance CMZ16GX3M4A1600C9B 16GB (4x4GB) DDR3 $149.00
    Antec Sonata IV with 620W $187.00
    Crucial M4 SSD 256GB $439.00
    LG CH12LS28 12X BD-R Blu-ray DVD Combo Drive $69.00
    Arctic Cooling Freezer 13 Pro CO CPU Cooler $59.00
    Gigabyte GA-Z68MX-UD2H-B3 Motherboard $165.00

    First I had to update the BIOS to F12 and configure a few settings:

    • enable HPET in 64bit mode
    • Set all SATA controllers to AHCI
    • give 64MB of memory to the integrated graphics
    • turn off the SATA RAID BIOS
    I then prepared a UniBeast stick on my other Mac, according to the instructions here. I followed the guide but could not get to the Lion installer. After fiddling around with a few parameters I realised that passing PCIRootUID=1 on the UniBeast loader did the trick. After partitioning and formatting the SSD I was able to install Lion and boot it through the USB stick.
    I then installed Multibeast with the DSDT for my mainboard. After rebooting Lion got stuck on the white apple screen. To go ahead I passed GraphicsEnabler=false to the boot loader and got into Lion at a low resolution. System Info reports that the machine is a Mac Pro, and that was the problem since the Mac Pro doesn’t have an Intel HD 3000 graphics card. So I ran Multibeast again and installed the Mac Mini System Definition. I had to add it to my /Extra/org.chameleon.Boot.plist:


    < ?xml version="1.0" encoding="UTF-8"?>
    < !DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
            <key>Legacy Logo</key>

    After a reboot I got it running in full resolution. What was still missing is the USB3 driver and the Lnx2Mac RTL81xx driver from MultiBeast, which installed with no problems. Everything is working now, even the sound and the USB Bluetooth stick. It’s a rock stable system overclocked to 4GHz and I have never seen a faster Mac. And it is silent, too. CPU core temperature never goes over 60 degrees, even overclocked & under full load.

  • MD1032 6:21 pm on November 11, 2011 Permalink  

    Mounting Drobo b800i on Linux using iSCSI 

    iSCSI support in the new Drobo is a really neat feature. Here’s how to mount the Drobo as a block device in Linux:

    • install some hard disks and connect the Drobo via USB cable to a Windows or Mac computer
    • open the Drobo Dashboard and create a volume. I recommend to set it to 16TB size, no matter how many disks you actually have installed. This allows you to grow the filesystem later when you add more disks.
    • give the Drobo a static IP address on the iSCSI1 interface and connect it via Ethernet cable to your Linux machine (directly or using a gigabit switch)
    • unplug the USB cable
    • in Linux you need to install the iSCSI daemon. On Ubuntu just become root and run apt-get install open-iscsi
    • make sure your Ethernet card is configured to be on the same network as the Drobo
    • run iscsiadm -m discovery  --type sendtargets --portal where the IP address is your Drobo iSCSI1 IP address
    • you should now see your volumes listed, like,0 iqn.2005-06.com.drobo:b800i.tdb1119b0269.id1
    • connect to your id1 volume by running iscsiadm -m node --targetname iqn.2005-06.com.drobo:b800i.tdb1119b0269.id1 --portal --login
    • run dmesg | tail to see whether the block device was detected by the Linux kernel
    • run parted /dev/sdb to partition your device. Use mklabel to create a GUID partition table (GPT). Then use mkpart to create a partition. Drobo apparently does not support ext4, but ext3 works fine for me.
    • the block device will appear to be of size 16TB. However your actual useable space depends on the number and size of the disks you are using and the amount of redundancy you selected. Make sure that the partition you create is smaller than the actually available space. You can calculate the capacity of your Drobo here. Leave the rest of the 16TB disk as free space.
    • exit parted and format the disk using mkfs.ext3 /dev/sdb1
    • mount /dev/sdb1 and enjoy blazing fast storage
    • for automatic iSCSI target login on boot, run iscsiadm -m node -T iqn.2005-06.com.drobo:b800i.tdb1119b0269.id1 -p --op update -n node.startup -v automatic
    • If the target login fails, it helped me once to disconnect the USB cable
    • If the Drobo volume should mount on boot, add an entry to the /etc/fstab with options auto,_netdev
    • Keith Bradnam 1:50 pm on September 13, 2012 Permalink

      Is everything still working with you b800i? Can I ask how far apart your Drobo and server are, i.e. are they on the same local network or separated by various networks?

    • Christoph 3:59 pm on September 14, 2012 Permalink

      Yes it’s working on a local network, haven’t tested it across subnets

  • MD1032 4:59 pm on October 15, 2011 Permalink  

    XBMC & Lirc & Ubuntu 11.10 oneiric 

    After upgrading to Ubuntu 11.10, my MCE remote stopped working in XBMC. Since XBMC did not get an update (it’s coming from a separate PPA), I assume the LIRC button naming for the “mceusb” driver has changed in the new lirc package. It doesn’t match the “mceusb” section in XBMC’s Lircmap.xml anymore.

    What I had to do to get my MCE remote working again in XBMC was to create a new file ~/.xbmc/userdata/Lircmap.xml and insert the remote button codes that I gathered from running “irw” and pressing the buttons. Make sure that the “lirc” package is installed and choose the “Windows Media Center Remote” when it asks you for the type of remote you have.

    This is mostly the default mapping, with a few customisations for my personal preferences. Note that this is for the “mceusb” driver, if you use a different driver, you have to change the “<remote device=”mceusb”>” line and gather the correct codes from “irw”.

    	<remote device="mceusb">

    The above file maps the buttons on the remote to XBMC button names. If also want to change the mapping of XBMC buttons to XBMC functions, you need to create another file, e.g. ~/.xbmc/userdata/keymaps/remote.xml . I like to use the “play” button to display a context menu on the selection screens and codec statistics during playback. The following file overrides the default XBMC mapping to enable this:

    • Logan 4:18 am on October 16, 2011 Permalink

      Thanks for posting that. It’s just what I needed. I’d narrowed it down to lirc but had no idea how to revert back to an old version or fix this one. Appreciate folks like you who post helpful things for the benefit of others.

    • dash 9:56 am on October 16, 2011 Permalink

      Thanks a lot !, that’s exactly what I needed to make my remote work again with XBMC .

    • Richard 6:44 am on October 21, 2011 Permalink

      Thanks a lot! That worked for me!
      Just made a minimal install of Ubuntu 11.10 with XBMC Nightly and the only thing that didn’t work until now was my mce remote.

      Keep posting stuff like this….. kept my out of the dark cold late nights searching the web 😉

    • Roberto 2:17 am on October 22, 2011 Permalink

      Thanks. This works for everything lirc. From Rhythmbox to mplayer and pulseaudio.

    • Vincent 9:29 pm on October 24, 2011 Permalink

      Thanks too, Works perfectly now on 11.10

    • fr0sty 1:44 am on November 18, 2011 Permalink

      This fixed it for me, but now i seem to have double keypresses in XBMC. IRW gives me double keypresses, for example when going through the menu in XBMC it moves 2 options instead of 1

    • Mark Anderson 2:19 am on November 28, 2011 Permalink

      Thank you so much!!! I thought I broke my lirc with 11.10 update, only to find it did the exact same thing with a fresh install. With these instructions, I had my HTPC working in no time.

    • Elliot Nathanson 7:25 am on January 9, 2012 Permalink

      Yes – thank you! Lirc also broke with my 11.10 update.

    • Daniel D 8:47 am on April 21, 2012 Permalink

      I have a Rosewill RRC-126 and i wasn’t sure how to map it fully in XBMC thank you so much all buttons work how i want now!

  • MD1032 11:32 am on September 23, 2011 Permalink  

    Openfire & Ubuntu & more than 1000 XMPP users 

    Openfire on Ubuntu may get into a state where it doesn’t accept incoming connections anymore. The process is still there, the log files do not give any hints, but new XMPP clients just hang at the connection attempt.

    The reason for this behaviour may be a limit on a user’s maximum number of file descriptors. On Ubuntu, it defaults to 1024 (check with ulimit -n). To lift this limit, edit /etc/security/limits.conf and add the lines:

    root		soft	nofile		100000
    root        	hard    nofile          100000

    to raise the limit to 100K file descriptors and restart openfire. Since you are running the openfire init script as root, the limits need to be applied to root. Even though the process is started as user openfire, the ulimit from the parent process (run as root) seems to get inherited.

    Update: This does not work when openfire is started at boot through an init.d script. The limits.conf is only applied by a PAM module at login. Modify the init script to include “ulimit -n 100000”. This does not need limits.conf since the init scripts are run as root.

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc