<?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"
	>

<channel>
	<title>Paint the Tiger, Carve the Swan &#187; NSLU2</title>
	<atom:link href="http://schinckel.net/category/hardware/nslu2/feed/" rel="self" type="application/rss+xml" />
	<link>http://schinckel.net</link>
	<description>Like a fortune cookie, only without the fortune, and not a cookie.</description>
	<pubDate>Fri, 05 Sep 2008 13:30:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>NSLU2 and USB 2.0 Hubs</title>
		<link>http://schinckel.net/2007/05/04/nslu2-and-usb-20-hubs/</link>
		<comments>http://schinckel.net/2007/05/04/nslu2-and-usb-20-hubs/#comments</comments>
		<pubDate>Fri, 04 May 2007 13:57:00 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[NSLU2]]></category>

		<guid isPermaLink="false">http://schinckel.net/2007/05/04/nslu2-and-usb-20-hubs/</guid>
		<description><![CDATA[Having more than two USB drives with an NSLU2 is possible, if you are using a firmware other than the original Linksys rubbish.  Some people report having gotten some hubs to work fine.
I originally had both drives working using a spare 1.0 hub I had lying around, but it was dog slow.  So [...]]]></description>
			<content:encoded><![CDATA[<p>Having more than two USB drives with an NSLU2 is possible, if you are using a firmware other than the original Linksys rubbish.  Some people report having gotten some hubs to work fine.</p>
<p>I originally had both drives working using a spare 1.0 hub I had lying around, but it was dog slow.  So I bought a 2.0 hub.  This worked for the first couple of gigs it copied across from another disk, but then reported errors.  It appeared the device just decided to unmount and remount in a different place.</p>
<p>I went and bought another hub today, from a different shop.  Same problems.  I think they are actually the same hub in different packaging, but another 2.0 hub I have lying about fails worse - the drives don&#8217;t even mount to begin with.</p>
<p>So I went for plan D.  It seems that the USB controller chip used can drive up to 5 USB ports, so I cut a USB extension cable, and wired it onto the board in the correct locations.  Didn&#8217;t work.  Disconnecting made it work again.</p>
<p>Finally, I was able to get it to work by not using the power connections on the other port, but the +5V and GND locations elsewhere on the board.  This was the only way I was able to get the NSLU2 to still boot with the extra port connected.</p>
<p>I may have been able to use unpowered ports.  That might be cooler.  I just thought that the PSU might not be +5V, in which case stuff could go badly wrong.  Better check&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://schinckel.net/2007/05/04/nslu2-and-usb-20-hubs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Preparing a Disk for OpenSlug</title>
		<link>http://schinckel.net/2007/05/01/preparing-a-disk-for-openslug/</link>
		<comments>http://schinckel.net/2007/05/01/preparing-a-disk-for-openslug/#comments</comments>
		<pubDate>Tue, 01 May 2007 14:18:01 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[NSLU2]]></category>

		<guid isPermaLink="false">http://schinckel.net/2007/05/01/preparing-a-disk-for-openslug/</guid>
		<description><![CDATA[I got a new 250GB USB drive today, and plugged in a hub into my NSLU2, and connected this up.  These are the commands I needed to execute to get it all set up (it was an NTFS formatted disk initially).
First of all, use dmesg to ensure the disk has been recognised and mounted. [...]]]></description>
			<content:encoded><![CDATA[<p>I got a new 250GB <abbr title="Universal Serial Bus">USB</abbr> drive today, and plugged in a hub into my <abbr title="[Linksys] Network Storage Link (USB) 2.0">NSLU2</abbr>, and connected this up.  These are the commands I needed to execute to get it all set up (it was an <abbr title="(Windows) NT File System">NTFS</abbr> formatted disk initially).</p>
<p>First of all, use <code>dmesg</code> to ensure the disk has been recognised and mounted.  I had to change from my USB2.0 hub to a USB1.0 hub.  I&#8217;ll get a new 2.0 hub in the next few days to try that out.  Apparently some of them don&#8217;t work.</p>
<p>From dmesg, the hub has been recognised:</p>
<p><code>usb 2-1.1: new full speed USB device using ohci_hcd and address 3<br />
usb 2-1.1: not running at top speed; connect to a high speed hub</code></p>
<p>The new disk has been mounted as an NTFS (dirty) disk:</p>
<p><code>NTFS volume version 3.1.<br />
NTFS-fs error (device sdc1): load_system_files(): $LogFile is not clean.  Mounting read-only.  Mount in Windows.</code></p>
<p>Things to note: the device name in this case is <code>/dev/sdc1</code>.  This is the third <abbr title="Universal Serial Bus">USB</abbr> device in my chain.  <code>/dev/sda(1,2,3)</code> are the root, swap and user partitions on the boot disk, <code>/dev/sdb1</code> is the first 250GB drive I bought.</p>
<p><code>nslu2:~ root$ umount /media/sdc1/</code></p>
<p><code>nslu2:~ root$ fdisk /dev/sdc1/</code></p>
<p>Then you will need to delete the partition (<code>d</code>), and create a new one (<code>n</code>).  (<code>p</code>): Primary partition, #<code>1</code>, accept default start and end blocks.  Then use (<code>w</code>) to write the partition out to disk. </p>
<p><code>nslu2:~ root$ reboot</code></p>
<p>Wait for the machine to reboot fully.</p>
<p><code>nslu2:~ root$ umount /media/sdc1/<br />
nslu2:~ root$ mkfs.ext3 /dev/sdc1<br />
mke2fs 1.38 (30-Jun-2005)<br />
...</code></p>
<p>It takes a while to process.  Worthwhile rebooting after this just to be sure.  All done.</p>
]]></content:encoded>
			<wfw:commentRss>http://schinckel.net/2007/05/01/preparing-a-disk-for-openslug/feed/</wfw:commentRss>
		</item>
		<item>
		<title>NSLU2 OpenSlug Bootup Error</title>
		<link>http://schinckel.net/2007/03/02/nslu2-openslug-bootup-error/</link>
		<comments>http://schinckel.net/2007/03/02/nslu2-openslug-bootup-error/#comments</comments>
		<pubDate>Fri, 02 Mar 2007 12:00:08 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[NSLU2]]></category>

		<guid isPermaLink="false">http://schinckel.net/2007/03/02/nslu2-openslug-bootup-error/</guid>
		<description><![CDATA[The other morning, my power went off.  I almost slept through my wake-up time, but just made it to work on time.
However, the power failure must have caused some sort of a problem with my NSLU2 server.  For some reason, I was no longer able to connect to it in any way shape [...]]]></description>
			<content:encoded><![CDATA[<p>The other morning, my power went off.  I almost slept through my wake-up time, but just made it to work on time.</p>
<p>However, the power failure must have caused some sort of a problem with my <abbr title="[Linksys] Network Storage Link (USB) 2.0">NSLU2</abbr> server.  For some reason, I was no longer able to connect to it in any way shape or form.  Samba connections failed, and even <abbr title="Secure SHell">SSH</abbr>-ing in didn&#8217;t work, with any of the users I had set up.</p>
<p>I finally figured out that it had something to do with not being able to boot off the disk properly.  It was booting up, then beeping loudly three times (two different tones).  Then, it was responding to pings, and accepting ssh connections, but not authenticating.</p>
<p>So I connected using the root account and the default password, and it worked.  And, true to form, the disks were recognised, but for some reason not mounted.</p>
<p>I tried the <code>turnup disk /dev/sda1</code> command, which doesn&#8217;t do anything destructive, but tells the machine to boot up from that device.  It failed, with the following error:</p>
<blockquote><p>turnup: /dev/sda1: partition does not seem to be a valid root partition<br />
  The partition must contain a full operating system.  To ensure that<br />
  this is the case it is checked for the following, all of which must<br />
  exist for the bootstrap to work:</p>
<p>  1) A directory /mnt.<br />
  2) A command line interpreter program in /bin/sh.<br />
  3) The program chroot in /sbin or /usr/sbin.<br />
  4) The program init in /sbin, /etc or /bin.</p>
