<?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>Avi :) &#187; linux</title>
	<atom:link href="http://blog.avi.co/wp/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.avi.co</link>
	<description>Open Source Software Hippy and all-round pedant</description>
	<lastBuildDate>Mon, 07 Jun 2010 14:34:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Massive dumps with MySQL</title>
		<link>http://blog.avi.co/wp/massive-dumps-with-mysql/</link>
		<comments>http://blog.avi.co/wp/massive-dumps-with-mysql/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 23:47:03 +0000</pubDate>
		<dc:creator>Avi</dc:creator>
				<category><![CDATA[Geekery]]></category>
		<category><![CDATA[dump]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plaintextiscool]]></category>

		<guid isPermaLink="false">http://aviswebsite.co.uk/?p=450</guid>
		<description><![CDATA[hurr. *insert FLUSH TABLES joke here*
I have a 2.5GB sql dump to import to my MySQL server. MySQL doesn't like me giving it work to do, and the box it's running on only has 3GB of memory. So, I stumbled across bigdump, which is brilliant. It's a PHP script that splits massive SQL dumps into [...]]]></description>
			<content:encoded><![CDATA[<p>hurr. *insert <tt>FLUSH TABLES</tt> joke here*</p>
<p>I have a 2.5GB sql dump to import to my MySQL server. MySQL doesn't like me giving it work to do, and the box it's running on only has 3GB of memory. So, I stumbled across <a href="http://www.ozerov.de/bigdump.php">bigdump</a>, which is brilliant. It's a PHP script that splits massive SQL dumps into smaller statements, and runs them one at a time against the server. Always the way: 10 lines into duct-taping together something to do the job for you, you find that someone else has done it rather elegantly.<sup>1</sup></p>
<p>In short, we extract the directory to a publicly http-accessible location, stick the sql dump there and tell it to go.</p>
<p>In long, installation is approximately as follows:</p>
<pre class="bash">avi@jup-linux2:~$ <span style="color: #7a0874; font-weight: bold;">cd</span> www
avi@jup-linux2:~/www$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> bigdump
avi@jup-linux2:~/www$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">777</span> bigdump
avi@jup-linux2:~/www$ <span style="color: #7a0874; font-weight: bold;">cd</span> bigdump/
avi@jup-linux2:~/www$ <span style="color: #c20cb9; font-weight: bold;">wget</span> -q http://www.ozerov.de/bigdump.<span style="color: #c20cb9; font-weight: bold;">zip</span>
avi@jup-linux2:~/www$ <span style="color: #c20cb9; font-weight: bold;">unzip</span> bigdump.<span style="color: #c20cb9; font-weight: bold;">zip</span>
avi@jup-linux2:~/www/bigdump$ <span style="color: #c20cb9; font-weight: bold;">ls</span>
bigdump.php  bigdump.<span style="color: #c20cb9; font-weight: bold;">zip</span></pre>
<p>Where <tt>~/www</tt> is my apache UserDir (i.e. when I visit <tt>http://localhost/~avi</tt>, i see the contents of <tt>~/www</tt>). We need permissions to execute PHP scripts in this dir, too (which I have already). We also need to give everyone permissions to do everything - don't do this on the internet!<sup>2</sup></p>
<p>Configuration involves editing <tt>bigdump.php</tt> with the hostname of our MySQL server, the name of the DB we want to manipulate and our credentials. The following is lines 40-45 of mine:</p>
<pre class="php"><span style="color: #808080; font-style: italic;">// Database configuration</span>
&nbsp;
<span style="color: #0000ff;">$db_server</span>   = <span style="color: #ff0000;">'localhost'</span>;
<span style="color: #0000ff;">$db_name</span>     = <span style="color: #ff0000;">'KBDB'</span>;
<span style="color: #0000ff;">$db_username</span> = <span style="color: #ff0000;">'kbox'</span>;
<span style="color: #0000ff;">$db_password</span> = <span style="color: #ff0000;">'imnottellingyou'</span>;</pre>
<p>Finally, we need to give it a dump to process. For dumps of less than 2Mb<sup>3</sup>, we can upload through the web browser, else we need to upload or link our sql dump to the same directory as bigdump:</p>
<pre class="bash">avi@jup-linux2:~/www/bigdump$ <span style="color: #c20cb9; font-weight: bold;">ln</span> -s /home/avi/kbox/kbox_dbdata ./dump.sql</pre>
<p>Now, we visit the php page through a web browser, and get a pretty interface:</p>
<p><a href="http://aviswebsite.co.uk/wordpress/wp-content/uploads/massive-dumps-with-mysql/bigdump.png"><img src="http://aviswebsite.co.uk/wordpress/wp-content/uploads/massive-dumps-with-mysql/bigdump-150x150.png" alt="" title="Bigdump UI" width="150" height="150" class="aligncenter size-thumbnail wp-image-460" /></a></p>
<p>BigDump lists all the files in its working directory, and for any that are SQL dumps provides a 'Start Import' link. To import one of them, click the link and wait.</p>
<ol class="footnotes"><li id="footnote_0_450" class="footnote">Yes, you Perl people, it's in PHP. But it's not written by me. So on balance turns out more elegant.</li><li id="footnote_1_450" class="footnote">Those permissions aside - anyone can execute whatever SQL they like with your credentials through this page. Seriously, not on the internet!</li><li id="footnote_2_450" class="footnote">Or whatever's smaller out of <tt>upload_max_filesize</tt> and <tt>post_max_size</tt> in your <tt>php.ini</tt></li></ol>]]></content:encoded>
			<wfw:commentRss>http://blog.avi.co/wp/massive-dumps-with-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generating Fluxbox menus for VNC (Vinagre) connections</title>
		<link>http://blog.avi.co/wp/generating-fluxbox-menus-for-vnc-connection/</link>
		<comments>http://blog.avi.co/wp/generating-fluxbox-menus-for-vnc-connection/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 10:05:23 +0000</pubDate>
		<dc:creator>Avi</dc:creator>
				<category><![CDATA[Geekery]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[fluxbox]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[vinagre]]></category>
		<category><![CDATA[vnc]]></category>

		<guid isPermaLink="false">http://aviswebsite.co.uk/?p=505</guid>
		<description><![CDATA[One of the lovely things about Fluxbox is the text-driven menu. One of the nice things about Vinagre (Gnome's VNC client) is the xml-based bookmarks file. Here's a handy script to create a Fluxbox submenu out of your Vinagre bookmarks:
&#160;
#! /usr/bin/perl
&#160;
use strict;
use warnings;
use XML::Simple;
my $HOME = $ENV&#123; HOME &#125;;
&#160;
my $bookmarks_file = &#34;$HOME/.local/share/vinagre/vinagre-bookmarks.xml&#34;;
my $menu_file = &#34;$HOME/.fluxbox/vnc_menu&#34;;
&#160;
my [...]]]></description>
			<content:encoded><![CDATA[<p>One of the lovely things about <a href="http://www.fluxbox.org/">Fluxbox</a> is the text-driven menu. One of the nice things about <a href="http://projects.gnome.org/vinagre/">Vinagre</a> (Gnome's VNC client) is the xml-based bookmarks file. Here's a handy script to create a Fluxbox submenu out of your Vinagre bookmarks:</p>
<pre class="perl">&nbsp;
<span style="color: #808080; font-style: italic;">#! /usr/bin/perl</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> strict;
<span style="color: #000000; font-weight: bold;">use</span> warnings;
<span style="color: #000000; font-weight: bold;">use</span> XML::<span style="color: #006600;">Simple</span>;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$HOME</span> = <span style="color: #0000ff;">$ENV</span><span style="color: #66cc66;">&#123;</span> HOME <span style="color: #66cc66;">&#125;</span>;
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$bookmarks_file</span> = <span style="color: #ff0000;">&quot;$HOME/.local/share/vinagre/vinagre-bookmarks.xml&quot;</span>;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$menu_file</span> = <span style="color: #ff0000;">&quot;$HOME/.fluxbox/vnc_menu&quot;</span>;
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$xml</span> = <span style="color: #000000; font-weight: bold;">new</span> XML::<span style="color: #006600;">Simple</span> <span style="color: #66cc66;">&#40;</span>KeyAttr=&gt;<span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$data</span> = <span style="color: #0000ff;">$xml</span>-&gt;<span style="color: #006600;">XMLin</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;$bookmarks_file&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<a href="http://perldoc.perl.org/functions/open.html"><span style="color: #000066;">open</span></a><span style="color: #66cc66;">&#40;</span>MENU, <span style="color: #ff0000;">&quot;&gt;$menu_file&quot;</span><span style="color: #66cc66;">&#41;</span> || <a href="http://perldoc.perl.org/functions/die.html"><span style="color: #000066;">die</span></a> <span style="color: #ff0000;">&quot;Error opening <span style="color: #000099; font-weight: bold;">\$</span>menu_file: $menu_file $0&quot;</span>;
&nbsp;
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> MENU <span style="color: #ff0000;">&quot;[begin]<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$b</span><span style="color: #66cc66;">&#40;</span>@<span style="color: #66cc66;">&#123;</span><span style="color: #0000ff;">$data</span>-&gt;<span style="color: #66cc66;">&#123;</span><span style="color: #ff0000;">&quot;item&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
	<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> MENU <span style="color: #ff0000;">&quot;[exec] ($b-&gt;{name}) {vinagre $b-&gt;{host}:$b-&gt;{port}}<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
<span style="color: #66cc66;">&#125;</span>
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> MENU <span style="color: #ff0000;">&quot;[end]<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
<a href="http://perldoc.perl.org/functions/close.html"><span style="color: #000066;">close</span></a> MENU;
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.avi.co/wp/generating-fluxbox-menus-for-vnc-connection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP error on fresh install of PHPWiki: Non-static method _PearDbPassUser::_PearDbPassUser() cannot be called statically</title>
		<link>http://blog.avi.co/wp/phpwiki-error-non-static-method-_peardbpassuser_peardbpassuser-cannot-be-called-statically/</link>
		<comments>http://blog.avi.co/wp/phpwiki-error-non-static-method-_peardbpassuser_peardbpassuser-cannot-be-called-statically/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 21:58:29 +0000</pubDate>
		<dc:creator>Avi</dc:creator>
				<category><![CDATA[Geekery]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://aviswebsite.co.uk/?p=278</guid>
		<description><![CDATA[I've just installed PHPWiki 1.3.14-4 from the debian repositories and out of the box I got the following message on trying to log in to it:
Fatal error: Non-static method _PearDbPassUser::_PearDbPassUser() cannot be called statically, assuming $this from incompatible context in /usr/share/phpwiki.bak.d/lib/WikiUserNew.php on line 1118
The problem appears to be that, as of PHP 5.something, you're not [...]]]></description>
			<content:encoded><![CDATA[<p>I've just installed PHPWiki 1.3.14-4 from the debian repositories and out of the box I got the following message on trying to log in to it:</p>
<pre>Fatal error: Non-static method _PearDbPassUser::_PearDbPassUser() cannot be called statically, assuming $this from incompatible context in /usr/share/phpwiki.bak.d/lib/WikiUserNew.php on line 1118</pre>
<p>The problem appears to be that, as of PHP 5.something, you're not allowed to have a function with the same name as a class. Apparently it's been a failure in E_STRICT mode for a while.</p>
<p>Anyway, the solution is to rename <tt>_PearDbPassUser()</tt> to something else, and then replace all calls to it with this new name.</p>
<p>I've done this and, so far, everything appears to work.</p>
<p>The function is defined in <tt>/usr/share/lib/phpwiki/lib/WikiUser/PearDb.php</tt>:</p>
<pre class="diff">&nbsp;
jup-linux2:/usr/share$ diff phpwiki.bak.d/lib/WikiUser/PearDb.php phpwiki/lib/WikiUser/PearDb.php
<span style="color: #440088;">18c18</span>
<span style="color: #991111;">&lt; function _PearDbPassUser<span style="">&#40;</span>$UserName='',$prefs=false<span style="">&#41;</span> <span style="">&#123;</span></span>
<span style="color: #888822;">---
<span style="color: #00b000;">&gt;     function _PearDbPassUserFoo<span style="">&#40;</span>$UserName='',$prefs=false<span style="">&#41;</span> <span style="">&#123;</span></span></span>
&nbsp;</pre>
<p>and is called in <tt>/usr/share/WikiUserNew.php</tt>:</p>
<pre class="diff">&nbsp;
jup-linux2:/usr/share$ diff phpwiki.bak.d/lib/WikiUserNew.php phpwiki/lib/WikiUserNew.php
<span style="color: #440088;">1118c1118</span>
<span style="color: #991111;">&lt; _PearDbPassUser::_PearDbPassUser<span style="">&#40;</span>$this-&gt;_userid, $this-&gt;_prefs<span style="">&#41;</span>;</span>
<span style="color: #888822;">---
<span style="color: #00b000;">&gt;                 _PearDbPassUser::_PearDbPassUserFoo<span style="">&#40;</span>$this-&gt;_userid, $this-&gt;_prefs<span style="">&#41;</span>;</span></span>
<span style="color: #440088;">1157c1157</span>
<span style="color: #991111;">&lt; _PearDbPassUser::_PearDbPassUser<span style="">&#40;</span>$this-&gt;_userid, $prefs<span style="">&#41;</span>;</span>
<span style="color: #888822;">---
<span style="color: #00b000;">&gt;                 _PearDbPassUser::_PearDbPassUserFoo<span style="">&#40;</span>$this-&gt;_userid, $prefs<span style="">&#41;</span>;</span></span>
<span style="color: #440088;">2120c2120</span>
<span style="color: #991111;">&lt; function PearDbUserPreferences <span style="">&#40;</span>$saved_prefs = false<span style="">&#41;</span> <span style="">&#123;</span></span>
<span style="color: #888822;">---
<span style="color: #00b000;">&gt;     function PearDbUserPreferencesFoo <span style="">&#40;</span>$saved_prefs = false<span style="">&#41;</span> <span style="">&#123;</span></span></span>
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.avi.co/wp/phpwiki-error-non-static-method-_peardbpassuser_peardbpassuser-cannot-be-called-statically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Munin plugins are really easy to write</title>
		<link>http://blog.avi.co/wp/munin-plugins-are-really-easy-to-write/</link>
		<comments>http://blog.avi.co/wp/munin-plugins-are-really-easy-to-write/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 13:36:19 +0000</pubDate>
		<dc:creator>Avi</dc:creator>
				<category><![CDATA[Geekery]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[munin]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://aviswebsite.co.uk/?p=200</guid>
		<description><![CDATA[Munin plugins basically need to output variable names and values, and a little bit of config. They're tremendously easy to write.
My plugin is mostly useless - it graphs the value returned by /dev/urandom, and the random constants from debian and dilbert. Current graph is here and the code is as follows:
#! /bin/bash
&#160;
case $1 in
  [...]]]></description>
			<content:encoded><![CDATA[<p>Munin plugins basically need to output variable names and values, and a little bit of config. They're tremendously easy to write.</p>
<p>My plugin is mostly useless - it graphs the value returned by /dev/urandom, and the random constants from <a href="http://xkcd.com/221/">debian</a> and <a href="http://www.random.org/analysis/dilbert.jpg">dilbert</a>. Current graph is <a href="http://aviswebsite.co.uk/munin/localdomain/localhost.localdomain-random-day.png">here</a> and the code is as follows:</p>
<pre class="bash"><span style="color: #808080; font-style: italic;">#! /bin/bash</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> $<span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">in</span>
        config<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #c20cb9; font-weight: bold;">cat</span> &lt; &lt; EOF
graph_category amusement
graph_title Random numbers
graph_vlabel value
debian.label debian
dilbert.label dilbert
urandom.label /dev/urandom
graph_scale no
EOF
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #007800;">urandom=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">cat</span> /dev/urandom | <span style="color: #c20cb9; font-weight: bold;">tr</span> -<span style="color: #c20cb9; font-weight: bold;">dc</span> <span style="color: #ff0000;">'0-9'</span> | <span style="color: #c20cb9; font-weight: bold;">head</span> -c2<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;urandom.value &quot;</span> <span style="color: #007800;">$urandom</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;debian.value 4&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;dilbert.value 9&quot;</span>
&nbsp;</pre>
<p>Munin's plugins live in <tt>/etc/munin/plugins/</tt>, most of which are symlinks to scripts in <tt>/usr/share/plugins/</tt>. On restart, munin-node rechecks the plugins directory and loads any new plugins.<br />
For a plugin called <tt>foo</tt>, munin-node will run <tt>foo configure</tt> first to get the configuration of the graph (which is passed to <tt>munin-graph</tt>), and then <tt>foo</tt>. For information as to graph configuration, see <a href="http://munin.projects.linpro.no/wiki/HowToWritePlugins#Muninpluginconfigcommand">here</a>.<br />
It takes about 15 mins of collection for it to start making a graph, and you'll get more data every 5mins thereafter.</p>
<p>The script itself is mostly self-explanatory, except for:</p>
<p>- The values and the labels are linked by what occurs before the dot. If you define <tt>foo.label</tt> in the config output, that is what will be used to label the number that comes after <tt>foo.value</tt> in the 'normal' output. The munin tutorial sort-of hints at this, but only uses one variable.</p>
<p>- Munin doesn't care what order the variables come out in, it uses the labels to determine who's who. Similarly, it doesn't seem particularly fussed as to which flavour of horizontal whitespace is used.</p>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.avi.co/wp/munin-plugins-are-really-easy-to-write/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>*buntu 9.10</title>
		<link>http://blog.avi.co/wp/buntu-9-10/</link>
		<comments>http://blog.avi.co/wp/buntu-9-10/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 13:34:10 +0000</pubDate>
		<dc:creator>Avi</dc:creator>
				<category><![CDATA[Geekery]]></category>
		<category><![CDATA[*buntu]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://aviswebsite.co.uk/wordpress/?p=23</guid>
		<description><![CDATA[It's out! Torrents here and here.
]]></description>
			<content:encoded><![CDATA[<p>It's out! Torrents <a href="http://aviswebsite.co.uk/ubuntu">here</a> and <a href="http://h1373931.stratoserver.net/~avi/torrents/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.avi.co/wp/buntu-9-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some notes from configuring rTorrent</title>
		<link>http://blog.avi.co/wp/some-notes-from-configuring-rtorrent/</link>
		<comments>http://blog.avi.co/wp/some-notes-from-configuring-rtorrent/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 22:53:16 +0000</pubDate>
		<dc:creator>Avi</dc:creator>
				<category><![CDATA[Geekery]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[torrent]]></category>

		<guid isPermaLink="false">http://aviswebsite.co.uk/wordpress/?p=28</guid>
		<description><![CDATA[In anticipation of the new *buntus tomorrow, I'm configuring one of my servers as a torrent node for it, and for reasons unknown I've settled on rtorrent which is in the repos. The documentation is a little lacking (but does tell you how to do things like download torrents. Read it), and the most popular [...]]]></description>
			<content:encoded><![CDATA[<p>In anticipation of the new *buntus tomorrow, I'm configuring one of my servers as a torrent node for it, and for reasons unknown I've settled on <tt>rtorrent</tt> which is in the repos. The <a href="http://libtorrent.rakshasa.no/wiki/RTorrentUserGuide">documentation</a> is a little lacking (but does tell you how to do things like download torrents. Read it), and the <a href="http://kmandla.wordpress.com/2007/05/02/howto-use-rtorrent-like-a-pro/">most popular HowTo</a> is quite verbose.</p>
<p><tt>~/.torrentrc</tt> is the config file for rtorrent. The one from the Debian repos puts an example in <tt>/usr/share/doc/rtorrent/examples/rtorrent.rc</tt>, and apparently so does *buntu. You probably want to edit this. Path variables can be absolute or relative, and are generally relative and inside <tt>./</tt> by default. I've two directories, <tt>~/torrents/</tt> for the torrents and <tt>~/.rtorrent/</tt> for rtorrent's working directories.<br />
Some variables I found to be handy:</p>
<pre class="perl">scgi_local=<span style="color: #ff0000;">&quot;~/.rtorrent/socket/rpc.socket&quot;</span></pre>
<p>Defines the socket file for scgi communication, which you only really need if you want external stats from it. I did, but haven't yet got round to using them.</p>
<pre class="perl">session = ~/.rtorrent/sessio</pre>
<p>The session directory, which lets multiple instances of rtorrent remember where they left off. Cannot be shared between instances.</p>
<p><strong>Scheduling</strong><br />
rtorrent supports command scheduling, the syntax for which is occasionally documented. The syntax is approximately:</p>
<pre class="perl">schedule = a,b,c,d</pre>
<p>Where<br />
<tt>a</tt>: What you want to call this scheduled command<sup>1</sup>.<br />
<tt>b</tt>: How many seconds after rtorrent starts you want to first execute the command.<br />
<tt>c</tt>: The interval for subsequent executions.<br />
<tt>d</tt>: the command you want to execute.<br />
This comes in most handy for auotmatically starting torrents in a directory:</p>
<pre class="perl">schedule = watch_directory,<span style="color: #cc66cc;">5</span>,<span style="color: #cc66cc;">5</span>,load_start=~/torrents/*.torrent</pre>
<p>Exactly what that does is left as an excercise to the reader (the example .rtorrent.rc explains, too).</p>
<ol class="footnotes"><li id="footnote_0_28" class="footnote">I don't know where this comes in handy later on</li></ol>]]></content:encoded>
			<wfw:commentRss>http://blog.avi.co/wp/some-notes-from-configuring-rtorrent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing user list on Ubuntu Karmic log-on screen</title>
		<link>http://blog.avi.co/wp/removing-user-list-on-ubuntu-karmic-log-on-screen/</link>
		<comments>http://blog.avi.co/wp/removing-user-list-on-ubuntu-karmic-log-on-screen/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 20:36:34 +0000</pubDate>
		<dc:creator>Avi</dc:creator>
				<category><![CDATA[Geekery]]></category>
		<category><![CDATA[*buntu]]></category>
		<category><![CDATA[donotwant]]></category>
		<category><![CDATA[gdm]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://aviswebsite.co.uk/?p=181</guid>
		<description><![CDATA[This doesn't work any more
Install XDM instead. ;)

Karmic ships with a new version of GDM (2.28) which is rewritten, and by default presents a list of usernames, in much the same way as XP does by default. Lots of people dislike this. It's also currently lacking a graphical config tool (it is in beta...).
To change [...]]]></description>
			<content:encoded><![CDATA[<p><center><strong><a href="https://bugs.launchpad.net/ubuntu/+source/gdm/+bug/464957">This doesn't work any more</a></strong><br />
Install XDM instead. ;)<br />
</center></p>
<p>Karmic ships with a new version of GDM (2.28) which is rewritten, and by default presents a list of usernames, in much the same way as XP does by default. Lots of people dislike this. It's also currently lacking a graphical config tool (it <i>is</i> in beta...).</p>
<p>To change it, run this:</p>
<pre class="bash">&nbsp;
<span style="color: #808080; font-style: italic;"># gdm gconftool<span style="color: #000000;">-2</span> --<span style="color: #000000; font-weight: bold;">set</span> --<span style="color: #7a0874; font-weight: bold;">type</span> boolean /apps/gdm/simple-greeter/disable_user_list true</span>
&nbsp;</pre>
<p>This, I feel, is non-ideal since it just replaces the users list with a 'log in' Window and button which is completely superfluous - if I'm at the logon screen, I probably do want to log onto the PC, and the most logical thing for it to do is to be already asking for my username, ideally with that text box in focus. The previous login screen was pretty much ideal, and I'm not sure what benefit the new one has.</p>
<p>Source: <a href="https://answers.launchpad.net/ubuntu/+source/gdm/+question/86506">https://answers.launchpad.net/ubuntu/+source/gdm/+question/86506</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.avi.co/wp/removing-user-list-on-ubuntu-karmic-log-on-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mknod</title>
		<link>http://blog.avi.co/wp/mknod/</link>
		<comments>http://blog.avi.co/wp/mknod/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 13:54:31 +0000</pubDate>
		<dc:creator>Avi</dc:creator>
				<category><![CDATA[Geekery]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://aviswebsite.co.uk/blog/?p=711</guid>
		<description><![CDATA[mknod has eluded me for a while. I've had to use it a couple of times, in rushed following of tutorials, and I know it's used to create the device files under /dev. It's not the preferred way of doing it (which is mkdev), and it's not the normal way (udev and/or devfs tend to [...]]]></description>
			<content:encoded><![CDATA[<p><tt>mknod</tt> has eluded me for a while. I've had to use it a couple of times, in rushed following of tutorials, and I know it's used to create the device files under <tt>/dev</tt>. It's not the preferred way of doing it (which is <tt>mkdev</tt>), and it's not the normal way (<tt>udev</tt> and/or <tt>devfs</tt> tend to do a good job of doing it automatically). </p>
<p>It needs to be told of the device type (easy enough: block, character or terminal) and be supplied with a major and a minor number. </p>
<p>That's the bit that's confused me for a while - major and minor numbers - but I've just decided to actually read beyond the man page and find this.</p>
<p>Much as I'd half-expected some peculiar mathematical relationship, it turns out to just be the way the list of devices known to the kernel is ordered. </p>
<p>It's split into groups, each group is sequentially numbered (the major number), and for each group, every item in it is also sequentially numbered (the minor numbers). </p>
<p>Here's a handy snippet from mine, showing major number 83, and the listing of minor numbers 0,1,2 and 15:</p>
<pre>83 char        Matrox mga_vid video driver
                 0 = /dev/mga_vid0      1st video card
                 1 = /dev/mga_vid1      2nd video card
                 2 = /dev/mga_vid2      3rd video card
                  ...
                15 = /dev/mga_vid15     16th video card</pre>
<p>And that's basically it. If I install a second matrox mga video card and don't run anything to automatically create the device for me, I need to run <tt>mknod /dev/mga_vid1 c 83 1</tt>. The name I supply is not dictated by the file - I could have called it <tt>/dev/secod_matrox_video_card</tt> if I'd really wanted to - the other parameters must be correct to identify the device, the name supplied is for the user to dictate what the device should be called. It's wise to name it in such a way as to avoid clashes, though.</p>
<p>In order to get a copy of the file, under Debian running a 2.4.37 kernel, having installed <tt>linux-source-2.4.37</tt>, you'll find <tt>/usr/src/linux-source-2.4.37.tar.bz2</tt> which you can extract to get at the kernel source. In here, in the <tt>Documentation</tt> directory is a file called <tt>devices.txt</tt>, which lists the devices known to your kernel and their numbers. </p>
<p>The current version of the list is maintained <a hrefl="http://www.lanana.org/docs/device-list/">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.avi.co/wp/mknod/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why I use Linux</title>
		<link>http://blog.avi.co/wp/why-i-use-linux/</link>
		<comments>http://blog.avi.co/wp/why-i-use-linux/#comments</comments>
		<pubDate>Sun, 10 May 2009 22:29:59 +0000</pubDate>
		<dc:creator>Avi</dc:creator>
				<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Tracts]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[proselytism]]></category>

		<guid isPermaLink="false">http://aviswebsite.co.uk/?p=242</guid>
		<description><![CDATA[This is one of those things that's always difficult to explain. The bits of Linux that I miss on other platforms are not things that you immediately see as being of particular importance. The best example of this is the freedom - why would I care that I'm free to do as I please with [...]]]></description>
			<content:encoded><![CDATA[<p>This is one of those things that's always difficult to explain. The bits of Linux that I miss on other platforms are not things that you immediately see as being of particular importance. The best example of this is the freedom - why would I care that I'm free to do as I please with this software? I've no idea, if I'm perfectly honest. But what follows is a list of the things I miss the most when I find myself on something else (most often WinXP):</p>
<p><strong>Customisation</strong><br />
With very little in the way of limitations, I can make it look and behave how I want it to. Most obviously, I can customise the taskbars and notification areas, add monitoring icons, change colours, configure keyboard shortcuts and the like. But I can also tear out bits of the system that I don't particularly want, optionally replacing them with options I prefer. Or just use daft keyboard mappings where every key acts as if it was three to the left or something.<br />
The important bit is that my Linux PC works in the way I want it to. When I'm on a Windows box, I must work in the way it wants me to.</p>
<p><strong>Two Clipboards</strong><br />
In xorg, the most prolific window server on Linux, you have two clipboards. One is the 'normal' one which you manually insert stuff into through &lt;ctrl&gt;+&lt;c&gt; or &lt;ctrl&gt;+&lt;shift&gt;+&lt;del&gt; and pasted with &lt;ctrl&gt;+&lt;v&gt; or &lt;ctrl&gt;+&lt;shift&gt;+&lt;ins&gt;. The other is automatically populated by highlighting text with the mouse cursor and pasted with the middle mouse click. It's a fantastically quick way of copying and pasting.</p>
<p><strong>Multiple Workspaces</strong><br />
If you've used them, you're probably nodding in agreement, if you haven't, it's difficult to explain. The best way I can think of is to imagine a KVM switch, but where all the monitors you switch between are those on a multi-monitor display. If anyone's got any better ways of explaining it, please let me know so I can stick it here.</p>
<p><strong>Always On Top</strong><br />
I know Windows Task Manager can do it, but that's about the only window I've never wanted to keep on top of the others.</p>
<p><strong>Text Based</strong><br />
Linux is mostly text-based in its configuration, and is generally blessed with at least three sets of wonderfully powerful text processing tools (the shell, Perl and Python). This means that batch changes to configurations are really easy, as is exporting particular bits of configuration and importing them to somewhere else. Also, the fact that the shell is as powerful as the clicky interface means that pretty much anything you might want to do can be automated. Which brings me on to:</p>
<p><strong>Automation</strong><br />
Windows in particular seems to have a bit of an aversion to automating things. I don't know if it's just the Windows environments I've found myself in, the fact that most tasks are substantially easier (if more time consuming) with a mouse than on the command line, or because the batch file setup is crap, but there seems to be something about a Windows environment that lends itself very well to the pointless replication of manual work.<br />
Linux practically forces you to automate things. Typing commands into a shell, while easy and quick, isn't particularly fun. And it's so obviously easily automatable that, well, you might as well.</p>
<p><strong>Repositories</strong><br />
If I want a gopher client, I open up my repository client, search for 'gopher client', read the descriptions of what it shows up, download what looks best and start using it.<br />
This software has come from the same place as the operating system, so I can trust that it is not malware, that the description is accurate and that it will be compatible with my system. It will also be upgraded when I update the system.<br />
It's easier, more secure, faster and more convenient than the Windows way of trawling the net and trying to work out on what basis to judge the trustworthiness of a particular application. Though if I'm that way inclined, the repository system doesn't stop me doing that.</p>
<p><strong>Hardware Compatability</strong><br />
Maybe I'm just unlucky, but most times I've installed Windows, I've then spent a couple of hours visiting manufacturer's websites trying to find drivers for my hardware so I can get anything at all working. Sometimes on a fresh install I have a working network, but generally I've needed to find graphics, wifi, usb, audio and various chipset drivers at the very least, quite often ethernet ones, too. It's not helped by the fact that Windows is apparently completely unaware of what hardware's in the box until you've installed the correct driver for it, which makes working out which driver you need more a game of chance than a methodical process.</p>
<p><strong>Modular and integrated</strong><br />
The unix philosophy is for software to be small, simple and have a single well-served purpose. This is generally adhered to in the free software world, mostly because it's a pretty good approach.<br />
For example, I have aspell installed. It's a spellchecker and it checks spelling. It does so in my web browser, mail client, IM client and office suite. If i typed in anything else, it'd probably work there, too. This means I only ever need to add words to the dictionary once, and it'll be considered valid everywhere. It also means that the people who develop my web browser and mail client can concentrate on developing good web browsers and mail clients, and leave the spell checking up to the people who develop spell checkers.</p>
<p><strong>The Community and its support</strong><br />
It's massive. Or, perhaps rather, they're massive. And useful. I'm on a number of mailing lists and forums dedicated to sharing tips and helping people with free software. If I'm having trouble with anything Linux based, there're three or four pools of several thousand enthusiasts who are not only likely to know or be able to find an answer, but will probably enjoy doing it. And they run across the spectra of difficulty, use cases and user stupidity.<br />
I've spent a long time trying to find similar for Windows, but there appears to be a jump from free home user level support to pay-for business use support.</p>
<p><strong>No Marketing Department</strong><br />
One fantastically huge advantage of free software is that there's no incentive to make it popular. In contrast to commercial software where the aim to sell as many licenses as possible, the only possible aim of free software is to produce the best software possible. Any large free software project has this aim, since there is no other way to be popular.<br />
This is brilliant, for several reasons. Firstly, the software tends to turn out pretty good. Secondly, marketing teams don't get anywhere near it, so design and feature decisions tend to be founded in reality. There's no 3d accelerated solitaire (to my knowledge), but there's the above list of features. Thirdly, upgrades are non-compulsory. You'll never have version 1.4 stop working because 1.5 is out. You might well find that security updates are no longer released and so you're advised to upgrade, but if you *really* like 1.4 you can hire a developer to patch the security holes and develop it in the direction you want it developed.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.avi.co/wp/why-i-use-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Synergy to share a keyboard and mouse across PCs</title>
		<link>http://blog.avi.co/wp/using-synergy-to-share-a-keyboard-and-mouse-across-pcs/</link>
		<comments>http://blog.avi.co/wp/using-synergy-to-share-a-keyboard-and-mouse-across-pcs/#comments</comments>
		<pubDate>Sat, 09 May 2009 21:10:50 +0000</pubDate>
		<dc:creator>Avi</dc:creator>
				<category><![CDATA[Geekery]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[synergy]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://aviswebsite.co.uk/?p=348</guid>
		<description><![CDATA[Synergy is a really neat way of using multiple computers at the same time, like a more convenient KVM switch (you do need to be physically close to all of them). 
It basically allows you to have a monitor for each PC on your desk, and one keyboard and mouse with which to monitor them. [...]]]></description>
			<content:encoded><![CDATA[<p>Synergy is a really neat way of using multiple computers at the same time, like a more convenient KVM switch (you do need to be physically close to all of them). </p>
<p>It basically allows you to have a monitor for each PC on your desk, and one keyboard and mouse with which to monitor them. Switching between PCs involves just moving the mouse pointer onto the relevant screen. It uses 'screens' rather than monitors, so you don't need to let it know if you've got a complicated multi-monitor setup on a host (or even if you add or remove monitors from one), and it allows for having screens of different sizes and for, say, the bottom half of one screen to line up with the top half of the next.</p>
<p>It's a server/client model - you have one server box into which you plug the keyboard and mouse. The rest connect over the network to it (in cleartext, don't do this where you don't trust the network).</p>
<p>I have two hosts. My work laptop is running Windows XP and has an external monitor plugged in to it. My testing PC is running Debian testing and is a PC proper. Here's my desk:<br />
<a href="http://aviswebsite.co.uk/wordpress/wp-content/uploads/using-synergy-to-share-a-keyboard-and-mouse-across-pcs/desk1.jpg"><img src="http://aviswebsite.co.uk/wordpress/wp-content/uploads/using-synergy-to-share-a-keyboard-and-mouse-across-pcs/desk1-300x225.jpg" alt="desk" title="desk" class="aligncenter size-medium wp-image-386" /></a><br />
<tt>jup-linux2</tt> is the left monitor (attached to the PC to its left, running Debian), <tt>jup-rmt07</tt> is the laptop on the right, which is also attached to the Sony screen in the middle. Since I take the laptop home with me occasionally, <tt>jup-linux2</tt> is configured as a server, <tt>jup-rmt07</tt> as the client (less to unplug).</p>
<p>Synergy is in the debian repositories, so it's just an <tt>apt-get install synergy</tt>. This provides two binaries, <tt>/usr/bin/synergyc</tt> and <tt>/usr/bin/synergys</tt>, which are the client and the server respectively.<br />
To install it in Windows, you'll want to grab it from their <a href="http://sourceforge.net/projects/synergy2/files/">Sourceforge page</a></p>
<p><strong>Configuring and starting the server</strong><br />
So, having installed, we can configure! The configuration file can be arbitrarily named, mine's cunningly called <tt>~/.synergy.conf</tt> and appears verbatim at the bottom of this. Synergy's really rather configurable, but I've never found much need for more than the basics, so I've an incredibly simple setup.</p>
<p>First, we define some 'screens'. Here we can also configure optons for screens, especially as regards the transference of caps-lock and num-lock statuses. I've no special requests, so I just list the hosts whose screens I want Synergy to manage:</p>
<pre>section: screens
	jup-rmt07:
	jup-linux2:
end</pre>
<p>Second, we define the links. For each monitor, we state what is at any edge of it. This is used to decide where to put the mouse pointer on leaving the screen, so it needs to be done in both directions - the fact that <tt>jup-linux2</tt> is to the left of <tt>jup-rmt07</tt> does not imply to synergy that <tt>jup-rmt07</tt> is to the right of <tt>jup-linux2</tt>:</p>
<pre>section: links
jup-rmt07:
	left = jup-linux2
jup-linux2:
	right = jup-rmt07
end </pre>
<p>If I have two screens at different heights, I can tell synergy that the top 30% of <tt>jup-linux2</tt> lines up with the bottom 40% of <tt>jup-rmt07</tt>, for example:</p>
<pre>jup-linux2
	right(70-100) = jup-linux2(0-40)
jup-rmt07
	left(0-40) = jup-rmt07(70-100)</pre>
<p>Again, you always always <strong>always</strong> need to define the screen in both directions. The file is parsed by synergy to see what to do on leaving that particular screen - when you're in jup-rmt07 and move towards the left of the screen, it's only going to do anything if there's a <tt>left</tt> defined for that screen, irrespective of how many rights point there.<br />
If my screens are above and below each other, <tt>up</tt> and <tt>down</tt> are used. A screen can have as many other screens round it as you like, by assigning percentages of edges to different screens.</p>
<p>Configuring the server under Windows involves a different process to use the same principles. Essentially, you build the same text file as above, but in a clicky gui. It's a little odd, but quite simple.</p>
<p><a href="http://aviswebsite.co.uk/wordpress/wp-content/uploads/using-synergy-to-share-a-keyboard-and-mouse-across-pcs/synergy-win-server1.PNG"><img src="http://aviswebsite.co.uk/wordpress/wp-content/uploads/using-synergy-to-share-a-keyboard-and-mouse-across-pcs/synergy-win-server1-150x150.PNG" alt="configuring Synergy server under Windows" title="synergy-win-server" width="150" height="150" class="size-thumbnail wp-image-370" /></a></p>
<p>To start the synergy server, we now run</p>
<pre class="bash">synergys --config ~/.synergy.conf</pre>
<p>Replacing '~/.synergy.conf' with the path to wherever the config file is saved.</p>
<p><strong>Configuring and starting the clients</strong></p>
<p>So, we have a server. Now, clients.<br />
On Windows, synergy is only one executable, so we start that, select the 'Use another computer's shared keyboard and mouse (client)' option, stick the server's hostname or IP in the box, and click 'start'.<br />
If you have a *nix client, the command to connect to a server at <tt>jup-rmt07</tt> is <tt>synergyc jup-rmt07</tt>. <tt>synergyc</tt> provides a few options for changing the behaviour.</p>
<p><strong>Starting Synergy automatically</strong><br />
Finally, I want them to start automagically on boot/login. For the linux host, this is relatively easy, add the following to your crontab:</p>
<pre class="bash">@reboot synergys --config ~/.synergy.conf</pre>
<p>And it'll be started on boot.<br />
To start it under Windows, click the 'AutoStart' button. This will let you configure it to start it on login or, if you have the requisite permissions, start on boot.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.avi.co/wp/using-synergy-to-share-a-keyboard-and-mouse-across-pcs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
