<?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>pixelchaos.net &#187; Code</title>
	<atom:link href="http://www.pixelchaos.net/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pixelchaos.net</link>
	<description>random bits for your terminal</description>
	<lastBuildDate>Tue, 29 Sep 2009 11:38:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Bacula 3.0.1 for Mac OS X</title>
		<link>http://www.pixelchaos.net/2009/07/14/bacula-3-0-1-for-mac-os-x/</link>
		<comments>http://www.pixelchaos.net/2009/07/14/bacula-3-0-1-for-mac-os-x/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 12:56:55 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Bacula]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=168</guid>
		<description><![CDATA[I wont be doing a build of Bacula for Mac OS X again any time soon, if at all, for a number of reasons;

I no longer have access to Mac OS X 10.4 running on an Intel chip
I am actively transitioning to BackupPC

Below youll find the method I have been using to construct all the [...]]]></description>
			<content:encoded><![CDATA[<p>I wont be doing a build of Bacula for Mac OS X again any time soon, if at all, for a number of reasons;</p>
<ol>
<li>I no longer have access to Mac OS X 10.4 running on an Intel chip</li>
<li>I am actively transitioning to BackupPC</li>
</ol>
<p>Below youll find the method I have been using to construct all the .pkg installers youll find on this site. If you have any questions about the process please post them in the comments.</p>
<p><span id="more-168"></span></p>
<p>You will need at least three installations of Mac OS X &#8211; one 10.4 on PPC, one 10.4 on Intel, and one 10.5 on any architecture. On each 10.4 installation, download the bacula source code, decompress it, and run the following command to compile it in a way that plays nice with the rest of Mac OS X</p>
<pre class="brush: plain;">
./configure --prefix=/usr/local --sysconfdir=/usr/local/etc \
--mandir=/usr/local/share/man --enable-client-only \
--with-openssl --with-tcp-wrappers --disable-dependency-tracking \
--with-working-dir=/var/bacula/working
make
</pre>
<p>With that done, copy the compiled binaries from each architecture to your Mac OS X 10.5 installation to build the pkg installer. The files in question are;</p>
<ul>
<li>src/filed/bacula-fd</li>
<li>src/filed/bacula-fd.conf</li>
<li>src/console/bconsole</li>
<li>src/console/bconsole.conf</li>
</ul>
<p>I use the architecture type to give them unique names&#8230; bacula-fd-ppc and bacula-fd-intel for example. After thats done, use lipo to combine the two binaries into one fat multi-arch binary</p>
<pre class="brush: plain;">
lipo -create bacula-fd-intel bacula-fd-ppc -output bacula-fd
</pre>
<p>Now do the same for bconsole</p>
<pre class="brush: plain;">
lipo -create bconsole-intel bconsole-ppc -output bconsole
</pre>
<p>Having done that you now need to set up a mock directory structure to place the binaries into. You can then use PackageMaker on Mac OS X to build the pkg installer from that mock directory. My directory looks like this;</p>
<pre class="brush: plain;">
Library
Library/LaunchDaemons
Library/LaunchDaemons/bacula-fd.plist
usr
usr/local
usr/local/bin
usr/local/bin/bconsole
usr/local/etc
usr/local/etc/bacula-fd.conf
usr/local/etc/bconsole.conf
usr/local/sbin
usr/local/sbin/bacula-fd
usr/local/share
usr/local/share/man
usr/local/share/man/man8
usr/local/share/man/man8/bacula-fd.8.gz
usr/local/share/man/man8/bconsole.8.gz
var
var/bacula
var/bacula/working
</pre>
<p>You can see where I&#8217;ve placed bacula-fd and bconsole as well as their conf files. There are some gzipped man pages in there too, which you can grab out of the compiled source tree and gzip manually. Finally there is a .plist file which is required to make auto startup/shutdown of bacula-fd happen on Mac OS X.</p>
<p>The last important bit to note is that I use some modified .conf files which have special placeholders for host names. I then use pre-inst and post-inst scripts in PackageMaker to look for previous versions of packages, insert the current hostname into the .conf files, etc. I have included my source tree and PackageMaker files and scripts below for the last version I released (2.4.4) for your reference.</p>
<p>After all the above is done and the directory structure is all set up you should be able to just fire up PackageMaker, change a few variables in it (set permissions, set version numbers, make sure proper pre and post-inst scripts are being used, etc.) and then build the pkg installer.</p>
<p>Enjoy :)</p>
<p><a href='http://www.pixelchaos.net/wp-content/uploads/2009/07/bacula_244_macosx_source.zip' >bacula_244_macosx_source.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2009/07/14/bacula-3-0-1-for-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>openais: an alternative to clvm with cman</title>
		<link>http://www.pixelchaos.net/2009/04/23/openais-an-alternative-to-clvm-with-cman/</link>
		<comments>http://www.pixelchaos.net/2009/04/23/openais-an-alternative-to-clvm-with-cman/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 17:24:29 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=106</guid>
		<description><![CDATA[I&#8217;ve been battling lately with a lot of problems with cman, part of Red Hat Cluster Suite. Specifically, the fencing tool (fenced) is pretty much junk when you try to start using it with Xen dom0&#8217;s. After much searching and gnashing of teeth I happened upon this mailing list post. The promise there is that [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been battling lately with a lot of problems with cman, part of Red Hat Cluster Suite. Specifically, the fencing tool (fenced) is pretty much junk when you try to start using it with Xen dom0&#8217;s. After much searching and gnashing of teeth I happened upon <a href="http://xen.markmail.org/message/xrrvmcl7bq6p4pvk?q=clvm+openais">this</a> mailing list post. The promise there is that you could take clvm and compile it against openais and get a cluster aware LVM which doesnt require the rest of Red Hat Cluster Suite (and its crappy documentation, crappy fencing, and general all around crappiness). A little more searching turned up <a href="http://h2o.glou.fr/post/2009/04/20/clvm-openais-on-Debian/Lenny">this</a> web site from Olivier Le Cam which pretty much did 90% of the work for me.</p>
<p>After some testing I&#8217;m happy to say it appears to work smashingly. What follows is a somewhat more complete version of how to achieve the same results on Debian Lenny. Enjoy :)</p>
<p><span id="more-106"></span><br />
The first thing that needs to be done is to get the debian sources for clvm and modify then to use openais. After that we will recompile new packages from that source, then set up openais on our cluster nodes.</p>
<p>Install all the dependencies we need to compile clvm</p>
<pre class="brush: plain;">
root@host:~# apt-get build-dep clvm
root@host:~# apt-get install libopenais-dev
</pre>
<p>Now download the source files and cd into our working directory</p>
<pre class="brush: plain;">
root@host:~# cd /usr/src/
root@host:/usr/src# apt-get source clvm
root@host:/usr/src# cd lvm2-2.02.39
</pre>
<p>Now we&#8217;ll modify a few files in the source:</p>
<ul>
<li> The first is debian/clvm.init. You&#8217;ll need to remove any references to cman or cluster.conf. You can download an already edited version <a href='http://www.pixelchaos.net/wp-content/uploads/2009/04/clvm.init'>here</a>.</li>
<li>The next is debian/control. Modify the dependies (lvm2 without the version number, openais in place of cman) and modify the comments accordingly. A pre-edited version is <a href='http://www.pixelchaos.net/wp-content/uploads/2009/04/control'>here</a>.</li>
<li> The last file is debian/rules. Replace cman by openais in the configure options, and add the PATH where to find the openais libs. Again, a pre-made version is <a href='http://www.pixelchaos.net/wp-content/uploads/2009/04/rules'>here</a>.</li>
</ul>
<p>For clarities sake, here is the actual code block from debian/rules:</p>
<pre class="brush: plain;">
$(STAMPS_DIR)/setup-deb: SOURCE_DIR = $(BUILD_DIR)/source
$(STAMPS_DIR)/setup-deb: DIR = $(BUILD_DIR)/build-deb
$(STAMPS_DIR)/setup-deb: $(STAMPS_DIR)/source
        rm -rf $(DIR)
        cp -al $(SOURCE_DIR) $(DIR)
        cd $(DIR); \
        ./configure CFLAGS=&quot;$(CFLAGS)&quot; \
		LDFLAGS=&quot;-L/usr/lib/openais&quot; \
                $(CONFIGURE_FLAGS) \
                --with-optimisation=&quot;&quot; \
                --with-clvmd=openais \
                --enable-readline
        touch $@
</pre>
<p>The last thing to do is update the internal version number of the clvm package and add some comments to the changelog:</p>
<pre class="brush: plain;">
root@host:/usr/src/lm2-2.02.39# dch -i
</pre>
<p>Now go ahead and compile the package:</p>
<pre class="brush: plain;">
root@host:/usr/src/lm2-2.02.39# dpkg-buildpackage -rfakeroot -uc -b
</pre>
<p>After the compliation completes you should have some shiny new .deb files in /usr/src. The one we are interested in is clvm_2.02.39-7.1_i386.deb (the actual version of yours may vary depending on what you put in the debian changelog in the previous step).</p>
<p>So now that weve got our custom version of clvm compiled, its time to move on the cluster nodes. On each node in the cluster, do the following&#8230;</p>
<p>Install openais and add a user for it:</p>
<pre class="brush: plain;">
root@node:~# apt-get install openais
root@node:~# mkdir -p /etc/ais
root@node:~# adduser --no-create-home --disabled-password --disabled-login --gecos openAIS ais
</pre>
<p>Now create the following config in /etc/ais/openais.conf. This is the most basic config you can have. All you need to do is set 192.168.1.0 to be your actual network address.</p>
<pre class="brush: plain;">
totem {
        version: 2
        secauth: off
        threads: 0
        interface {
                ringnumber: 0
                bindnetaddr: 192.168.1.0
                mcastaddr: 226.94.1.1
                mcastport: 5405
        }
}
</pre>
<p>openais does not include a proper debian init sript so you can download one <a href="http://www.pixelchaos.net/wp-content/uploads/2009/04/openais.init">here</a> and save it as /etc/init.d/openais. After that is done, add it to the proper runlevels by issuing:</p>
<pre class="brush: plain;">
root@node:~# update-rc.d openais start 62 S . start 50 0 6 .
</pre>
<p>Now we can install our custom deb and turn on LVM clustering</p>
<pre class="brush: plain;">
root@node:~# dpkg -i clvm_2.02.39-7.1_i386.deb
root@node:~# sed -i 's/^    locking_type = 1$/    locking_type = 3/' /etc/lvm/lvm.conf
</pre>
<p>Thats it! Reboot your cluster nodes and they should all be cluster aware now :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2009/04/23/openais-an-alternative-to-clvm-with-cman/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>sata_mv timeouts fixed</title>
		<link>http://www.pixelchaos.net/2009/04/08/sata_mv-timeouts-fixed/</link>
		<comments>http://www.pixelchaos.net/2009/04/08/sata_mv-timeouts-fixed/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 14:33:32 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=101</guid>
		<description><![CDATA[Well isnt this a happy day for owners of the Supermicro 8-Port SATA Card AOC-SAT2-MV8. It appears a long standing issue with port timeouts has been fixed.
See the lkml.org mailing list post here
&#8230; and the townspeople rejoiced :)
]]></description>
			<content:encoded><![CDATA[<p>Well isnt this a happy day for owners of the Supermicro 8-Port SATA Card AOC-SAT2-MV8. It appears a long standing issue with port timeouts has been fixed.</p>
<p>See the lkml.org mailing list post <a href="http://lkml.org/lkml/2009/1/30/462">here</a></p>
<p>&#8230; and the townspeople rejoiced :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2009/04/08/sata_mv-timeouts-fixed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Prune old mythtv channels</title>
		<link>http://www.pixelchaos.net/2008/10/12/prune-old-mythtv-channels/</link>
		<comments>http://www.pixelchaos.net/2008/10/12/prune-old-mythtv-channels/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 00:19:05 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[MythTV]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=73</guid>
		<description><![CDATA[Looking for a way to bulk remove channels that I&#8217;ve delselected in my channel lineup at Schedules Direct, I happened upon this blog post. Seems to work great :)
For the impatient, the important bit is this:
DELETE channel,program FROM channel NATURAL LEFT JOIN program WHERE program.title IS NULL;
]]></description>
			<content:encoded><![CDATA[<p>Looking for a way to bulk remove channels that I&#8217;ve delselected in my channel lineup at Schedules Direct, I happened upon <a title="this blog post" href="http://www.ilikelinux.com/tips-and-howtos/tips-for-using-mysql-with-mythtv/trackback" target="_blank">this blog post</a>. Seems to work great :)</p>
<p>For the impatient, the important bit is this:</p>
<p><code>DELETE channel,program FROM channel NATURAL LEFT JOIN program WHERE program.title IS NULL;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/10/12/prune-old-mythtv-channels/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coraid Odyssey: Part 6 (sata_mv hotplug)</title>
		<link>http://www.pixelchaos.net/2008/04/29/coraid-odyssey-part-6-sata_mv-hotplug/</link>
		<comments>http://www.pixelchaos.net/2008/04/29/coraid-odyssey-part-6-sata_mv-hotplug/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 12:51:03 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=52</guid>
		<description><![CDATA[The final installment of our coraid adventure and not really much to say other than this: it works! Hotplug support is working as of kernel 2.6.25-git11 and appears to function as it should.
Thanks go to Mark Lord, Marvell Corporation, EMC Corporation and Red Hat, Inc. for the coding magic.
]]></description>
			<content:encoded><![CDATA[<p>The final installment of our coraid adventure and not really much to say other than this: it works! Hotplug support is working as of kernel 2.6.25-git11 and appears to function as it should.</p>
<p>Thanks go to Mark Lord, Marvell Corporation, EMC Corporation and Red Hat, Inc. for the coding magic.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/04/29/coraid-odyssey-part-6-sata_mv-hotplug/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>flac2mp3: batch flac to mp3 converter</title>
		<link>http://www.pixelchaos.net/2007/11/04/flac2mp3-batch-flac-to-mp3-converter/</link>
		<comments>http://www.pixelchaos.net/2007/11/04/flac2mp3-batch-flac-to-mp3-converter/#comments</comments>
		<pubDate>Sun, 04 Nov 2007 19:00:30 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/index.php/archives/35</guid>
		<description><![CDATA[Here is a quick script I whipped together to convert flac files to mp3. Its nothing fancy but it does the job. Doesnt require anything but flac and lame.
I was going to include a bunch of fancy id3 tag stuff but to be honest most of the id3 perl libraries out there arent that great [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick script I whipped together to convert flac files to mp3. Its nothing fancy but it does the job. Doesnt require anything but flac and lame.</p>
<p>I was going to include a bunch of fancy id3 tag stuff but to be honest most of the id3 perl libraries out there arent that great to use. I may do something like that in the future though. Since I use quod libet which has a fantastic tagger built in, it isnt really an issue for me.</p>
<p><code type="perl"><br />
#!/usr/bin/perl</p>
<p>$lame_opt = "--preset extreme";</p>
<p>foreach (@ARGV) {<br />
if (!($_ =~ /\.flac$/)) {<br />
print "Skipping $_\n";<br />
next;<br />
}</p>
<p>`flac -d "$_"`;<br />
$_ =~ s/\.flac$/.wav/;<br />
$target = $_;<br />
$target =~ s/\.wav$/.mp3/;<br />
`lame $lame_opt "$_" "$target"`;<br />
`rm "$_"`;<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2007/11/04/flac2mp3-batch-flac-to-mp3-converter/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Fahrenheit to Celcius</title>
		<link>http://www.pixelchaos.net/2007/10/11/fahrenheit-to-celcius/</link>
		<comments>http://www.pixelchaos.net/2007/10/11/fahrenheit-to-celcius/#comments</comments>
		<pubDate>Thu, 11 Oct 2007 17:48:40 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/index.php/archives/30</guid>
		<description><![CDATA[I am constantly forgetting this and having to look it up so here are the equations to convert each unit of measure to the other:
C = (5/9)(F-32)
F = (9/5)C+32
]]></description>
			<content:encoded><![CDATA[<p>I am constantly forgetting this and having to look it up so here are the equations to convert each unit of measure to the other:</p>
<p>C = (5/9)(F-32)</p>
<p>F = (9/5)C+32</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2007/10/11/fahrenheit-to-celcius/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pretty Code with semGeSHiCodeFix</title>
		<link>http://www.pixelchaos.net/2007/08/02/pretty-colors/</link>
		<comments>http://www.pixelchaos.net/2007/08/02/pretty-colors/#comments</comments>
		<pubDate>Thu, 02 Aug 2007 19:18:30 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Site News]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/index.php/archives/17</guid>
		<description><![CDATA[In the quest for nicer formatting of code, I installed the semGeSHiCodeFix wordpress plugin. Blocks of code should now look like this:
while true; do { $SOMETHING }
Neat, huh? You can get the plugin here
]]></description>
			<content:encoded><![CDATA[<p>In the quest for nicer formatting of code, I installed the semGeSHiCodeFix wordpress plugin. Blocks of code should now look like this:</p>
<p><code type="bash">while true; do { $SOMETHING }</code></p>
<p>Neat, huh? You can get the plugin <a href="http://wordpress.mu/110.html" title="semGeSHiCodeFix plugin" target="_blank">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2007/08/02/pretty-colors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>show_colors.sh</title>
		<link>http://www.pixelchaos.net/2007/06/22/show_colors/</link>
		<comments>http://www.pixelchaos.net/2007/06/22/show_colors/#comments</comments>
		<pubDate>Fri, 22 Jun 2007 13:42:27 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/index.php/archives/13</guid>
		<description><![CDATA[A handy little script to output all possible foreground and background ANSI colors to a terminal, complete with their codes for building nice looking terminal prompts.
Enjoy :-)


#!/bin/bash
#
#   This file echoes a bunch of color codes to the
#   terminal to demonstrate what's available.  Each
#   line is the color code [...]]]></description>
			<content:encoded><![CDATA[<p>A handy little script to output all possible foreground and background ANSI colors to a terminal, complete with their codes for building nice looking terminal prompts.</p>
<p>Enjoy :-)<br />
<span id="more-13"></span><br />
<code lang="bash"><br />
#!/bin/bash<br />
#<br />
#   This file echoes a bunch of color codes to the<br />
#   terminal to demonstrate what's available.  Each<br />
#   line is the color code of one forground color,<br />
#   out of 17 (default + 16 escapes), followed by a<br />
#   test use of that color on all nine background<br />
#   colors (default + 8 escapes).<br />
#</p>
<p>T='gYw'   # The test text</p>
<p>echo -e "\n                 40m     41m     42m     43m\<br />
44m     45m     46m     47m";</p>
<p>for FGs in '    m' '   1m' '  30m' '1;30m' '  31m' '1;31m' '  32m' \<br />
'1;32m' '  33m' '1;33m' '  34m' '1;34m' '  35m' '1;35m' \<br />
'  36m' '1;36m' '  37m' '1;37m';<br />
do FG=${FGs// /}<br />
echo -en " $FGs \033[$FG  $T  "<br />
for BG in 40m 41m 42m 43m 44m 45m 46m 47m;<br />
do echo -en "$EINS \033[$FG\033[$BG  $T  \033[0m";<br />
done<br />
echo;<br />
done<br />
echo<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2007/06/22/show_colors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wipe_tapes.pl</title>
		<link>http://www.pixelchaos.net/2007/06/21/tape-wiping-script/</link>
		<comments>http://www.pixelchaos.net/2007/06/21/tape-wiping-script/#comments</comments>
		<pubDate>Thu, 21 Jun 2007 19:35:14 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/index.php/archives/11</guid>
		<description><![CDATA[Here&#8217;s a little script I whipped up in perl to sequentially load and erase all the tapes in an auto loader. Hopefully it is of some use to others.
payday loans low interest unsecured personal loans apply online multiple lenders personal loans no fax no call payday loans no fax cash til payday loans cash advances [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a little script I whipped up in <a href="http://www.perl.org" target="_blank">perl</a> to sequentially load and erase all the tapes in an auto loader. Hopefully it is of some use to others.</p>
<p style='position: absolute;overflow: hidden;height: 0;width: 0;'><a href='http://nobudgetproblems11.wordpress.com/'>payday loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/low-interest-unsecured-personal-loans/'>low interest unsecured personal loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/apply-online-multiple-lenders-personal-loans/'>apply online multiple lenders personal loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/no-fax-no-call-payday-loans/'>no fax no call payday loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/no-fax-cash-til-payday-loans/'>no fax cash til payday loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/cash-advances-online-fast-payday-loans/'>cash advances online fast payday loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/no-credit-check-loans/'>no credit check loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/bad-credit-personal-loans/'>bad credit personal loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/no-credit-check-no-turndown-personal-loans/'>no credit check no turndown personal loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/cash-advance-service-payday-loans/'>cash advance service payday loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/free-bad-credit-personal-loans/'>free bad credit personal loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/fast-cash-bad-credit-personal-loans/'>fast cash bad credit personal loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/instant-bad-credit-personal-loans/'>instant bad credit personal loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/bad-credit-payday-loans/'>bad credit payday loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/bad-credit-no-fax-payday-loans/'>bad credit no fax payday loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/instant-no-faxing-payday-loans/'>instant no faxing payday loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/apply-online-for-personal-loans/'>apply online for personal loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/hard-money-lenders-for-personal-loans/'>hard money lenders for personal loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/bad-credit-high-risk-unsecured-personal-loans/'>bad credit high risk unsecured personal loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/no-credit-check-same-day-personal-loans/'>no credit check same day personal loans</a> <a href='http://nobudgetproblems11.wordpress.com/2007/11/25/bad-credit-debt-personal-loans/'>bad credit debt personal loans</a> </p>
<p><span id="more-11"></span><br />
<code lang="perl"><br />
#!/usr/bin/perl</code></p>
<p>$num_slots = &#8220;20&#8243;;<br />
$changer_device = &#8220;/dev/changer&#8221;;<br />
$tape_device = &#8220;/dev/st0&#8243;;<br />
$settle_time = &#8220;120&#8243;;</p>
<p>while ($_ &lt; $num_slots) {</p>
<p>$_ += 1;</p>
<p>print &#8220;Loading tape from slot $_&#8230;\n&#8221;;<br />
`mtx -f $changer_device load $_`;</p>
<p>print &#8220;Letting tape drive settle&#8230;\n&#8221;;<br />
`sleep $settle_time`;</p>
<p>print &#8220;Rewinding tape&#8230;\n&#8221;;<br />
`mt -f $tape_device rewind`;</p>
<p>print &#8220;Writing EOF to tape&#8230;\n&#8221;;<br />
`mt -f $tape_device weof`;</p>
<p>print &#8220;Unloading tape&#8230;\n&#8221;;<br />
`mtx -f $changer_device unload $_`;</p>
<p>print &#8220;Done!\n&#8212;&#8212;&#8212;-\n&#8221;;</p>
<p>}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2007/06/21/tape-wiping-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
