<?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>FW.Hardijzer.nl</title>
	<atom:link href="http://fw.hardijzer.nl/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://fw.hardijzer.nl</link>
	<description>My little corner of the giant intarwebz!</description>
	<lastBuildDate>Thu, 19 Aug 2010 10:54:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Fixing backslashes in SVN from windows</title>
		<link>http://fw.hardijzer.nl/?p=100</link>
		<comments>http://fw.hardijzer.nl/?p=100#comments</comments>
		<pubDate>Thu, 19 Aug 2010 10:54:24 +0000</pubDate>
		<dc:creator>Frans-Willem Hardijzer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://fw.hardijzer.nl/?p=100</guid>
		<description><![CDATA[At Iminent someone did something horrible:
The trunk pretty much contained:

file a
dir b

dir c

file d


file e



And someone ,on presumably a mac or a *nix machine, added the directory &#8220;b\c&#8221;. In *nix, where the SVN server was run, this was a perfectly valid directory name. On Windows, what most of us run on, the backslash is a [...]]]></description>
			<content:encoded><![CDATA[<p>At Iminent someone did something horrible:<br />
The trunk pretty much contained:</p>
<ul>
<li>file a</li>
<li>dir b
<ul>
<li>dir c
<ul>
<li>file d</li>
</ul>
</li>
<li>file e</li>
</ul>
</li>
</ul>
<p>And someone ,on presumably a mac or a *nix machine, added the directory &#8220;b\c&#8221;. In *nix, where the SVN server was run, this was a perfectly valid directory name. On Windows, what most of us run on, the backslash is a directory seperator.</p>
<p>So when TortoiseSVN tries update or check-out, it fails to create a directory like that. Even worse, when you try to delete the offending directory from the &#8220;Browse Repository&#8221;, it actually interpreted the \ as a directory seperator, so while you wanted to delete directory &#8220;b\c&#8221;, it ended up deleting directory c in b. My boss had fixed this by completely removing the trunk, and putting in a new one from his working copy, but this way you lose all history of the files, and any changes that he had made to the working set were not visible anywhere.</p>
<p>I fixed it by doing the following:</p>
<ul>
<li>First, you branch from the Trunk revision just before those faulty directories were added.</li>
<li>Then you carefully merge all changes from trunk from that point to HEAD to that branch, while excluding all revisions that add those offending directories.</li>
<li>Then you branch the current trunk to a branch like &#8220;MessedUpTrunkBackup&#8221; using TortoiseSVN Repository browser (You can&#8217;t do it by checkout + branch, as checkout fails)</li>
<li>Then you delete the current trunk, again using the repository browser.</li>
<li>Then you copy the clean branch you made earlier to trunk, using either the repository browser or by using normal branching methods.</li>
</ul>
<p>Tada: You now have a new trunk, without the offending changes, but with full history on all files, and you can safely issue a checkout, or an update on an earlier working copy <img src='http://fw.hardijzer.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I am aware it&#8217;s probably possible to cleanly revert those changes from a *nix box, but we didn&#8217;t have any available at the moment, so I had to do it this way.</p>
]]></content:encoded>
			<wfw:commentRss>http://fw.hardijzer.nl/?feed=rss2&amp;p=100</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>V8 crashing with &#8216;Uncaught RangeError: Maximum call stack size exceeded&#8217;</title>
		<link>http://fw.hardijzer.nl/?p=97</link>
		<comments>http://fw.hardijzer.nl/?p=97#comments</comments>
		<pubDate>Wed, 14 Jul 2010 23:30:19 +0000</pubDate>
		<dc:creator>Frans-Willem Hardijzer</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://fw.hardijzer.nl/?p=97</guid>
		<description><![CDATA[While working with V8 in another process, it kept crashing at initialization with the message &#8216;Uncaught RangeError: Maximum call stack size exceeded&#8217;. I wasn&#8217;t doing anything big, just initialization.
After about 3 hour of debugging, I found out what was wrong. Normally, V8 will assume that you have no more than 512KB of stack space. To [...]]]></description>
			<content:encoded><![CDATA[<p>While working with V8 in another process, it kept crashing at initialization with the message &#8216;Uncaught RangeError: Maximum call stack size exceeded&#8217;. I wasn&#8217;t doing anything big, just initialization.<br />
After about 3 hour of debugging, I found out what was wrong. Normally, V8 will assume that you have no more than 512KB of stack space. To prevent stack overflows, it will take a stack address, substract 512kb from it, and remember that address. If it ever passes that address, it&#8217;ll throw a RangeError.</p>
<p>The problem lies in the fact that the program I was working with had a stack somewhere around 0&#215;60000 or 384kb. V8 then substracts 512 from that, but instead of getting a nice stack-boundary, it ends up with an incredibly big number due to integer underflow. The next time it checks the stack, it compares the stack address (still somewhere around 0&#215;60000) with it&#8217;s calculated stack limited (which, due to the underflow, is about 0xFFFE0000), and assumes it has a stack overflow.</p>
<p>To fix this, I had to manually set the stack limit. Basically, the following code takes a random stack address, divides it by 2, and uses that as the lower-limit to the stack:</p>
<pre class="brush: cpp;">
	v8::ResourceConstraints rc;
	rc.set_stack_limit((uint32_t *)(((uint32_t)&amp;rc)/2));
	v8::SetResourceConstraints(&amp;rc);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://fw.hardijzer.nl/?feed=rss2&amp;p=97</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Live Messenger APIs</title>
		<link>http://fw.hardijzer.nl/?p=93</link>
		<comments>http://fw.hardijzer.nl/?p=93#comments</comments>
		<pubDate>Tue, 06 Jul 2010 14:05:43 +0000</pubDate>
		<dc:creator>Frans-Willem Hardijzer</dc:creator>
				<category><![CDATA[Messenger]]></category>

		<guid isPermaLink="false">http://fw.hardijzer.nl/?p=93</guid>
		<description><![CDATA[While the old messenger APIs have been steadily crumbling the past few versions, and the latest WLM10 beta having made it nearly useless, I was amazed to find several new APIs.
One of them is the &#8220;LivePlatform&#8221; API, which seems to be what messenger is using to retrieve the contact list and social news.
I don&#8217;t have [...]]]></description>
			<content:encoded><![CDATA[<p>While the old messenger APIs have been steadily crumbling the past few versions, and the latest WLM10 beta having made it nearly useless, I was amazed to find several new APIs.<br />
One of them is the &#8220;LivePlatform&#8221; API, which seems to be what messenger is using to retrieve the contact list and social news.<br />
I don&#8217;t have time to investigate this fully, but I did get to put together a small demo. To try it, create a new console application in C#, add C:\Program Files\Windows Live\Contacts\LivePlatform.dll as a reference, and put in the following code in Main:</p>
<pre class="brush: csharp;">
 LivePlatform.LivePlatformFactory factory=new LivePlatform.LivePlatformFactory();
            LivePlatform.ILiveIdentityCollection ids = factory.IdentityService.CachedIdentities;
            System.Console.WriteLine(&quot;Cached identities&quot;);
            for (int i = 0; i &lt; ids.Count; i++)
            {
                LivePlatform.ILiveIdentity id = ids[i];
                if (id.HasPassword)
                    System.Console.WriteLine(&quot;\t&quot;+id.Username);
            }
            System.Console.Write(&quot;Username: &quot;);
            string szUsername = System.Console.ReadLine();
            LivePlatform.ILiveIdentity found = null;
            for (int i = 0; i &lt; ids.Count; i++)
            {
                LivePlatform.ILiveIdentity id = ids[i];
                if (id.HasPassword &amp;&amp; id.Username.ToLower().Equals(szUsername.ToLower()))
                {
                    found = id;
                    break;
                }
            }
            string szPassword = &quot;&quot;;
            if (found == null)
            {
                System.Console.Write(&quot;Password: &quot;);
                szPassword = System.Console.ReadLine();
            }
            platform=(found==null)?factory.CreateEx(szUsername,szPassword):factory.Create(found);
            platform.Config[&quot;BlockingSignin&quot;] = true; //Don't set this to make Signin non-blocking. You'll have to wire up events to listen for OnReady before you do anything, though.
            platform.Signin(null);
            System.Console.WriteLine(&quot;Full name: &quot;+platform.Me.FullName);
            LivePlatform.ILiveObjectCollection query = platform.Query(&quot;type(contact)&quot;);
            System.Console.WriteLine(String.Format(&quot;Contacts: {0}&quot;, query.Count));
            for (int c = 0; c &lt; query.Count; c++)
            {
                LivePlatform.ILiveObject obj = query[c];
                LivePlatform.ILiveContact contact = obj as LivePlatform.ILiveContact;
                System.Console.WriteLine(String.Format(&quot;{0} ({1})&quot;, contact.FullName,(contact.Emails.Count&gt;0)?contact.Emails[0].Address:&quot;none&quot;));
            }
            System.Console.WriteLine(&quot;Press enter to quit&quot;);
            System.Console.ReadLine();
</pre>
<p>It&#8217;ll print your full name, as well as your full contact list. Also note that if you added your facebook account, those contacts will show up too.<br />
Some other queries I saw when debugging messenger:</p>
<pre class="brush: plain;">
type(invite)
type(contact) and contacts:canHideFrom(true)
type(contact)
type(contact) and contacts:isHidingFrom(true) and contancts:canHideFrom(true)
type(contact)
type(circle)
type(category)
type(category) and contacts:isfavorite(true)
type(contact) and contacts:isonline(true)
type(category) and contacts:isfavorite(true)
</pre>
<p>I believe that hooking this API in messenger might allow for some pretty cool tricks, for example something like BuddyFuse.</p>
<p>As a final note, I&#8217;d like to say that I&#8217;m posting this because I&#8217;m hoping more sharing might make the messenger community more like it once was. If you find out more about this API, or other new APIs, please be so kind to share them too so a new sharing eco-system might emerge. Thanks.</p>
<p>EDIT: Added cached identities.</p>
]]></content:encoded>
			<wfw:commentRss>http://fw.hardijzer.nl/?feed=rss2&amp;p=93</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CyanogenMod modded</title>
		<link>http://fw.hardijzer.nl/?p=90</link>
		<comments>http://fw.hardijzer.nl/?p=90#comments</comments>
		<pubDate>Tue, 27 Apr 2010 00:48:23 +0000</pubDate>
		<dc:creator>Frans-Willem Hardijzer</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://fw.hardijzer.nl/?p=90</guid>
		<description><![CDATA[For my Nexus One, I&#8217;ve been trying a few new ROMs. One that is supposedly very good is CyanogenMod, and I personally kinda like it.
One downside however, is that the power widget colors for features turned on have been changed to an ugly light blue-ish color, that completely mismatches with any other android user interface [...]]]></description>
			<content:encoded><![CDATA[<p>For my Nexus One, I&#8217;ve been trying a few new ROMs. One that is supposedly very good is CyanogenMod, and I personally kinda like it.<br />
One downside however, is that the power widget colors for features turned on have been changed to an ugly light blue-ish color, that completely mismatches with any other android user interface parts. So I did what any respectable tinkerer would do, and changed them back to green. Here&#8217;s how I did it, hoping these instructions might help other people with the same or related problems. Note that all the tools I uesd should be easy to find using google <img src='http://fw.hardijzer.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Apparently, the power widget is in Settings.apk. This file also contains a lot of other stuff, and not suprisingly the settings dialogs are among those. Seeing as CyanogenMod adds quite a bit to the settings dialogs, simply putting back a stock Settings.apk is not an option.<br />
So instead, we should change something inside of Settings.apk. This is what I did to get the Settings.apk (and back it up) using the Android SDK:<br />
<code><br />
adb remount<br />
adb shell<br />
cd /system/app<br />
cp Settings.apk Settings.bak<br />
exit<br />
adb pull /system/app/Settings.apk Settings.zip<br />
</code><br />
Then I opened Settings.zip with winrar, and browsed around. I found the files needed in res/drawable-hdpi under filenames appwidget_settings_ind_on_?.9.png and appwidget_settings_ind_mid_?.9.png (where ? is c, r and l).<br />
My first attempt was simply to change the colors using GIMP, but that messed up the scaling of the pictures.<br />
To fix that, I used a program called tweakpng, and removed all PNG chunks not in the original file, and copied the one chunk that the new file didn&#8217;t have from the old file.<br />
This targets the scaling issues, but somehow I still had some weird blue lines through the images.<br />
Instead of turning it to white as I wanted, I figured the normal Android green would be sufficient too. So I set out to get it from a stock ROM.<br />
I found the stock Nexus ROM, and found the system.img. Apparently it&#8217;s a YAFFS2 filesystem, and after some googling, I found a tool unyaffs (needed to compile that on a linux box) to extract it. As said before I couldn&#8217;t just take the Settings.apk from there, so instead I renamed it to Settings_orig.zip, and with winrar moved the files I found earlier from the original into the modified zip file.<br />
Then I used<br />
<code><br />
adb push Settings.zip /system/app/Settings.apk<br />
</code><br />
to push it back onto my device.<br />
After re-adding the widget, the colors were green again <img src='http://fw.hardijzer.nl/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://fw.hardijzer.nl/?feed=rss2&amp;p=90</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compiling V8? Do not use Python x64!</title>
		<link>http://fw.hardijzer.nl/?p=85</link>
		<comments>http://fw.hardijzer.nl/?p=85#comments</comments>
		<pubDate>Wed, 06 Jan 2010 16:36:47 +0000</pubDate>
		<dc:creator>Frans-Willem Hardijzer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[scons]]></category>
		<category><![CDATA[v8]]></category>

		<guid isPermaLink="false">http://fw.hardijzer.nl/?p=85</guid>
		<description><![CDATA[When compiling Google V8 on Windows, do not use an AMD64 version of Python.
Firstly, the scons installer will not function, as it can&#8217;t find a python version in the registry.
Secondly, even if you just install scons manually, the V8 SConstruct file will fail. Because the return value from platform.machine() is now AMD64, the GuessArchitecture function [...]]]></description>
			<content:encoded><![CDATA[<p>When compiling Google V8 on Windows, do not use an AMD64 version of Python.<br />
Firstly, the scons installer will not function, as it can&#8217;t find a python version in the registry.<br />
Secondly, even if you just install scons manually, the V8 SConstruct file will fail. Because the return value from platform.machine() is now AMD64, the GuessArchitecture function in V8&#8217;s build script will not recognize a valid architecture, and the entire thing will fail.<br />
If you just uninstall Python, and re-install an x86 version, everything will function fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://fw.hardijzer.nl/?feed=rss2&amp;p=85</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My rtorrent setup</title>
		<link>http://fw.hardijzer.nl/?p=73</link>
		<comments>http://fw.hardijzer.nl/?p=73#comments</comments>
		<pubDate>Tue, 28 Jul 2009 17:15:31 +0000</pubDate>
		<dc:creator>Frans-Willem Hardijzer</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://fw.hardijzer.nl/?p=73</guid>
		<description><![CDATA[I hate leaving my main desktop turned on at night. I&#8217;m pretty sure it has something to do with the fact that it&#8217;s: a) noisy, b) in the same room I sleep in, and I: c) can&#8217;t sleep with a lot of noise or light in my room. This is why I have a seperate [...]]]></description>
			<content:encoded><![CDATA[<p>I hate leaving my main desktop turned on at night. I&#8217;m pretty sure it has something to do with the fact that it&#8217;s: a) noisy, b) in the same room I sleep in, and I: c) can&#8217;t sleep with a lot of noise or light in my room. This is why I have a seperate computer (without monitor that is) in another room that does all the stuff I&#8217;d want to be doing at night. It used to record from the TV channel, but dutch television sucks when it comes to good series, so a while ago I put a torrent client on there. Here&#8217;s a description of my old setup, and how I set it up today.<br />
<span id="more-73"></span><br />
Originally it worked like this: I had several directories where FlexGet or I myself would dump torrent files. All these directories were listed in rtorrent as watch directories, with each a seperate directory they got moved to when finished. This worked pretty well, but it had some shortcomings:</p>
<ul>
<li>It never cleaned up the torrent files, so at this point I had well over 200 .torrent files that I really no longer needed, but still existed on the drive.</li>
<li>I only had some directory for &#8220;general&#8221; torrents that I could manually deposit torrents in. This way games, linux distro&#8217;s, movies, everything I manually downloaded ended up in the same directory.</li>
<li>rtorrent never actually erased any of the torrents. It stopped seeding at a point, but it would still exist in the overview. Because of this the rtorrent overview was a mess, and the only way to really make any sense out of it was to look at the &#8220;Incomplete&#8221; tab only.</li>
<li>If I wanted to add a new RSS feed with a seperate directory, I had to adjust bot the flexget config and the rtorrent config, and restart rtorrent.</li>
</ul>
<p>Now, as tvrss shut down, and I needed to reconfigure a few things, so I figured I&#8217;d better completely re-do the setup. What I came up with were a few PHP scripts that would fire on several rtorrent events and do all the hard work. Here&#8217;s my current setup:</p>
<ul>
<li>/media/tb/.rtorrent/data/: this directory holds all the data that rtorrent downloads or has downloaded. Incomplete files are actually in here, complete files will be symlinks to their final destination(s)</li>
<li>/media/tb/.rtorrent/incoming/: This is the directory that holds all completed files</li>
<li>/media/tb/.rtorrent/session/: rtorrent session info</li>
<li>/media/tb/.rtorrent/torrentdump/: This is where I can dump torrents for manual downloading. Files will end up in /media/tb/.rtorrent/incoming/Dump. It also works with recursive dirs: all torrents in /media/tb/.rtorrent/torrentdump/A/B/C will be downloaded to /media/tb/.rtorrent/incoming/Dump/A/B/C.</li>
<li>/media/tb/.rtorrent/torrents/: This holds the torrents actually being downloaded, as well as a .info file for each torrent holding information on what should happen with it after it&#8217;s completed.</li>
<li>/media/tb/.rtorrent/scandump.sh: A PHP script that will scan the torrentdump directory, move the torrents to the torrents directory, and create .info files for each</li>
<li>/media/tb/.rtorrent/oncompleted.sh: A PHP script that will be fired by rtorrent once a download finishes. This will move the downloaded data to it&#8217;s destination directory, leave a symlink in the data directory, fix up permissions, and remove the torrent and info file.</li>
<li>/media/tb/.rtorrent/rtorrent.rc: rtorrent config file.</li>
<li>/media/tb/Incoming: symlink to /media/tb/.rtorrent/incoming</li>
<li>/media/tb/TorrentDump: symlink to /media/tb/.rtorrent/torrentdump</li>
</ul>
<p>Let&#8217;s start with scandump.sh:</p>
<pre class="brush: php;">
#!/usr/bin/php
&lt;?
$suffix=&quot;.torrent&quot;;

function scan($directory,$outputpath,&amp;$todo) {
	$d=opendir($directory);
	if ($d!==FALSE) {
		while (FALSE !== ($file=readdir($d))) {
			if ($file[0]==&quot;.&quot;) {
				//Ignore
			} else {
				$path=$directory.&quot;/&quot;.$file;
				if (is_dir($path)) {
					scan($path,$outputpath.&quot;/&quot;.$file,$todo);
				} else if (substr($path,strlen($path)-strlen($suffix))==$suffix) {
					$todo[$path]=Array(
						&quot;path&quot;=&gt;$outputpath
					);
				}
			}
		}
		closedir($d);
	}
}
$todo=Array();
scan(&quot;/media/tb/.rtorrent/torrentdump&quot;,&quot;Dump&quot;,$todo);
$torrentdir=&quot;/media/tb/.rtorrent/torrents/&quot;;
foreach ($todo as $torrent=&gt;$info) {
	$target=$torrentdir.basename($torrent);
	$infopath=$target.&quot;.info&quot;;
	file_put_contents($infopath,serialize($info));
	exec(&quot;mv -f &quot;.escapeshellarg($torrent).&quot; &quot;.escapeshellarg($target));
}
?&gt;
</pre>
<p>the &#8220;scan&#8221; function recursively scans a directory for torrent files. Every torrent file it finds will be put in the $todo array, together with the destination directory (and maybe other info). The main script will call this on /media/tb/.rtorrent/torrentdump, together with a &#8220;Dump&#8221; directory as output dir. After that, it will create a .info file for each torrent first (which contains the serialized data from the scan function), and then move the torrent to the torrents dir for rtorrent to download.</p>
<p>Next up: oncompleted.sh:</p>
<pre class="brush: php;">
#!/usr/bin/php
&lt;?
$torrent=$argv[1];
$infofile=$torrent.&quot;.info&quot;;
if (!file_exists($infofile))
	die(&quot;Nothing to do&quot;);
$datapath=$argv[2];
$info=unserialize(file_get_contents($infofile));
$downloaddir=&quot;/media/tb/.rtorrent/incoming/&quot;;
$newdir=$downloaddir;
$newpath=$newdir.&quot;/&quot;.$data;
$pathsplit=explode(&quot;/&quot;,$info[&quot;path&quot;]);
$newpath=$newdir;
foreach ($pathsplit as $pathbit) {
	//Make new directory (with chmod and all)
	$newdir.=&quot;/&quot;.$pathbit;
	exec(&quot;mkdir -m 777 &quot;.escapeshellarg($newdir));
}
//Move data
exec(&quot;mv -f &quot;.escapeshellarg($datapath).&quot; &quot;.escapeshellarg($newpath));
//Chmod data
exec(&quot;chmod -R 666 &quot;.escapeshellarg($newpath));
//Link old data to new data
exec(&quot;ln -s &quot;.escapeshellarg($newpath).&quot; &quot;.escapeshellarg($datapath));
//Remove torrent file (will have rtorrent remove symlink)
exec(&quot;rm -rf &quot;.escapeshellarg($torrent));
//Remove info file
exec(&quot;rm -rf &quot;.escapeshellarg($infofile));
?&gt;
</pre>
<p>This gets both the torrent file ($argv[1]), and the download path ($argv[2]). It tries to open the .info file, and then creates the needed directories (as read/write for everyone), moves the file, chmods it read/write, set up a symlink on the old location (for rtorrent to keep seeding), and removes the torrent and info files.</p>
<p>rtorrent config follows:</p>
<pre class="brush: bash;">
# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.

# Maximum and minimum number of peers to connect to per torrent.
#min_peers = 40
#max_peers = 100

# Same as above but for seeding completed torrents (-1 = same as downloading)
#min_peers_seed = 10
#max_peers_seed = 50

# Maximum number of simultanious uploads per torrent.
#max_uploads = 15

# Global upload and download rate in KiB. &quot;0&quot; for unlimited.
#download_rate = 0
#upload_rate = 0

# Default directory to save the downloaded torrents.
directory = /media/tb/.rtorrent/data/

# Default session directory. Make sure you don't run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
session = /media/tb/.rtorrent/session/

# Watch a directory for new torrents, and stop those that have been
# deleted.
#schedule = watch_directory,5,5,load_start=./watch/*.torrent
#schedule = untied_directory,5,5,stop_untied=

# Close torrents when diskspace is low.
#schedule = low_diskspace,5,60,close_low_diskspace=100M

# Stop torrents when reaching upload ratio in percent,
# when also reaching total upload in bytes, or when
# reaching final upload ratio in percent.
# example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0
#schedule = ratio,60,60,&quot;stop_on_ratio=200,200M,2000&quot;

# The ip address reported to the tracker.
#ip = 127.0.0.1
#ip = rakshasa.no

# The ip address the listening socket and outgoing connections is
# bound to.
#bind = 127.0.0.1
#bind = rakshasa.no

# Port range to use for listening.
port_range = 12300-12400

# Start opening ports at a random position within the port range.
port_random = yes

# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported.
check_hash = no

# Set whetever the client should try to connect to UDP trackers.
use_udp_trackers = yes

# Alternative calls to bind and ip that should handle dynamic ip's.
#schedule = ip_tick,0,1800,ip=rakshasa
#schedule = bind_tick,0,1800,bind=rakshasa

# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
encryption = allow_incoming,try_outgoing,enable_retry

# Enable DHT support for trackerless torrents or when all trackers are down.
# May be set to &quot;disable&quot; (completely disable DHT), &quot;off&quot; (do not start DHT),
# &quot;auto&quot; (start and stop DHT as needed), or &quot;on&quot; (start DHT immediately).
# The default is &quot;off&quot;. For DHT to work, a session directory must be defined.
#
dht = on

# UDP port to use for DHT.
#
dht_port = 12300

# Enable peer exchange (for torrents not marked private)
#
peer_exchange = yes

#
# Do not modify the following parameters unless you know what you're doing.
#

# Hash read-ahead controls how many MB to request the kernel to read
# ahead. If the value is too low the disk may not be fully utilized,
# while if too high the kernel might not be able to keep the read
# pages in memory thus end up trashing.
#hash_read_ahead = 10

# Interval between attempts to check the hash, in milliseconds.
#hash_interval = 100

# Number of attempts to check the hash while using the mincore status,
# before forcing. Overworked systems might need lower values to get a
# decent hash checking rate.
#hash_max_tries = 10

# Set the umask for this process, which is applied to all files created by the program.
# umask = 0666

# Watches
# Scan torrent dump, and watch for torrents
schedule = watch_directory,10,10,&quot;execute=/media/tb/.rtorrent/scandump.sh;load_start=/media/tb/.rtorrent/torrents/*.torrent&quot;
# Watch for torrent files being deleted
schedule = watch_untied,10,10,&quot;remove_untied=&quot;
# If a torrent is erased, erase the contents
on_erase = rm_files,&quot;execute=rm,-rf,--,$d.get_base_path=&quot;
# Run oncompleted on a completed torrent
on_finished = linkup,&quot;execute=/media/tb/.rtorrent/oncompleted.sh,$d.get_tied_to_file=,$d.get_base_path=&quot;

# Throthling
schedule = throttle_high,01:00:00,24:00:00,&quot;download_rate=0;upload_rate=50&quot;
schedule = throttle_low,09:00:00,24:00:00,&quot;download_rate=500;upload_rate=20&quot;
download_rate=500
upload_rate=20
schedule = ratio,10,10,&quot;stop_on_ratio=1,1K,2&quot;

# XMLRPC for wTorrent
scgi_port = localhost:5000
</pre>
<p>Some of the notable changes from a default rtorrent setup:</p>
<ul>
<li>Before watching the watch directory, it calls scandump.sh</li>
<li>After the torrent file is deleted, it&#8217;s removed (= completed files stop seeding)</li>
<li>If a torrent is erased, the data is erased. Note that if a torrent is completed, the data is merely a symlink, so no completed torrents will be deleted</li>
<li>On finished, oncompleted.sh will be run</li>
</ul>
<p>So, this is a much better setup than I had already. Some of the things I still need to fix:</p>
<ul>
<li>Set up FlexGet to download series, and create appropriate .info files for each torrent</li>
<li>Find a way to have untied torrents seed for a while, and remove after a certain seeding threshold</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://fw.hardijzer.nl/?feed=rss2&amp;p=73</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>LiveScratcher first public alpha</title>
		<link>http://fw.hardijzer.nl/?p=69</link>
		<comments>http://fw.hardijzer.nl/?p=69#comments</comments>
		<pubDate>Fri, 17 Jul 2009 09:01:04 +0000</pubDate>
		<dc:creator>Frans-Willem Hardijzer</dc:creator>
				<category><![CDATA[LiveScratcher]]></category>
		<category><![CDATA[Messenger]]></category>

		<guid isPermaLink="false">http://fw.hardijzer.nl/?p=69</guid>
		<description><![CDATA[What&#8217;s that? a new forum? and a weird development announcement? Go check it out!
I&#8217;ll be spending today on writing up documentation on that forum and doing quick bugfixes.
]]></description>
			<content:encoded><![CDATA[<p>What&#8217;s that? a <a href="http://www.livescratcher.com/forum/">new forum</a>? and a weird <a href="http://www.livescratcher.com/forum/showthread.php?tid=2">development announcement</a>? Go check it out!</p>
<p>I&#8217;ll be spending today on writing up documentation on that forum and doing quick bugfixes.</p>
]]></content:encoded>
			<wfw:commentRss>http://fw.hardijzer.nl/?feed=rss2&amp;p=69</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Disappointing discoveries</title>
		<link>http://fw.hardijzer.nl/?p=65</link>
		<comments>http://fw.hardijzer.nl/?p=65#comments</comments>
		<pubDate>Wed, 15 Jul 2009 19:16:48 +0000</pubDate>
		<dc:creator>Frans-Willem Hardijzer</dc:creator>
				<category><![CDATA[LiveScratcher]]></category>
		<category><![CDATA[Messenger]]></category>

		<guid isPermaLink="false">http://fw.hardijzer.nl/?p=65</guid>
		<description><![CDATA[Normally it&#8217;s pretty cool to find new APIs in Messenger. Imagine my excitement when I found a new interface named &#8220;IMSNMessengerConversationWnd2&#8243; that seemed to inherit from the already known IMSNMessengerConversationWnd interface. Two new functions appeared to have been added. Hurrah!
So I spent 3 hours of my time debugging and testing these new functions. Turns out [...]]]></description>
			<content:encoded><![CDATA[<p>Normally it&#8217;s pretty cool to find new APIs in Messenger. Imagine my excitement when I found a new interface named &#8220;IMSNMessengerConversationWnd2&#8243; that seemed to inherit from the already known <a href="http://forums.fanatic.net.nz/index.php?showtopic=16989&amp;st=0">IMSNMessengerConversationWnd</a> interface. Two new functions appeared to have been added. Hurrah!</p>
<p>So I spent 3 hours of my time debugging and testing these new functions. Turns out they&#8217;re not nearly as exciting as I had hoped:</p>
<pre class="brush: cpp;">
	[
	  odl,
	  uuid(929BB08C-B50C-4ECD-B68C-175F0B69A544),
	  helpstring(&quot;MSN Messenger Conversation Window Interface Ex&quot;),
	  dual,
	  oleautomation
	]
	interface IMSNMessengerConversationWnd2 : IMSNMessengerConversationWnd {
		[id(0x0000080c), propget, helpstring(&quot;Get the window text.&quot;)]
		HRESULT WindowTitle([out, retval] BSTR* bstrWindowTitle);
		[id(0x0000080c), propput, helpstring(&quot;Set the window text.&quot;)]
		HRESULT WindowTitle([in] BSTR bstrWindowTitle);
	};
</pre>
<p>I&#8217;ve tested this in Vista, it gets and sets the window titlebar. As Vista doesn&#8217;t use the borderless-windows that WLM9 uses on XP, I&#8217;m not sure if it works on that, but I suspect that this interface has been specially generated for precisely that.</p>
<p>Well, either way, have fun with it. Sure hope my time has been useful for someone :p</p>
]]></content:encoded>
			<wfw:commentRss>http://fw.hardijzer.nl/?feed=rss2&amp;p=65</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Javascript Haskell mash-up</title>
		<link>http://fw.hardijzer.nl/?p=62</link>
		<comments>http://fw.hardijzer.nl/?p=62#comments</comments>
		<pubDate>Wed, 15 Jul 2009 01:18:13 +0000</pubDate>
		<dc:creator>Frans-Willem Hardijzer</dc:creator>
				<category><![CDATA[LiveScratcher]]></category>
		<category><![CDATA[Messenger]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://fw.hardijzer.nl/?p=62</guid>
		<description><![CDATA[With LiveScratcher I&#8217;m working a lot with JavaScript, and I&#8217;ve really grown to love the language. For example, today I stumbled upon this blog post. It&#8217;s a JavaScript implementation of a lot of Haskell tricks and functions, including a quick &#8220;curry&#8221; function (read the blog post to find out what it is).
Just felt that was [...]]]></description>
			<content:encoded><![CDATA[<p>With LiveScratcher I&#8217;m working a lot with JavaScript, and I&#8217;ve really grown to love the language. For example, today I stumbled upon <a href="http://flesler.blogspot.com/2008/11/haskell-functions-for-javascript.html">this blog post</a>. It&#8217;s a JavaScript implementation of a lot of Haskell tricks and functions, including a quick &#8220;curry&#8221; function (read the blog post to find out what it is).</p>
<p>Just felt that was worth sharing <img src='http://fw.hardijzer.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://fw.hardijzer.nl/?feed=rss2&amp;p=62</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LiveScratcher: Now what?</title>
		<link>http://fw.hardijzer.nl/?p=60</link>
		<comments>http://fw.hardijzer.nl/?p=60#comments</comments>
		<pubDate>Tue, 14 Jul 2009 00:08:40 +0000</pubDate>
		<dc:creator>Frans-Willem Hardijzer</dc:creator>
				<category><![CDATA[LiveScratcher]]></category>
		<category><![CDATA[Messenger]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://fw.hardijzer.nl/?p=60</guid>
		<description><![CDATA[LiveScratcher, and it&#8217;s early abandoned brother project Modumes, have been in the pipeline for months now. I think I had the initial idea of a modular extension platform for Messenger well over a year ago. Either way, I never really had a lot of time to put some real work into it. Until now, that [...]]]></description>
			<content:encoded><![CDATA[<p>LiveScratcher, and it&#8217;s early abandoned brother project Modumes, have been in the pipeline for months now. I think I had the initial idea of a modular extension platform for Messenger well over a year ago. Either way, I never really had a lot of time to put some real work into it. Until now, that is. Holidays have started two weeks ago, and I&#8217;ve been crashing at my parent&#8217;s place (free food <img src='http://fw.hardijzer.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ) and working on LiveScratcher non-stop since. I hadn&#8217;t quite expected it (what would you expect from a project that&#8217;s been in the making for months without any results), but I feel that the end of the road (or at least something worth showing) is near <img src='http://fw.hardijzer.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I&#8217;ve put up the initial scaffolding for the Messenger API, and am currently filling in the functionality for the Messenger, Contact, and Conversation classes. The DirectUI (messenger&#8217;s user-interface library) module is in a somewhat usable state, and I&#8217;ve even written an old-style UIFile parser to it (written completely in Javascript). One package I haven&#8217;t started on is the Interop (= communication with external libraries) one, but the plan for that one is well established in my head, and shouldn&#8217;t be too hard to implement.</p>
<p>For now I&#8217;m aiming for something that is on-par with Messenger Plus!&#8217;s scripting, but once I reach that I hope to keep expanding and surpass it greatly. One of the advantages I have is the extensibility. Each package can export certain functionality, and as such anyone is free to extend the API as they wish. Someone could make a package solely dedicated to communicating with facebook or twitter, and other developers can then use those packages from their scripts, for example creating a script that keeps your facebook or twitter friends updated on how many contacts you have.</p>
<p>Here&#8217;s a list of a few things that are done and worth mentioning:</p>
<ul>
<li>Minimal main system: the main system *only* contains the bare necessities needed to load the modules and scripts. As such you can replace virtually anything with your own implementation; Don&#8217;t like the standard Console? take it out and write your own.</li>
<li>Google&#8217;s V8 JavaScript engine: The same engine that&#8217;s behind the blittering speed of Google Chrome. A downside is that things like &#8220;new ActiveXObject&#8221; aren&#8217;t supported, but upsides are plenty: It&#8217;s fast, it&#8217;s flexible, it&#8217;s standards compliant, and it actually allowed me to do the DirectUI stuff (Microsoft&#8217;s JScript was a bitch when it came to threading, V8 just sticks to one)</li>
<li>Code searching package: No more hard-coding of patch offsets, simply define what kind of pattern you&#8217;re looking for, and this package will find the offset(s) for you. It&#8217;ll optimize multiple patterns so only one pass over the memory is needed, so it should be really fast, and it&#8217;ll run in the background and only keep your script waiting minimally: it will return the offset the millisecond it&#8217;s found, and continue searching in the background.</li>
<li>Quick and simple console package that outputs script errors, and exports functions to add messages, warnings, or errors so you have an easy way to output data to the user.</li>
<li>DirectUI access: Want to remove a button from messenger? add a new one? Move the wordwheel to the bottom of the contact list? It&#8217;s all possible.</li>
<li>UIFile parser completely implemented in JavaScript, allows you to define your own output callbacks (or use existing ones), so someone could easily stick in a UIB compiler.</li>
<li>Packages can consist of modules (DLLs) or scripts, or even a combination of both.</li>
<li>The actual Messenger API is a mess, there&#8217;s about three different ways to do things, and half of the functionality is often broken. But as a package developer you don&#8217;t have to worry about that: I&#8217;ve taken the time to write a Messenger package that takes care of all that for you, and exports an easy to use interface for your scripts to use <img src='http://fw.hardijzer.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>Need some functionality that&#8217;s not yet in LiveScratcher but is in Plus? For now there&#8217;s a PlusCom package that allows you to make a (string values only) bridge between a Plus! script and a LiveScratcher package.<br />
I&#8217;m not sure if this will be useful when it&#8217;s all done, but it was a nice experiment, and might come in handy with other things.</li>
<li>Need to pop up a toast? That&#8217;s already in the Messenger module <img src='http://fw.hardijzer.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  with callbacks and everything. And not fake lookalike toasts, nope, actual real Messenger toasts with custom text.</li>
</ul>
<p>Now, it all sounds really great when I put it like this, but there&#8217;s also a bunch of things that are missing (but that I do plan to implement some day):</p>
<ul>
<li>Debugger: as of now, all you have is some errors in the console if something goes wrong. I&#8217;m planning on exposing the V8 debugger protocol and write a nice debugger plugin for Eclipse or Notepad++ or something like that.</li>
<li>More advanced Interop: For now I&#8217;m focussing on an interop approach like Plus!. A simpe way to call external libraries with integers or strings, and some memory block class for pointer stuff. When I have the time I&#8217;m hoping to come up with a nicer approach that allows you to specify a structure and it will make a memory-block automatically and catch all get/set calls to it.</li>
<li>Protocol level stuff: For now I&#8217;m focussing on exposing all the API based stuff, but at some point I hope to write a proxy/protocol-analysing package that would allow for similar functionality to Messenger Discoveries&#8217;s plugins.</li>
<li>RichEdit hooking: It&#8217;s going to be a big project, but I do hope to implement some kind of RichEdit hook and expose that, so scripts can implement new mark-up stuff. For example implement Plus!&#8217;s coloring, or implement a LateX package that automatically converts latex to images.</li>
</ul>
<p>Well, now you know most of what it is and my plans about it. If for some reason you got excited (sure hope you did <img src='http://fw.hardijzer.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ) and want to take a look and give some feedback, please don&#8217;t hesitate to contact me. Just leave a comment and I&#8217;ll get in touch with you. I&#8217;ll gladly send it over and give you all the help you need to get using it. At this point however I&#8217;m not quite comfortable with just uploading it here (as it&#8217;s still very very crude and rough around the edges), so you will have to personally ask me if you want to take a peek <img src='http://fw.hardijzer.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://fw.hardijzer.nl/?feed=rss2&amp;p=60</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
