<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>six degrees of freedom</title>
	<atom:link href="http://6.ptmc.org/feed" rel="self" type="application/rss+xml" />
	<link>http://6.ptmc.org</link>
	<description></description>
	<lastBuildDate>Wed, 12 Dec 2012 09:32:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>OpenStack &#8220;backing file&#8221; cleanup script</title>
		<link>http://6.ptmc.org/362?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=openstack-backing-file-cleanup-script</link>
		<comments>http://6.ptmc.org/362#comments</comments>
		<pubDate>Wed, 12 Dec 2012 09:30:40 +0000</pubDate>
		<dc:creator>MD1032</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://6.ptmc.org/?p=362</guid>
		<description><![CDATA[Sometimes OpenStack leaves the &#8220;backing file&#8221; of the sparse root filesystem behind after a VM is destroyed. Those files are located in /var/lib/nova/instances/_base/ and can use up hundreds of GB. To find out which of those backing files are orphans and delete them, someone has posted a script, which I slightly improved: #!/bin/sh cd /var/lib/nova/instances [...]]]></description>
				<content:encoded><![CDATA[<p>Sometimes OpenStack leaves the &#8220;backing file&#8221; of the sparse root filesystem behind after a VM is destroyed. Those files are located in <em>/var/lib/nova/instances/_base/ </em>and can use up hundreds of GB. To find out which of those backing files are orphans and delete them, someone <a href="http://www.gossamer-threads.com/lists/openstack/dev/17386">has posted a script</a>, which I slightly improved:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>nova<span style="color: #000000; font-weight: bold;">/</span>instances
<span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;disk*&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #660033;">-n1</span> qemu-img info <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> backing <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/.*file: //'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/ .*//'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">uniq</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ignore
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> i; <span style="color: #000000; font-weight: bold;">do</span>
<span style="color: #007800;">ARGS</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$ARGS</span> \( \! -path <span style="color: #007800;">$i</span> \) &quot;</span>
<span style="color: #000000; font-weight: bold;">done</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ignore
<span style="color: #7a0874; font-weight: bold;">eval</span> <span style="color: #ff0000;">&quot;find /var/lib/nova/instances/_base/ -type f <span style="color: #007800;">$ARGS</span> -delete&quot;</span></pre></td></tr></table></div>

<p>Someone in the original post claimed that adding <em>remove_unused_base_images = True </em>to nova.conf would do this automatically, however I could not reproduce that on Folsom.</pre>
]]></content:encoded>
			<wfw:commentRss>http://6.ptmc.org/362/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to create a bootable volume in Openstack Folsom</title>
		<link>http://6.ptmc.org/357?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-create-a-bootable-volume-in-openstack-folsom</link>
		<comments>http://6.ptmc.org/357#comments</comments>
		<pubDate>Sat, 10 Nov 2012 02:33:14 +0000</pubDate>
		<dc:creator>MD1032</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://6.ptmc.org/?p=357</guid>
		<description><![CDATA[Wouldn&#8217;t it be nice to have the root filesystem of your Openstack VM inside a volume? This way you could install a lot of packages on the root partition without spreading the files over several volumes. You could take a snapshot of the entire system (OS &#38; data) and boot right off it. Openstack Folsom [...]]]></description>
				<content:encoded><![CDATA[<p>Wouldn&#8217;t it be nice to have the root filesystem of your Openstack VM inside a volume? This way you could install a lot of packages on the root partition without spreading the files over several volumes. You could take a snapshot of the entire system (OS &amp; data) and boot right off it.</p>
<p>Openstack Folsom supports this feature. Here&#8217;s how you can create your own bootable volume:</p>
<ul>
<li>On your desktop machine, download the cloud image of the OS that you want to boot from a volume. I chose Ubuntu 12.10:</li>
<li><code>wget <a href="http://cloud-images.ubuntu.com/releases/quantal/release/ubuntu-12.10-server-cloudimg-amd64-disk1.img" rel="nofollow">http://cloud-images.ubuntu.com/releases/quantal/release/ubuntu-12.10-server-cloudimg-amd64-disk1.img</a></code></li>
<li>Now convert it to RAW format using qemu-img</li>
<li><code>qemu-img convert -O raw ubuntu-12.10-server-cloudimg-amd64-disk1.img ubuntu-12.10-server-cloudimg-amd64-disk1.raw</code></li>
<li>Start up a regular VM from the Ubuntu cloud image (or any other image you have)</li>
<li>Create a volume (that you later want to boot from) and attach it to the VM</li>
<li>SSH into the VM and become root</li>
<li>check if your volume is attached with <code>fdisk -l</code>. The volume device name is /dev/vdb in my case</li>
<li>ssh into your desktop machine (or wherever you have the RAW image)  from the VM and write the image data directly into the volume device</li>
<li><code>ssh user@desktop cat ubuntu-12.10-server-cloudimg-amd64-disk1.raw &gt; /dev/vdb</code></li>
</ul>
<p>If you want your root partition to be larger than 2GB, you can now resize it to the volume size. To do that, start <code>parted</code>, get the partition information, delete (!) the partition, create a new one with the same &#8220;start&#8221; value, but with (total size-1) as the end value. Partition type is &#8220;primary&#8221;, filesystem &#8220;ext4&#8243;.</p>
<p><code><br />
root@3:/home/ubuntu# parted /dev/vdb<br />
GNU Parted 2.3<br />
Using /dev/vdb<br />
Welcome to GNU Parted! Type 'help' to view a list of commands.<br />
(parted) unit B<br />
(parted) p<br />
Model: Virtio Block Device (virtblk)<br />
Disk /dev/vdb: 21474836480B<br />
Sector size (logical/physical): 512B/512B<br />
Partition Table: msdos</code></p>
<p>Number Start End Size Type File system Flags<br />
1 8225280B 2146798079B 2138572800B primary ext4 boot</p>
<p>(parted) rm 1<br />
(parted) mkpart<br />
Partition type? primary/extended? p<br />
File system type? [ext2]? ext4<br />
Start? 8225280<br />
End? 21474836479<br />
Warning: The resulting partition is not properly aligned for best performance.<br />
Ignore/Cancel? i</p>
<p>(parted) set 1 boot on<br />
(parted) p<br />
Model: Virtio Block Device (virtblk)<br />
Disk /dev/vdb: 21474836480B<br />
Sector size (logical/physical): 512B/512B<br />
Partition Table: msdos</p>
<p>Number Start End Size Type File system Flags<br />
1 8225280B 21474836479B 21466611200B primary ext4 boot</p>
<p>(parted) q<br />
Information: You may need to update /etc/fstab.</p>
<p>Now you can detach the volume in Horizon and create a new instance. Choose &#8220;Boot from Volume&#8221; in &#8220;Volume Options&#8221; and choose your volume. You may also take a snapshot of the volume first, if you want to preserve it in a fresh state for later. You still need to choose an image in the &#8220;Details&#8221; section, which makes no sense in this case, since the VM is entirely booted off the volume.</p>
]]></content:encoded>
			<wfw:commentRss>http://6.ptmc.org/357/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>collectd libvirt plugin build dependencies</title>
		<link>http://6.ptmc.org/348?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=collectd-libvirt-plugin-build-dependencies</link>
		<comments>http://6.ptmc.org/348#comments</comments>
		<pubDate>Fri, 31 Aug 2012 07:03:33 +0000</pubDate>
		<dc:creator>MD1032</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://6.ptmc.org/?p=348</guid>
		<description><![CDATA[When configuring collectd using ./configure &#8211;prefix=/usr/local &#8211;enable-libvirt , the modules section that&#8217;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 [...]]]></description>
				<content:encoded><![CDATA[<p>When configuring collectd using <strong>./configure &#8211;prefix=/usr/local &#8211;enable-libvirt</strong> , the modules section that&#8217;s displayed after configuring on my machine shows:<br />
<code><br />
libvirt . . . . . . . no (dependency error)<br />
</code><br />
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.</p>
]]></content:encoded>
			<wfw:commentRss>http://6.ptmc.org/348/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Airport Extreme: update dynamic hostname through BIND</title>
		<link>http://6.ptmc.org/327?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=airport-extreme-update-dynamic-hostname-through-bind</link>
		<comments>http://6.ptmc.org/327#comments</comments>
		<pubDate>Mon, 11 Jun 2012 05:43:10 +0000</pubDate>
		<dc:creator>MD1032</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://6.ptmc.org/?p=327</guid>
		<description><![CDATA[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 [...]]]></description>
				<content:encoded><![CDATA[<p>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 <a href="https://www.ietf.org/rfc/rfc2136.txt">RFC 2136 Dynamic Updates in the Domain Name System (DNS UPDATE)</a>.</p>
<p>Here&#8217;s how you can use this feature.</p>
<p><strong>Requirements:</strong></p>
<ul>
<li>Apple Airport Extreme Base Station</li>
<li>Airport Utility version 5.6 (the DNS update feature is not accessible in 6.0+)</li>
<li>a domain name where you can choose your own nameserver (most domain sellers allow this)</li>
<li>a (Linux) server running BIND9 on a static IP address</li>
</ul>
<p><strong>Setup</strong></p>
<ul>
<li>for this setup I assume that your Linux box has the static hostname mybox.com on IP address 46.19.92.98. 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.</li>
<li>Install BIND version 9 on your Linux server (e.g. &#8220;sudo apt-get install bind9&#8243;) and create a zone file for your domain. You can put it in <strong>/etc/bind/zones/mydomain.com.db</strong> and make it look like this:</li>
</ul>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bind" style="font-family:monospace;">$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.
			A	46.19.92.98
			MX	10 mydomain.com.
$ORIGIN mydomain.com.
*			A	46.19.92.98
$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.</pre></td></tr></table></div>

<ul>
<li>google for some BIND tutorials if you need more information on the zone file configuration</li>
<li>make sure port 53 UDP is open in your Linux box&#8217;s firewall</li>
<li>create a RNDC key. This is the &#8220;password&#8221; used to update your DNS zone. Run &#8220;rndc-confgen -a -c /etc/bind/rndc.key&#8221;</li>
<li>add the following to your /etc/bind/named.conf.local:</li>
</ul>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bind" style="font-family:monospace;">include &quot;/etc/bind/rndc.key&quot;;
zone &quot;mydomain.com&quot; {
      type master;
      file &quot;/etc/bind/zones/mydomain.com.db&quot;;
      update-policy {
        grant rndc-key name airport.mydomain.com A;
      };
};</pre></td></tr></table></div>

<ul>
<li>ensure that your zone file and the named.conf.local have permissions -rw-r&#8211;r&#8211; and are owned by root, group bind.</li>
<li>on Ubuntu 12.04 I had to edit the file <strong>/etc/apparmor.d/usr.sbin.named</strong> and change the line &#8220;/etc/bind/zones/** r,&#8221; to &#8220;/etc/bind/zones/** rw,&#8221;</li>
<li>restart apparmor and bind</li>
<li>check the syslog for any bind errors</li>
<li>if you&#8217;ve just changed the nameserver of domain.com to mybox.com, it may take 24h or more for this update to reach your provider&#8217;s DNS cache</li>
<li>check your nameserver configuration with &#8220;dig&#8221;. &#8220;dig a domain.com&#8221; should give you an answer section with your Linux box&#8217;s IP address. &#8220;dig ns domain.com&#8221; should return mybox.com. &#8220;dig PTR b._dns-sd._udp.domain.com&#8221; should return domain.com.</li>
<li>when everything works as expected, we can now configure Airport Extreme. Open &#8220;Airport Utility 5.6&#8243;, choose the &#8220;base station&#8221; tab and click &#8220;Edit&#8230;&#8221;. Configure it as in the screenshot below. The password is the &#8220;secret&#8221; as mentioned inside your rndc.key file. Enter it without the quotes.</li>
</ul>
<div><a href="http://6.ptmc.org/wp-content/uploads.ptmc.org/2012/06/aebs.png"><img class="alignnone size-full wp-image-338" title="aebs" src="http://6.ptmc.org/wp-content/uploads.ptmc.org/2012/06/aebs.png" alt="" width="689" height="687" /></a></div>
<ul>
<li>click &#8220;Done&#8221; and &#8220;Update&#8221;. Your Airport Extreme should update the DNS A record for airport.domain.com every 15 minutes. In your syslog it looks like this:</li>
</ul>
<p><code>Jun 11 07:15:07 alderaan named[31953]: client 40.224.233.149#5353: updating zone 'domain.com/IN': deleting rrset at 'airport.domain.com' A<br />
Jun 11 07:15:07 alderaan named[31953]: client 40.224.233.149#5353: updating zone 'domain.com/IN': adding an RR at 'airport.domain.com' A</code></p>
<ul>
<li>you can now reach your home network from anywhere through the hostname &#8220;airport.domain.com&#8221;. Success!!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://6.ptmc.org/327/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script to convert a SYMPA mail archive to mbox format (sympa2mbox)</title>
		<link>http://6.ptmc.org/323?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=script-to-convert-a-sympa-mail-archive-to-mbox-format-sympa2mbox</link>
		<comments>http://6.ptmc.org/323#comments</comments>
		<pubDate>Mon, 14 May 2012 06:31:31 +0000</pubDate>
		<dc:creator>MD1032</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://6.ptmc.org/?p=323</guid>
		<description><![CDATA[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 &#8220;formail&#8221; installed. #!/bin/bash &#160; # This scripts takes a sympa email archive and converts it into a # single mbox file &#160; path=&#34;$1&#34; dest=&#34;$2&#34; &#160; function die&#40;&#41; &#123; echo &#34;$1&#34; [...]]]></description>
				<content:encoded><![CDATA[<p>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 &#8220;formail&#8221; installed.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># This scripts takes a sympa email archive and converts it into a</span>
<span style="color: #666666; font-style: italic;"># single mbox file</span>
&nbsp;
<span style="color: #007800;">path</span>=<span style="color: #ff0000;">&quot;$1&quot;</span>
<span style="color: #007800;">dest</span>=<span style="color: #ff0000;">&quot;$2&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> die<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$1&quot;</span>
	<span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># ensure arguments are passed</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$path</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> die <span style="color: #ff0000;">&quot;Pass archive directory as first argument.&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$dest</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> die <span style="color: #ff0000;">&quot;Pass destination mbox file name as second argument.&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># sanity checking</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$path</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> die <span style="color: #ff0000;">&quot;Can't find '<span style="color: #007800;">$path</span>'&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$dest</span>&quot;</span> <span style="color: #000000; font-weight: bold;">||</span> die <span style="color: #ff0000;">&quot;Can't write to '<span style="color: #007800;">$dest</span>'&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># we rely on directories being name in alpha order oldest -&gt; newest </span>
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #c20cb9; font-weight: bold;">dir</span> <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$path</span>&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$path</span>/<span style="color: #007800;">$dir</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Working on <span style="color: #007800;">$path</span>/<span style="color: #007800;">$dir</span>...&quot;</span>
		<span style="color: #007800;">files</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$path</span>/<span style="color: #007800;">$dir</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> -n<span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$files</span>; <span style="color: #000000; font-weight: bold;">do</span>
			formail <span style="color: #660033;">-ds</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #007800;">$path</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$file</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$dest</span>
		<span style="color: #000000; font-weight: bold;">done</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;done&quot;</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://6.ptmc.org/323/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove failing VMs in OpenStack</title>
		<link>http://6.ptmc.org/316?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=remove-failing-vms-in-openstack</link>
		<comments>http://6.ptmc.org/316#comments</comments>
		<pubDate>Fri, 04 May 2012 05:40:32 +0000</pubDate>
		<dc:creator>MD1032</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://6.ptmc.org/?p=316</guid>
		<description><![CDATA[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 &#8220;spawning&#8221; or &#8220;deleting&#8221; state. To get rid of these zombie entries I remove them from the database using the [...]]]></description>
				<content:encoded><![CDATA[<p>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 &#8220;spawning&#8221; or &#8220;deleting&#8221; 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):</p>
<p><code><br />
#!/bin/bash<br />
mysql -uroot -ppassword &lt;&lt; EOF<br />
use nova;<br />
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';<br />
DELETE FROM nova.instance_info_caches WHERE instance_id='$1';<br />
DELETE FROM nova.instances WHERE uuid='$1';<br />
EOF<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://6.ptmc.org/316/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Force library refresh on Nook Simple Touch</title>
		<link>http://6.ptmc.org/309?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=force-library-refresh-on-nook-simple-touch</link>
		<comments>http://6.ptmc.org/309#comments</comments>
		<pubDate>Sat, 31 Mar 2012 07:20:07 +0000</pubDate>
		<dc:creator>MD1032</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://6.ptmc.org/?p=309</guid>
		<description><![CDATA[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 [...]]]></description>
				<content:encoded><![CDATA[<p>If you have rooted a Nook Simple Touch e.g. using <a href="http://forum.xda-developers.com/showthread.php?t=1343143" rel="nofollow">http://forum.xda-developers.com/showthread.php?t=1343143</a>, 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.</p>
<p>To force a library refresh, create a script containing the line</p>
<p><code>busybox killall vold</code></p>
<p>of course you need to have busybox installed through Google Play and you have to run this script with root permissions.</p>
]]></content:encoded>
			<wfw:commentRss>http://6.ptmc.org/309/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RAID5 array of 6 SSDs Performance Evaluation</title>
		<link>http://6.ptmc.org/294?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=raid5-array-of-6-ssds-performance-evaluation</link>
		<comments>http://6.ptmc.org/294#comments</comments>
		<pubDate>Tue, 20 Mar 2012 03:34:39 +0000</pubDate>
		<dc:creator>MD1032</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://6.ptmc.org/?p=294</guid>
		<description><![CDATA[I&#8217;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&#8217;m running 64bit Ubuntu 11.10 server. The following two articles offer some good ideas on performance tuning the SSD RAID: http://h3x.no/2011/07/09/tuning-ubuntu-mdadm-raid56 https://wiki.archlinux.org/index.php/Solid_State_Drives The chuck size on [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;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&#8217;m running 64bit Ubuntu 11.10 server.</p>
<p>The following two articles offer some good ideas on performance tuning the SSD RAID:</p>
<p><a href="http://h3x.no/2011/07/09/tuning-ubuntu-mdadm-raid56" rel="nofollow">http://h3x.no/2011/07/09/tuning-ubuntu-mdadm-raid56</a></p>
<p><a href="https://wiki.archlinux.org/index.php/Solid_State_Drives" rel="nofollow">https://wiki.archlinux.org/index.php/Solid_State_Drives</a></p>
<p>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&#8217;ve decided to partition the disks with &#8220;gdisk&#8221;, 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.</p>
<p>I&#8217;m using the following optimizations in /etc/rc.local:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">md</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>disk<span style="color: #000000; font-weight: bold;">/</span>by-id<span style="color: #000000; font-weight: bold;">/</span>md-uuid-f70a5a71:577d6424:8ca4b9cf:265a61a3 <span style="color: #000000; font-weight: bold;">|</span> 
<span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $NF }'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/[/\.]//g'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">32768</span> <span style="color: #000000; font-weight: bold;">&gt;</span>  <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>block<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$md</span><span style="color: #000000; font-weight: bold;">/</span>md<span style="color: #000000; font-weight: bold;">/</span>stripe_cache_size
blockdev <span style="color: #660033;">--setra</span> <span style="color: #000000;">4096</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$md</span>
&nbsp;
<span style="color: #007800;">SSD</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>disk<span style="color: #000000; font-weight: bold;">/</span>by-id<span style="color: #000000; font-weight: bold;">/</span>ata-M4<span style="color: #000000; font-weight: bold;">*</span>
<span style="color: #000000; font-weight: bold;">for</span> s <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$SSD</span>
<span style="color: #000000; font-weight: bold;">do</span>
  <span style="color: #007800;">NODE</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span> <span style="color: #007800;">$s</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $NF }'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/[/\.]//g'</span><span style="color: #000000; font-weight: bold;">`</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> noop <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>block<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$NODE</span><span style="color: #000000; font-weight: bold;">/</span>queue<span style="color: #000000; font-weight: bold;">/</span>scheduler
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

<p>Make sure /etc/rc.local is run by bash, not sh. The block device scheduler for the SSDs is set to &#8220;noop&#8221;, since there is no seek time on the SSD.</p>
<p>Here are some benchmarks:<br />
<code><br />
root@localhost:/mnt/ssd# dd of=file.bin if=/dev/zero bs=1G count=10<br />
10+0 records in<br />
10+0 records out<br />
10737418240 bytes (11 GB) copied, 20.4972 s, 524 MB/s<br />
root@localhost:/mnt/ssd# dd if=file.bin of=/dev/null<br />
20971520+0 records in<br />
20971520+0 records out<br />
10737418240 bytes (11 GB) copied, 16.53 s, 650 MB/s<br />
</code></p>
<p>650MB/s read speed is not too bad!</p>
<p>Probably add GRUB_CMDLINE_LINUX_DEFAULT=&#8221;bootdegraded=true&#8221; to /etc/default/grub to allow the array to boot in degraded state.</p>
<p>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 <a href="https://lkml.org/lkml/2012/3/11/261">in the making</a>. Until then, a regular wipe of all SSDs may allow for steady performance.</p>
]]></content:encoded>
			<wfw:commentRss>http://6.ptmc.org/294/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How I built my custom Mac</title>
		<link>http://6.ptmc.org/279?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-i-built-my-custom-mac</link>
		<comments>http://6.ptmc.org/279#comments</comments>
		<pubDate>Mon, 21 Nov 2011 06:56:00 +0000</pubDate>
		<dc:creator>MD1032</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://6.ptmc.org/?p=279</guid>
		<description><![CDATA[Here&#8217;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 [...]]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s a list of the parts:</p>
<p><code>Intel Core i7 2600K $335.00<br />
Corsair Vengeance CMZ16GX3M4A1600C9B 16GB (4x4GB) DDR3 $149.00<br />
Antec Sonata IV with 620W $187.00<br />
Crucial M4 SSD 256GB $439.00<br />
LG CH12LS28 12X BD-R Blu-ray DVD Combo Drive $69.00<br />
Arctic Cooling Freezer 13 Pro CO CPU Cooler $59.00<br />
Gigabyte GA-Z68MX-UD2H-B3 Motherboard $165.00<br />
</code><br />
First I had to update the BIOS to F12 and configure a few settings:</p>
<ul>
<li>enable HPET in 64bit mode</li>
<li>Set all SATA controllers to AHCI</li>
<li>give 64MB of memory to the integrated graphics</li>
<li>turn off the SATA RAID BIOS</li>
</ul>
<div>I then prepared a UniBeast stick on my other Mac, according to the instructions <a href="http://tonymacx86.blogspot.com/2011/10/unibeast-install-mac-os-x-lion-using.html">here</a>. I followed the guide but could not get to the Lion installer. After fiddling around with a few parameters I realised that passing <strong>PCIRootUID=1</strong> 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.</div>
<div>I then installed Multibeast with the <a href="http://www.tonymacx86.com/dsdt.php">DSDT</a> for my mainboard. After rebooting Lion got stuck on the white apple screen. To go ahead I passed <strong>GraphicsEnabler=false</strong> 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&#8217;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 <strong>/Extra/org.chameleon.Boot.plist</strong>:</div>
<p>&nbsp;</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;">&lt; ?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;">&lt; !DOCTYPE plist PUBLIC <span style="color: #ff0000;">&quot;-//Apple//DTD PLIST 1.0//EN&quot;</span> <span style="color: #ff0000;">&quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plist</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>GraphicsEnabler<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Yes<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Timeout<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Legacy Logo<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Yes<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>SMBIOS<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/Extra/smbios.plist<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>EthernetBuiltIn<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>y<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plist<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>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&#8217;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 &amp; under full load.</p>
]]></content:encoded>
			<wfw:commentRss>http://6.ptmc.org/279/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mounting Drobo b800i on Linux using iSCSI</title>
		<link>http://6.ptmc.org/269?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mounting-drobo-b800i-on-linux-using-iscsi</link>
		<comments>http://6.ptmc.org/269#comments</comments>
		<pubDate>Fri, 11 Nov 2011 07:21:10 +0000</pubDate>
		<dc:creator>MD1032</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://6.ptmc.org/?p=269</guid>
		<description><![CDATA[iSCSI support in the new Drobo is a really neat feature. Here&#8217;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 [...]]]></description>
				<content:encoded><![CDATA[<p>iSCSI support in the new Drobo is a really neat feature. Here&#8217;s how to mount the Drobo as a block device in Linux:</p>
<ul>
<li>install some hard disks and connect the Drobo via USB cable to a Windows or Mac computer</li>
<li>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.</li>
<li>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)</li>
<li>unplug the USB cable</li>
<li>in Linux you need to install the iSCSI daemon. On Ubuntu just become root and run <code>apt-get install open-iscsi</code></li>
<li>make sure your Ethernet card is configured to be on the same network as the Drobo</li>
<li>run <code>iscsiadm -m discovery  --type sendtargets --portal 169.254.2.0</code> where the IP address is your Drobo iSCSI1 IP address</li>
<li>you should now see your volumes listed, like <code>169.254.2.0:3260,0 iqn.2005-06.com.drobo:b800i.tdb1119b0269.id1</code></li>
<li>connect to your id1 volume by running <code>iscsiadm -m node --targetname iqn.2005-06.com.drobo:b800i.tdb1119b0269.id1 --portal 169.254.2.0 --login</code></li>
<li>run <code>dmesg | tail</code> to see whether the block device was detected by the Linux kernel</li>
<li>run <code>parted /dev/sdb</code> to partition your device. Use <code>mklabel</code> to create a GUID partition table (GPT). Then use <code>mkpart</code> to create a partition. Drobo apparently does not support ext4, but ext3 works fine for me.</li>
<li>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 <a href="http://www.drobo.com/products/capacity-calculator/index.php">here</a>. Leave the rest of the 16TB disk as free space.</li>
<li>exit <code>parted</code> and format the disk using <code>mkfs.ext3 /dev/sdb1</code></li>
<li>mount /dev/sdb1 and enjoy blazing fast storage</li>
<li>for automatic iSCSI target login on boot, run <code>iscsiadm -m node -T iqn.2005-06.com.drobo:b800i.tdb1119b0269.id1 -p 169.254.2.0 --op update -n node.startup -v automatic</code></li>
<li>If the target login fails, it helped me once to disconnect the USB cable</li>
<li>If the Drobo volume should mount on boot, add an entry to the <code>/etc/fstab</code> with options <code>auto,_netdev</code></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://6.ptmc.org/269/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
