<?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>Thinking Digitally &#187; Unix</title>
	<atom:link href="http://thinkingdigitally.com/category/unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://thinkingdigitally.com</link>
	<description>programming for the fun of it</description>
	<lastBuildDate>Tue, 09 Feb 2010 04:55:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Upgrading to RTorrent 0.8.5</title>
		<link>http://thinkingdigitally.com/archive/upgrading-to-rtorrent-0-8-5/</link>
		<comments>http://thinkingdigitally.com/archive/upgrading-to-rtorrent-0-8-5/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 07:15:10 +0000</pubDate>
		<dc:creator>Rob Olson</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[bittorrent]]></category>
		<category><![CDATA[dtach]]></category>
		<category><![CDATA[libtorrent]]></category>
		<category><![CDATA[rtorrent]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://thinkingdigitally.com/?p=208</guid>
		<description><![CDATA[Recently I went through the process of upgrading rtorrent-0.8.2 and libtorrent-0.12.2 on my Ubuntu 9.04 box to the latest versions, rtorrent-0.8.5 and libtorrent-0.12.5. Unfortunately what should be a simple process was rather complicated because the developer has not yet updated the project&#8217;s website to reflect all of the changes that have been made to the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I went through the process of upgrading rtorrent-0.8.2 and libtorrent-0.12.2 on my Ubuntu 9.04 box to the latest versions, rtorrent-0.8.5 and libtorrent-0.12.5. Unfortunately what should be a simple process was rather complicated because the developer has not yet updated the <a href="http://libtorrent.rakshasa.no/">project&#8217;s website</a> to reflect all of the changes that have been made to the configuration options in version 0.8.4 (which was released nearly a year ago!). After dozens of Google searches I was able track down the information I needed. In addition, I have added notes on hiccups I ran into when compiling RTorrent from source and getting RTorrent to work with dtach.</p>

<p><span id="more-208"></span></p>

<h3>Compiling</h3>

<p>To compile LibTorrent I needed to install the <code>libsigc++-2.0-dev</code> package. To compile RTorrent I needed to install <code>libcurl4-openssl-dev</code>. Both can be installed via apt-get:</p>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sudo apt-get install libsigc++-2.0-dev libcurl4-openssl-dev</pre></div></div>


<h3>Updating .rtorrent.rc</h3>

<h4>The New Ratio Syntax</h4>

<p>This actually has been documented to some extent on the <a href="http://libtorrent.rakshasa.no/wiki/RTorrentRatioHandling">RTorrentRatioHandling</a> wiki page. Unfortunately &#8220;The basics&#8221; make little sense to me. Here is what I did:</p>

<p>Remove my old schedule command to stop torrents when they reach a certain ratio:</p>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">schedule = ratio,60,60,&quot;stop_on_ratio=100&quot;</pre></div></div>


<p>And replace it with:</p>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># Enable the default ratio group.
ratio.enable=
&nbsp;
# Change the limits
ratio.min.set=100
#ratio.max.set=300
#ratio.upload.set=20M</pre></div></div>


<p>My desired behavior is for RTorrent to close a torrent when its ratio reaches 1.0 which is why I am only setting ratio.min.set.</p>

<p>I am extremely curious why the developer decided to make the configuration command to enable ratios <code>ratio.enable=</code>. The equals sign on the end of the line makes the option feel very incomplete and does not make sense.</p>

<h4>Deprecated on_&#42; commands</h4>

<p>All of the on_* commands are now deprecated.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> This includes on_start, on_stop, on_finished, and on_erase. I use an on_finished command to move finished torrents to a separate directory which had to be changed.</p>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># deprecated on_finished command
# on_finished = move_complete,&quot;d.set_directory=~/torrents/finished/ ;execute=mv,-u,$d.get_base_path=,~/torrents/finished/&quot;
&nbsp;
# Equivalent on_finished for rtorrent &gt; 0.8.4
system.method.set_key = event.download.finished,move_complete,&quot;d.set_directory=~/torrents/finished/ ;execute=mv,-u,$d.get_base_path=,~/torrents/finished/&quot;</pre></div></div>


<h3>DTach</h3>

<p>On a whim I decided to switch to running RTorrent with <a href="http://dtach.sourceforge.net/">dtach</a> instead of inside GNU Screen. My hope is that dtach will perform a little better. Unfortunately when I opened RTorrent with dtach my arrow keys changed my download threshold instead of navigating the list of torrents. A fix that I found is to specify <code>TERM=linux</code> when launching dtach.<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup></p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">env</span> <span style="color: #007800;">TERM</span>=linux dtach <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>rtorrent.dtach rtorrent</pre></div></div>


<p>Once again I find it why this works to be a mystery but no explanation was given.</p>

<h3>Rant</h3>

<p>I have a lot of respect for the creator of RTorrent/LibTorrent. He has created an excellent Bittorrent client and backend that I have been happily been using for a couple years. However, I think it is very poor form that he released new updates that change the configuration interface without properly documenting the upgrade path on the website. This was frustrating enough that I tried to update the LibTorrent trac but public accounts are not allowed, blocking my attempt to help.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p><a href="http://rakshasa.no/pipermail/libtorrent-devel/2009-June/002176.html">Deprecated on_&#42; commands</a>&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p><a href="http://libtorrent.rakshasa.no/ticket/192">DTach TERM=linux fix</a>&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://thinkingdigitally.com/archive/upgrading-to-rtorrent-0-8-5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HOWTO: Setup SSH keys</title>
		<link>http://thinkingdigitally.com/archive/howto-setup-ssh-keys/</link>
		<comments>http://thinkingdigitally.com/archive/howto-setup-ssh-keys/#comments</comments>
		<pubDate>Fri, 14 Dec 2007 23:11:59 +0000</pubDate>
		<dc:creator>Rob Olson</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[dsa]]></category>
		<category><![CDATA[keychain]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://thinkingdigitally.com/archive/howto-setup-ssh-keys/</guid>
		<description><![CDATA[Setting up SSH keys is an extremely useful and fairly easy thing to do yet I delayed doing it for over a year because I never found any simple straightforward instructions for how to do it. Here are my straightforward, no nonsense instructions for setting up password-less ssh remote login. Note: In these instructions I [...]]]></description>
			<content:encoded><![CDATA[<p>Setting up <code>SSH</code> keys is an extremely useful and fairly easy thing to do yet I delayed doing it for over a year because I never found any simple straightforward instructions for how to do it.</p>

<p>Here are my straightforward, no nonsense instructions for setting up password-less <code>ssh</code> remote login.</p>

<p><span id="more-20"></span></p>

<p>Note: In these instructions I refer to a local computer and a remote computer. The local computer is your personal computer or the computer your are running <code>ssh</code> from and the remote computer is the computer you are connecting to. If you are connecting to a server that is the remote computer.</p>

<p>Begin by running <strong>ssh-keygen -t dsa</strong> on your local computer. The output will look something like this. When it asks for a passphrase enter something but remember what it is as you will have to enter it again. Later we will find out how to save the passphrase using keychain so we do not have to enter it every time.</p>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/Users/rob/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/rob/.ssh/id_dsa.
Your public key has been saved in /Users/rob/.ssh/id_dsa.pub.
The key fingerprint is:
e1:9c:c3:55:9a:ab:5f:7d:db:0c:bf:02:67:cd:ac:ce rob@athena.local</pre></div></div>


<p>This will create two files, <code>~/.ssh/id_dsa</code> and <code>~/.ssh/id_dsa.pub</code>. Next we need to append id&#95;dsa.pub to <code>~/.ssh/authorized_keys2</code> on the remote computer</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> .ssh<span style="color: #000000; font-weight: bold;">/</span>id_dsa.pub <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">ssh</span> remote_computer_ip <span style="color: #ff0000;">&quot;cat &gt;&gt; .ssh/authorized_keys2&quot;</span></pre></div></div>


<p>Insert the IP address of the remote computer and run the command (it is all one line). Once that is done the <code>ssh</code> keys are now setup. Test it by connecting to the remote computer.</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">ssh</span> username<span style="color: #000000; font-weight: bold;">@</span>remote-computer
Enter passphrase <span style="color: #000000; font-weight: bold;">for</span> key <span style="color: #ff0000;">'/home/rob/.ssh/id_dsa'</span>:</pre></div></div>


<p>After entering the correct passphrase the remote computer will finish the login process.</p>

<p>At this point we are no better off then we were before. Entering a phasephrase is often more work than a password. To save us the work of entering our passphrase each time we can use Keychain programs. There are keychain programs for OS X and Linux.</p>

<p><strong>Keychain on Mac OS X</strong>: OS X 10.5 will store <code>ssh</code> passphrases in the OS X Keychain the first time you attempt to login.</p>

<p><strong>Keychain on Linux</strong>: On linux we need to install a program similarly named &#8216;keychain&#8217;. Seek out and install keychain from your distribution&#8217;s repositories. After it is installed we need to add the following lines to <code>~/.bash_profile</code>.</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">keychain id_dsa
<span style="color: #7a0874; font-weight: bold;">source</span> ~<span style="color: #000000; font-weight: bold;">/</span>.keychain<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$HOSTNAME</span>-sh</pre></div></div>


<p>Now test it by reopening terminal and keychain should run. Once your passphrase is stored in keychain you will be able to login to the remote computer without being prompted for a passphrase.</p>

<p><strong>Note about RSA:</strong> You may have seen RSA keys used instead of DSA keys. RSA encryption is used by version 1 of the <code>ssh</code> protocol whereas DSA is used by version 2. OpenSSH is capable of using both DSA and RSA keys so you may use whichever you like.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkingdigitally.com/archive/howto-setup-ssh-keys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