<p>  One or more of these items is missing.  Mount /dev/sda1 on /mnt<br />
  and examine its contents.  You can use turnup disk|nfs -i -f<br />
  to copy this operating system onto the disk, but it may overwrite<br />
  files on the disk.
</p></blockquote>
<p>Okay, that might help.  A quick <code>mount /dev/sda1 /mnt/sda1</code> showed that the partition was valid.  But no /mnt directory inside there.  Create one, then run the <code>turnup disk /dev/sda1</code> command again.  Then <code>shutdown -r now</code>.</p>
<p>Upon reboot, only a single beep (which, <abbr title="if I remember correctly">IIRC</abbr>, I put there!), and everything is normal.  <em>Phew!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://schinckel.net/2007/03/02/nslu2-openslug-bootup-error/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Use veto wisely under samba</title>
		<link>http://schinckel.net/2007/01/20/use-veto-wisely-under-samba/</link>
		<comments>http://schinckel.net/2007/01/20/use-veto-wisely-under-samba/#comments</comments>
		<pubDate>Sat, 20 Jan 2007 06:07:41 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[NSLU2]]></category>

		<guid isPermaLink="false">http://schinckel.net/2007/01/20/use-veto-wisely-under-samba/</guid>
		<description><![CDATA[I reformatted my file server, and installed OpenSlug on it (much faster than LinkSys firmware, I&#8217;ve noticed), and when I was setting up the Samba shares, I thought I&#8217;d be a clever bastard, and outsmart the Finder.
See, when you access a directory, or copy files using the Finder, and you are copying to a non-HFS [...]]]></description>
			<content:encoded><![CDATA[<p>I reformatted my file server, and installed OpenSlug on it (much faster than LinkSys firmware, I&#8217;ve noticed), and when I was setting up the Samba shares, I thought I&#8217;d be a clever bastard, and outsmart the Finder.</p>
<p>See, when you access a directory, or copy files using the Finder, and you are copying to a non-HFS disk, it creates a file ._Filename.ext that stores meta-data, the new version of the Resource Fork, for all of you old-school Mac heads.</p>
<p>So, I thought, if I use:</p>
<p>veto files = /._*/.DS_Store/</p>
<p>then I won&#8217;t have any problems with these files littering up the directory structure.</p>
<p>But, this won&#8217;t work.  It doesn&#8217;t allow for the creation of these files, which causes the Finder to choke:</p>
<p><img src='/images/Veto_Dot_Underscore.png' alt='' /></p>
<p>Removing the veto (I moved it into hide files, which should prevent other clients from seeing them) fixed the problem.</p>
<p>For search engines, the text of the dialog box is:</p>
<blockquote><p>You cannot copy some of these items to the destination because their names are too long or contain invalid characters for the destination.  Do you want to skip copying these items and continue copying the other items?
</p></blockquote>
<p>It took me quite a while to figure out why this was happening&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://schinckel.net/2007/01/20/use-veto-wisely-under-samba/feed/</wfw:commentRss>
		</item>
		<item>
		<title>NSLU2 busybox issues</title>
		<link>http://schinckel.net/2007/01/10/nslu2-busybox-issues/</link>
		<comments>http://schinckel.net/2007/01/10/nslu2-busybox-issues/#comments</comments>
		<pubDate>Wed, 10 Jan 2007 14:20:01 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[NSLU2]]></category>

		<guid isPermaLink="false">http://schinckel.net/2007/01/10/nslu2-busybox-issues/</guid>
		<description><![CDATA[I had a bit of an issue with my NSLU2 tonight.  I wasn&#8217;t able to install coreutils.  It was complaining that busybox-links was installed, and it was clashing.  However, I didn&#8217;t have it installed, and no amount of ipkg remove busybox-links, or ipkg -force-overwrite install coreutils was working.
Then I came across Slugging, [...]]]></description>
			<content:encoded><![CDATA[<p>I had a bit of an issue with my NSLU2 tonight.  I wasn&#8217;t able to install <code>coreutils</code>.  It was complaining that <code>busybox-links</code> was installed, and it was clashing.  However, I didn&#8217;t have it installed, and no amount of <code>ipkg remove busybox-links</code>, or <code>ipkg -force-overwrite install coreutils</code> was working.</p>
<p>Then I came across <a href="http://outrora.eu/2006/10/29/slugging/">Slugging</a>, which shows how to deal with this exact problem: remove the <em>busybox </em>and <em>busybox-links</em> stanzas from the file <code>/usr/lib/ipkg/status</code>.</p>
<p>Thanks, z0mbi3.  Even though I hate l33tsp33k.</p>
]]></content:encoded>
			<wfw:commentRss>http://schinckel.net/2007/01/10/nslu2-busybox-issues/feed/</wfw:commentRss>
		</item>
		<item>
		<title>NSLU2 Memory issues</title>
		<link>http://schinckel.net/2006/10/09/nslu2-memory-issues/</link>
		<comments>http://schinckel.net/2006/10/09/nslu2-memory-issues/#comments</comments>
		<pubDate>Mon, 09 Oct 2006 09:38:39 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[NSLU2]]></category>

		<guid isPermaLink="false">http://schinckel.net/2006/10/09/nslu2-memory-issues/</guid>
		<description><![CDATA[I&#8217;m running my NSLU2 as a file server, torrent client and kaid server.  With 6 torrents running, it runs out of memory, and starts killing processes willy-nilly.
Took me a while to figure out this was why my script to auto-start a new torrent was being “Terminated.”
Not sure how it works out which processes to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m running my NSLU2 as a file server, torrent client and kaid server.  With 6 torrents running, it runs out of memory, and starts killing processes willy-nilly.</p>
<p>Took me a while to figure out this was why my script to auto-start a new torrent was being “Terminated.”</p>
<p>Not sure how it works out which processes to kill, or if there&#8217;s a way to reduce memory use.</p>
<p>Then I came across a HOWTO: <a href="http://www.nslu2-linux.org/wiki/HowTo/AddAdditionalSwapSpace">Add Additional Swap Space</a>.  Should fix stuff a bit.</p>
<p>Just a note: it takes ages for the file to be created, apparently.</p>
<p class="itunes"> <a href="http://phobos.apple.com/WebObjects/MZSearch.woa/wa/advancedSearchResults?songTerm=Kissing+A+Fool&amp;artistTerm=George+Michael">Kissing A Fool</a> • <a href="http://phobos.apple.com/WebObjects/MZSearch.woa/wa/advancedSearchResults?artistTerm=George+Michael">George Michael</a> • <a href="http://phobos.apple.com/WebObjects/MZSearch.woa/wa/advancedSearchResults?albumTerm=Ladies+&amp;+Gentlemen+:+The+Best+Of+George+Michael&amp;artistTerm=George+Michael">Ladies &#038; Gentlemen : The Best Of George Michael</a> ★★</p>
<p>Edit: using <code>ps x o %mem 0 command</code>, I can see that each <code>enhanced-ctorrent</code> process grabs about 5 meg, while the 10 or so <code>kaid</code> processes each use up 2.1Mb.  Since I haven&#8217;t started using <code>kaid</code> yet, maybe I should stop it auto-starting&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://schinckel.net/2006/10/09/nslu2-memory-issues/feed/</wfw:commentRss>
		</item>
		<item>
		<title>autoTorrent.py</title>
		<link>http://schinckel.net/2006/09/01/autotorrentpy/</link>
		<comments>http://schinckel.net/2006/09/01/autotorrentpy/#comments</comments>
		<pubDate>Fri, 01 Sep 2006 12:36:05 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[NSLU2]]></category>

		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://schinckel.blogsome.com/2006/09/01/autotorrentpy/</guid>
		<description><![CDATA[I&#8217;ve written a bit of code that works to automatically start any number of torrents placed into a specific directory.  The way it&#8217;s set up at the moment is that it will only start the next one on the list, and you need to call it iteratively to start all of them.  That&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve written a bit of code that works to automatically start any number of torrents placed into a specific directory.  The way it&#8217;s set up at the moment is that it will only start the next one on the list, and you need to call it iteratively to start all of them.  That&#8217;s mainly because on my NSLU2 I get some CPU usage issues if I start more than one at a time.  Just have this script called every 5 mins or so in a crontab, and it will start every .torrent added to the source directory.</p>
<p><code>*/5     *       *       *       *       root    /path/to/script/autoTorrent.py</code></p>
<p>I could make a resident version, that uses a <code>time.sleep()</code> to call the main function every 5 minutes.  Then this could be added to the <code>/opt/etc/init-d/</code> directory.</p>
<p><span id="more-937"></span></p>
<pre>
<span class='python1-comment'>#! /usr/bin/env python

</span><span class='python1-reservedword'>import</span><span class='python1-space'> </span><span class='python1-identifier'>os</span><span class='python1-symbol'>,</span><span class='python1-space'> </span><span class='python1-identifier'>time

</span><span class='python1-comment'># Any .torrent file placed in $base/source will be downloaded.
# When it's complete, it will be moved from $base/work to $base/target

</span><span class='python1-identifier'>base_dir</span><span class='python1-space'> </span><span class='python1-symbol'>=</span><span class='python1-space'> </span><span class='python1-string'>&quot;/home/user/torrent&quot;
</span><span class='python1-identifier'>source_dir</span><span class='python1-space'> </span><span class='python1-symbol'>=</span><span class='python1-space'> </span><span class='python1-identifier'>os</span><span class='python1-symbol'>.</span><span class='python1-identifier'>path</span><span class='python1-symbol'>.</span><span class='python1-identifier'>join</span><span class='python1-symbol'>(</span><span class='python1-identifier'>base_dir</span><span class='python1-symbol'>,</span><span class='python1-string'>&quot;source&quot;</span><span class='python1-symbol'>)
</span><span class='python1-identifier'>target_dir</span><span class='python1-space'> </span><span class='python1-symbol'>=</span><span class='python1-space'> </span><span class='python1-identifier'>os</span><span class='python1-symbol'>.</span><span class='python1-identifier'>path</span><span class='python1-symbol'>.</span><span class='python1-identifier'>join</span><span class='python1-symbol'>(</span><span class='python1-identifier'>base_dir</span><span class='python1-symbol'>,</span><span class='python1-string'>&quot;target&quot;</span><span class='python1-symbol'>)
</span><span class='python1-identifier'>work_dir</span><span class='python1-space'> </span><span class='python1-symbol'>=</span><span class='python1-space'> </span><span class='python1-identifier'>os</span><span class='python1-symbol'>.</span><span class='python1-identifier'>path</span><span class='python1-symbol'>.</span><span class='python1-identifier'>join</span><span class='python1-symbol'>(</span><span class='python1-identifier'>base_dir</span><span class='python1-symbol'>,</span><span class='python1-string'>&quot;work&quot;)

</span><span class='python1-identifier'>torrent_cmd</span><span class='python1-space'> </span><span class='python1-symbol'>=</span><span class='python1-space'> </span><span class='python1-string'>&quot;enhanced-ctorrent&quot;
</span><span class='python1-identifier'>torrent_args</span><span class='python1-space'> </span><span class='python1-symbol'>=</span><span class='python1-space'> </span><span class='python1-string'>&quot;-S localhost:2780 &gt;/dev/null &amp;&quot;

</span><span class='python1-reservedword'>def</span><span class='python1-space'> </span><span class='python1-identifier'>getTorrents</span><span class='python1-symbol'>(</span><span class='python1-identifier'>path</span><span class='python1-symbol'>):
</span><span class='python1-space'>    </span><span class='python1-identifier'>os</span><span class='python1-symbol'>.</span><span class='python1-identifier'>chdir</span><span class='python1-symbol'>(</span><span class='python1-identifier'>path</span><span class='python1-symbol'>)
</span><span class='python1-space'>    </span><span class='python1-identifier'>data</span><span class='python1-space'> </span><span class='python1-symbol'>=</span><span class='python1-space'> </span><span class='python1-identifier'>os</span><span class='python1-symbol'>.</span><span class='python1-identifier'>popen</span><span class='python1-symbol'>(</span><span class='python1-string'>&quot;ls -1 *.torrent&quot;</span><span class='python1-symbol'>).</span><span class='python1-identifier'>read</span><span class='python1-symbol'>()
</span><span class='python1-space'>    </span><span class='python1-identifier'>torrents</span><span class='python1-space'> </span><span class='python1-symbol'>=</span><span class='python1-space'> </span><span class='python1-identifier'>data</span><span class='python1-symbol'>.</span><span class='python1-identifier'>split</span><span class='python1-symbol'>(</span><span class='python1-string'>&quot;\n&quot;</span><span class='python1-symbol'>)[:-</span><span class='python1-number'>1</span><span class='python1-symbol'>]
</span><span class='python1-space'>    </span><span class='python1-reservedword'>for</span><span class='python1-space'> </span><span class='python1-identifier'>i</span><span class='python1-space'> </span><span class='python1-reservedword'>in</span><span class='python1-space'> </span><span class='python1-non-reservedkeyword'>range</span><span class='python1-symbol'>(</span><span class='python1-non-reservedkeyword'>len</span><span class='python1-symbol'>(</span><span class='python1-identifier'>torrents</span><span class='python1-symbol'>)):
</span><span class='python1-space'>        </span><span class='python1-identifier'>torrents</span><span class='python1-symbol'>[</span><span class='python1-identifier'>i</span><span class='python1-symbol'>]</span><span class='python1-space'> </span><span class='python1-symbol'>=</span><span class='python1-space'> </span><span class='python1-identifier'>os</span><span class='python1-symbol'>.</span><span class='python1-identifier'>path</span><span class='python1-symbol'>.</span><span class='python1-identifier'>join</span><span class='python1-symbol'>(</span><span class='python1-identifier'>path</span><span class='python1-symbol'>,</span><span class='python1-space'> </span><span class='python1-identifier'>torrents</span><span class='python1-symbol'>[</span><span class='python1-identifier'>i</span><span class='python1-symbol'>])
</span><span class='python1-space'>    </span><span class='python1-reservedword'>return</span><span class='python1-space'> </span><span class='python1-identifier'>torrents

</span><span class='python1-reservedword'>def</span><span class='python1-space'> </span><span class='python1-identifier'>getNewTorrents</span><span class='python1-symbol'>(</span><span class='python1-identifier'>path</span><span class='python1-symbol'>,</span><span class='python1-space'> </span><span class='python1-identifier'>oldTorrents</span><span class='python1-symbol'>):
</span><span class='python1-space'>    </span><span class='python1-identifier'>allTorrents</span><span class='python1-space'> </span><span class='python1-symbol'>=</span><span class='python1-space'> </span><span class='python1-identifier'>getTorrents</span><span class='python1-symbol'>(</span><span class='python1-identifier'>path</span><span class='python1-symbol'>)
</span><span class='python1-space'>    </span><span class='python1-identifier'>newTorrents</span><span class='python1-space'> </span><span class='python1-symbol'>=</span><span class='python1-space'> </span><span class='python1-symbol'>[]
</span><span class='python1-space'>    </span><span class='python1-reservedword'>for</span><span class='python1-space'> </span><span class='python1-identifier'>each</span><span class='python1-space'> </span><span class='python1-reservedword'>in</span><span class='python1-space'> </span><span class='python1-identifier'>allTorrents</span><span class='python1-symbol'>:
</span><span class='python1-space'>        </span><span class='python1-reservedword'>if</span><span class='python1-space'> </span><span class='python1-identifier'>each</span><span class='python1-space'> </span><span class='python1-reservedword'>not</span><span class='python1-space'> </span><span class='python1-reservedword'>in</span><span class='python1-space'> </span><span class='python1-identifier'>oldTorrents</span><span class='python1-symbol'>:
</span><span class='python1-space'>            </span><span class='python1-identifier'>newTorrents</span><span class='python1-symbol'>.</span><span class='python1-identifier'>append</span><span class='python1-symbol'>(</span><span class='python1-identifier'>each</span><span class='python1-symbol'>)
</span><span class='python1-space'>    </span><span class='python1-reservedword'>return</span><span class='python1-space'> </span><span class='python1-identifier'>newTorrents

</span><span class='python1-reservedword'>def</span><span class='python1-space'> </span><span class='python1-identifier'>startTorrent</span><span class='python1-symbol'>(</span><span class='python1-identifier'>torrent</span><span class='python1-symbol'>):
</span><span class='python1-space'>    </span><span class='python1-identifier'>os</span><span class='python1-symbol'>.</span><span class='python1-identifier'>chdir</span><span class='python1-symbol'>(</span><span class='python1-identifier'>work_dir</span><span class='python1-symbol'>)
</span><span class='python1-space'>    </span><span class='python1-identifier'>cmd</span><span class='python1-space'> </span><span class='python1-symbol'>=</span><span class='python1-space'> </span><span class='python1-string'>&quot; &quot;</span><span class='python1-symbol'>.</span><span class='python1-identifier'>join</span><span class='python1-symbol'>((</span><span class='python1-identifier'>torrent_cmd</span><span class='python1-symbol'>,</span><span class='python1-space'> </span><span class='python1-identifier'>os</span><span class='python1-symbol'>.</span><span class='python1-identifier'>path</span><span class='python1-symbol'>.</span><span class='python1-identifier'>join</span><span class='python1-symbol'>(</span><span class='python1-identifier'>source_dir</span><span class='python1-symbol'>,</span><span class='python1-identifier'>torrent</span><span class='python1-symbol'>),</span><span class='python1-space'> </span><span class='python1-identifier'>torrent_args</span><span class='python1-symbol'>))
</span><span class='python1-space'>    </span><span class='python1-identifier'>os</span><span class='python1-symbol'>.</span><span class='python1-identifier'>system</span><span class='python1-symbol'>(</span><span class='python1-identifier'>cmd</span><span class='python1-symbol'>)
</span><span class='python1-space'>    </span><span class='python1-comment'>#print cmd

</span><span class='python1-reservedword'>def</span><span class='python1-space'> </span><span class='python1-identifier'>getRunningTorrents</span><span class='python1-symbol'>():
</span><span class='python1-space'>    </span><span class='python1-comment'># do'h, ps on nslu2 is broken.  Had to install procps.
</span><span class='python1-space'>    </span><span class='python1-identifier'>cmd</span><span class='python1-space'> </span><span class='python1-symbol'>=</span><span class='python1-space'> </span><span class='python1-string'>&quot;ps axwwo command | grep enhanced&quot;
</span><span class='python1-space'>    </span><span class='python1-identifier'>data</span><span class='python1-space'> </span><span class='python1-symbol'>=</span><span class='python1-space'> </span><span class='python1-identifier'>os</span><span class='python1-symbol'>.</span><span class='python1-identifier'>popen</span><span class='python1-symbol'>(</span><span class='python1-identifier'>cmd</span><span class='python1-symbol'>).</span><span class='python1-identifier'>readlines</span><span class='python1-symbol'>()
</span><span class='python1-space'>    </span><span class='python1-identifier'>runningTorrents</span><span class='python1-space'> </span><span class='python1-symbol'>=</span><span class='python1-space'> </span><span class='python1-symbol'>[]
</span><span class='python1-space'>    </span><span class='python1-reservedword'>for</span><span class='python1-space'> </span><span class='python1-identifier'>each</span><span class='python1-space'> </span><span class='python1-reservedword'>in</span><span class='python1-space'> </span><span class='python1-identifier'>data</span><span class='python1-symbol'>:
</span><span class='python1-space'>        </span><span class='python1-reservedword'>if</span><span class='python1-space'> </span><span class='python1-identifier'>each</span><span class='python1-symbol'>.</span><span class='python1-identifier'>split</span><span class='python1-symbol'>()[</span><span class='python1-number'>0</span><span class='python1-symbol'>]</span><span class='python1-space'> </span><span class='python1-symbol'>==</span><span class='python1-space'> </span><span class='python1-string'>&quot;enhanced-ctorrent&quot;</span><span class='python1-symbol'>:
</span><span class='python1-space'>           </span><span class='python1-identifier'>runningTorrents</span><span class='python1-symbol'>.</span><span class='python1-identifier'>append</span><span class='python1-symbol'>(</span><span class='python1-identifier'>each</span><span class='python1-symbol'>.</span><span class='python1-identifier'>split</span><span class='python1-symbol'>()[</span><span class='python1-number'>1</span><span class='python1-symbol'>])
</span><span class='python1-space'>    </span><span class='python1-reservedword'>return</span><span class='python1-space'> </span><span class='python1-identifier'>runningTorrents

</span><span class='python1-reservedword'>def</span><span class='python1-space'> </span><span class='python1-identifier'>startIdleTorrents</span><span class='python1-symbol'>():
</span><span class='python1-space'>    </span><span class='python1-identifier'>torrents</span><span class='python1-space'> </span><span class='python1-symbol'>=</span><span class='python1-space'> </span><span class='python1-identifier'>getNewTorrents</span><span class='python1-symbol'>(</span><span class='python1-identifier'>source_dir</span><span class='python1-symbol'>,</span><span class='python1-space'> </span><span class='python1-identifier'>getRunningTorrents</span><span class='python1-symbol'>())

</span><span class='python1-space'>    </span><span class='python1-comment'># since we get some CPU usage issues on starting several torrents at the same time,
</span><span class='python1-space'>    </span><span class='python1-comment'># just start the first torrent in the list.  Then we can rely on the idea we'll
</span><span class='python1-space'>    </span><span class='python1-comment'># be called by a cron-job or something to start the next.
</span><span class='python1-space'>
    </span><span class='python1-identifier'>startTorrent</span><span class='python1-symbol'>(</span><span class='python1-identifier'>torrents</span><span class='python1-symbol'>[</span><span class='python1-number'>0</span><span class='python1-symbol'>])

</span><span class='python1-reservedword'>if</span><span class='python1-space'> </span><span class='python1-systemfunctionsandvariables'>__name__</span><span class='python1-space'> </span><span class='python1-symbol'>==</span><span class='python1-space'> </span><span class='python1-string'>&quot;__main__&quot;</span><span class='python1-symbol'>:
</span><span class='python1-space'>   </span><span class='python1-identifier'>startIdleTorrents</span><span class='python1-symbol'>()
</span>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://schinckel.net/2006/09/01/autotorrentpy/feed/</wfw:commentRss>
		</item>
		<item>
		<title>autoTorrent</title>
		<link>http://schinckel.net/2006/08/31/autotorrent/</link>
		<comments>http://schinckel.net/2006/08/31/autotorrent/#comments</comments>
		<pubDate>Thu, 31 Aug 2006 13:19:25 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[Languages]]></category>

		<category><![CDATA[NSLU2]]></category>

		<guid isPermaLink="false">http://schinckel.blogsome.com/2006/08/31/autotorrent/</guid>
		<description><![CDATA[I&#8217;ve started using BitTorrent, or rather a couple of different clients, since I got ADSL, but what I really want is a fire-and-forget client for the NSLU2.
This is what should happen.

Monitor a certain directory.  If a .torrent file is added to this directory, add it to the queue.
When a torrent is complete, move the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started using BitTorrent, or rather a couple of different clients, since I got ADSL, but what I really want is a fire-and-forget client for the NSLU2.</p>
<p>This is what should happen.</p>
<ul>
<li>Monitor a certain directory.  If a .torrent file is added to this directory, add it to the queue.</li>
<li>When a torrent is complete, move the file(s) to a completed directory.  Send an email, or something.  Perhaps add an item to an RSS feed.  Remove the .torrent from the download queue, but keep it seeded.</li>
<li>When neither of the other computers is turned on, download the next .torrent in the queue.</li>
<li>If the download total of the running torrents is less than 80% of the available, start the next .torrent in the queue.</li>
<li>If more than one .torrent is running and bandwidth use is greater than 90%, then stop the lowest in the queue that is running.</li>
<li>Have a nice web interface that allows for changing the queue order.</li>
</ul>
<p>There is a torrent ipkg for nslu2, which I&#8217;ve downloaded, but I may write my own.  It&#8217;s show day tomorrow, so that might be a good start.</p>
]]></content:encoded>
			<wfw:commentRss>http://schinckel.net/2006/08/31/autotorrent/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Downloading NSLU2 Firmware 6.8 Woes</title>
		<link>http://schinckel.net/2006/08/19/downloading-nslu2-firmware-68-woes/</link>
		<comments>http://schinckel.net/2006/08/19/downloading-nslu2-firmware-68-woes/#comments</comments>
		<pubDate>Sat, 19 Aug 2006 09:50:23 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[NSLU2]]></category>

		<category><![CDATA[Rants and Raves]]></category>

		<guid isPermaLink="false">http://schinckel.blogsome.com/2006/08/19/downloading-nslu2-firmware-68-woes/</guid>
		<description><![CDATA[It&#8217;s really cool that people are still working on the Firmware upgrades for the NSLU2, and I went to upgrade the firmware today to try to get MySQL working properly.  The file is 6.5 MB, and my download keeps failing at 3 MB.  And I can&#8217;t resume, as I can&#8217;t find the actual [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s really cool that people are still working on the Firmware upgrades for the NSLU2, and I went to upgrade the firmware today to try to get MySQL working properly.  The file is 6.5 MB, and my download keeps failing at 3 MB.  And I can&#8217;t resume, as I can&#8217;t find the actual address - they&#8217;ve done a pretty good job of making that hard to find.</p>
<p>Annoying&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://schinckel.net/2006/08/19/downloading-nslu2-firmware-68-woes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>NSLU2</title>
		<link>http://schinckel.net/2005/11/21/nslu2/</link>
		<comments>http://schinckel.net/2005/11/21/nslu2/#comments</comments>
		<pubDate>Mon, 21 Nov 2005 07:24:37 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[Blogging]]></category>

		<category><![CDATA[NSLU2]]></category>

		<guid isPermaLink="false">http://schinckel.blogsome.com/2005/11/21/nslu2/</guid>
		<description><![CDATA[I have a Google Alert for the string &#8220;NSLU2&#8243;.  Just now, I had a new alert, and my NSLU2 category has just made it into the top 20&#8230;
Yay!
]]></description>
			<content:encoded><![CDATA[<p>I have a Google Alert for the string &#8220;NSLU2&#8243;.  Just now, I had a new alert, and my NSLU2 category has just made it into the top 20&#8230;</p>
<p>Yay!</p>
]]></content:encoded>
			<wfw:commentRss>http://schinckel.net/2005/11/21/nslu2/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
