<?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</title>
	<atom:link href="http://edeca.net/wp/feed/" rel="self" type="application/rss+xml" />
	<link>http://edeca.net/wp</link>
	<description>Musings of a geek</description>
	<lastBuildDate>Sun, 21 Feb 2010 15:01:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<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 [...]]]></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>=0<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> -1<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> + 1<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> 0 <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>0</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 offline [...]]]></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>
<h2>Download</h2>
<p class="download"><a href="http://edeca.net/downloads/libnids/libnids-1.24.tar.gz">libnids-1.24.tar.gz</a> &#8211; the complete tarball<br />
<a href="http://edeca.net/downloads/libnids/libnids1.23to1.24.patch">libnids1.23to1.24.patch</a> &#8211; a unified diff between the last release and 1.24</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 [...]]]></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, install [...]]]></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>1</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>1</slash:comments>
		</item>
		<item>
		<title>Blocking SSH brute forcing using denyhosts</title>
		<link>http://edeca.net/wp/2010/01/blocking-ssh-brute-forcing-using-denyhosts/</link>
		<comments>http://edeca.net/wp/2010/01/blocking-ssh-brute-forcing-using-denyhosts/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 23:04:44 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://edeca.net/wp/?p=254</guid>
		<description><![CDATA[Tired of seeing repeated attempts to login to a Linux server you run?  There are a number of options, all with their own benefits and disadvantages.  The easiest way is to move the port that the SSH server runs on, perhaps to 2222 instead of 22.  However. this can be annoying behind some firewalls and [...]]]></description>
			<content:encoded><![CDATA[<p>Tired of seeing repeated attempts to login to a Linux server you run?  There are a number of options, all with their own benefits and disadvantages.  The easiest way is to move the port that the SSH server runs on, perhaps to <tt>2222</tt> instead of <tt>22</tt>.  However. this can be annoying behind some firewalls and means that you need to specify the port each time you SSH to a host.  This post looks at denyhosts, a viable alternative.<br />
<span id="more-254"></span><br />
denyhosts will monitor your authorisation log (typically <tt>/var/log/auth.log</tt>) and ban IPs that repeatedly fail to authorise as a genuine user.  It will deny future logins by adding the IP address to <tt>/etc/hosts.deny</tt>.</p>
<p>On a sensible Debian or Ubuntu install, getting denyhosts is as simple as running:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><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 /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ aptitude install denyhosts</div></td></tr></tbody></table></div>
<p>denyhosts should work as soon as it is installed.  However, a few options can be tweaked to make it work nicely.  The configuration file is at <tt>/etc/denyhosts.conf</tt>.</p>
<p>Firstly, set a proper administration email by changing <tt>ADMIN_EMAIL</tt>.  The option <tt>RESET_ON_SUCCESS</tt> might also be important to you, by setting it to <tt>yes</tt> the failure count for an IP address will be reset if there is a successful login.  If you want the blocks to expire (which is more important if you use synchronisation) then you should tweak <tt>PURGE_DENY</tt> to a sensible value, for example 1 week.</p>
<p>Synchronisation is one nice feature of denyhosts that means that information on IPs that attempt SSH bruteforcing can be shared between servers.  Information about synchronisation can be read <a title="denyhosts FAQ" href="http://denyhosts.sourceforge.net/faq.html#sync">in the FAQ</a> but enabling it is as simple as uncommenting the <tt>SYNC_SERVER</tt> line.  By default, your server will share information on bruteforcers and receive it from other administrators who run denyhosts.</p>
<p>You can check how denyhosts is working by watching the logfile at <tt>/var/log/denyhosts</tt>.  You can see newly added blocks logged as a line like the below:</p>
<p><tt>new denied hosts: ['202.107.228.xxx']</tt></p>
<p>Of course, you don&#8217;t need this as you&#8217;ve already disabled SSH password logins and your firewall disables access to port 22 from anywhere except a specially crafted list of IPs.  But for 5 minutes work, it provides some peace of mind.</p>
]]></content:encoded>
			<wfw:commentRss>http://edeca.net/wp/2010/01/blocking-ssh-brute-forcing-using-denyhosts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Docbook XML made easy</title>
		<link>http://edeca.net/wp/2009/11/docbook-xml-made-easy/</link>
		<comments>http://edeca.net/wp/2009/11/docbook-xml-made-easy/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 19:36:03 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[docbook]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://edeca.net/wp/?p=246</guid>
		<description><![CDATA[In a slightly crazed moment today I decided to write some documentation.  Having used Docbook before for my UML Bridging Tutorial, I thought I&#8217;d pay it another visit.

As I was lazy and wanted a quick GUI way to do markup, I found an XML editor from XMLmind.  It is written in Java so [...]]]></description>
			<content:encoded><![CDATA[<p>In a slightly crazed moment today I decided to write some documentation.  Having used <a href="http://www.docbook.org/">Docbook</a> before for my <a href="http://edeca.net/articles/bridging/index.html">UML Bridging Tutorial</a>, I thought I&#8217;d pay it another visit.</p>
<p><span id="more-246"></span><br />
As I was lazy and wanted a quick GUI way to do markup, I found an XML editor from <a href="http://www.xmlmind.com/xmleditor/persoedition.html">XMLmind</a>.  It is written in Java so should run in most places and, except a few quirks, seems really good.  An hour later I had a few chapters written in Docbook markup ready to be published.</p>
<p>However, I couldn&#8217;t find many sites that gave a quick and easy example of how to convert from XML to PDF or HTML.  It seems that for Docbook XML you need a toolchain, which means understanding in a lot of detail what each stage does.  With Docbook SGML there were a number of nifty <tt>docbook2x</tt> programs which did the work and gave HTML, PDF or text output (amongst others).</p>
<p>To duplicate this quickly and easily with Docbook XML, I found that <tt>xmlto</tt> and <tt>dblatex</tt> were the solution.  To create an HTML document, it couldn&#8217;t be easier than:</p>
<pre># Make a one page per chapter HTML book
$ xmlto xhtml MyDocument.xml
# Make a one page HTML document
$ xmlto html-nochunks MyDocument.xml</pre>
<p>For PDF, it is as simple as:</p>
<pre># dblatex defaults to PDF
$ dblatex MyDocument.xml</pre>
<p>Both of these packages (as well as the Docbook stylesheets) have been available in Ubuntu since 8.04.  In order to make (X)HTML output prettier, you might like to look at <a href="http://ds9a.nl/docbook/minimal-page.html">this page</a> which gives a great tutorial.</p>
]]></content:encoded>
			<wfw:commentRss>http://edeca.net/wp/2009/11/docbook-xml-made-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Printing in Windows 7</title>
		<link>http://edeca.net/wp/2009/11/printing-in-windows-7/</link>
		<comments>http://edeca.net/wp/2009/11/printing-in-windows-7/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 19:44:34 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[annoyances]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://edeca.net/wp/?p=240</guid>
		<description><![CDATA[So Windows 7 is here.  This blog post is rather outdated as far as that is concerned.  What&#8217;s missing still is becoming more of a frustration though, as neither the HP P1006 or Canon laser printer I have are currently supported.

From the Canon website:
&#8220;Canon will support its laser printer, multifunctional, fax and personal [...]]]></description>
			<content:encoded><![CDATA[<p>So Windows 7 is here.  This blog post is rather outdated as far as that is concerned.  What&#8217;s missing still is becoming more of a frustration though, as neither the HP P1006 or Canon laser printer I have are currently supported.<br />
<span id="more-240"></span><br />
From the <a href="http://www.canon.co.uk/Operating_System_Drivers/index.asp">Canon website</a>:</p>
<blockquote><p>&#8220;Canon will support its laser printer, multifunctional, fax and personal copier products with Windows 7.  Detailed information will be available closer to start of sales of Windows 7.&#8221;</p></blockquote>
<p>Well Canon, that was a few weeks ago, time to wake up.  <a href="http://tinyurl.com/ykd9gts">HP&#8217;s statement</a> if you choose Windows 7 from their official support page is similarly unenlightening:</p>
<blockquote><p>&#8220;HP is committed to providing the best experience for HP products in the Windows 7 operating environment.<br />
Today, a solution for your product is not available in Microsoft’s Windows 7. However, a full solution driver download will be available in late November 2009.&#8221;</p></blockquote>
<p>Apparently the HP P1006 can be coerced to install with a bit of work and the original driver CD.  Fortunately I have a multifunction printer that is fine and no real urge to force drivers onto my shiny new install.  Neither the Canon or HP site offers an email notification when drivers are available, which is rather inexcusable from two of the biggest companies around.</p>
<p>The reason for these printers not working eludes me.  Whilst the HP P1006 is not a &#8220;real&#8221; printer (instead it relies on software that runs on the PC to send a sequence of dots) the Vista drivers apparently do work, so it should just be a case of testing and signing the drivers for Windows 7.  With the most open beta program that Microsoft have ever run, this shouldn&#8217;t have been hard.</p>
<p>All this aside, Windows 7 is a really nice upgrade from XP.  Microsoft have put in a lot of effort to make it work first time and it&#8217;s a real shame that Canon and HP botched this with a serious fail.</p>
]]></content:encoded>
			<wfw:commentRss>http://edeca.net/wp/2009/11/printing-in-windows-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Showing Remember The Milk events in the iPhone calendar</title>
		<link>http://edeca.net/wp/2009/09/showing-remember-the-milk-events-in-the-iphone-calendar/</link>
		<comments>http://edeca.net/wp/2009/09/showing-remember-the-milk-events-in-the-iphone-calendar/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 20:07:39 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://edeca.net/wp/?p=199</guid>
		<description><![CDATA[I&#8217;ve been using Remember The Milk for a few days now and I am really impressed.  One thing that is missing is the ability to show what tasks are due on a certain day when browsing the calendar, because Apple haven&#8217;t opened up the calendar API.  However, it is incredibly easy to add [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using Remember The Milk for a few days now and I am really impressed.  One thing that is missing is the ability to show what tasks are due on a certain day when browsing the calendar, because Apple haven&#8217;t opened up the calendar API.  However, it is incredibly easy to add this feature.<br />
<span id="more-199"></span><br />
iPhone OS 3.0 brought the ability to subscribe to remote calendars using iCalendar or CalDAV.  Remember The Milk publishes a read-only view of your tasks via. iCalendar.</p>
<p>To begin with, login to Remember The Milk and proceed to the tasks overview page.  Make a note of the link highlighted in the picture below, with the text &#8220;iCalendar (Events)&#8221;.  Note that you don&#8217;t need to copy the part after <tt>?tok</tt>, or it would be very long to type into the iPhone!</p>
<div id="attachment_214" class="wp-caption aligncenter" style="width: 321px"><a href="http://edeca.net/wp/wp-content/uploads/2009/09/rememberthemilk.png"><img class="size-full wp-image-214" title="Remember The Milk iCalendar export" src="http://edeca.net/wp/wp-content/uploads/2009/09/rememberthemilk.png" alt="Remember The Milk iCalendar export" width="311" height="212" /></a><p class="wp-caption-text">Remember The Milk iCalendar export</p></div>
<p>You should end up with a link like this:</p>
<p><tt>www.rememberthemilk.com/icalendar/username/12345678/events/</tt></p>
<p>Make sure your username and the unique number are correct.  Now head over to your iPhone and follow the steps below.</p>
<ul>
<li>Open Settings and choose &#8220;Mail, Contacts, Calendars&#8221;</li>
<li>Choose &#8220;Add account&#8230;&#8221; and then &#8220;Other&#8221;</li>
<li>Choose &#8220;Add Subscribed Calendar&#8221;</li>
<div id="attachment_223" class="wp-caption aligncenter" style="width: 160px"><a href="http://edeca.net/wp/wp-content/uploads/2009/09/iphone1.jpg"><img src="http://edeca.net/wp/wp-content/uploads/2009/09/iphone1-150x150.jpg" alt="Adding a subscribed calendar" title="Adding a subscribed calendar to the iPhone" width="150" height="150" class="size-thumbnail wp-image-223" /></a><p class="wp-caption-text">Adding a subscribed calendar</p></div>
<li>Type in the link you got from the Remember The Milk website into the &#8220;Server&#8221; field and select &#8220;Next&#8221;</li>
<li>The iPhone should now tell you the account requires a username and password, use your Remember The Milk credentials (the same as for their website) and press &#8220;Next&#8221;</li>
<div id="attachment_224" class="wp-caption aligncenter" style="width: 160px"><a href="http://edeca.net/wp/wp-content/uploads/2009/09/iphone2.jpg"><img src="http://edeca.net/wp/wp-content/uploads/2009/09/iphone2-150x150.jpg" alt="Confirming iCalendar account details" title="Confirming iCalendar account details on the iPhone" width="150" height="150" class="size-thumbnail wp-image-224" /></a><p class="wp-caption-text">Confirming iCalendar account details</p></div>
<li>If the phone says &#8220;Subscribed Calendar account verified&#8221;, you are good to go!  If not, double check you have an internet connection and that the link, username and password are all correct.</li>
<li>Press &#8220;Save&#8221; and head back to the iPhone calendar</li>
<li>Find a day where you have a task due in order to check it worked.  On my phone, they appear as red events</li>
<div id="attachment_222" class="wp-caption aligncenter" style="width: 160px"><a href="http://edeca.net/wp/wp-content/uploads/2009/09/iphone3.jpg"><img src="http://edeca.net/wp/wp-content/uploads/2009/09/iphone3-150x150.jpg" alt="Remember The Milk events in the iPhone calendar" title="Remember The Milk events in the iPhone calendar" width="150" height="150" class="size-thumbnail wp-image-222" /></a><p class="wp-caption-text">Remember The Milk events in the iPhone calendar</p></div>
</ul>
<p>If you like this, please comment.  And don&#8217;t forget to subscribe to Remember The Milk!  I will probably do so in a few days, it is a really useful service.</p>
]]></content:encoded>
			<wfw:commentRss>http://edeca.net/wp/2009/09/showing-remember-the-milk-events-in-the-iphone-calendar/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using iTunes with media keyboards</title>
		<link>http://edeca.net/wp/2009/09/using-itunes-with-media-keyboards/</link>
		<comments>http://edeca.net/wp/2009/09/using-itunes-with-media-keyboards/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 16:58:48 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://edeca.net/wp/?p=196</guid>
		<description><![CDATA[It has frustrated me for a while that the play/pause buttons on my keyboard don&#8217;t control iTunes unless the iTunes window has focus.  This seemed a bit strange, but a very quick Google finds a very useful plugin that fixes this issue.  Thanks to the author.. whoever they are!
]]></description>
			<content:encoded><![CDATA[<p>It has frustrated me for a while that the play/pause buttons on my keyboard don&#8217;t control iTunes unless the iTunes window has focus.  This seemed a bit strange, but a very quick Google finds a <a href="http://www.everythingitunes.com/os/windows/2008-01-04/mmkeysdll/">very useful plugin</a> that fixes this issue.  Thanks to the author.. whoever they are!</p>
]]></content:encoded>
			<wfw:commentRss>http://edeca.net/wp/2009/09/using-itunes-with-media-keyboards/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
