<?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>edeca.net &#187; Computing</title>
	<atom:link href="http://edeca.net/wp/category/computing/feed/" rel="self" type="application/rss+xml" />
	<link>http://edeca.net/wp</link>
	<description>Musings of a geek</description>
	<lastBuildDate>Sat, 10 Jul 2010 11:10:18 +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>Net::LibNIDS 0.1 released</title>
		<link>http://edeca.net/wp/2010/06/netlibnids-0-1-released/</link>
		<comments>http://edeca.net/wp/2010/06/netlibnids-0-1-released/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 20:53:55 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://edeca.net/wp/?p=543</guid>
		<description><![CDATA[The other day I pushed a new version of Net::LibNIDS to CPAN. It interfaces with the C library libnids in order to provide TCP stream reassembly and returns the data to your Perl callback. The API for the Perl module is still nasty but a bunch of bugs have been fixed which make it quite [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I pushed a new version of <a href="http://search.cpan.org/~edeca/Net-LibNIDS/LibNIDS.pm">Net::LibNIDS</a> to CPAN.  It interfaces with the C library <a href="http://libnids.sourceforge.net/">libnids</a> in order to provide TCP stream reassembly and returns the data to your Perl callback.<br />
<span id="more-543"></span><br />
The API for the Perl module is still nasty but a bunch of bugs have been fixed which make it quite usable.  I plan on uploading some other modules in the coming months which make utilise Net::LibNIDS to do their work.</p>
<p>If you use it, make sure you use the latest version of libnids (currently v1.24) as it fixes a bunch of important bugs.  This currently isn&#8217;t in Debian/Ubuntu and the maintainer has disappeared, so compile from source for now.  Red Hat based distributions get it easy it seems, as somebody has already compiled it for RHEL4 or later.</p>
]]></content:encoded>
			<wfw:commentRss>http://edeca.net/wp/2010/06/netlibnids-0-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Better than grep</title>
		<link>http://edeca.net/wp/2010/05/better-than-grep/</link>
		<comments>http://edeca.net/wp/2010/05/better-than-grep/#comments</comments>
		<pubDate>Sat, 29 May 2010 19:56:50 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Computing]]></category>

		<guid isPermaLink="false">http://edeca.net/wp/?p=534</guid>
		<description><![CDATA[Anybody who has used command-line systems for a serious amount of time will love grep. But today I stumbled across ack, which (for many things) is better than grep and a whole lot nicer to use. The best bit? It&#8217;s pure Perl, therefore also uses real Perl regular expressions. Yes, there might be grep --perl-regexp, [...]]]></description>
			<content:encoded><![CDATA[<p>Anybody who has used command-line systems for a serious amount of time will love grep.  But today I stumbled across ack, which (for many things) is better than grep and a whole lot nicer to use.</p>
<p>The best bit?  It&#8217;s pure Perl, therefore also uses real Perl regular expressions.  Yes, there might be <tt>grep --perl-regexp</tt>, but nobody bothers compiling that in.  Plus ack has some other neat features.</p>
<p>See more at the <a href="http://betterthangrep.com/">ack website</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://edeca.net/wp/2010/05/better-than-grep/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Limiting command runtime in Linux</title>
		<link>http://edeca.net/wp/2010/05/limiting-command-runtime-in-linux/</link>
		<comments>http://edeca.net/wp/2010/05/limiting-command-runtime-in-linux/#comments</comments>
		<pubDate>Sun, 02 May 2010 10:55:10 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://edeca.net/wp/?p=474</guid>
		<description><![CDATA[It is sometimes useful to limit the running time of a process, either to stop it from using up all resources or to make sure nightly cron jobs don&#8217;t continue into working hours. I needed this for rsync, to let a remote backup server slowly catch up if large amounts of data were added to [...]]]></description>
			<content:encoded><![CDATA[<p>It is sometimes useful to limit the running time of a process, either to stop it from using up all resources or to make sure nightly cron jobs don&#8217;t continue into working hours.</p>
<p>I needed this for rsync, to let a remote backup server slowly catch up if large amounts of data were added to the live server during the day.  A <a href="http://old.nabble.com/Limit-rsync-running-time-td25490601.html">useful post</a> on the rsync mailing list discusses an rsync patch but also the <tt>timeout</tt> command.</p>
<p>After installing (the Debian package is simply <tt>timeout</tt>) it is as easy as running with the number of seconds to run for:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ timeout 21600 rsync -a ...</div></div>
<p>It is also possible to specify the signal which will be sent to a program, which is useful if you do not want to simply send SIGKILL.  I used SIGHUP in the hope that rsync would have a chance to exit gracefully:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ timeout -1 21600 rsync -a ...</div></div>
<p>A full list of signals and their numeric values can be found in <tt>man 1 kill</tt>.</p>
<p>A <a href="http://johannes.jakeapp.com/blog/category/fun-with-linux/200901/bash-timeouts">wrapper script</a> is also available from Johannes Buchner.  </p>
]]></content:encoded>
			<wfw:commentRss>http://edeca.net/wp/2010/05/limiting-command-runtime-in-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Obtaining DNS servers automatically on Cisco ADSL routers</title>
		<link>http://edeca.net/wp/2010/04/obtaining-dns-servers-automatically-on-cisco-adsl-routers/</link>
		<comments>http://edeca.net/wp/2010/04/obtaining-dns-servers-automatically-on-cisco-adsl-routers/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 21:00:54 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Computing]]></category>

		<guid isPermaLink="false">http://edeca.net/wp/?p=410</guid>
		<description><![CDATA[I noticed tonight that my Cisco 837 was using hard-coded DNS servers which were no longer valid, hence breaking my internets. In order to keep them updated automatically, I added the following to the appropriate dialer configuration (interface Dialer0 on an 8xx): ppp ipcp dns request This causes the router to request DNS server addresses [...]]]></description>
			<content:encoded><![CDATA[<p>I noticed tonight that my Cisco 837 was using hard-coded DNS servers which were no longer valid, hence breaking my internets.  In order to keep them updated automatically, I added the following to the appropriate dialer configuration (<tt>interface Dialer0</tt> on an 8xx):</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ppp ipcp dns request</div></div>
<p>This causes the router to request DNS server addresses when the PPP session is negotiated (when it &#8220;dials up&#8221; to ADSL).</p>
<p>After reconnecting the PPP session (either reload or shutdown the interface and then bring it back) it is possible to check that DNS servers have been obtained using <tt>sh host</tt>:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">router#sh host<br />
Default domain is not set<br />
Name/address lookup uses domain service<br />
Name servers are 62.69.62.6, 62.69.62.7</div></div>
<p>If the router is running a DNS server it is possible to direct DHCP clients at the router IP instead, forcing them to use these same settings.</p>
]]></content:encoded>
			<wfw:commentRss>http://edeca.net/wp/2010/04/obtaining-dns-servers-automatically-on-cisco-adsl-routers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>dspam integration with dovecot</title>
		<link>http://edeca.net/wp/2010/03/dspam-integration-with-dovecot/</link>
		<comments>http://edeca.net/wp/2010/03/dspam-integration-with-dovecot/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 19:23:45 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Computing]]></category>

		<guid isPermaLink="false">http://edeca.net/wp/?p=374</guid>
		<description><![CDATA[In a previous message I spoke about training dspam automatically. The script I posted there works, but it&#8217;s not brilliant so I started looking for other ways of achieving spam training from the client. Whilst looking for alternatives I found the dovecot antispam plugin which seems almost perfect. Configure a spam folder (I called mine [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://edeca.net/wp/2010/02/training-dspam-from-thunderbird-junk-messages/">previous message</a> I spoke about training dspam automatically.  The script I posted there works, but it&#8217;s not brilliant so I started looking for other ways of achieving spam training from the client.<br />
<span id="more-374"></span><br />
Whilst looking for alternatives I found the <a href="http://johannes.sipsolutions.net/Projects/dovecot-antispam">dovecot antispam plugin</a> which seems almost perfect.  Configure a spam folder (I called mine &#8220;Junk&#8221; to integrate with Thunderbird) and it will detect when the user moves mail in or out of the folder.  This automatically trains as ham or spam, depending on the direction mail is moved.</p>
<p>I grabbed a <a href="http://johannes.sipsolutions.net/download/dovecot-antispam/">source tarball</a> from the website and started there.  Installing is simple:</p>
<ol>
<li>After extracting, copy <tt>defconfig</tt> to <tt>.config</tt></li>
<li>Edit <tt>.config</tt> to set the user and enable the backends you require</li>
<li>Run make and then make install (as root, obviously)</li>
<li>Edit the dovecot configuration to set plugin configuration</li>
</ol>
<p>I chose the <tt>dspam-exec</tt> backend, but read the documentation before using it as it will spawn the dspam binary for each mail moved in.</p>
<p>You should ensure that the user that the dspam-antispam plugin runs as is trusted by dspam (edit <tt>/etc/dspam/dspam.conf</tt> and ensure there is a <tt>Trust &lt;user&gt;</tt> line) <b>and</b> does not violate dovecot security settings (set at compile time).  On Debian, this seemed to mean running the plugin as <tt>root</tt>.</p>
<p>Editing the dovecot configuration includes enabling the plugin in the <tt>protocol imap</tt> section:</p>
<pre>mail_plugins = antispam</pre>
<p>And, for the dspam-exec plugin, configuring it like so:</p>
<pre># Which folder the antispam plugin monitors
antispam_spam = Junk
# Antispam trash folder
antispam_trash = trash;Trash;Deleted Items;Deleted Messages

antispam_signature = X-DSPAM-Signature
antispam_signature_missing = move

#===================
# dspam-exec plugin

# dspam binary
antispam_dspam_binary = /usr/bin/dspam

# semicolon-separated list of extra arguments to dspam
# (default unset i.e. none)
antispam_dspam_args = --deliver;--user;%u
# antispam_dspam_args = --deliver=;--user;%u  # % expansion done by dovecot
# antispam_dspam_args = --mode=teft</pre>
<p>This seems to be the minimum to get the dspam-exec backend working.  Note that configuration for other options will be different, if somebody fancies sharing a configuration that sends mail to <tt>&lt;user&gt;-spam@&lt;domain&gt;</tt> I&#8217;d be very grateful <img src='http://edeca.net/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Thanks to Johannes for writing this plugin.</p>
]]></content:encoded>
			<wfw:commentRss>http://edeca.net/wp/2010/03/dspam-integration-with-dovecot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Training dspam from Thunderbird junk messages</title>
		<link>http://edeca.net/wp/2010/02/training-dspam-from-thunderbird-junk-messages/</link>
		<comments>http://edeca.net/wp/2010/02/training-dspam-from-thunderbird-junk-messages/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 14:53:20 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[dspam]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://edeca.net/wp/?p=347</guid>
		<description><![CDATA[Recently I have installed and configured dspam on my mailserver. It seems to work nicely but needs occasional training. I wanted to integrate this with Thunderbird so that users could automatically train dspam from their mail client. Based on this code I knocked together a few lines of bash script which will scan junk mail [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have installed and configured <a href="http://www.nuclearelephant.com">dspam</a> on my mailserver.  It seems to work nicely but needs occasional training.  I wanted to integrate this with Thunderbird so that users could automatically train dspam from their mail client.<br />
<span id="more-347"></span><br />
Based on <a href="http://www.ghidinelli.com/2006/10/01/combining-thunderbird-junk-mail-filtering-and-dspam">this code</a> I knocked together a few lines of bash script which will scan junk mail directories on the server and automatically train dspam.  This means that an end-user can click the &#8220;Junk&#8221; button in Thunderbird (or Mail.app, etc) and dspam will be trained for them automagically.  The user could even just move the messages there manually, or use some sort of filtering or an extension.</p>
<p>The best bit is that it is completely transparent to the end user and doesn&#8217;t require them to forward messages with headers intact to a weird <tt>user-spam@example.net</tt> address in order to conduct training.</p>
<p>If you find it useful or make changes, please let me know in the comments below.</p>
<h3>The code</h3>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/bash</span><br />
<br />
<span style="color: #666666; font-style: italic;">########</span><br />
<span style="color: #666666; font-style: italic;"># TrainDspam.sh</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">#   Author: David Cannings &lt;david @edeca.net&gt;</span><br />
<span style="color: #666666; font-style: italic;">#     Date: 21/02/2010</span><br />
<span style="color: #666666; font-style: italic;"># Based on: http://tinyurl.com/yhky5w9</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># This script scans mail directories for the Thunderbird &quot;Junk&quot; folder</span><br />
<span style="color: #666666; font-style: italic;"># (or any other folder with the same name) and trains dspam with the</span><br />
<span style="color: #666666; font-style: italic;"># messages contained within it.</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># It can be used for periodic (e.g. daily) training of spam messages which</span><br />
<span style="color: #666666; font-style: italic;"># a user has flagged as junk in their mail client.</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># It will only train for accounts which appear to be using dspam.</span><br />
<span style="color: #666666; font-style: italic;">########</span><br />
<br />
<span style="color: #666666; font-style: italic;">########</span><br />
<span style="color: #666666; font-style: italic;"># Configuration</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Path to mail directory, which should contain folders per domain and</span><br />
<span style="color: #666666; font-style: italic;"># user e.g. /home/mail/&lt;domain&gt;/&lt;user1&gt;/</span><br />
<span style="color: #007800;">MAIL_PATH</span>=<span style="color: #ff0000;">&quot;/home/mail&quot;</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Path to the directory containing 'dspam'</span><br />
<span style="color: #007800;">DSPAM_BIN_DIR</span>=<span style="color: #ff0000;">&quot;/usr/bin&quot;</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Path to the directory containing the dspam user data files</span><br />
<span style="color: #007800;">DSPAM_DATA_DIR</span>=<span style="color: #ff0000;">&quot;/var/spool/dspam&quot;</span><br />
<br />
<span style="color: #666666; font-style: italic;"># If you want this script to delete messages from the Junk folder</span><br />
<span style="color: #666666; font-style: italic;"># after training, set this to 1.</span><br />
<span style="color: #007800;">DELETE_MAIL</span>=<span style="color: #000000;">0</span><br />
<br />
<span style="color: #666666; font-style: italic;"># DON'T EDIT BELOW THIS LINE</span><br />
<span style="color: #666666; font-style: italic;">########</span><br />
<br />
<span style="color: #000000; font-weight: bold;">for</span> FOLDER <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #007800;">$MAIL_PATH</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'.Junk'</span> <span style="color: #660033;">-type</span> d -print<span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #000000; font-weight: bold;">do</span><br />
&nbsp;<span style="color: #007800;">DOMAIN</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$FOLDER</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> -F<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #ff0000;">'{print $(NF-3)}'</span><span style="color: #000000; font-weight: bold;">`</span><br />
&nbsp;<span style="color: #007800;">USER</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$FOLDER</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> -F<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #ff0000;">'{print $(NF-2)}'</span><span style="color: #000000; font-weight: bold;">`</span><br />
<br />
&nbsp;<span style="color: #666666; font-style: italic;"># We only want to train for accounts that are dspam users,</span><br />
&nbsp;<span style="color: #666666; font-style: italic;"># so check the data directory</span><br />
&nbsp;<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${DSPAM_DATA_DIR}</span>/data/<span style="color: #007800;">${DOMAIN}</span>/<span style="color: #007800;">${USER}</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp;<span style="color: #007800;">TRAINED_MESSAGES</span>=<span style="color: #000000;">0</span><br />
&nbsp;<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$FOLDER</span><span style="color: #000000; font-weight: bold;">/</span>cur<span style="color: #000000; font-weight: bold;">/</span><br />
&nbsp;<span style="color: #000000; font-weight: bold;">for</span> MESSAGE <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> -<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #000000; font-weight: bold;">do</span><br />
&nbsp; &nbsp;<span style="color: #007800;">TRAINED_MESSAGES</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #007800;">$TRAINED_MESSAGES</span> + <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">`</span><br />
&nbsp; &nbsp;<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$MESSAGE</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #007800;">$DSPAM_BIN_DIR</span><span style="color: #000000; font-weight: bold;">/</span>dspam <span style="color: #660033;">--user</span> <span style="color: #800000;">${USER}</span><span style="color: #000000; font-weight: bold;">@</span><span style="color: #800000;">${DOMAIN}</span> <span style="color: #660033;">--class</span>=spam <span style="color: #660033;">--source</span>=error<br />
&nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$DELETE_MAIL</span> <span style="color: #660033;">-gt</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$NAME</span><br />
&nbsp;<span style="color: #000000; font-weight: bold;">done</span><br />
&nbsp;<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;- Trained <span style="color: #007800;">$TRAINED_MESSAGES</span> messages for <span style="color: #007800;">${USER}</span>@<span style="color: #007800;">${DOMAIN}</span>&quot;</span><br />
&nbsp;<span style="color: #000000; font-weight: bold;">fi</span><br />
<span style="color: #000000; font-weight: bold;">done</span></div></td></tr></tbody></table></div>
<p></user1></domain></david></p>
]]></content:encoded>
			<wfw:commentRss>http://edeca.net/wp/2010/02/training-dspam-from-thunderbird-junk-messages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Updates to libnids</title>
		<link>http://edeca.net/wp/2010/02/updates-to-libnids/</link>
		<comments>http://edeca.net/wp/2010/02/updates-to-libnids/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 12:14:33 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Computing]]></category>

		<guid isPermaLink="false">http://edeca.net/wp/?p=341</guid>
		<description><![CDATA[Much of the code I have written as part of my day job uses the rather excellent libnids.  However, there are a few bugs in version 1.23 relating to packets with radiotap headers or code which tries to read from multiple pcap files in sequence. The radiotap bug was fixed by Michal Pecio, the pcap [...]]]></description>
			<content:encoded><![CDATA[<p>Much of the code I have written as part of my day job uses the rather excellent <a href="http://libnids.sourceforge.net/">libnids</a>.  However, there are a few bugs in version 1.23 relating to packets with <a href="http://www.radiotap.org/">radiotap</a> headers or code which tries to read from multiple pcap files in sequence.<br />
<span id="more-341"></span><br />
The radiotap bug was fixed by Michal Pecio, the pcap offline bug by myself.  Both fixes are very simple (1 and 4 lines respectively) and I have packaged up the changes into release 1.24.</p>
<p>Hopefully Rafal Wojtczuk, the libnids author, will publish these changes on the Sourceforge site soon.  Until then you can grab a patch between the two versions or a complete distribution tarball below.</p>
<p><b>Update:</b> As of today (March 14th 2010) Rafal has updated libnids to v1.24 with a number of other changes.  You can grab it from the <a href="http://libnids.sourceforge.net/">official libnids website</a>.  Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://edeca.net/wp/2010/02/updates-to-libnids/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Contributing [to CPAN] is easy!</title>
		<link>http://edeca.net/wp/2010/02/contributing-is-easy/</link>
		<comments>http://edeca.net/wp/2010/02/contributing-is-easy/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 21:00:52 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://edeca.net/wp/?p=334</guid>
		<description><![CDATA[The following article is a repost of an original that I wrote for blogs.perl.org. I thought I would share my experience of submitting a module to CPAN for the first time. In summary: it&#8217;s stupidly easy and if I can do it, so can you. I&#8217;m not the best Perl coder and therefore I rely [...]]]></description>
			<content:encoded><![CDATA[<p>The following article is a repost of <a href="http://blogs.perl.org/users/david/2010/02/contributing-is-easy.html">an original</a> that I wrote for <a href="http://blogs.perl.org">blogs.perl.org</a>.</p>
<p>I thought I would share my experience of  submitting a module to CPAN for the first time.  In summary: it&#8217;s  stupidly easy and if I can do it, so can you.<br />
<span id="more-334"></span><br />
I&#8217;m not the best Perl coder and therefore I rely heavily on CPAN  modules to do the real work.  Every now and again I stumble upon bugs,  many of which are simple to fix after a little debugging.  However, some  modules aren&#8217;t heavily maintained and some haven&#8217;t been touched in  years.  Bugs that are filed on RT can go unanswered, gathering digital  dust while your development machine is riddled with heavily modified  modules.</p>
<p>The solution?  In my case it was as easy as discussing a few changes  with the module author, who added me as a co-maintainer.  That allows me  to upload new versions, fix tickets in the bug queue and probably many  other things I&#8217;ve not discovered.</p>
<p>Uploading a new module requires logging into <a href="http://pause.cpan.org/">PAUSE</a> and pointing it at a file on your  local disk or a remote HTTP server.  A few emails later and a short  wait and the changes appear on the CPAN website itself.</p>
<p>Some useful things to consider when uploading a new module:</p>
<ul>
<li>Does it still build?  Run make clean (or make realclean) and check  from scratch!</li>
<li>If applicable, do the changes break any tests (run make test)</li>
<li>Is the MANIFEST file up to date?</li>
<li>Bump the version number in all files that use it (the .pm itself,  README, META.yml etc) &#8211; grep is your friend here</li>
<li>Document what is new in the Changes file</li>
<li>Remove any other files left over from your development, then tar it  all up</li>
<li>Go and resolve bugs on <a href="http://rt.cpan.org/">rt.cpan.org</a> that you have fixed and take some credit!</li>
</ul>
<p>(I&#8217;m sure I have missed some important ones, please add them below!)</p>
<p>I noticed when replying to a bug ticket that there is a &#8220;minutes  spent&#8221; field.  In all honesty, the above probably took no longer than  10.  And that&#8217;s how long it takes to have the whole Perl community  benefit from your <span style="text-decoration: line-through;">newly broken</span> nicely updated module.</p>
<p>As another quick plug: this is also my first blog post to  blogs.perl.org.  It was also stupidly easy so if you don&#8217;t fancy coding,  get scribbling instead!</p>
]]></content:encoded>
			<wfw:commentRss>http://edeca.net/wp/2010/02/contributing-is-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Syncing the iPhone addressbook with Horde</title>
		<link>http://edeca.net/wp/2010/01/syncing-the-iphone-addressbook-with-horde/</link>
		<comments>http://edeca.net/wp/2010/01/syncing-the-iphone-addressbook-with-horde/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 13:48:57 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[horde]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://edeca.net/wp/?p=275</guid>
		<description><![CDATA[Since I&#8217;d had my iPhone I&#8217;ve wanted to be able to sync my contacts with my Horde Webmail install.  This post is about setting up the Funambol application in order to do so. Firstly, you need something on the phone which will support SyncML, the standard that allows different devices to exchange data.  To sync, [...]]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;d had my iPhone I&#8217;ve wanted to be able to sync my contacts with my Horde Webmail install.  This post is about setting up the Funambol application in order to do so.<br />
<span id="more-275"></span></p>
<p>Firstly, you need something on the phone which will support <a title="Wikipedia entry for SyncML" href="http://en.wikipedia.org/wiki/SyncML">SyncML</a>, the standard that allows different devices to exchange data.  To sync, install the iPhone Funambol application (<a title="Funambol application iTunes store link" href="http://itunes.apple.com/gb/artist/funambol-us/id284457847" target="_blank">iTunes store link</a>) which is currently free and works really well.</p>
<p>The Funambol application itself is very simple, adding an account is easy:</p>
<ul>
<li> set the &#8220;Server&#8221; field to something like <tt>http://example.com/horde/rpc.php</tt> (replace the location appropriately)</li>
<li>set the &#8220;Username&#8221; and &#8220;Password&#8221; fields to the same ones you use to login normally</li>
<li>in the &#8220;Contacts&#8221; section of the setup, the &#8220;Remote Name&#8221; should be set to <tt>card</tt></li>
</ul>
<p>The &#8220;Sync Direction&#8221; can be set whichever way you prefer.  A cavaet: I only do one way synchronisation.  That is, I sync my contacts from iPhone to server, but not the other way.  Whilst it does work both ways, I haven&#8217;t tested it extensively.  It is possible that rabid zombies will eat your firstborn if you change something on the server and try to update the iPhone.</p>
<p>Once these settings are updated, you can go back to the main screen and hit the big &#8220;Sync Contacts&#8221; button.  If it succeeds, you will see your contacts appear on the Horde server.  If not, you can always view the log from the settings menu to work out what went wrong.</p>
<p>One of the coolest (but most useless) features is that any photos associated with contacts will also be uploaded to the server.</p>
<p>Note that some fields aren&#8217;t automatically used by Horde, such as the &#8220;Home Email&#8221; and &#8220;Work Email&#8221;.  This is very easy to fix, but you&#8217;ll need to ask your system administrator to have a look at <a href="http://edeca.net/wp/2010/01/modifying-the-horde-turba-addressbook-for-the-iphone/">this post</a> on my blog.</p>
<p>Feel free to leave me a comment if you get stuck and I will endeavour to help you fix it.</p>
]]></content:encoded>
			<wfw:commentRss>http://edeca.net/wp/2010/01/syncing-the-iphone-addressbook-with-horde/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Modifying fields in the Turba addressbook</title>
		<link>http://edeca.net/wp/2010/01/modifying-fields-in-the-turba-addressbook/</link>
		<comments>http://edeca.net/wp/2010/01/modifying-fields-in-the-turba-addressbook/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 13:48:26 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[horde]]></category>

		<guid isPermaLink="false">http://edeca.net/wp/?p=290</guid>
		<description><![CDATA[I have recently started using the Funambol iPhone app to keep my contacts in sync with my webmail addressbook.  However, some fields aren&#8217;t included in Turba by default and need adding.  This post is for system administrators rather than users, so if you don&#8217;t run your own webmail then point your friendly geek at this [...]]]></description>
			<content:encoded><![CDATA[<p>I have recently started using the <a title="Funambol iPhone app" href="http://www.funambol.com/solutions/iphone.php">Funambol iPhone app</a> to keep my contacts in sync with my webmail addressbook.  However, some fields aren&#8217;t included in Turba by default and need adding.  This post is for system administrators rather than users, so if you don&#8217;t run your own webmail then point your friendly geek at this post.<br />
<span id="more-290"></span><br />
Firstly make sure you are using a recent version of Horde (e.g. 3.3.6).  There are three easy steps to adding the fields you would like in Turba:</p>
<ul>
<li>define an attribute (e.g. it is called &#8220;Home Email&#8221; and is of type &#8220;email&#8221;)</li>
<li>add it to list of fields that Turba uses (so it is displayed in the right place)</li>
<li>add the backend storage (so Turba can query/save the values)</li>
</ul>
<p>For this example, we are adding the home and work email fields, which are compatible with the iPhone contacts.  This post assumes you use a database backend, if you don&#8217;t then step 3 will be slightly different.</p>
<h4>1: Define an attribute</h4>
<p>Firstly, check the file <tt>turba/config/attributes.php</tt> and make sure the following is present:</p>
<pre>$attributes['homeEmail'] = array(
'label' =&gt; _("Home Email"),
'type' =&gt; 'email',
'required' =&gt; false,
'params' =&gt; array('allow_multi' =&gt; false, 'strip_domain' =&gt; false, 'link_compose' =&gt; true)
);</pre>
<p>This defines the field &#8220;Home Email&#8221;.  In recent versions of Horde this should already exist, so you shouldn&#8217;t need to modify the config. If you are creating a different type of field that does not exist already, it is easiest to copy the definition of something similar and change the label and attribute name.</p>
<h4>2: Tell Turba we want to use this field</h4>
<p>Next the file <tt>turba/config/sources.php</tt> needs to be edited.  Find the line <tt>'email' =&gt; 'object_email'</tt> and add below it the following two lines:</p>
<pre>'homeEmail' =&gt; 'object_homeemail',
'workEmail' =&gt; 'object_workemail',</pre>
<p>This tells Turba that the fields <tt>homeEmail</tt> and <tt>workEmail</tt> come from the database fields <tt>object_homeemail</tt> and <tt>object_workemail</tt>, respectively.  We also need to modify the list of tabs so that Turba knows to display our new values in the right place.</p>
<p>Email addresses should go on the &#8220;Communications&#8221; tab, after the existing email field, so we modify the array and insert the attribute names like below:</p>
<pre>_("Communications") =&gt; array('email', 'homeEmail', 'workEmail', 'homePhone', 'workPhone',
'cellPhone', 'fax', 'pager'),</pre>
<h4>3: Add the backend storage</h4>
<p>Assuming you use a database backend, this is as easy as creating two new fields in the database.  They should be named according to the values in <tt>sources.php</tt> that we defined above and should be similar to an existing row of the same type.  As we are creating email fields, we can use the same data type as the <tt>object_email</tt> row.</p>
<p>For this example, the following SQL will modify the database appropriately:</p>
<pre>ALTER TABLE `turba_objects`
ADD `object_homeemail` VARCHAR( 255 ) NOT NULL AFTER `object_email`,
ADD `object_workemail` VARCHAR( 255 ) NOT NULL AFTER `object_homeemail`</pre>
<p>The same process above can be followed for other fields that might be missing, post a comment if there is something that you&#8217;d like help adding.</p>
]]></content:encoded>
			<wfw:commentRss>http://edeca.net/wp/2010/01/modifying-fields-in-the-turba-addressbook/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
