<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Pádraig Kitterick</title>
	<atom:link href="http://blog.padraigkitterick.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.padraigkitterick.com</link>
	<description>code &#124; music &#124; photography</description>
	<pubDate>Sun, 24 Aug 2008 00:06:49 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Complete GMail redundancy in 7 easy steps</title>
		<link>http://blog.padraigkitterick.com/2008/08/24/backing-up-your-gmail-with-ubuntu/</link>
		<comments>http://blog.padraigkitterick.com/2008/08/24/backing-up-your-gmail-with-ubuntu/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 00:06:49 +0000</pubDate>
		<dc:creator>Pádraig</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Tech]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<category><![CDATA[email]]></category>

		<category><![CDATA[dovecot]]></category>

		<category><![CDATA[fetchmail]]></category>

		<category><![CDATA[gmail]]></category>

		<category><![CDATA[procmail]]></category>

		<category><![CDATA[redundancy]]></category>

		<guid isPermaLink="false">http://padraigkitterick.wordpress.com/?p=45</guid>
		<description><![CDATA[If there is anything that the recent GMail outages taught us, it&#8217;s that losing access to your email for a few hours should not mean that the end of the world has arrived. I think it also served as a reminder that if you rely 100% on the cloud for access to your data, then [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If there is anything that the recent <a title="Outage comment on official Gmail blog" href="http://gmailblog.blogspot.com/2008/08/we-feel-your-pain-and-were-sorry.html" target="_blank">GMail</a> <a title="El Reg weighs in on the outage" href="http://www.theregister.co.uk/2008/08/12/gmail_outage_outrage/" target="_blank">outages</a> taught us, it&#8217;s that losing access to your email for a few hours should not mean that the <a title="Gmail Outage @ 43folders" href="http://www.43folders.com/2008/08/12/working-in-contexts" target="_blank">end of the world</a> has arrived. I think it also served as a reminder that if you rely 100% on <a title="Cloud computing @ wikipedia" href="http://en.wikipedia.org/wiki/Cloud_computing" target="_blank">the cloud</a> for access to your data, then be prepared to be disconnected from it every once in a while. Fortunately, it&#8217;s quite easy to take advantage of free email services from the likes of Google while also making sure that should the worst happen, you can still access your data.</p>
<p><span id="more-45"></span></p>
<p>With more and more communication, both professional and personal, being conducted through email, it&#8217;s no wonder that people do get nervous when they suddenly lose control over several years worth of contacts and emails. This short article will show you how easy it is to back up your GMail automatically to a remote server which you can then access in the event that GMail goes down or you <a title="Denied access to a GMail account" href="http://www.chrisbrogan.com/when-google-owns-you/" target="_blank">lose access to your account</a>. We&#8217;ll be using nothing but free open-source software. If you already have a net-connected machine with <a title="Ubuntu" href="http://www.ubuntu.com/" target="_blank">Ubuntu</a> installed then you&#8217;re set to go. Otherwise, consider recycling an old pentium-or-better-cpu machine with a network card—the processing demands are relatively low and the most important resource is storage space for all the emails and attachments. Although these instructions are for Ubuntu, they should also work on Debian or any other Debian-based distro.</p>
<p>To set this up you obviously need a GMail account, although any email account which can be accessed using the <a title="POP @ wikipedia" href="http://en.wikipedia.org/wiki/Post_Office_Protocol" target="_blank">POP protocol</a> can be backed up using the same method. We&#8217;ll be using the excellent <a title="Fetchmail" href="http://www.catb.org/~esr/fetchmail/" target="_blank">Fetchmail</a> to retrieve messages from the GMail account while leaving them untouched in your GMail inbox, <a title="Procmail" href="http://www.procmail.org/" target="_blank">Procmail</a> to deliver and filter them into a local <a title="Maildir @ wikipedia" href="http://en.wikipedia.org/wiki/Maildir" target="_blank">Maildir</a>-format mailbox, and <a title="Dovecot" href="http://www.dovecot.org/" target="_blank">Dovecot</a> to access the emails remotely, all on the latest release of <a title="Ubuntu" href="http://www.ubuntu.com/" target="_blank">Ubuntu</a>, <em>Hardy Heron (8.04 LTS)</em>.</p>
<p><strong>1. Setup GMail</strong></p>
<ul>
<li>Log in to your GMail account</li>
<li>Click &#8216;Settings&gt;Imap/Pop&#8217; and enable POP access</li>
<li>You can chose whether to only download messages which arrive from now on or to download all existing messages. The latter is useful if you have already been using your GMail account for a while and would like to back all existing messages to a secure alternative location.</li>
</ul>
<p><strong>2. Install packages</strong></p>
<ul>
<li>Fire up a terminal window and run the following command:<code><br />
sudo apt-get install dovecot-imapd procmail fetchmail mutt</code></li>
<li>This should automatically download and install everything you need. The <em>mutt</em> package is optional and is a useful tool for checking if your IMAP server is working properly and that your emails are being downloaded (not to mention a nice command-line email client!).</li>
</ul>
<p><strong>3. Configure Fetchmail</strong></p>
<ul>
<li>We need to define our GMail accounts in fetchmail&#8217;s configuration file. Open the file <strong>/etc/fetchmailrc</strong> for editing as root. The file won&#8217;t exist yet so we&#8217;ll have to create it.</li>
<li> Copy &amp; paste the following into the file:<code><br />
set daemon 60<br />
set syslog<br />
set postmaster &#8220;<strong>localuser</strong>&#8220;<br />
poll pop.gmail.com<br />
protocol pop3<br />
username &#8220;username@gmail.com&#8221; there with password &#8220;yourpassword&#8221; is <strong>localuser</strong> here<br />
keep ssl<br />
mda &#8220;/usr/bin/procmail -d <strong>localuser</strong>&#8220;</code></li>
<li>Change <span style="color:#000000;"><strong>localuser</strong></span> to your local username on the linux box and the email and password to match your gmail account. If you want, you can add as many other accounts as you want here. For each account, just copy the text starting from &#8216;poll&#8230;&#8217; and change the login details.</li>
<li>The first line tells fetchmail to check for new emails every 60 seconds. Edit to match your preferred update frequency.</li>
<li>Edit <strong>/etc/default/fetchmail</strong> as root and change the line <code>START_DAEMON=no</code> to <code>START_DAEMON=yes</code></li>
</ul>
<p><strong>4. Configure Procmail (~/.procmailrc)</strong></p>
<ul>
<li>We&#8217;re using procmail to deliver email from fetchmail to a mailbox in <a title="Maildir @ wikipedia" href="http://en.wikipedia.org/wiki/Maildir" target="_blank">Maildir</a> format. This is necessary due to the lack of Maildir support in Fetchmail, which supports the <a title="mbox format @ wikipedia" href="http://en.wikipedia.org/wiki/Mbox" target="_blank">mbox</a> format. The main difference between the formats is that Maildir stores each email in a single file, making it very efficient when you have a lot of emails. In contrast, mbox format stores all emails in a single file.</li>
<li>Create <strong>~/.procmailrc</strong> and put the following text in it:<code><br />
MAILDIR=$HOME/Mail/<br />
DEFAULT=$MAILDIR<br />
VERBOSE=on<br />
LOGFILE=$MAILDIR/procmail.log<br />
:0<br />
$MAILDIR</code></li>
<li>Set permissions on the file with: <code>chmod 640 ~/.procmailrc</code></li>
<li>This file simply tells procmail where to store the emails (in ~/Mail) and where to store it&#8217;s logs. Procmail is capable of a lot more than this, and it supports a powerful filtering language. You can specify rules in your <strong>~/.procmailrc</strong> file to filter emails based on sender, subject, etc.</li>
</ul>
<p><strong>5. Configure Dovecot<br />
</strong></p>
<ul>
<li>We&#8217;re almost there! We can retrieve emails from the GMail servers and deliver them locally. Now we need a way to access the email remotely. For this we&#8217;re using Dovecot, and we need to tweak the configure a little.</li>
<li>As root, open up <strong>/etc/dovecot/dovecot.conf</strong> and update the following lines:<code><br />
protocols = imaps<br />
mail_location = maildir:~/Mail</code></li>
</ul>
<p><strong>6. Setup maildir</strong></p>
<ul>
<li>We need to create the local mailbox with:<code><br />
maildirmake.dovecot ~/Mail</code></li>
</ul>
<p><strong>7. Start services</strong></p>
<p>Okay, now everything is set up we need to start up the services:</p>
<p><code>sudo /etc/init.d/fetchmail start<br />
sudo /etc/init.d/dovecot start</code></p>
<p><strong>8. Enjoy!</strong></p>
<p>That&#8217;s it! Run <code>tail -f /var/log/syslog</code> to check fetchmail is receiving messages and also check <strong>~/Mail/procmail.log</strong> to see that procmail is not throwing up any errors. The final thing you need to do is make sure you can access your email server remotely. Dovecot is running over SSL on port 993, so just configure your router to enable external access to that port. Then just configure Outlook , Thunderbird, etc. to access IMAP over SSL and you have full access to all your emails on your own server.</p>
<p><em>Note:</em> if you chose to setup GMail POP access to allow all existing messages to be downloaded and you have lots of messages in your account, it will take a few runs of fetchmail to collect them all. Leave things running overnight and check back in the morning!</p>
<p><strong>Optional step: Setup mutt</strong></p>
<ul>
<li>Create the file <strong>~/.muttrc</strong> and put the following in it:<code><br />
set mbox_type=Maildir<br />
set folder=&#8221;~/Mail&#8221;<br />
set mask=&#8221;!^\\.[^.]&#8220;<br />
set mbox=&#8221;~/Mail&#8221;<br />
set record=&#8221;+.Sent&#8221;<br />
set postponed=&#8221;+.Drafts&#8221;<br />
set spoolfile=&#8221;~/Mail&#8221;</code></li>
<li>Now just run <code>mutt</code> and read your email!</li>
</ul>
<p><strong>Related Links</strong></p>
<ul>
<li><a title="Set Up a Debian or Ubuntu Machine as a Maildrop" href="http://www.webmonkey.com/tutorial/Set_Up_a_Debian_or_Ubuntu_Machine_as_a_Maildrop" target="_blank">Set Up a Debian or Ubuntu Machine as a Maildrop </a></li>
<li><a title="Dovecot" href="http://www.dovecot.org/" target="_blank">Dovecot</a></li>
<li><a title="Fetchmail" href="http://www.catb.org/~esr/fetchmail/" target="_blank">Fetchmail</a></li>
<li><a title="Procmail" href="http://www.procmail.org/" target="_blank">Procmail</a></li>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/padraigkitterick.wordpress.com/45/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/padraigkitterick.wordpress.com/45/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padraigkitterick.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padraigkitterick.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/padraigkitterick.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/padraigkitterick.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/padraigkitterick.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/padraigkitterick.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/padraigkitterick.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/padraigkitterick.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/padraigkitterick.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/padraigkitterick.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padraigkitterick.com&blog=2845992&post=45&subd=padraigkitterick&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.padraigkitterick.com/2008/08/24/backing-up-your-gmail-with-ubuntu/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/padraigkitterick-128.jpg" medium="image">
			<media:title type="html">Pádraig</media:title>
		</media:content>
	</item>
		<item>
		<title>links for 2008-08-12 [delicious.com]</title>
		<link>http://blog.padraigkitterick.com/2008/08/12/links-for-2008-08-12-deliciouscom/</link>
		<comments>http://blog.padraigkitterick.com/2008/08/12/links-for-2008-08-12-deliciouscom/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 15:30:31 +0000</pubDate>
		<dc:creator>Pádraig</dc:creator>
		
		<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://blog.padraigkitterick.com/2008/08/12/links-for-2008-08-12-deliciouscom/</guid>
		<description><![CDATA[

Deafness and the User Experience
Interesting article about improving the experience of deaf website users in an informed way.
My favourite quote:
&#34;We are not disabled and Deafness is not a disability; it’s the perception of many hearing (people) that we are disabled, and that is our disability.&#34;


keyczar
Easy-to-use encryption library with Java and Python bindings


Best. Unboxing. Ever.


  [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><ul class="delicious">
<li>
<div class="delicious-link"><a href="http://www.alistapart.com/articles/deafnessandtheuserexperience">Deafness and the User Experience</a></div>
<div class="delicious-extended">Interesting article about improving the experience of deaf website users in an informed way.</p>
<p>My favourite quote:<br />
&quot;We are not disabled and Deafness is not a disability; it’s the perception of many hearing (people) that we are disabled, and that is our disability.&quot;</p></div>
</li>
<li>
<div class="delicious-link"><a href="http://code.google.com/p/keyczar/">keyczar</a></div>
<div class="delicious-extended">Easy-to-use encryption library with Java and Python bindings</div>
</li>
<li>
<div class="delicious-link"><a href="http://www.flickr.com/photos/ntr23/tags/unpacking/">Best. Unboxing. Ever.</a></div>
</li>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/padraigkitterick.wordpress.com/44/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/padraigkitterick.wordpress.com/44/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padraigkitterick.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padraigkitterick.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/padraigkitterick.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/padraigkitterick.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/padraigkitterick.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/padraigkitterick.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/padraigkitterick.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/padraigkitterick.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/padraigkitterick.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/padraigkitterick.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padraigkitterick.com&blog=2845992&post=44&subd=padraigkitterick&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.padraigkitterick.com/2008/08/12/links-for-2008-08-12-deliciouscom/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/padraigkitterick-128.jpg" medium="image">
			<media:title type="html">Pádraig</media:title>
		</media:content>
	</item>
		<item>
		<title>Automatic key generation with App Engine</title>
		<link>http://blog.padraigkitterick.com/2008/06/21/automatic-key-generation-with-app-engine/</link>
		<comments>http://blog.padraigkitterick.com/2008/06/21/automatic-key-generation-with-app-engine/#comments</comments>
		<pubDate>Sat, 21 Jun 2008 12:57:50 +0000</pubDate>
		<dc:creator>Pádraig</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Python]]></category>

		<category><![CDATA[Tech]]></category>

		<category><![CDATA[Web]]></category>

		<category><![CDATA[appengine]]></category>

		<category><![CDATA[constructor]]></category>

		<category><![CDATA[Google]]></category>

		<category><![CDATA[key]]></category>

		<category><![CDATA[key_name]]></category>

		<category><![CDATA[model]]></category>

		<guid isPermaLink="false">http://padraigkitterick.wordpress.com/?p=41</guid>
		<description><![CDATA[After playing Google App Engine for a few days, I&#8217;ve realised the power that even the basic framework provided by Google, webapp, provides. Working with Python adds a level of flexibility that I never had when working with PHP many years ago (although this was before OO had really infected PHP).
While working on my first [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>After playing <a title="Google App Engine" href="http://code.google.com/appengine">Google App Engine</a> for a few days, I&#8217;ve realised the power that even the basic framework provided by Google, <a title="webapp framework" href="http://code.google.com/appengine/docs/webapp/">webapp</a>, provides. Working with Python adds a level of flexibility that I never had when working with PHP many years ago (although this was before OO had really infected PHP).</p>
<p>While working on my first real application for app engine I soon came across the problem of creating sensible key names for objects. If you aren&#8217;t familiar with the data object models in app engine, each object has a unique key, generated automatically when the object is created, and a key name (property: key_name) which can be specified by the user. The key name can be very useful if you need object identifiers which are human-readable, such as when you use them as part of your apps URLs.</p>
<p><span id="more-41"></span></p>
<p>All data objects are defined as Python classes which subclass the db.Model class, provided by Google. A simple example, from the app I&#8217;m working on, is an object which holds information about an author:</p>
<pre>class Author(db.Model):
  first_name = db.StringProperty(required=True)
  middle_name = db.StringProperty()
  last_name = db.StringProperty(required=True)</pre>
<p>Creating a new author is a simple matter of calling the class and passing property values either as keyword arguments or by accessing the property through the new instance:</p>
<pre>a = Author(first_name='John',
           last_name='Smith')
a.middle_name = 'Thomas'</pre>
<p>We can specify the optional <strong>key_name</strong> property when we create the object:</p>
<pre>a = Author(first_name='Alan',
           middle_name='Simon',
           last_name='Jones',
           key_name='alansimonjones')</pre>
<p>However, it&#8217;s more than likely that if we want to use the <strong>key_name</strong> property for a class of data objects, we will generate it procedurally based on the initial property values of the object. Above, we create the key name using the authors names. You could create a function which wraps the creation of the author object which does this for you:</p>
<pre>def newAuthor(first_name, last_name, middle_name = ''):
  parts = [first_name, middle_name, last_name]

  # Define the key name from the authors names.
  # We split() and join each name to remove any spaces
  key_name = ''.join([''.join(x.split()) for x in parts]).lower()
  return Author(first_name=first_name,
             last_name=last_name,
             middle_name=middle_name,
             key_name=key_name)</pre>
<p>but this is quite a lot of boilerplate code to solve a simple problem. Moreover, you need to make sure everyone working on the code is aware that this function must be used to create new author objects, rather than by calling the object class directly.</p>
<p>A more elegant solution is to encapsulate the creation of the key_name property in the class definition itself. This is bread and butter stuff for any Pythonista, and is handled by defining a constructor for our author object, using it to define our key name and then to manually call the constructor of the db.Model class. The last step is necessary as once we define our own constructor, the constructor of the super class is not called automatically. To add to the things we need to handle, it&#8217;s important to know that the db.Model class uses dynamic positional and keyword arguments. If that makes no sense to you, don&#8217;t worry, it&#8217;s simpler than you may think.</p>
<p>Python provides an additional way of specifying standard function arguments using the <strong>*variable</strong> syntax, and keyword arguments using the <strong>**variable</strong> syntax. If used in the definition of a function, the <strong>*variable</strong> will be a tuple of positional arguments, and <strong>**variable</strong> will be a dictionary relating keywords to variables. Therefore, we must make sure our new constructor has the same parameters as db.Model to ensure 100% compatibility.</p>
<p>Here is the updated author class, with the new <strong>__init__()</strong> function defined. It has been slightly altered because we access the keyword values using the <strong>kw</strong> dictionary and we need to check whether each of the properties have been specified or not by examining <strong>kw.keys()</strong>:</p>
<pre>class Author(db.Model):
  first_name = db.StringProperty(required=True)
  middle_name = db.StringProperty()
  last_name = db.StringProperty(required=True)

  def __init__(self, *args, **kw):
    parts = ['first_name', 'middle_name', 'last_name']

    # Define the key name from the authors names.
    # We split() and join each name to remove any spaces
    key_name = ''.join([''.join(kw[x].split()) for x in parts if x in kw.keys()]).lower()

    # Insert the new key_name property into the keyword arguments
    kw['key_name'] = key_name

    # Call the constructor of the base class
    db.Model.__init__(self, *args, **kw)</pre>
<p>We can now create new author objects and the key names will be generated automatically and will follow our specified format:</p>
<pre>a = Author(first_name='John', last_name='Smith')
# Will print 'johnsmith'
print a.key().name()

a = Author(first_name='John', middle_name='Alan Mike', last_name='Smith')
# Will print 'johnalanmikesmith'
print a.key().name()</pre>
<p>Being able to alter the properties of an object or preconfigure core properties at the time of instantiation can be useful in all sorts of situations, but this particular example is one which I can see myself using a lot.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/padraigkitterick.wordpress.com/41/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/padraigkitterick.wordpress.com/41/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padraigkitterick.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padraigkitterick.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/padraigkitterick.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/padraigkitterick.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/padraigkitterick.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/padraigkitterick.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/padraigkitterick.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/padraigkitterick.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/padraigkitterick.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/padraigkitterick.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padraigkitterick.com&blog=2845992&post=41&subd=padraigkitterick&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.padraigkitterick.com/2008/06/21/automatic-key-generation-with-app-engine/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/padraigkitterick-128.jpg" medium="image">
			<media:title type="html">Pádraig</media:title>
		</media:content>
	</item>
		<item>
		<title>links for 2008-02-13</title>
		<link>http://blog.padraigkitterick.com/2008/02/13/links-for-2008-02-13/</link>
		<comments>http://blog.padraigkitterick.com/2008/02/13/links-for-2008-02-13/#comments</comments>
		<pubDate>Wed, 13 Feb 2008 15:25:08 +0000</pubDate>
		<dc:creator>Pádraig</dc:creator>
		
		<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://blog.padraigkitterick.com/2008/02/13/links-for-2008-02-13/</guid>
		<description><![CDATA[

JungleDisk
Extremely cheap online storage using Amazon&#8217;s S3 service.


Python main() functions
Some advice from Guido about handling main() functions and input parameters.


Jottit
Make a website by typing into a box. No, really - that&#8217;s it.


Things to do when you&#8217;re a bored developer
Some ideas on how to be productive in what would otherwise be dead time.


    [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><ul class="delicious">
<li>
<div class="delicious-link"><a href="http://www.jungledisk.com/">JungleDisk</a></div>
<div class="delicious-extended">Extremely cheap online storage using Amazon&#8217;s S3 service.</div>
</li>
<li>
<div class="delicious-link"><a href="http://www.artima.com/weblogs/viewpost.jsp?thread=4829">Python main() functions</a></div>
<div class="delicious-extended">Some advice from Guido about handling main() functions and input parameters.</div>
</li>
<li>
<div class="delicious-link"><a href="http://jottit.com/">Jottit</a></div>
<div class="delicious-extended">Make a website by typing into a box. No, really - that&#8217;s it.</div>
</li>
<li>
<div class="delicious-link"><a href="http://bjorn.jottit.com/Things_to_do_when_you're_a_bored_developer.">Things to do when you&#8217;re a bored developer</a></div>
<div class="delicious-extended">Some ideas on how to be productive in what would otherwise be dead time.</div>
</li>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/padraigkitterick.wordpress.com/39/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/padraigkitterick.wordpress.com/39/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padraigkitterick.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padraigkitterick.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/padraigkitterick.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/padraigkitterick.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/padraigkitterick.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/padraigkitterick.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/padraigkitterick.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/padraigkitterick.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/padraigkitterick.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/padraigkitterick.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padraigkitterick.com&blog=2845992&post=39&subd=padraigkitterick&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.padraigkitterick.com/2008/02/13/links-for-2008-02-13/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/padraigkitterick-128.jpg" medium="image">
			<media:title type="html">Pádraig</media:title>
		</media:content>
	</item>
		<item>
		<title>Using PuTTY ssh keys with OpenSSH on Ubuntu</title>
		<link>http://blog.padraigkitterick.com/2007/09/16/using-putty-ssh-keys-with-openssh-on-ubuntu/</link>
		<comments>http://blog.padraigkitterick.com/2007/09/16/using-putty-ssh-keys-with-openssh-on-ubuntu/#comments</comments>
		<pubDate>Sun, 16 Sep 2007 15:43:01 +0000</pubDate>
		<dc:creator>Pádraig</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.padraigkitterick.com/2007/09/16/using-putty-ssh-keys-with-openssh-on-ubuntu/</guid>
		<description><![CDATA[Anyone who needs to access a unix/linux/osx machine from windows via ssh will be familiar with PuTTY, the free ssh client. PuTTYGen, available to download here, is a handy utility for creating RSA/DSA public/private keys for authentication. If you have generated your RSA keys using PuTTYGen, and would like to use them with OpenSSH on [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Anyone who needs to access a unix/linux/osx machine from windows via ssh will be familiar with <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">PuTTY</a>, the free ssh client. PuTTYGen, available to download <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">here</a>, is a handy utility for creating RSA/DSA public/private keys for authentication. If you have generated your RSA keys using PuTTYGen, and would like to use them with OpenSSH on Ubuntu, you just need to follow a few simple steps:</p>
<ul>
<li>Install putty with: <code>sudo apt-get install putty</code></li>
<li>Create the public key file:<br />
<code>puttygen /path/to/puttykey.ppk -L &gt; ~/.ssh/id_rsa.pub</code></li>
<li>Create the private key file:<br />
<code>puttygen /path/to/puttykey.ppk -O private-openssh -o ~/.ssh/id_rsa</code></li>
</ul>
<p>You should now be able to log into an SSH server using your private key. To install your public key simply copy from ~/.ssh/id_rsa.pub on your local machine to ~/.ssh/authorized_keys on the remote server.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/padraigkitterick.wordpress.com/38/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/padraigkitterick.wordpress.com/38/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padraigkitterick.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padraigkitterick.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/padraigkitterick.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/padraigkitterick.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/padraigkitterick.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/padraigkitterick.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/padraigkitterick.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/padraigkitterick.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/padraigkitterick.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/padraigkitterick.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padraigkitterick.com&blog=2845992&post=38&subd=padraigkitterick&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.padraigkitterick.com/2007/09/16/using-putty-ssh-keys-with-openssh-on-ubuntu/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/padraigkitterick-128.jpg" medium="image">
			<media:title type="html">Pádraig</media:title>
		</media:content>
	</item>
		<item>
		<title>asioWavPlay for Matlab released</title>
		<link>http://blog.padraigkitterick.com/2007/09/05/asiowavplay-for-matlab-released/</link>
		<comments>http://blog.padraigkitterick.com/2007/09/05/asiowavplay-for-matlab-released/#comments</comments>
		<pubDate>Wed, 05 Sep 2007 22:23:36 +0000</pubDate>
		<dc:creator>Pádraig</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://blog.padraigkitterick.com/2007/09/05/asiowavplay-for-matlab-released/</guid>
		<description><![CDATA[If you use Matlab for audio research / development, you&#8217;ll be familiar with the pretty poor native support for audio playback. As part of my research, I wanted to play multichannel (&#62;2) files at a variety of sampling rates and bit depths. In addition, I also wanted to use a low-latency audio layer, such as [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you use Matlab for audio research / development, you&#8217;ll be familiar with the pretty poor native support for audio playback. As part of my research, I wanted to play multichannel (&gt;2) files at a variety of sampling rates and bit depths. In addition, I also wanted to use a low-latency audio layer, such as ASIO, to take directÂ  advantange of my <a HREF="http://www.motu.com/products/pciaudio/24IO/" TARGET="_blank" TITLE="MOTU audio hardware">audio hardware</a>.</p>
<p>So, with a bit of coding I managed to put together a Matlab extension which allows for the playback of multichannel sound files using any soundcard with an ASIO driver. The plugin uses ASIO, <a HREF="http://www.portaudio.com/" TARGET="_blank" TITLE="PortAudio">PortAudio</a>, and <a HREF="http://www.mega-nerd.com/libsndfile/" TARGET="_blank" TITLE="libsndfile">libsndfile</a>. Samples are read from the audio file as needed, so playback start time is not dependant on the length of the file - useful in time-critical applications. Memory usage is also low because the whole file doesn&#8217;t need to be loaded into memory, only enough to fill the audio buffer.</p>
<p>You can download it over at the <a HREF="http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=15704" TARGET="_blank" TITLE="asioWavPlay">Matlab file exchange</a> and the source is included under the GPL. Comments and suggestions welcome!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/padraigkitterick.wordpress.com/37/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/padraigkitterick.wordpress.com/37/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padraigkitterick.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padraigkitterick.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/padraigkitterick.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/padraigkitterick.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/padraigkitterick.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/padraigkitterick.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/padraigkitterick.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/padraigkitterick.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/padraigkitterick.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/padraigkitterick.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padraigkitterick.com&blog=2845992&post=37&subd=padraigkitterick&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.padraigkitterick.com/2007/09/05/asiowavplay-for-matlab-released/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/padraigkitterick-128.jpg" medium="image">
			<media:title type="html">Pádraig</media:title>
		</media:content>
	</item>
		<item>
		<title>links for 2007-08-07</title>
		<link>http://blog.padraigkitterick.com/2007/08/07/links-for-2007-08-07/</link>
		<comments>http://blog.padraigkitterick.com/2007/08/07/links-for-2007-08-07/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 01:28:49 +0000</pubDate>
		<dc:creator>Pádraig</dc:creator>
		
		<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://blog.padraigkitterick.com/2007/08/07/links-for-2007-08-07/</guid>
		<description><![CDATA[

Parallel Python
Module for creating parallel Python scripts using either SMP or on a cluster. Much simpler than getting an MPI setup working&#8230;


       ]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><ul class="delicious">
<li>
<div class="delicious-link"><a href="http://www.parallelpython.com/">Parallel Python</a></div>
<div class="delicious-extended">Module for creating parallel Python scripts using either SMP or on a cluster. Much simpler than getting an MPI setup working&#8230;</div>
</li>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/padraigkitterick.wordpress.com/36/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/padraigkitterick.wordpress.com/36/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padraigkitterick.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padraigkitterick.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/padraigkitterick.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/padraigkitterick.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/padraigkitterick.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/padraigkitterick.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/padraigkitterick.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/padraigkitterick.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/padraigkitterick.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/padraigkitterick.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padraigkitterick.com&blog=2845992&post=36&subd=padraigkitterick&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.padraigkitterick.com/2007/08/07/links-for-2007-08-07/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/padraigkitterick-128.jpg" medium="image">
			<media:title type="html">Pádraig</media:title>
		</media:content>
	</item>
		<item>
		<title>Building a Diskless Linux Cluster: Debian (Etch) + DRBL + GridEngine</title>
		<link>http://blog.padraigkitterick.com/2007/07/25/building-a-diskless-linux-cluster-debian-etch-drbl-gridengine/</link>
		<comments>http://blog.padraigkitterick.com/2007/07/25/building-a-diskless-linux-cluster-debian-etch-drbl-gridengine/#comments</comments>
		<pubDate>Wed, 25 Jul 2007 14:32:42 +0000</pubDate>
		<dc:creator>Pádraig</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://blog.padraigkitterick.com/2007/07/25/building-a-diskless-linux-cluster-debian-etch-drbl-gridengine/</guid>
		<description><![CDATA[It&#8217;s quite common in University departments for roomfuls of very capable PCs to sit idle from 5pm until 8am everyday and all weekend. Thankfully, it&#8217;s possible to turn such a wasted resource into a powerful cluster of Linux machines using freely available open source software. In fact, even a group of machines in an office, [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>It&#8217;s quite common in University departments for roomfuls of very capable PCs to sit idle from 5pm until 8am everyday and all weekend. Thankfully, it&#8217;s possible to turn such a wasted resource into a powerful cluster of Linux machines using freely available open source software. In fact, even a group of machines in an office, or at home, can be transformed into a similar state with the minimum of effort. By booting the PCs (or nodes) over the network, no changes are made to the current setup of the machines, so reverting back to their normal state is as simple as rebooting. This guide will bring you through the process of creating a High-Performance Computing (HPC) cluster using the latest version of the <a title="Debian GNU/Linux" href="http://www.debian.org" target="_blank">Debian</a> GNU/Linux operating system, <a title="Diskless Remote Boot in Linux" href="http://drbl.sourceforge.net/" target="_blank">Diskless Remote Boot in Linux</a> (DRBL), and Sun&#8217;s Open Source <a title="Grid Engine" href="http://gridengine.sunsource.net/" target="_blank">N1 Grid Engine 6</a>.<span id="more-35"></span></p>
<p><strong>Requirements</strong></p>
<p>Creating a Linux cluster doesn&#8217;t require a huge amount of resources, either in hardware or in time, but there is a bare minimum of hardware that you need to get started:</p>
<ol>
<li>A moderately powerful (at least a Pentium 4 with 1Gb RAM) machine to act as the master node. This really needs to be a dedicated machine, as this will allow users to submit jobs whether the cluster is currently running or not.</li>
<li>The master node obviously needs a network card, but if you want to give the master or the nodes internet access, or are planning to have more than about 40 nodes, you will need two or three network cards. Even high-end Gigabit ethernet cards are cheap these days, and the way your nodes will communicate with the master can make or break a successful cluster.</li>
<li>Network infrastructure to connect all of the nodes together. A 100Mbit network is the absolute minimum, particularly if you will have more than 10 nodes. Gigabit ethernet is recommended.</li>
<li>One or more node PCs which support PXE booting (network booting). If the bios doesn&#8217;t have an option to boot from the network card, or you don&#8217;t see any messages about netbooting when you start the PCs, then you need to install a card which supports PXE. These nodes don&#8217;t need to have a hard drive, but if they do (and you have some spare space) then it can be used for a swap partition (virtual memory in Windows-speak). It helps if the nodes contain similar hardware (such as is found in most offices or University computer rooms), as it reduces the amount of configuration required (almost nobody likes to rebuild the Linux kernel 20 times).</li>
</ol>
<p><strong>Download the script files</strong></p>
<p>You will need to download some <a title="DRBL SGE Scripts" href="http://www.padraigkitterick.com/drbl_sge_scripts.zip">scripts</a> which help setup GridEngine with DRBL (Python is required to run them, but is installed by default in Debian)</p>
<p><strong>Install Debian</strong></p>
<p>For this project, I used the latest release of Debian, &#8216;Etch&#8217;. You can download it <a title="Download Debian Etch" href="http://www.debian.org/CD/">here</a>. I&#8217;m not going to go through the installation process, as you can find plenty of excellent documentation over at the <a title="Debian GNU/Linux" href="http://www.debian.org" target="_blank">Debian website</a>. I suggest heading straight for the <a title="Debian Installation Manual" href="http://www.debian.org/releases/stable/installmanual" target="_blank">installation manual</a>.</p>
<p>Thanks to the excellent installation scripts for <a title="Diskless Remote Boot in Linux" href="http://drbl.sourceforge.net/" target="_blank">Diskless Remote Boot Linux</a> (DRBL), you can choose whatever installation type you want when installing Debian. For example, if you want to use graphical configuration utilities to set up your system, the select a desktop install, which will include the X window system. If you only plan to access the master over SSH then choose a lightweight console-only install.</p>
<p><strong>Install DRBL</strong></p>
<p>Again, I won&#8217;t duplicate the excellent and thorough installation guide available from the DRBL website over <a title="DRBL Installation Guide" href="http://drbl.sourceforge.net/one4all/" target="_blank">here</a>. However, for the purposes of this guide it is important that you choose the <em>Single System Image</em> (SSI) mode when installing. This means that all the nodes download the same system image over the network which provides the minimum filesystem to boot Linux, and the rest of the system, including <code>/home</code>, <code>/usr</code> and <code>/opt</code> are NFS mounted (accessed over the network) on the master node. Therefore, any software and user files on the master node are available to all of the cluster nodes. To deploy new software across the cluster, the most dramatic step you need to take is to reboot the nodes, something that DRBL will even do for you.</p>
<p>A final point here is to take extra care when configuring the network setup of your nodes. During installation, DRBL will assume that any network card configured with a private address (e.g. 192.168.*) will contain nodes. If you will have over 40 machines on the network, consider splitting them up into two groups, and install two network cards in the machine with different subnets, e.g. 192.168.1.1/255.255.255.0 and 192.168.2.1/255.255.255.0. Having a multi-homed master node will increase the amount of data that you can push out to nodes.</p>
<p><strong>Install Grid Engine</strong></p>
<p>Before you go any further, make sure tht DRBL is installed, and that you can boot your nodes over the network from your master node. All following steps assume a working DRBL <em>Single System Image</em> setup with one or more nodes.</p>
<p>Now that you have a network of machines, the next step is to install software which will manage the distribution and scheduling of jobs on the cluster. There are several alternatives to choose from, including <a title="TORQUE Resource Manager" href="http://www.clusterresources.com/pages/products/torque-resource-manager.php" target="_blank">Torque</a>, <a title="Simple Linux Utility for Resource Management" href="http://www.llnl.gov/linux/slurm/" target="_blank">SLURM</a>, and <a title="Condor" href="http://www.cs.wisc.edu/condor/" target="_blank">Condor</a>.</p>
<p><em>Note: I strongly suggest that you do not install or use the Condor project on your system(s). Not only is the source code only available on request, and only to those that the maintainers feel are &#8217;suitable&#8217;, but by default the program will report information about your installation back to the Condor servers on a regular basis. There is no mention of this during the installation procedure. To add to this, the license requires that any publication which includes data that has been analysed or processed using Condor <strong>must </strong>include a reference to the Condor project. Given that there are plenty of open source alternatives available, I don&#8217;t recommend using this.</em></p>
<p><em><strong>UPDATE:</strong> As of 6.9.5, Condor is now released under the Apache Licence, v. 2.0. Therefore, some of the above concerns have been addressed. In particular, the source code is now available, but only when you agree to fill in personal information. However, I am still unsure whether usage information is reported to the maintainers by default. Caveat Emptor.<br />
</em></p>
<p>For this guide, we will be installing Sun&#8217;s <a title="Grid Engine" href="http://gridengine.sunsource.net/" target="_blank">N1 GridEngine 6</a>. GridEngine is simple to install on Linux, requires only a minimum of installed libraries, is relatively easy to integrate with an existing DRBL setup, and provides a wide range of powerful tools to manage and use your cluster. There is also extensive <a title="Grid Engine Documentation" href="http://gridengine.sunsource.net/documentation.html" target="_blank">documentation</a> available online.</p>
<p>Installing GridEngine will involve three setups:</p>
<ol>
<li>Installing the <code>qmaster</code> on the master node</li>
<li>Installing the execution host on the master node</li>
<li>Configuring the nodes and GridEngine to work together</li>
</ol>
<p><strong>Installing <code>qmaster</code></strong></p>
<p>This step simply involves installing <code>qmaster</code> on the master node as per the <a title="N1 GridEngine 6 - Installation Guide" href="http://docs.sun.com/app/docs/doc/817-6118/6mlhe9ad6?q=N1GE&amp;a=view" target="_blank">online documentation</a>. However, before starting the installation script, there are a few things you will need to do:</p>
<ul>
<li>Make sure the hostname of the master (or any of the nodes) doesn&#8217;t also point to <code>localhost</code> or <code>localhost.localdomain</code>. SGE objects very strongly if it does. So,if your /etc/hosts file looks like this:<br />
<code>127.0.0.1 localhost mymaster<br />
192.168.0.1 mymaster.mydomain.com mymaster</code><br />
then you will want to change it to:<code><br />
127.0.0.1 localhost<br />
192.168.0.1 mymaster.mydomain.com mymaster</code></li>
<li>Create a file containing the hostnames of your DRBL nodes. This will be used during the GridEngine installation process. Need to create a textfile which contains one hostname per line. This information is available from your DRBL installation at /etc/drbl/IP_HOSTS_TABLE. You can generate it using:<br />
<code>create_drbl_hostlist.py /path/to/output/hostlist</code></li>
</ul>
<p>During the <code>qmaster</code> installation process you can safely accept most of the defaults, but make sure you choose to:</p>
<ul>
<li><em>Install as root user</em><br />
You don&#8217;t have to do this, but it simplifies the process of getting SGE to run on the DRBL nodes. Please note that in recommending this, I am presuming that your cluster network is private, and the nodes won&#8217;t be accessible by non-privileged users (i.e. not you).</li>
<li><em>Do opt to verify file permissions</em></li>
<li><em>Select to use BerkleyDB, but without a spool server</em></li>
<li><em>Use the ID range suggested in the manual: 20000-20100</em></li>
<li><em>Accept to install startup scripts</em></li>
<li><em>Accept to load a file which contains the hostnames of your nodes.</em><br />
Here you enter the full path to file you created before running the install script.</li>
<li><em>Use normal scheduling</em></li>
</ul>
<p>Once it&#8217;s installed, source the SGE settings file in your .bashrc with the command:<br />
<code>source sge-root/cell/common/settings.sh</code><br />
where <code>sge-root</code> is the SGE installation directory.</p>
<p><strong>Install the execution host on the master server</strong></p>
<p>We don&#8217;t actually want to make the master node an execution node (although you may want to), as it&#8217;s job is to manage and schedule jobs on the other nodes. However, as the nodes rely on the master node&#8217;s filesystem for their applications, we will set up the execution daemons temporarily so that we may run them remotely on the nodes. Again, installation is as per the <a title="GridEngine Execution Host Installation Guide" href="http://docs.sun.com/app/docs/doc/817-6118/6mlhe9adc?a=view">documentation</a>, but there are some important choices to make:</p>
<ul>
<li><em>Specify a local spool dir: <code>/var/tmp/spool</code></em></li>
<li><em>Accept to install startup scripts</em></li>
</ul>
<p>After the install is finished:</p>
<ul>
<li><em>Move <code>/etc/init.d/sgeexecd</code> to somewhere safe</em></li>
<li><em>Run <code>update-rc.d -n sgeexecd remove</code> (because we don&#8217;t want to start at boot time on the master node)</em></li>
<li><em>Move <code>sgeexecd</code> script back into <code>/etc/init.d</code> (which will make it available to the nodes once we rerun the drblpush script)</em></li>
<li><em>Add <code>sgeexecd</code> to <code>/opt/drbl/conf/client-extra-service</code></em><br />
where /opt/drbl is your DRBL installation directory. This will make sure that the execution host daemon is started automatically when the nodes boots so they will be available to run jobs.</li>
<li><em>On the master node, save the current execution host config as a template with:</em><br />
<code>qconf -sconf hostname &gt; node.conf.template</code><br />
<em> where <code>hostname</code> is the hostname of the master. The config includes the custom local spool dir <code>/var/tmp/spool</code> which we want to be set for each of our nodes, so that the spool is storted locally in ram, and not on the master. If all of the nodes saved their spool information to the master via NFS, it would place a greater strain on the master node and the network infrastructure. Storing the information locally means that network bandwidth is saved for booting nodes and transferring user data/scripts for execution on the cluster. </em></li>
<li>Finally, run:<br />
<code>create_sge_nodeconfig.py /path/to/node.conf.template</code><br />
This script will create a new GridEngine configuration for each of the DRBL nodes (as defined in /etc/drbl/IP_HOSTS_TABLE) based on the template we saved.<em>Note: it is not strictly necessary to have a seperate configuration for each of the nodes, as the main purpose is to set the spool location to /var/tmp/spool. This is also possible by modifying the global configuration parameters of the GridEngine. However, I personally prefer having the ability to change the configuration of individual nodes if necessary without having to create a new configuration for them each time. As we use scripts to create and update the configurations, it doesn&#8217;t require any effort to adopt either setup.</em></li>
</ul>
<p><strong>Configure the nodes</strong></p>
<p>At the moment, a job queue (&#8217;all.q&#8217;) has been created on the master, because we ran the execution host install script. For this cluster, we can either add all our nodes to that queue or create a seperate queue for each node. For this setup we will have a seperate job queue on all execution hosts. We now want to remove the all.q queue from the master, remove it as an execute node, and add queues to all of our DRBL hosts:</p>
<ul>
<li>Save the queue config for the master with:<br />
<code>qconf -sq all.q &gt; node.queue.template</code></li>
<li>We&#8217;ll now modify the queue config template so that we can<br />
easily recreate a new config for each node with a script.<br />
Open the queue conf template in your favourite text editor<br />
and make the following changes:<br />
<code>qname    %HOST%.q<br />
hostlist    %HOST%<br />
slots    1</code><br />
Note: if you have more than 1 processor on all your nodes<br />
then you can change the number to reflect this<br />
<code>shell    /bin/bash</code><br />
Set this to whatever shell you want to use for jobs</li>
<li>Run <code>create_sge_nodequeues.py /path/to/queue.template</code><br />
This will create a new queue on each node with one slot per<br />
processor, enabling jobs to be submitted and executed.</li>
<li>Delete the all.q queue on the master as we won&#8217;t be<br />
using it:<br />
<code>qconf -dq all.q</code></li>
<li>And now, remove the @allhosts group because we have made<br />
individual queues for each node, so we don&#8217;t need it either:<br />
<code>qconf -dhgrp @allhosts</code></li>
<li>And last we remove the master as an execution node. It was<br />
set as such by running the execution host installation<br />
script, but we can undo that with:<br />
<code>qconf -de master</code></li>
</ul>
<p>If you now run <code>qhost -q | more</code> you should see a list of all your DRBL<br />
nodes and below each should be a queue definition. Running `qstat -f<br />
should now list the various queues that were created, and show how many<br />
slots each of them have and how many slots are filled at the moment.</p>
<p>Now, rerun <code>drblpush -i</code> or <code>drblpush -c /etc/drbl/drblpush</code> and restart one of<br />
your nodes. ssh into the node when it boots and confirm that <code>sgeexecd </code>is<br />
running with: <code>ps ax | grep sge</code>. If it isn&#8217;t, check for startup messages in<br />
<code>/tmp/execd*</code>.</p>
<p>Back on the master, rerun <code>qhost -q | more</code>. The node that you have<br />
rebooted should be listed with extra information than the others,<br />
such as free memory, number of processors, and load. You can now boot<br />
the rest of your nodes to create a diskless cluster with GridEngine and<br />
DRBL!</p>
<p><strong>Setting up MPI/MPICH support on GridEngine</strong></p>
<p>If you want to configure MPI/MPICH support, there are two steps<br />
which need to be completed. First, you must add a new parallel<br />
environment to GridEngine which sets up the mpi/mpich startup<br />
and shutdown scripts that are provided with SGE for use with<br />
MPI/MPICH jobs. Second, you must add your new parallel environment<br />
to each of your already existing job queues. For this example we<br />
will be setting up mpich as our parallel environment. If you want<br />
non-tight MPI support, just replace mpich with mpi throughout:</p>
<ul>
<li> Make a copy of the mpich.template in the mpi directory</li>
<li> Fill in the information that is missing (marked with &lt;&gt;) in the template, such as number of slots (just put 999) and the SGE root dir (for me it&#8217;s <code>/opt/n1ge6</code>)</li>
<li>Now add the parallel environment with:<code><br />
qconf -Ap /path/to/modified/mpich.template</code><br />
You can check it exists with <code>qconf -spl</code> and <code>qconf -sp mpich</code></li>
<li>Next, modify the node.queue.template that we created in a previous step, and change the &#8216;pe_list&#8217; from &#8216;make&#8217; to &#8216;make mpich&#8217;. This will enable parallel jobs to be run on the queue.</li>
<li>Finally, update all our queues (one for each DRBL node) with:<code><br />
update_sge_nodequeues.py /path/to/modified/node.queue.template</code></li>
<li>You can then check the updated queue definitions with:<code><br />
qconf -sq &lt;queuename&gt;</code><br />
where queuename is one of the queues on a DRBL node.</li>
</ul>
<p><strong>Using QMon</strong></p>
<p>QMon is the graphical interface to the Sun GridEngine system. To<br />
run it, you need some extra libraries installed. Unfortunately,<br />
they haven&#8217;t (and probably won&#8217;t) have a release candidate for<br />
Debian, so you need to get it manually from the Debian servers:</p>
<ul>
<li> Download the package for your install <a title="libmotif3 for Debian" href="http://packages.debian.org/unstable/libs/libmotif3" target="_blank">here</a>.</li>
<li>Install with <code>dpkg -i package-name.deb</code></li>
<li>Type <code>qmon </code>to start it.</li>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/padraigkitterick.wordpress.com/35/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/padraigkitterick.wordpress.com/35/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padraigkitterick.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padraigkitterick.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/padraigkitterick.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/padraigkitterick.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/padraigkitterick.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/padraigkitterick.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/padraigkitterick.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/padraigkitterick.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/padraigkitterick.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/padraigkitterick.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padraigkitterick.com&blog=2845992&post=35&subd=padraigkitterick&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.padraigkitterick.com/2007/07/25/building-a-diskless-linux-cluster-debian-etch-drbl-gridengine/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/padraigkitterick-128.jpg" medium="image">
			<media:title type="html">Pádraig</media:title>
		</media:content>
	</item>
		<item>
		<title>links for 2007-06-20</title>
		<link>http://blog.padraigkitterick.com/2007/06/20/links-for-2007-06-20/</link>
		<comments>http://blog.padraigkitterick.com/2007/06/20/links-for-2007-06-20/#comments</comments>
		<pubDate>Wed, 20 Jun 2007 01:27:20 +0000</pubDate>
		<dc:creator>Pádraig</dc:creator>
		
		<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://blog.padraigkitterick.com/2007/06/20/links-for-2007-06-20/</guid>
		<description><![CDATA[

Mistakes in Experimental Design and Interpretation
An excellent article discussing the common mistakes and pitfalls in the development, analysis, and interpretation of scientific experiments


Blogging Zelda
A blog detailing a player&#8217;s expierences as he completes each title in the Zelda series


       ]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><ul class="delicious">
<li>
<div class="delicious-link"><a href="http://norvig.com/experiment-design.html">Mistakes in Experimental Design and Interpretation</a></div>
<div class="delicious-extended">An excellent article discussing the common mistakes and pitfalls in the development, analysis, and interpretation of scientific experiments</div>
</li>
<li>
<div class="delicious-link"><a href="http://bloggingzelda.blogspot.com/">Blogging Zelda</a></div>
<div class="delicious-extended">A blog detailing a player&#8217;s expierences as he completes each title in the Zelda series</div>
</li>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/padraigkitterick.wordpress.com/34/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/padraigkitterick.wordpress.com/34/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padraigkitterick.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padraigkitterick.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/padraigkitterick.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/padraigkitterick.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/padraigkitterick.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/padraigkitterick.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/padraigkitterick.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/padraigkitterick.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/padraigkitterick.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/padraigkitterick.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padraigkitterick.com&blog=2845992&post=34&subd=padraigkitterick&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.padraigkitterick.com/2007/06/20/links-for-2007-06-20/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/padraigkitterick-128.jpg" medium="image">
			<media:title type="html">Pádraig</media:title>
		</media:content>
	</item>
		<item>
		<title>links for 2007-05-09</title>
		<link>http://blog.padraigkitterick.com/2007/05/09/links-for-2007-05-09/</link>
		<comments>http://blog.padraigkitterick.com/2007/05/09/links-for-2007-05-09/#comments</comments>
		<pubDate>Wed, 09 May 2007 01:29:41 +0000</pubDate>
		<dc:creator>Pádraig</dc:creator>
		
		<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://blog.padraigkitterick.com/2007/05/09/links-for-2007-05-09/</guid>
		<description><![CDATA[

You Can Own an Integer Too - Get Yours Here
Get your free 128-bit integers in the handy and easy to read HEX notation. I prefer 13,256,278,887,989,457,651,018,865,901,401,704,640 myself.


Flying LOW!
Amazing photographs of landings at St. Maarten airport in the Netherlands Antilles.


       ]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><ul class="delicious">
<li>
<div class="delicious-link"><a href="http://www.freedom-to-tinker.com/?p=1155">You Can Own an Integer Too - Get Yours Here</a></div>
<div class="delicious-extended">Get your free 128-bit integers in the handy and easy to read HEX notation. I prefer 13,256,278,887,989,457,651,018,865,901,401,704,640 myself.</div>
</li>
<li>
<div class="delicious-link"><a href="http://www.airliners.net/search/photo.search?nr_of_rows=2088&amp;sort_order=views&amp;first_this_page=0&amp;page_limit=15&amp;thumbnails=&amp;&amp;placesearch=Philipsburg%20%2F%20St.%20Maarten%20-%20Princess%20Juliana%20(SXM%20%2F%20TNCM)">Flying LOW!</a></div>
<div class="delicious-extended">Amazing photographs of landings at St. Maarten airport in the Netherlands Antilles.</div>
</li>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/padraigkitterick.wordpress.com/33/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/padraigkitterick.wordpress.com/33/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padraigkitterick.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padraigkitterick.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/padraigkitterick.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/padraigkitterick.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/padraigkitterick.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/padraigkitterick.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/padraigkitterick.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/padraigkitterick.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/padraigkitterick.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/padraigkitterick.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padraigkitterick.com&blog=2845992&post=33&subd=padraigkitterick&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.padraigkitterick.com/2007/05/09/links-for-2007-05-09/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/padraigkitterick-128.jpg" medium="image">
			<media:title type="html">Pádraig</media:title>
		</media:content>
	</item>
	</channel>
</rss>