<?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>Blogging to Nowhere &#187; awesome</title>
	<atom:link href="http://webworxshop.com/tag/awesome/feed" rel="self" type="application/rss+xml" />
	<link>http://webworxshop.com</link>
	<description>cat /dev/brain &#62; /dev/null</description>
	<lastBuildDate>Sat, 05 May 2012 21:57:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
	<atom:link rel="hub" href="http://superfeedr.com/hubbub" />
			<item>
		<title>Quick QR Code Generation</title>
		<link>http://webworxshop.com/2011/03/09/quick-qr-code-generation</link>
		<comments>http://webworxshop.com/2011/03/09/quick-qr-code-generation#comments</comments>
		<pubDate>Tue, 08 Mar 2011 22:58:22 +0000</pubDate>
		<dc:creator>Rob Connolly</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[qrcode]]></category>

		<guid isPermaLink="false">http://blog.webworxshop.com/?p=552</guid>
		<description><![CDATA[<p><a href="https://secure.wikimedia.org/wikipedia/en/wiki/QR_Code">QR Codes</a> are a really easy way to share information between your desktop or laptop and a smartphone, which don&#8217;t have the privacy issues inherent in Google&#8217;s <a href="https://code.google.com/p/chrometophone/">Chrome To Phone</a>. The excellent FOSS <a href="http://code.google.com/p/zxing/">Barcode Scanner</a> app for Android makes scanning these codes and opening the scanned data a breeze. However, generating them [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://secure.wikimedia.org/wikipedia/en/wiki/QR_Code">QR Codes</a> are a really easy way to share information between your desktop or laptop and a smartphone, which don&#8217;t have the privacy issues inherent in Google&#8217;s <a href="https://code.google.com/p/chrometophone/">Chrome To Phone</a>. The excellent FOSS <a href="http://code.google.com/p/zxing/">Barcode Scanner</a> app for Android makes scanning these codes and opening the scanned data a breeze. However, generating them on the desktop can be a bit of a pain. There are several websites, browser addons and APIs for generating these codes, but up until now I haven&#8217;t found anything really quick and easy.</p>
<p>That is until today, when I discovered the &#8216;qrencode&#8217; utility. Qrencode does exactly what it says on the tin. It takes some text, encodes it as a QR Code and writes the result as a PNG file. It&#8217;s a simple command line tool, which opens up awesome scripting possibilities. </p>
<p>My use case is simply to send the URL of a web page that I&#8217;m viewing on my desktop to my phone, via QR Code. I found that qrencode was quite happy to write its output to stdout, which meant I could display the result directly using ImageMagick&#8217;s &#8216;display&#8217; command, e.g:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ qrencode http:<span style="color: #000000; font-weight: bold;">//</span>blog.webworxshop.com <span style="color: #660033;">-o</span> - <span style="color: #000000; font-weight: bold;">|</span> display</pre></div></div>

<p>You&#8217;ll notice that by default the QR Code is quite small. We can fix this by increasing the block size:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ qrencode http:<span style="color: #000000; font-weight: bold;">//</span>blog.webworxshop.com <span style="color: #660033;">-s</span> <span style="color: #000000;">10</span> <span style="color: #660033;">-o</span> - <span style="color: #000000; font-weight: bold;">|</span> display</pre></div></div>

<p>Next, I wanted to automatically pull the text to encode from somewhere to save typing &#8211; the clipboard was an ideal candidate. Enter &#8216;xclip&#8217;. Xclip is a command line utility to read and write from/to the X system&#8217;s built in clipboard. I used bash&#8217;s backtick command substitution to grab text from the clipboard and encode it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ qrencode <span style="color: #000000; font-weight: bold;">`</span>xclip -o<span style="color: #000000; font-weight: bold;">`</span> <span style="color: #660033;">-s</span> <span style="color: #000000;">10</span> <span style="color: #660033;">-o</span> - <span style="color: #000000; font-weight: bold;">|</span> display</pre></div></div>

<p>And there you have it, a simple one line command to generate and display a QR Code from the contents of the clipboard. I created a bash script containing the command and assigned it to a keyboard shortcut in Gnome (Ctrl-Shift-Q), so that sharing URLs to my phone is as simple as selecting the text in the location bar and hitting Ctrl-C followed by Ctrl-Shift-Q.</p>
<p>If you want to give this a try, you&#8217;ll need to install the utilities discussed, in Fedora these can be installed with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> yum <span style="color: #c20cb9; font-weight: bold;">install</span> qrencode xclip ImageMagick</pre></div></div>

<p>Enjoy!</p>
 <p><a href="http://webworxshop.com/?flattrss_redirect&amp;id=552&amp;md5=d83e1c544fe3e8d5e3a6824b95c0ec6c" title="Flattr" target="_blank"><img src="http://blog.webworxshop.com/wp-content/plugins/flattrss/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://webworxshop.com/2011/03/09/quick-qr-code-generation/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=robconnolly&amp;popout=1&amp;url=http%3A%2F%2Fwebworxshop.com%2F2011%2F03%2F09%2Fquick-qr-code-generation&amp;language=en_GB&amp;category=text&amp;title=Quick+QR+Code+Generation&amp;description=QR+Codes+are+a+really+easy+way+to+share+information+between+your+desktop+or+laptop+and+a+smartphone%2C+which+don%26%238217%3Bt+have+the+privacy+issues+inherent+in+Google%26%238217%3Bs+Chrome+To+Phone....&amp;tags=Android%2Cawesome%2Cbash%2CFedora%2Cfoss%2Cqrcode%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Review: Piwik Analytics Software</title>
		<link>http://webworxshop.com/2011/01/21/review-piwik-analytics-software</link>
		<comments>http://webworxshop.com/2011/01/21/review-piwik-analytics-software#comments</comments>
		<pubDate>Thu, 20 Jan 2011 20:37:53 +0000</pubDate>
		<dc:creator>Rob Connolly</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[piwik]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.webworxshop.com/?p=403</guid>
		<description><![CDATA[<p>If you read my previous post regarding the <a href="http://blog.webworxshop.com/2011/01/13/giving-this-site-an-overhaul">site overhaul</a> that I&#8217;m currently doing you will have seen me mention that I&#8217;m now using the <a href="http://piwik.org">Piwik</a> Open Source Analytics Package in place of <a href="http://analytics.google.com">Google Analytics</a>. Well I&#8217;ve had it running for a few days and have played around with it a bit, [...]]]></description>
			<content:encoded><![CDATA[<p>If you read my previous post regarding the <a href="http://blog.webworxshop.com/2011/01/13/giving-this-site-an-overhaul">site overhaul</a> that I&#8217;m currently doing you will have seen me mention that I&#8217;m now using the <a href="http://piwik.org">Piwik</a> Open Source Analytics Package in place of <a href="http://analytics.google.com">Google Analytics</a>. Well I&#8217;ve had it running for a few days and have played around with it a bit, so I thought I&#8217;d review it. I&#8217;m going to start with my reasons for moving from GA and then move along and score it on several different criteria:</p>
<ul>
<li>Installation and Setup</li>
<li>Site integration</li>
<li>User interface</li>
<li>Extensibility (API availability)</li>
<li>Overall impressions (documentation, community, etc.)</li>
</ul>
<p><strong>The philosophical argument</strong></p>
<p>As well as the obvious benefit (from a Freedom perspective) of using one less proprietary web service, there is also another reason that I switched away from Google Analytics. Basically, this was privacy. For a while I&#8217;ve been using technologies to limit the amount of data which leaks from my browser as I navigate the web, in order to reduce the amount of profiling of my web activities. This isn&#8217;t because I have anything to hide. I just don&#8217;t like the idea of large companies building up a huge database on me, without my permission. The upshot of this is that I found myself in the slightly hypocritical situation of blocking GA in my own browser, but using it to track others on my site.</p>
<p>The solution was obvious, remove GA from my site. However, I didn&#8217;t want to lose the valuable information that it provides me with. Also, I don&#8217;t have a problem with site owners collecting data that can help them, just with them sharing it with 3rd parties such as Google, who then build it into their larger profiling efforts. A quick search turned up <a href="http://piwik.org">Piwik</a> which aims to provide a full featured GA replacement that you can run on your own server. Because site owners run their own instances, they remain in charge of their tracking of users, retain ownership of the data and best of all don&#8217;t give any data to Google.</p>
<p>With the aim of responsible and unobtrusive tracking in mind I&#8217;ve added a page to my site to allow users to <a href="http://blog.webworxshop.com/tracking-opt-out">Opt-out</a> of the Piwik tracking by means of a cookie. The link is also accessible from the sidebar under the copyright notice. I&#8217;m afraid some of the text on that page is pretty difficult to see with my current theme, but I&#8217;m working on this. For now just uncheck the check box to opt-out.</p>
<p>Right, on to the main event, the actual review&#8230;</p>
<p><strong>1. Installation and Setup</strong></p>
<p>There&#8217;s actually not much to say here, which is because installation was ridiculously easy! I just downloaded the zip to my sever (with wget) and unzipped it into my server root directory. This produced a directory called &#8216;piwik&#8217; and a &#8216;How to Install Piwik.html&#8217; file, which if you point your browser at it will redirect you to the <a href="http://piwik.org/docs/installation/">installation instructions</a>. The rest of the installation was fairly simple, following the instructions I pointed my browser at the &#8216;/piwik/&#8217; directory of my site and was greeted by the installer. Following this was really easy, you&#8217;ll need to create a MySQL database when prompted for the database info, but that&#8217;s about as hard as it gets. Towards the end you&#8217;ll be prompted to setup your site with Piwik which involves entering a few details about the site, then you&#8217;ll be provided with a snippet of JavaScript to add to your site template. Which leads me neatly into the next section&#8230;</p>
<p><strong>2. Site Integration</strong></p>
<p>I didn&#8217;t copy and paste the JavaScript into my template, instead opting to install the WP-Piwik addon for WordPress. This made the set up easy and also gave me a widget on my WordPress admin dashboard which gives me a nice overview of my site visits. As I already said I was also able to add a widget to the site to enable visitors to opt-out of tracking. This was also simple, just involving a copy and paste of a couple of lines of HTML from one of the settings pages into a WordPress page. Easy!</p>
<p>You can also integrate Piwik widgets with your site, by following the <a href="http://piwik.org/docs/embed-piwik-report/">instructions in the documentation</a>, this is a neat feature, especially if you have a custom start page set in your web browser (something which I have yet to get around to making).</p>
<p>I also investigated the campaigns functionality in order to track entries to my site from the RSS feed. This is really simple to use, all you have to do is append the query string &#8216;?piwik_campaign=NAME&#8217;, where NAME is the name of your campaign to the end of a URL, to have it show up under that campaign. I found that I could integrate this with WordPress pretty well by adding the following snippet of code to the functions.php file of my theme:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> piwik_track_feed<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$url</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;?piwik_campaign=RSS&quot;</span><span style="color: #339933;">;</span>
     <span style="color: #b1b100;">return</span> <span style="color: #000088;">$url</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;the_permalink_rss&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;piwik_track_feed&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>If you now check the URLs in your RSS feeds, they will all have the query string added and clicks will be attributed to the &#8216;RSS&#8217; campaign in Piwik.</p>
<p><strong>3. User Interface</strong></p>
<p>The Piwik user interface is really nice. I&#8217;ve included some screenshots below, so that you can make up your own mind. It&#8217;s pretty similar to the GA user interface, only cleaner and all the AJAX stuff makes it feel really responsive. I also love the real time tracking widget, which is something GA totally lacks. The only bad thing about the UI is the requirement of Flash for the graphs. I hate Flash and it doesn&#8217;t have a reliable 64-bit Linux version, which means I only have it installed on my netbook. Oh, and before you ask, I tried it with <a href="http://gnashdev.org/">Gnash</a> and it didn&#8217;t work!</p>

<a href='http://webworxshop.com/2011/01/21/review-piwik-analytics-software/piwik_screenshot_2' title='Piwik Locations Page'><img width="150" height="150" src="http://blog.webworxshop.com/wp-content/uploads/2011/01/piwik_screenshot_2-150x150.png" class="attachment-thumbnail" alt="Piwik Locations Page" title="Piwik Locations Page" /></a>
<a href='http://webworxshop.com/2011/01/21/review-piwik-analytics-software/piwik_screenshot_3' title='Piwik Search Engine Pages'><img width="150" height="150" src="http://blog.webworxshop.com/wp-content/uploads/2011/01/piwik_screenshot_3-150x150.png" class="attachment-thumbnail" alt="Piwik Search Engine Pages" title="Piwik Search Engine Pages" /></a>
<a href='http://webworxshop.com/2011/01/21/review-piwik-analytics-software/piwik_screenshot_1' title='Main Piwik Dashboard'><img width="150" height="150" src="http://blog.webworxshop.com/wp-content/uploads/2011/01/piwik_screenshot_1-150x150.png" class="attachment-thumbnail" alt="Main Piwik Dashboard" title="Main Piwik Dashboard" /></a>

<p><strong>4. Extensibility</strong></p>
<p>By extensibility, I was primarily interested in API access. There&#8217;s certainly no shortage of this with two APIs listed on the <a href="http://piwik.org/docs/">documentation page</a>. One API is for performing tracking, which I didn&#8217;t need given my usage of the WordPress plugin. I looked instead at the <a href="http://piwik.org/docs/analytics-api/">analytics API</a>, which allows you to access all the data through simple HTTP requests. I was able to write a simple Python script to email me my main statistics once a day, in about an hour (including working out how the Python email and smtplib modules work!). Performing an Piwik API call in Python is as simple as:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> getVisits<span style="color: black;">&#40;</span>idSite, period, date<span style="color: black;">&#41;</span>:
    url = <span style="color: #483d8b;">&quot;%s/index.php?module=API&amp;method=VisitsSummary.get&amp;idSite=%d&amp;perio$
    return json.load(urllib2.urlopen(url))</span></pre></td></tr></table></div>

<p>Of course, as it&#8217;s Python its ridiculously simple!</p>
<p>Of course, if you find something that you can&#8217;t do with the API (which is unlikely, because it seems to cover everything), the you can access the data in the database &#8211; because it&#8217;s in YOUR database. You can also back-up and secure your data exactly how you want to. This is something that GA just can&#8217;t compete with!</p>
<p><strong>5. Overall Impressions</strong></p>
<p>My impressions of Piwik as a project have been really good. The documentation is excellent and there seems to be a good community behind it. As a product its a pleasure to use, really easy to install and just works. The reliance on flash for the graphs is a bit disappointing, but perhaps this will change in the future as HTML5 matures. Here are the obligatory scores:</p>
<ul>
<li>Installation and Setup &#8211; 5/5</li>
<li>Site Integration &#8211; 4/5</li>
<li>User Interface &#8211; 3/5</li>
<li>Extensibility &#8211; 5/5</li>
</ul>
<p><strong>Overall Score: 4/5</strong></p>
<p><strong>Verdict: If your currently using Google Analytics, stop it! (and use this instead)<br />
</strong></p>
 <p><a href="http://webworxshop.com/?flattrss_redirect&amp;id=403&amp;md5=e6f4ae5a275cf188ea6e2d671020c5bc" title="Flattr" target="_blank"><img src="http://blog.webworxshop.com/wp-content/plugins/flattrss/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://webworxshop.com/2011/01/21/review-piwik-analytics-software/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=robconnolly&amp;popout=1&amp;url=http%3A%2F%2Fwebworxshop.com%2F2011%2F01%2F21%2Freview-piwik-analytics-software&amp;language=en_GB&amp;category=text&amp;title=Review%3A+Piwik+Analytics+Software&amp;description=If+you+read+my+previous+post+regarding+the+site+overhaul+that+I%26%238217%3Bm+currently+doing+you+will+have+seen+me+mention+that+I%26%238217%3Bm+now+using+the+Piwik+Open+Source+Analytics+Package...&amp;tags=awesome%2Cfoss%2Cgoogle+analytics%2Cphp%2Cpiwik%2Cpython%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Unofficial Python Module of the Week #0: argparse</title>
		<link>http://webworxshop.com/2011/01/20/python-module-of-the-week-0-argparse</link>
		<comments>http://webworxshop.com/2011/01/20/python-module-of-the-week-0-argparse#comments</comments>
		<pubDate>Wed, 19 Jan 2011 19:00:19 +0000</pubDate>
		<dc:creator>Rob Connolly</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[argparse]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[upmotw]]></category>

		<guid isPermaLink="false">http://blog.webworxshop.com/?p=437</guid>
		<description><![CDATA[<p>[EDIT: This series has been renamed so as not to conflict with Doug Hellman's excellent Python Module of the Week series. See UPMotW #1 for details]</p> <p>I&#8217;m going to try something different today. This is going to be the first in a series (hopefully once weekly) of Python Modules of the Week. This has probably [...]]]></description>
			<content:encoded><![CDATA[<p><em>[EDIT: This series has been renamed so as not to conflict with Doug Hellman's excellent Python Module of the Week series. See UPMotW #1 for details]</em></p>
<p><em>I&#8217;m going to try something different today. This is going to be the first in a series (hopefully once weekly) of Python Modules of the Week. This has probably been done to death elsewhere, but I&#8217;m using it as an opportunity to learn some</em> <em>more Python</em> <em>and to cement some of these modules in my mind.</em></p>
<p><a href="http://docs.python.org/library/argparse.html">Argparse</a> is a Python module for processing command line arguments. It&#8217;s new in version 2.7 and is designed to replace the <a href="http://docs.python.org/library/optparse.html">Optparse</a> module. I&#8217;m not sure what the rationale for the change was as the two modules look very similar to me. However, it suffices to say that you should use argparse in all new code.</p>
<p>The main class of argparse is called ArgumentParser, it allows you to add arguments to your program and parse the provided arguments at runtime:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #dc143c;">parser</span> = argparse.<span style="color: black;">ArgumentParser</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #dc143c;">parser</span>.<span style="color: black;">add_argument</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;-v&quot;</span>, <span style="color: #483d8b;">&quot;--verbose&quot;</span><span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># a flag type argument</span>
<span style="color: #dc143c;">parser</span>.<span style="color: black;">add_argument</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;value&quot;</span>, <span style="color: #008000;">type</span>=<span style="color: #008000;">int</span><span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># an integer positional argument</span>
...
<span style="color: black;">args</span> = <span style="color: #dc143c;">parser</span>.<span style="color: black;">parse_args</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># parse the args from sys.argv</span>
<span style="color: #ff7700;font-weight:bold;">print</span><span style="color: black;">&#40;</span>args.<span style="color: black;">value</span><span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># arguments accessed as data members</span></pre></td></tr></table></div>

<p>You can also add meta-data such as help and descriptions to your arguments via keyword arguments to many of the methods. Take a look at the <a href="http://docs.python.org/library/argparse.html">module documentation</a> for examples. Once nice thing is that when you provide this data, argparse automatically generates the -h and &#8211;help flags and populates them with nicely formatted help output using the info you provide.</p>
<p>The argument parsing provided by argparse allows you to create some very complex command line interfaces to your scripts. I especially like the <a href="http://docs.python.org/library/argparse.html#sub-commands">sub-commands</a> framework, which allows each sub-command to exist as its own separate entity with its own options and help information. To create an argument parser with a sub-command is just a few lines:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #dc143c;">parser</span> = argparse.<span style="color: black;">ArgumentParser</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
subcommands = <span style="color: #dc143c;">parser</span>.<span style="color: black;">add_subparsers</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
mysubcommand = subcommands.<span style="color: black;">add_parser</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'mysubcommand'</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>Of course,each sub-command is an ArgumentParser in its own right, so you can add all the options that you normally would, including command line flags, positional arguments and help information. Also each sub-command will be listed in the help and will also have its own help page which can be accessed via:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>pyprog.py subcommand <span style="color: #660033;">--help</span></pre></td></tr></table></div>

<p>All in all, this is a very useful Python module to know about. Its ease of use and the number of things it &#8216;just takes care of&#8217; make it a pleasure to use. Hopefully it&#8217;ll have you writing nice command line interfaces to all those hacked together scripts that are currently controlled by commenting bits of them in and out!</p>
 <p><a href="http://webworxshop.com/?flattrss_redirect&amp;id=437&amp;md5=91c03113256d93a0dc851c4079a5dbb4" title="Flattr" target="_blank"><img src="http://blog.webworxshop.com/wp-content/plugins/flattrss/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://webworxshop.com/2011/01/20/python-module-of-the-week-0-argparse/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=robconnolly&amp;popout=1&amp;url=http%3A%2F%2Fwebworxshop.com%2F2011%2F01%2F20%2Fpython-module-of-the-week-0-argparse&amp;language=en_GB&amp;category=text&amp;title=Unofficial+Python+Module+of+the+Week+%230%3A+argparse&amp;description=%5BEDIT%3A+This+series+has+been+renamed+so+as+not+to+conflict+with+Doug+Hellman%27s+excellent+Python+Module+of+the+Week+series.+See+UPMotW+%231+for+details%5D+I%26%238217%3Bm+going+to+try...&amp;tags=argparse%2Cawesome%2Cfoss%2Cpython%2Cupmotw%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Kiwi PyCon Day Two</title>
		<link>http://webworxshop.com/2010/11/21/kiwi-pycon-day-two</link>
		<comments>http://webworxshop.com/2010/11/21/kiwi-pycon-day-two#comments</comments>
		<pubDate>Sun, 21 Nov 2010 07:25:33 +0000</pubDate>
		<dc:creator>Rob Connolly</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[kiwi pycon]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.webworxshop.com/?p=322</guid>
		<description><![CDATA[<p>Ahoy&#8217;hoy, again. Here&#8217;s my quick round up of day two of Kiwi PyCon. Here are the talks I attended:</p> Keynote: &#8220;Creating Pythonic APIs&#8221; by Anthony Baxter, from Google. This was really well put together, informative and above all hilarious. &#8220;How Python is influencing Neuroscience Research&#8221; by Daniel Myall. Again good to see python being used [...]]]></description>
			<content:encoded><![CDATA[<p>Ahoy&#8217;hoy, again. Here&#8217;s my quick round up of day two of Kiwi PyCon. Here are the talks I attended:</p>
<ul>
<li>Keynote: &#8220;Creating Pythonic APIs&#8221; by Anthony Baxter, from Google. This was really well put together, informative and above all hilarious.</li>
<li>&#8220;How Python is influencing Neuroscience Research&#8221; by Daniel Myall. Again good to see python being used for hardcore sciencey stuff!</li>
<li>&#8220;Don&#8217;t Block the GUI&#8221; by Glenn Ramsey. An introduction to basic threading and futures, I knew most of this stuff, but it was still interesting.</li>
<li>&#8220;Python in the Datacentre&#8221; by Matt Provost, from Weta Digital. Interesting to see the internals of how Python loads, it probably explains why Python is slow on embedded systems too.</li>
<li>&#8220;Wikkid Design&#8221; by Tim Penhey. About the design of a distributed Wiki system for Launchpad. Some good take home messages around choosing modules (personal recommendation and good documentation rule!).</li>
<li>Open Spaces (Track 1): &#8220;Why aren&#8217;t we using Python 3&#8243;, &#8220;NoSQL Databases&#8221; and &#8220;Robotics and UAVs&#8221;.</li>
<li>&#8220;Demystifying Unicode&#8221; by Leon Matthews. I knew nothing about unicode before this, now I know how to use it and that I should be using it!</li>
<li>&#8220;Teaching Computer Science with Python&#8221; by Carl Cerecke. An interesting look into the Canterbury CS Department&#8217;s moves towards Python for teaching.</li>
</ul>
<p>That&#8217;s it for now, there will be more in my full round up, which I&#8217;ll write when I have time (sometime this week). Bye for now!</p>
 <p><a href="http://webworxshop.com/?flattrss_redirect&amp;id=322&amp;md5=de43c6bae5645ab266d6014a498ab82d" title="Flattr" target="_blank"><img src="http://blog.webworxshop.com/wp-content/plugins/flattrss/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://webworxshop.com/2010/11/21/kiwi-pycon-day-two/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=robconnolly&amp;popout=1&amp;url=http%3A%2F%2Fwebworxshop.com%2F2010%2F11%2F21%2Fkiwi-pycon-day-two&amp;language=en_GB&amp;category=text&amp;title=Kiwi+PyCon+Day+Two&amp;description=Ahoy%26%238217%3Bhoy%2C+again.+Here%26%238217%3Bs+my+quick+round+up+of+day+two+of+Kiwi+PyCon.+Here+are+the+talks+I+attended%3A+Keynote%3A+%26%238220%3BCreating+Pythonic+APIs%26%238221%3B+by+Anthony+Baxter%2C+from+Google.+This+was...&amp;tags=awesome%2Cconference%2Cfoss%2Ckiwi+pycon%2Cpython%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Kiwi PyCon Day One&#8230;</title>
		<link>http://webworxshop.com/2010/11/20/kiwi-pycon-day-one</link>
		<comments>http://webworxshop.com/2010/11/20/kiwi-pycon-day-one#comments</comments>
		<pubDate>Sat, 20 Nov 2010 06:40:29 +0000</pubDate>
		<dc:creator>Rob Connolly</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[kiwi pycon]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.webworxshop.com/?p=284</guid>
		<description><![CDATA[<p>So I said I&#8217;d try to blog about Kiwi PyCon over the weekend, so here goes! This is just going to be a quick post going through a few highlights, I&#8217;ll save my detailed discussion for my full round up when I get back home.</p> <p>So here&#8217;s the talks I attended:</p> Keynote (obviously) &#8211; &#8220;How [...]]]></description>
			<content:encoded><![CDATA[<p>So I said I&#8217;d try to blog about Kiwi PyCon over the weekend, so here goes! This is just going to be a quick post going through a few highlights, I&#8217;ll save my detailed discussion for my full round up when I get back home.</p>
<p>So here&#8217;s the talks I attended:</p>
<ul>
<li>Keynote (obviously) &#8211; &#8220;How I learned to stop worrying and love deployment&#8221; by Jacob Kaplan-Moss (a core Django developer). This turned me onto a few modules, which I need to take a look at some point.</li>
<li>&#8220;Freeing the Cloud one (small) service at a time&#8221; by <a href="http://identi.ca/fmarier">Francois Marier</a> &#8211; about free web services and his service, <a href="http://libravatar.com">Libravatar</a>, in particular (Francois was also kind enough to help me out with a problem I was having with it right there and then, thanks Francois).</li>
<li>&#8220;Building a distributed Key-Value store with Cassandra&#8221; by Aaron Morton from Weta Digital. This was interesting, though I think a lot of it went over my head!</li>
<li>&#8220;Packaging and Virtual Environments&#8221; by Brett Wilkins (and another presenter, who&#8217;s name I can&#8217;t remember &#8211; so sorry to him!). This was really good and turned me onto <a href="http://packages.python.org/distribute/">distribute</a>, which is a setuptools replacement. I love the image on their website:</li>
</ul>
<ul>
<li><img class="aligncenter" src="http://python-distribute.org/pip_distribute.png" alt="" width="490" height="368" />Lightning talks &#8211; Of which the one on <a href="http://bottle.paws.de/docs/dev/index.html">Bottle</a> was particularly interesting &#8211; I&#8217;ve been looking for a lightweight web framework to play around with, so I&#8217;ll give it a try.</li>
<li>&#8220;5 Good Reasons for Automated Testing&#8221; by Roman Joost. Yeah, I really should be using automated testing!</li>
<li>&#8220;An Opinionated Guide to what makes a Good Unit Test&#8221; by Michael Hudson Doyle. Reinforced the opinion expressed above!</li>
<li>&#8220;Amazon Web Service: An Introduction&#8221; by Simone Brunozzi. This was quite businessy, but this stuff is definitely on my &#8220;must check out&#8221; list.</li>
<li>&#8220;Python In Astronomy&#8221; by Ian Bond. I missed the beginning of this but it&#8217;s awesome to see Python being used to do some hardcore science &#8211; finding planets no less!</li>
</ul>
<p>Well that&#8217;s my quick summary of day one, hopefully there&#8217;ll be more good stuff tomorrow, so I&#8217;ll &#8216;see&#8217; you then.</p>
 <p><a href="http://webworxshop.com/?flattrss_redirect&amp;id=284&amp;md5=e7fa11694a3bc93e6b35fb43c55dd1ae" title="Flattr" target="_blank"><img src="http://blog.webworxshop.com/wp-content/plugins/flattrss/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://webworxshop.com/2010/11/20/kiwi-pycon-day-one/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=robconnolly&amp;popout=1&amp;url=http%3A%2F%2Fwebworxshop.com%2F2010%2F11%2F20%2Fkiwi-pycon-day-one&amp;language=en_GB&amp;category=text&amp;title=Kiwi+PyCon+Day+One%26%238230%3B&amp;description=So+I+said+I%26%238217%3Bd+try+to+blog+about+Kiwi+PyCon+over+the+weekend%2C+so+here+goes%21+This+is+just+going+to+be+a+quick+post+going+through+a+few+highlights%2C...&amp;tags=awesome%2Cconference%2Cfoss%2Ckiwi+pycon%2Cpython%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Playing with Python Generators</title>
		<link>http://webworxshop.com/2010/08/30/playing-with-python-generators</link>
		<comments>http://webworxshop.com/2010/08/30/playing-with-python-generators#comments</comments>
		<pubDate>Mon, 30 Aug 2010 08:12:55 +0000</pubDate>
		<dc:creator>Rob Connolly</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[list comprehension]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.webworxshop.com/?p=266</guid>
		<description><![CDATA[<p>Today I&#8217;ve been playing with <a href="http://docs.python.org/tutorial/classes.html#generators">generators</a> in <a href="http://python.org">Python</a>. I have to say they are yet another awesome Python feature! They give you a very cool and efficient way to store some state within a function, this is useful if you&#8217;re trying to do something like generating a sequence, which you would otherwise need [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;ve been playing with <a href="http://docs.python.org/tutorial/classes.html#generators">generators</a> in <a href="http://python.org">Python</a>. I have to say they are yet another awesome Python feature! They give you a very cool and efficient way to store some state within a function, this is useful if you&#8217;re trying to do something like generating a sequence, which you would otherwise need a class for. I&#8217;m going to go over a couple of quick examples here in order to demonstrate what generators are and what you can do with them.</p>
<p><em>Side note: You need Python 2.4 or above to use generators, you&#8217;ll probably have this anyway, but it might pay to check before wondering why this stuff doesn&#8217;t work.</em></p>
<p><strong>A Quick Introduction</strong></p>
<p>At it&#8217;s heart a generator is a function which can return a value several times within it&#8217;s body. Each time the function is called it resumes from where it terminated in the previous call, with all it&#8217;s internal state intact (i.e. variables are held between calls). In Python a generator is defined by creating a function which uses the &#8216;yield&#8217; keyword. Each time that a yield is hit the function will return the specified value. Let&#8217;s start with an example which defines a generator implementation of the built-in &#8216;range&#8217; function:</p>
<p><code>def genrange(start, end):<br />
&nbsp;&nbsp;&nbsp;&nbsp;i = start<br />
&nbsp;&nbsp;&nbsp;&nbsp;while i &lt; end:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yield i<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i += 1</code></p>
<p>As you can see this is incredibly simple and behaves in the same way as the standard range function. The only difference is that when the generator method is called it will return a generator object rather than a value (in contrast to range, which will return a list of values in the range). These generator objects are iteratable so calling the &#8216;next&#8217; method on the object will run your code and return the next yielded value. Because the generator object is iteratable, the way in which you are likely to use it should look familiar:</p>
<p><code>for i in genrange(0, 10):<br />
&nbsp;&nbsp;&nbsp;&nbsp;print i</code></p>
<p>If you want to go ahead and create a list from the sequence as you generate it, you can use a <a href="http://www.secnetix.de/olli/Python/list_comprehensions.hawk">list comprehension</a>, like so:</p>
<p><code>l = [i for i in genrange(0, 10)]</code></p>
<p>Of course, as hist comprehensions can be much more complicated than this you can use it to achieve more than just creating the equivalent list as calling the built-in range function. For example, you could filter the output elements according to some criteria, or call a method on each element returned.</p>
<p><strong>A Trade Off</strong></p>
<p>Although the above example is incredibly simple, it presents an interesting trade off between memory use and the speed of iteration through the &#8216;list&#8217;. The trade off exists because you could just build the list of elements in a separate function and then iterate through it. This is a perfectly valid approach but if there are a large number of elements you will use a significant quantity of memory to store the list. You are also more likely to double handle the data, unless you are building the list up over a period of time. Using a generator in this case is likely to be more efficient, as you are just creating the elements as you need them, so only storing a minimal amount of data at any one time.</p>
<p>The other side of the trade off is performance. If the process that produces your iterative data is computationally expensive, it makes no sense to calculate more values than you will need. So if you have a data processing loop, that can potentially exit early (i.e. before reaching the end of the &#8216;list&#8217;) a generator will be more efficient. But equally, if you require a tight loop which iterates quickly, you would want to pre-compute the values.</p>
<p>When considering using generators you should weigh up these factors and think which method is going to be most efficient for your situation. I think in a lot of cases, you will end up coming down in favour of the generator solution.</p>
<p><strong>Another Example (Dan Brown is going to love me)</strong></p>
<p>I&#8217;m going to leave you with another quick example, namely a very efficient way of generating Fibonacci numbers using a generator. Without further ado:</p>
<p><code>def fibonacci():<br />
&nbsp;&nbsp;&nbsp;&nbsp;p1 = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;p2 = 1<br />
&nbsp;&nbsp;&nbsp;&nbsp;while True:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;f = p1 + p2<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p2 = p1<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p1 = f<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yield f</code></p>
<p>There you go, easy. Many other Fibonacci implementations use a recursive method, which is horribly inefficient. Most other implementations will require either a class to store persistent data in, or the use of static variables, both of which are more tricky to handle from a programming point of view.</p>
<p>Well that&#8217;s it. I think I&#8217;ve demonstrated that generators are pretty cool. The examples I&#8217;ve presented are very simplistic, but I&#8217;m sure you can think of awesome uses for them. Go forth and code!</p>
 <p><a href="http://webworxshop.com/?flattrss_redirect&amp;id=266&amp;md5=72107822bf78f0db240c0292d84185a1" title="Flattr" target="_blank"><img src="http://blog.webworxshop.com/wp-content/plugins/flattrss/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://webworxshop.com/2010/08/30/playing-with-python-generators/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=robconnolly&amp;popout=1&amp;url=http%3A%2F%2Fwebworxshop.com%2F2010%2F08%2F30%2Fplaying-with-python-generators&amp;language=en_GB&amp;category=text&amp;title=Playing+with+Python+Generators&amp;description=Today+I%26%238217%3Bve+been+playing+with+generators+in+Python.+I+have+to+say+they+are+yet+another+awesome+Python+feature%21+They+give+you+a+very+cool+and+efficient+way+to+store...&amp;tags=awesome%2Cfoss%2Cgenerator%2Clist+comprehension%2Cpython%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Some Tramping Photos</title>
		<link>http://webworxshop.com/2010/08/18/some-tramping-photos</link>
		<comments>http://webworxshop.com/2010/08/18/some-tramping-photos#comments</comments>
		<pubDate>Tue, 17 Aug 2010 21:29:23 +0000</pubDate>
		<dc:creator>Rob Connolly</dc:creator>
				<category><![CDATA[Photos]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[gallery3]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[tramping]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.webworxshop.com/?p=239</guid>
		<description><![CDATA[<p>Update: I recently discovered the <a href="http://wordpress.org/extend/plugins/nextgen-gallery/">NextGEN Gallery</a> plugin, so I&#8217;ve updated this post to use it.</p> <p>So, I finally worked out that WordPress can do awesome photo galleries. This means I have somewhere to put my photos that isn&#8217;t evil (i.e. not Facebook), that actually works and is simple to use. Yay!</p> <p>Here are [...]]]></description>
			<content:encoded><![CDATA[<p><em>Update: I recently discovered the <a href="http://wordpress.org/extend/plugins/nextgen-gallery/">NextGEN Gallery</a> plugin, so I&#8217;ve updated this post to use it.</em></p>
<p>So, I finally worked out that WordPress can do awesome photo galleries. This means I have somewhere to put my photos that isn&#8217;t evil (i.e. not Facebook), that actually works and is simple to use. Yay!</p>
<p>Here are a few photos from some tramping trips I organised over the last few weeks, the first was to the <a href="http://www.doc.govt.nz/parks-and-recreation/tracks-and-walks/auckland/warkworth-area/dome-forest-car-park-to-waiwhiu-grove/">Dome Forest Park</a> and the other was to <a href="http://www.doc.govt.nz/parks-and-recreation/tracks-and-walks/auckland/warkworth-area/moirs-hill-walkway/">Pohuehue Scenic Park</a>.</p>

<div class="ngg-galleryoverview" id="ngg-gallery-2-239">


	
	<!-- Thumbnails -->
		
	<div id="ngg-image-2" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://webworxshop.com/wp-content/gallery/tramping-2010/2010-07-03-12.17.34.jpg" title="Dark Group Photo – Dome Forest" class="shutterset_set_2" >
								<img title="Dark Group Photo – Dome Forest" alt="Dark Group Photo – Dome Forest" src="http://webworxshop.com/wp-content/gallery/tramping-2010/thumbs/thumbs_2010-07-03-12.17.34.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-3" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://webworxshop.com/wp-content/gallery/tramping-2010/2010-07-03-12.40.12.jpg" title="Aiden at top of Trig" class="shutterset_set_2" >
								<img title="Aiden at top of Trig" alt="Aiden at top of Trig" src="http://webworxshop.com/wp-content/gallery/tramping-2010/thumbs/thumbs_2010-07-03-12.40.12.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-4" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://webworxshop.com/wp-content/gallery/tramping-2010/2010-07-03-12.43.14.jpg" title="Brendan looks down from Trig" class="shutterset_set_2" >
								<img title="Brendan looks down from Trig" alt="Brendan looks down from Trig" src="http://webworxshop.com/wp-content/gallery/tramping-2010/thumbs/thumbs_2010-07-03-12.43.14.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://webworxshop.com/wp-content/gallery/tramping-2010/2010-07-03-13.45.45.jpg" title="Aiden balances on the Horizontal Tree " class="shutterset_set_2" >
								<img title="Aiden balances on the Horizontal Tree " alt="Aiden balances on the Horizontal Tree " src="http://webworxshop.com/wp-content/gallery/tramping-2010/thumbs/thumbs_2010-07-03-13.45.45.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-6" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://webworxshop.com/wp-content/gallery/tramping-2010/2010-07-03-13.46.05.jpg" title="Rebecca, Brendan and Claire" class="shutterset_set_2" >
								<img title="Rebecca, Brendan and Claire" alt="Rebecca, Brendan and Claire" src="http://webworxshop.com/wp-content/gallery/tramping-2010/thumbs/thumbs_2010-07-03-13.46.05.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-7" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://webworxshop.com/wp-content/gallery/tramping-2010/2010-07-03-14.25.30.jpg" title="Another Dome Forest View " class="shutterset_set_2" >
								<img title="Another Dome Forest View " alt="Another Dome Forest View " src="http://webworxshop.com/wp-content/gallery/tramping-2010/thumbs/thumbs_2010-07-03-14.25.30.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-8" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://webworxshop.com/wp-content/gallery/tramping-2010/2010-08-07-11.23.06.jpg" title="Pohuehue Waterfall " class="shutterset_set_2" >
								<img title="Pohuehue Waterfall " alt="Pohuehue Waterfall " src="http://webworxshop.com/wp-content/gallery/tramping-2010/thumbs/thumbs_2010-08-07-11.23.06.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-9" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://webworxshop.com/wp-content/gallery/tramping-2010/wpid-2010-07-03-14.25.22.jpg" title="A View – Dome Forest" class="shutterset_set_2" >
								<img title="A View – Dome Forest" alt="A View – Dome Forest" src="http://webworxshop.com/wp-content/gallery/tramping-2010/thumbs/thumbs_wpid-2010-07-03-14.25.22.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-10" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://webworxshop.com/wp-content/gallery/tramping-2010/wpid-2010-08-07-12.39.03.jpg" title="Pohuehue Group Photo" class="shutterset_set_2" >
								<img title="Pohuehue Group Photo" alt="Pohuehue Group Photo" src="http://webworxshop.com/wp-content/gallery/tramping-2010/thumbs/thumbs_wpid-2010-08-07-12.39.03.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>


 <p><a href="http://webworxshop.com/?flattrss_redirect&amp;id=239&amp;md5=531bd1174dd9d11fd59a565e64ebd252" title="Flattr" target="_blank"><img src="http://blog.webworxshop.com/wp-content/plugins/flattrss/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://webworxshop.com/2010/08/18/some-tramping-photos/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=robconnolly&amp;popout=1&amp;url=http%3A%2F%2Fwebworxshop.com%2F2010%2F08%2F18%2Fsome-tramping-photos&amp;language=en_GB&amp;category=text&amp;title=Some+Tramping+Photos&amp;description=Update%3A+I+recently+discovered+the+NextGEN+Gallery+plugin%2C+so+I%26%238217%3Bve+updated+this+post+to+use+it.+So%2C+I+finally+worked+out+that+WordPress+can+do+awesome+photo+galleries.+This+means...&amp;tags=awesome%2Cfacebook%2Cgallery3%2Cphotos%2Ctramping%2Cwordpress%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Denting via Android Intents</title>
		<link>http://webworxshop.com/2010/05/30/denting-via-android-intents</link>
		<comments>http://webworxshop.com/2010/05/30/denting-via-android-intents#comments</comments>
		<pubDate>Sun, 30 May 2010 01:01:36 +0000</pubDate>
		<dc:creator>Rob Connolly</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[identi.ca]]></category>
		<category><![CDATA[Intent]]></category>
		<category><![CDATA[Mustard]]></category>

		<guid isPermaLink="false">http://blog.webworxshop.com/?p=215</guid>
		<description><![CDATA[<p>This is just a quick post to share something cool that I was playing with the other day. I was wondering if it was possible to send a message from an Android application via the <a href="http://mustard.macno.org">Mustard</a> <a href="http://identi.ca">identi.ca</a> client. It turns out it is, and here&#8217;s how you do it:</p> <p>Intent i = new [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a quick post to share something cool that I was playing with the other day. I was wondering if it was possible to send a message from an Android application via the <a href="http://mustard.macno.org">Mustard</a> <a href="http://identi.ca">identi.ca</a> client. It turns out it is, and here&#8217;s how you do it:</p>
<p><code>Intent i = new Intent(Intent.ACTION_SEND);<br />
i.setType("text/plain");<br />
i.putExtra(Intent.EXTRA_TEXT, "Testing intents on android");<br />
startActivity(i);</code></p>
<p>These four lines of code hook into a key feature of the Android platform: Intents. The intent system is a neat way of communicating via apps and enables different apps to integrate together without knowing about each other specifically.</p>
<p>In this case, we are sending the ACTION_SEND intent, which Mustard is set up to handle. We set the mime-type of the message to &#8216;text/plain&#8217; and put the contents of our message into the EXTRA_TEXT field. We then start the intent, and we&#8217;re done!</p>
<p>When the intent is started Android presents the user with a list of all the possible applications which can handle the ACTION_SEND intent. In my case this is Email, Gmail, Messaging and Mustard, when I select  mustard the new message screen pops up and is populated with my message content. Hitting send posts the message and returns control to my app. Neat!</p>
<p>There are probably a whole host of ways you can integrate your apps with other apps on the phone using the intents system, I guess it&#8217;s just a matter of knowing what intents are received by each app and what they do.</p>
<p>Thanks to <a href="http://identi.ca/macno">@macno</a> (main developer of Mustard) and <a href="http://identi.ca/bugabundo">@bugabundo</a> on identi.ca for their help working this out!</p>
<p>Anyway, I hope someone finds this useful. This is the first time I&#8217;ve posted about Android development, but I&#8217;ll hopefully write more about it in the future. Bye for now!</p>
 <p><a href="http://webworxshop.com/?flattrss_redirect&amp;id=215&amp;md5=3173eabccfd10fb41128a9c0bce6b90a" title="Flattr" target="_blank"><img src="http://blog.webworxshop.com/wp-content/plugins/flattrss/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://webworxshop.com/2010/05/30/denting-via-android-intents/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=robconnolly&amp;popout=1&amp;url=http%3A%2F%2Fwebworxshop.com%2F2010%2F05%2F30%2Fdenting-via-android-intents&amp;language=en_GB&amp;category=text&amp;title=Denting+via+Android+Intents&amp;description=This+is+just+a+quick+post+to+share+something+cool+that+I+was+playing+with+the+other+day.+I+was+wondering+if+it+was+possible+to+send+a+message+from...&amp;tags=Android%2Cawesome%2CDevelopment%2Cfoss%2Cidenti.ca%2CIntent%2CMustard%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Installing and Configuring Arch Linux: Part 1</title>
		<link>http://webworxshop.com/2010/04/01/installing-and-configuring-arch-linux-part-1</link>
		<comments>http://webworxshop.com/2010/04/01/installing-and-configuring-arch-linux-part-1#comments</comments>
		<pubDate>Thu, 01 Apr 2010 04:52:04 +0000</pubDate>
		<dc:creator>Rob Connolly</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[archlinux]]></category>
		<category><![CDATA[archrob]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[beer]]></category>
		<category><![CDATA[crunchbang]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[identi.ca]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[LVM]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://blog.webworxshop.com/?p=168</guid>
		<description><![CDATA[<p>OTHERWISE ENTILED: Rob tries to install Arch Linux some of the time, but really spends most of the time drinking beer.</p> <p>Before I start: NO, UNLIKE EVERY OTHER ARTICLE ON THE WEB, PUBLISHED TODAY, THIS IS NOT A JOKE, K?!?</p> <p>I&#8217;ve been looking for a new distro recently. I do this from time to time, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>OTHERWISE ENTILED: Rob tries to install Arch Linux some of the time, but really spends most of the time drinking beer.</strong></p>
<p><em>Before I start: NO, UNLIKE EVERY OTHER ARTICLE ON THE WEB, PUBLISHED TODAY, THIS IS NOT A JOKE, K?!?</em></p>
<p>I&#8217;ve been looking for a new distro recently. I do this from time to time, principally because I get bored of what I&#8217;m currently running. Last time it was <a href="http://crunchbanglinux.org">Crunchbang</a> which I settled on. This time I wanted to go more advanced, so I started researching <a href="http://www.archlinux.org">Arch Linux</a>.</p>
<p>For those that don&#8217;t know, Arch Linux describes itself as:</p>
<blockquote><p>&#8230;a lightweight and flexible Linux® distribution that tries to Keep It Simple.</p></blockquote>
<p>I&#8217;d heard about Arch in the past from several sources and had heard that you basically have to install and configure everything yourself, but that the package manager (awesomely named <a href="http://wiki.archlinux.org/index.php/Pacman">Pacman</a>!) manages software without having to compile from source (unless you want to!).</p>
<p>The following series of posts will be a record of my experiences installing and configuring Arch on my home desktop machine. This isn&#8217;t intended to be an exhaustive installation guide, more just a record of where I tripped up in order to aid those who come next. If you are searching for an installation guide, try the <a href="http://wiki.archlinux.org/index.php/Official_Arch_Linux_Install_Guide">excellent article</a> on the <a href="http://wiki.archlinux.org">Arch Wiki</a>.</p>
<p>I&#8217;ve separated the post out into days. Note: it didn&#8217;t actually take me a full day for each part, I work during the day and only really had a couple of hours each evening to spend on this.</p>
<p><strong>Day 1: Backing Up</strong></p>
<p>Before installing I wanted to make sure I didn&#8217;t trash my existing Ubuntu system and all my personal data, as I still need to do all the stuff I usually do with my machine. So I made a backup.</p>
<p>I&#8217;m not really going to go into how. Suffice to say I used LVM snapshots and rsync, I might write about this in a future post.</p>
<p>This took a while, as I have quite a lot of data. I thought it best to have a beer in the mean time, so I did.</p>
<p><strong>Day 2: Making Space, Starting the Installation and Various Adventures with LVM</strong></p>
<p>The next thing to do was to resize my existing LVM partition containing Ubuntu so that I had space for Arch. I couldn&#8217;t work out how to do this at first as none of the partition tools I tried (GParted and Cfdisk) could resize the partition. I eventually worked out how to do it.</p>
<p>First, on my running Ubuntu system I resized the physical volume with:</p>
<p><code>$ pvresize --setphysicalvolumesize 500G /dev/sda1</code></p>
<p>This shrank the space used by LVM down to 500GB (from about 1000GB on my machine).</p>
<p>I then rebooted into the Arch live CD (64-bit edition in my case), and ran:</p>
<p><code>$ fdisk /dev/sda</code></p>
<p>Now what you have to do next is slightly alarming. You actually have to delete the partition and recreate it in the new size. This works, without destroying your data, because fdisk only manipulates the partition table on the disk, it doesn&#8217;t do any formatting of partitions, etc.</p>
<p>I did this through fdisk so that the partition was 501GB (making it a little bigger than the PV just to make sure). I then rebooted back into Ubuntu and ran:</p>
<p><code>$ pvresize /dev/sda1</code></p>
<p>To allow it to use all the space. This probably isn&#8217;t necessary but I wanted to be safe.</p>
<p>Next, I proceeded to the installation. For some reason the Arch boot CD was really slow to boot and gave me loads of read errors, I think this might have something to do with my drive as I&#8217;ve been experiencing the same with other disks. Eventually it booted and dropped my at the default prompt.</p>
<p>From then I basically followed the <a href="http://wiki.archlinux.org/index.php/Official_Arch_Linux_Install_Guide">installation guide</a> for setting up the package source (CD) and the date and time.</p>
<p>I then set about partitioning the disks. The Arch installer uses Cfdisk, which is fine. I just added two partitions to my disk, a small (255Meg) one for my /boot partition and a large LVM one for the rest of the system (I like LVM and wanted to use it again on Arch).</p>
<p>This was fine, but I had some problems setting up the LVM through the installer, even though the user guide seems to think it can do it. Every time I tried, it would just fail on creating the Volume Group, weird.</p>
<p>I gave up for the evening and (you guessed it) went for a beer!</p>
<p><strong>Day 3: Successful Installation</strong></p>
<p>The next day I thought I&#8217;d try googling for LVM on Arch, luckily when I got in to work <a href="http://identi.ca/duffkitty">@duffkitty</a> on <a href="http://identi.ca">identi.ca</a> had seen one of my posts complaining about having problems and had given me a link to the <a href="http://wiki.archlinux.org/index.php/LVM">LVM article</a> on the Arch Wiki.</p>
<p>This advocated setting up the whole LVM setup manually (and guides you through it) and then just setting the partitions to use in the installer. It also gives you some important things to look out for when configuring the system. Following these instructions worked like a charm and I was able to format everything correctly and install the base system.</p>
<p>I then moved on to configuring the system, following the install guide and taking into account the instructions in the LVM article. Everything went pretty much fine here and I eventually got to installing the bootloader. Here I replaced the Ubuntu Grub version with the one installed by Arch. This left me having to add an entry for Ubuntu, which wasn&#8217;t difficult, I just copied the Arch one and changed the partition and file names.</p>
<p>Then it was time to &#8216;type reboot and pray&#8217; as the Arch installation guide puts it.</p>
<p>So I did.</p>
<p>When I rebooted the bootloader came up with the Arch and Ubuntu entries. I selected Ubuntu just to check everything was OK.</p>
<p>It didn&#8217;t work.</p>
<p>Panicking and Swearing Ensued.</p>
<p>I rebooted and selected Arch.</p>
<p>That worked (thankfully).</p>
<p>When it had booted I logged in and opened up the Grub config file again. it turned out I mis-typed the name of the Ubuntu initrd file, that was easily fixed. Rebooting got me safely back to Ubuntu.</p>
<p>So now I have a functioning dual boot between my original Ubuntu install and a very basic Arch install, I think I might need some software there!</p>
<p>But first&#8230; beer.</p>
<p><strong>So What&#8217;s Next???</strong></p>
<p>Well, firstly I need to get my network connection up and running as I didn&#8217;t do that during the install. It&#8217;s a Wifi connection over WPA so that&#8217;s going to be fun. Then I can start installing software. I&#8217;ll probably follow the <a href="http://wiki.archlinux.org/index.php/Beginners_Guide">Beginners Guide</a> on the Wiki (from Part 3). I was also recommended <a href="http://wiki.archlinux.org/index.php/Yaourt">Yaourt</a> by <a href="http://identi.ca/duffkitty">@duffkitty</a>, so I&#8217;ll give that a try.</p>
<p>I&#8217;ll be continuing to play with Arch over the next few days and reporting my progress in follow up posts here. I&#8217;ll also be denting as I go along and you can follow all of these on my <a href="http://identi.ca/tag/archrob">#archrob hash tag</a>.</p>
<p>There&#8217;ll probably be beer too.</p>
<p>We&#8217;ll see how it goes, but eventually I hope to have a system I can use full time.</p>
<p>Bye for now! Happy Easter!</p>
 <p><a href="http://webworxshop.com/?flattrss_redirect&amp;id=168&amp;md5=fefe60d8b1cf23a35b2a0e9ceb197ee8" title="Flattr" target="_blank"><img src="http://blog.webworxshop.com/wp-content/plugins/flattrss/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://webworxshop.com/2010/04/01/installing-and-configuring-arch-linux-part-1/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=robconnolly&amp;popout=1&amp;url=http%3A%2F%2Fwebworxshop.com%2F2010%2F04%2F01%2Finstalling-and-configuring-arch-linux-part-1&amp;language=en_GB&amp;category=text&amp;title=Installing+and+Configuring+Arch+Linux%3A+Part+1&amp;description=OTHERWISE+ENTILED%3A+Rob+tries+to+install+Arch+Linux+some+of+the+time%2C+but+really+spends+most+of+the+time+drinking+beer.+Before+I+start%3A+NO%2C+UNLIKE+EVERY+OTHER+ARTICLE+ON...&amp;tags=archlinux%2Carchrob%2Cawesome%2Cbeer%2Ccrunchbang%2Cfoss%2Cidenti.ca%2Clinux%2CLVM%2Cubuntu%2Cwifi%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Even easier netboot installation…</title>
		<link>http://webworxshop.com/2009/06/24/even-easier-netboot-installation</link>
		<comments>http://webworxshop.com/2009/06/24/even-easier-netboot-installation#comments</comments>
		<pubDate>Wed, 24 Jun 2009 02:12:16 +0000</pubDate>
		<dc:creator>Rob Connolly</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[eeepc]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[netboot]]></category>
		<category><![CDATA[pxe]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.webworxshop.com/?p=94</guid>
		<description><![CDATA[<p>A while ago I covered <a href="/2009/02/09/pxe-netinstalling-for-simpletons">netbooting/installation on ubuntu</a>, well I&#8217;ve now found an even easier way to do this! It&#8217;s probably the easiest way to go about this as it really only involves editing one config file. Some of the info here comes from the <a href="https://help.ubuntu.com/community/Installation/Netboot">official Ubuntu documentation</a> on this, though my approach [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I covered <a href="/2009/02/09/pxe-netinstalling-for-simpletons">netbooting/installation on ubuntu</a>, well I&#8217;ve now found an even easier way to do this! It&#8217;s probably the easiest way to go about this as it really only involves editing one config file. Some of the info here comes from the <a href="https://help.ubuntu.com/community/Installation/Netboot">official Ubuntu documentation</a> on this, though my approach is actually easier, since you don&#8217;t need a separate tftp server.</p>
<p>The main piece of software you will need is dnsmasq, which you can install with the command:</p>
<p><code>sudo apt-get install dnsmasq</code></p>
<p>I already had this installed as I&#8217;m using it as a DNS cache for my network (which is also pretty useful). It turns out that dnsmasq is a bit of a &#8216;swiss army knife&#8217;, it can do DHCP, DNS and TFTP all together and very easily. You should edit the config file:</p>
<p><code>sudo nano /etc/dnsmasq.conf</code><span id="more-94"></span></p>
<p>And add/uncomment/edit the following lines:</p>
<p><code>dhcp-range=192.168.1.3,192.168.1.50,12h # sets the ip address range and update frequency for the network<br />
dhcp-boot=pxelinux.0 # set up network booting to boot the pxelinux bootloader<br />
enable-tftp # enable built in tftp server<br />
tftp-root=/var/tftpd # set tftp directory</code></p>
<p>Basically this sets up dnsmasq to be both the DHCP server for the network and push the PXE boot options out over the network. It also enables the built in TFTP server in dnsmasq and sets the directory to serve files from.</p>
<p>The next step is to get some files to serve, I got the PXE/netboot image from the Ubuntu <a href="http://cdimage.ubuntu.com/netboot/">cdimages</a> site, and untarred the files to the correct directory:</p>
<p><code>wget http://archive.ubuntu.com/ubuntu/dists/jaunty/main/installer-i386/current/images/netboot/netboot.tar.gz<br />
sudo mkdir -p /var/tftp<br />
tar -xvzf netboot.tar.gz -C /var/tftp/<br />
chown -R nobody:nogroup /var/tftp</code></p>
<p>The tar file of course is basically just the minimal install CD, set up for netbooting, so when you install you will need to download all the packages, for a simple cli install this doesn&#8217;t take very long, and you can use a package cache or something to help with future installs.</p>
<p>OK, now restart dnsmasq:</p>
<p><code>sudo /etc/init.d/dnsmasq restart</code></p>
<p>&#8230;and you should be good to go (make sure that your machine is the only DHCP server on the network). For tips on booting clients see my <a href="/2009/02/09/pxe-netinstalling-for-simpletons">original article</a> &#8211; btw, since I used the new version of Ubuntu I can now boot my Eee PC 901 over the network!</p>
<p>If you have any questions or problems with this I&#8217;d be happy to answer them, just post them below.</p>
<p>Bye for now!</p>
 <p><a href="http://webworxshop.com/?flattrss_redirect&amp;id=94&amp;md5=74540b59a8288d7ec643f81c176f5656" title="Flattr" target="_blank"><img src="http://blog.webworxshop.com/wp-content/plugins/flattrss/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://webworxshop.com/2009/06/24/even-easier-netboot-installation/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=robconnolly&amp;popout=1&amp;url=http%3A%2F%2Fwebworxshop.com%2F2009%2F06%2F24%2Feven-easier-netboot-installation&amp;language=en_GB&amp;category=text&amp;title=Even+easier+netboot+installation%E2%80%A6&amp;description=A+while+ago+I+covered+netbooting%2Finstallation+on+ubuntu%2C+well+I%26%238217%3Bve+now+found+an+even+easier+way+to+do+this%21+It%26%238217%3Bs+probably+the+easiest+way+to+go+about+this+as+it...&amp;tags=awesome%2Cdhcp%2Ceeepc%2Cfoss%2Cnetboot%2Cpxe%2Cubuntu%2Cblog" type="text/html" />
	</item>
	</channel>
</rss>

