<?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>bitplane.net &#187; News</title>
	<atom:link href="http://bitplane.net/category/news/feed/" rel="self" type="application/rss+xml" />
	<link>http://bitplane.net</link>
	<description>Rants, ramblings, free software</description>
	<lastBuildDate>Thu, 09 Feb 2012 02:37:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Irrlicht website update</title>
		<link>http://bitplane.net/2012/01/irrlicht-website-update/</link>
		<comments>http://bitplane.net/2012/01/irrlicht-website-update/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 07:39:39 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[Irrlicht]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=804</guid>
		<description><![CDATA[The WordPress version of the Irrlicht website is now live, which means we can edit pages and post news articles using an online editor, users can post comments and we can even appoint community editors to post stuff without giving them rights to the filesystem. Expect lots more activity there in the future]]></description>
			<content:encoded><![CDATA[<p>The WordPress version of the <a href="http://irrlicht.sourceforge.net">Irrlicht website</a> is now live, which means we can edit pages and post news articles using an online editor, users can post comments and we can even appoint community editors to post stuff without giving them rights to the filesystem.</p>
<p>Expect lots more activity there in the future <img src='http://bitplane.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2012/01/irrlicht-website-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2011 in review</title>
		<link>http://bitplane.net/2012/01/mmi/</link>
		<comments>http://bitplane.net/2012/01/mmi/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 10:21:09 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[bitcoin]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[home-brewing]]></category>
		<category><![CDATA[mead]]></category>
		<category><![CDATA[metawatch]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=786</guid>
		<description><![CDATA[Dear diary Sorry for not writing to you of late, but this year has been a busy one.  I&#8217;ll make up for my lack of output with this mammoth post reviewing a small selection of interesting things I got up to this year&#8230; Did far too much work Feels like I&#8217;ve been busting my balls [...]]]></description>
			<content:encoded><![CDATA[<p>Dear diary</p>
<p>Sorry for not writing to you of late, but this year has been a busy one.  I&#8217;ll make up for my lack of output with this mammoth post reviewing a small selection of interesting things I got up to this year&#8230;</p>
<p><span id="more-786"></span></p>
<h2>Did far too much work</h2>
<p>Feels like I&#8217;ve been busting my balls for the last two years, so I decided to stick all my invoices into Google Docs and graph the output. The answer is yes, I&#8217;ve been working like a full-time employee.</p>
<div id="attachment_790" class="wp-caption aligncenter" style="width: 310px"><a href="http://bitplane.net/2012/01/mmi/days-worked/" rel="attachment wp-att-790"><img class="size-medium wp-image-790" title="days worked" src="http://bitplane.net/wp-content/uploads/2012/01/days-worked-300x192.png" alt="" width="300" height="192" /></a><p class="wp-caption-text">2009 was a good year!</p></div>
<p>I love consulting and Microsoft have a great working environment, but a rolling contract at a huge corporation means living out of a hotel for months at a time, which gets old rather fast. I learned a lot about BizTalk, Visual Studio Load Test and T-SQL, I&#8217;ll miss the new friends I&#8217;ve made, but I certainly won&#8217;t miss the travel. So I&#8217;m taking a couple of months off to doss around, learn some new technologies and work on some free software before looking for another contract.</p>
<h2>Rediscovered Bitcoin during the bubble</h2>
<p>I initially flirted with Bitcoin in late 2010 and was completely fascinated by the idea of a P2P currency, specially the proof-of-work method and the anonymity. There was no GPU mining software available and doing work units on the CPU had pretty low returns, but in December I decided to get a decent PC for experimenting with this new currency. After a bunch of cooling problems and losing my wallet.dat (containing a mere 5 BTC, worth about 30 US cents each; £1 total at the time) I fell out of love with Bitcoin and forgot all about it&#8230;</p>
<p>Fast forward 6 months and everyone is talking about this amazing new currency, demand outstrips supply, prices soar and the bubble finally bursts at $28 a piece. Why, oh why did I spend £2,000 on a top of the range computer then not even bother mining any BTC, rather than £1000 on BTC in December and sell out at £95,0000 in June?</p>
<div id="attachment_798" class="wp-caption aligncenter" style="width: 310px"><a href="http://bitplane.net/2012/01/mmi/bitcoin/" rel="attachment wp-att-798"><img class="size-medium wp-image-798" title="bitcoin" src="http://bitplane.net/wp-content/uploads/2012/01/bitcoin-300x111.png" alt="" width="300" height="111" /></a><p class="wp-caption-text">What could have been</p></div>
<p>On top of the new PC the Bitcoin thing ended up costing me about £50 in electricity, and my ATI 5970 hasn&#8217;t been feeling well since. I did play online poker with Americans after they closed all the poker sites, and made about $200 trading on <a title="Magic The Gathering Online Exchange, believe it or not" href="http://mtgox.com" target="_blank">Mt Gox</a>. Not enough BTC to have someone assassinated but the option to buy 5 wraps of heroin from Silk Road is always open (INSTANT ADDICTION, TORE FAMILY APART. A++++ WOULD BUY AGAIN)</p>
<h2>Read Gödel, Escher, Bach</h2>
<p>With all the travel I&#8217;ve had a fair bit of time for reading, which is nice. Along with The Design of Everyday Things and Zen and the art of Motorcycle Maintenance, <a title="GEB" href="http://www.amazon.co.uk/gp/product/0140289208/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&amp;tag=bitplanenet-21&amp;linkCode=as2&amp;camp=1634&amp;creative=6738&amp;creativeASIN=0140289208">Godel, Escher, Bach</a> (that&#8217;s Girdle, Esher, Bark to us infidels) changed the way that I think about a lot of things.</p>
<p>This year I&#8217;m going to try to set more time aside for reading.</p>
<h2>Got into home brewing</h2>
<p>A few months back I decided to start brewing mead, yeah, <strong>before</strong> Skyrim came out. I&#8217;m now seven batches in and I think I&#8217;m getting the hang of it, my latest batches taste a bit less like sweaty feet and a bit more like something you might want to drink. I started out using a 5L bottle of water with 3 jars of honey, some raisins and bread yeast added to it and a balloon stuck over the top, and now I&#8217;ve progressed to demijohns with real air-locks and exotic ingredients like.. uh.. orange flesh, cloves and vanilla pods. I even made some labels:</p>
<div id="attachment_791" class="wp-caption aligncenter" style="width: 238px"><a href="http://bitplane.net/2012/01/mmi/mead/" rel="attachment wp-att-791"><img class="size-medium wp-image-791" title="Mead" src="http://bitplane.net/wp-content/uploads/2012/01/Mead-228x300.png" alt="" width="228" height="300" /></a><p class="wp-caption-text">How&#39;s the abdomen?</p></div>
<p>I figure that this whole home brewing thing is a long game, it&#8217;s worth starting while I&#8217;m in my 30s if I&#8217;m going to actually master it before I&#8217;m old and grey. That is if the state of the kitchen doesn&#8217;t cause me to die of death by angry woman first.</p>
<h2>Replaced my MBW-150</h2>
<p>After the LEDs burned out on my Sony Ericsson MBW-150 I replaced it with a shiny new <a href="http://www.metawatch.org/">Metawatch</a>. Apparently it looks like a cheap, tacky Casio (so some random guy in a bar tells me anyway), but it&#8217;s not really supposed to be bling; the firmware and Android software is open source, making the device infinitely programmable.</p>
<p><a href="http://bitplane.net/2012/01/mmi/metawatch/" rel="attachment wp-att-793"><img class="aligncenter size-medium wp-image-793" title="Metawatch" src="http://bitplane.net/wp-content/uploads/2012/01/Metawatch-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p>The down-side is that the firmware is too large to be compiled using gcc for MSP430, so there&#8217;s currently no free development environment. I sketched out an analogue face for it in C, but if I wanted to spend £2000 on an analogue watch face then I would have got a Rolex instead!</p>
<h2>Neglected Free Software</h2>
<p>I&#8217;ve been lazy when it comes to developing this year. I&#8217;ve done no work on my Android apps, pushed a single commit to Irrlicht and wrote about 100 lines of my <a href="http://canvnc.sf.net/">web-based VNC client</a>. I feel like I&#8217;ve cheated on the world by spending most of the year writing T-SQL and C# for Microsoft, so my new year&#8217;s resolution is to get off my backside and write some code.</p>
<p>And blog more. Yeah, I&#8217;ll do that too.</p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2012/01/mmi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flattr</title>
		<link>http://bitplane.net/2010/08/flattr/</link>
		<comments>http://bitplane.net/2010/08/flattr/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 01:08:15 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=613</guid>
		<description><![CDATA[Now that Flattr is finally in public beta, I&#8217;ve decided to sign up and pledge the minimum possible payment, a measly €2 a month. Now all I need to do is actually find some sites to donate to! I&#8217;m kind of torn about adding Flattr links to my projects, on one hand I want to [...]]]></description>
			<content:encoded><![CDATA[<p>Now that Flattr is finally in <a href="http://blog.flattr.com/2010/08/open-beta/">public beta</a>, I&#8217;ve decided to sign up and pledge the minimum possible payment, a measly €2 a month. Now all I need to do is actually find some sites to donate to!</p>
<p>I&#8217;m kind of torn about adding Flattr links to my projects, on one hand I want to encourage the uptake by being another site which supports Flattr, on the other hand I don&#8217;t want to whore myself out for a few pence.</p>
<p>So at some point I&#8217;ll add Flattr links to the free Android apps which I&#8217;ve made, which will feature in the menu at the top shortly.</p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2010/08/flattr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Website update</title>
		<link>http://bitplane.net/2009/12/website-update/</link>
		<comments>http://bitplane.net/2009/12/website-update/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 00:10:53 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[bitplane.net]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=550</guid>
		<description><![CDATA[I&#8217;ve finally got around to editing the Simplish template and adding pages for some of my old software projects. There&#8217;s some links at the top up there, hover over them and you get a nice drop-down menu with a list of projects. The meat of this is JavaScript stolen from another theme and some PHP [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally got around to editing the Simplish template and adding pages for some of my old software projects. There&#8217;s some links at the top up there, hover over them and you get a nice drop-down menu with a list of projects.</p>
<p>The meat of this is JavaScript stolen from another theme and some PHP code gratuitously pasted into my header, this isn&#8217;t IP theft, and not just because it&#8217;s the season of sharing! This is what&#8217;s great about free software licenses.</p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2009/12/website-update/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>More Sidewiki Leaks</title>
		<link>http://bitplane.net/2009/12/more-sidewiki-leaks/</link>
		<comments>http://bitplane.net/2009/12/more-sidewiki-leaks/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 01:26:38 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[censorship]]></category>
		<category><![CDATA[freedom of speech]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[Politics]]></category>
		<category><![CDATA[sidewiki leaks]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=377</guid>
		<description><![CDATA[Apparently the British press have been barred from publishing any of Tiger Woods&#8217; sex pictures, and the block somehow extends to Internet news sites. They aren&#8217;t even allowed to mention what the block is about, so I&#8217;ve taken the liberty of filling in the blanks on Google SidewikiLeaks and will update it to include links [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Apparently the British press have been barred from publishing any of Tiger Woods&#8217; sex pictures, and the block somehow extends to <a title="No Tiger Woods -------------, ----------------- for Brits" href="http://www.theregister.co.uk/2009/12/12/tiger_woods_accenture_ads/">Internet news sites</a>. They aren&#8217;t even allowed to mention what the block is about, so I&#8217;ve taken the liberty of filling in the blanks on Google SidewikiLeaks and will update it to include links to pictures when they are inevitably released:</p>
<p style="text-align: left;"><a href="http://bitplane.net/wp-content/uploads/2009/12/SideWikiLeaks.png"><img class="aligncenter size-full wp-image-378" title="Google SideWiki Leaks" src="http://bitplane.net/wp-content/uploads/2009/12/SideWikiLeaks.png" alt="Google SideWiki Leaks" width="517" height="246" /></a></p>
<p style="text-align: left;">It makes you glad that America has freedom of the press, even if Britain doesn&#8217;t.</p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2009/12/more-sidewiki-leaks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chart Against The X Factor</title>
		<link>http://bitplane.net/2009/12/bash-for-xmas-number-one/</link>
		<comments>http://bitplane.net/2009/12/bash-for-xmas-number-one/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 22:30:33 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[Music]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[google charts]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=342</guid>
		<description><![CDATA[For the last four years running Simon Cowell&#8217;s plastic karaoke acts have held the Christmas #1 spot in the UK singles charts thanks to ITV&#8217;s hit show The X Factor. People have been complaining that this has ruined the great British tradition of betting on which artist will take the number one slot, as it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>For the last four years running Simon Cowell&#8217;s plastic karaoke acts have held the Christmas #1 spot in the UK singles charts thanks to ITV&#8217;s hit show <a href="http://xfactor.itv.com/">The X Factor</a>. People have been complaining that this has ruined the great British tradition of betting on which artist will take the number one slot, as it&#8217;s traditionally the only time of year when the chart is dominated by wacky Christmas songs rather than the latest boy bands and whoever else thirteen year old girls spend their pocket money on.</p>
<p>I&#8217;m not too bothered about popular music, the singles chart or who gets the Xmas #1 slot, but last week I was invited to join a growing <a href="http://www.facebook.com/group.php?gid=2228594104">group on Facebook</a> who are campaigning to knock the X Factor winner from the top spot by mass purchasing Rage Against The Machine&#8217;s classic track <a href="http://www.youtube.com/watch?v=fkuOAY-S6OY">Killing in the Name</a>. The sound of rebellion to conquer the airwaves, political rap metal on future Christmas compilation albums, all for the princely sum of 79p? I don&#8217;t usually buy digital downloads but this time you can count me in!</p>
<p>According to <a href="http://news.sky.com/skynews/Home/Showbiz-News/X-Factor-Could-Be-Beaten-To-Christmas-Number-One-By-Anti-Simon-Cowell-Facebook-Campaign/Article/200912115491121">Sky News</a> the group had 43,000 members sometime on Friday, but by the time I got home on Saturday night there were 180,000 members and rising. As the media coverage increases so do the new members, which made me interested: how does a phenomenon like this evolve, how will it turn out next Sunday? What happens when the UK Charts people decide that it&#8217;s against the rules and disqualify the single?</p>
<p>So I decided to log and graph the group&#8217;s membership, every fifteen minutes I grab the page using wget, I extract the number of users and dump that into a text file along with the current date and time. Then I cut through it using a couple of awk and sed one liners, dump the results into an HTML file, graph it using Google Charts and upload the output to my file dump.</p>
<p><strong>Update: These graphs are no longer live! Click for the <a href="http://dump.bitplane.net/ratm/index.html">live versions</a> which are updated much more often using a different script</strong> </p>
<a href="http://dump.bitplane.net/ratm/index.html"><img class="size-full wp-image-345" title="Members" src="http://dump.bitplane.net/ratm/members.png" alt="Click for the source data" width="600" height="300" /></a>
<a href="http://dump.bitplane.net/ratm/index.html"><img class="size-full wp-image-345" title="Members/hr" src="http://dump.bitplane.net/ratm/perhr.png" alt="Members per hour" width="600" height="300" /></a>
<p>Here&#8217;s the scraping script:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>gaz<span style="color: #000000; font-weight: bold;">/</span>ratm<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># get the timestamp</span>
<span style="color: #007800;">timestamp</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> <span style="color: #ff0000;">&quot;+20%y/%m/%d %H:%M:%S&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># get the file</span>
<span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">--max-redirect</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-O</span> temp.html http:<span style="color: #000000; font-weight: bold;">//</span>www.facebook.com<span style="color: #000000; font-weight: bold;">/</span>group.php?<span style="color: #007800;">gid</span>=<span style="color: #000000;">2228594104</span> <span style="color: #660033;">--user-agent</span>=<span style="color: #ff0000;">&quot;Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.1.5) Gecko/20091109 Ubuntu/9.10 (karmic) Firefox/3.5.5&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># extract user count from the file</span>
<span style="color: #007800;">usercount</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;s/.* of \(.*\) members.*/\1/p&quot;</span> temp.html<span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># remove any commas from the string</span>
<span style="color: #007800;">usercount</span>=<span style="color: #800000;">${usercount//[,]/}</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># it must have a length, or it will cause problems when Facebook is having problems!</span>
<span style="color: #666666; font-style: italic;"># in this case, we just give a -1 (not good practice from a stats PoV, but it keeps it simple) </span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${#usercount}</span>&quot;</span> <span style="color: #660033;">-eq</span> <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #007800;">usercount</span>=<span style="color: #ff0000;">&quot;-1&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># remove the temporary file</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> temp.html
&nbsp;
<span style="color: #666666; font-style: italic;"># write the output in CSV format</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$timestamp</span>,<span style="color: #007800;">$usercount</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> data.dat
&nbsp;
<span style="color: #666666; font-style: italic;"># next I run the graph generating script</span></pre></div></div>

<p>And this one (no longer in use) creates the two above charts from the data:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># gets a column from a line of a CSV file. The first index is 1, not 0.</span>
getElement<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #007800;">RESULT</span>=<span style="color: #000000;">0</span>
    <span style="color: #7a0874; font-weight: bold;">local</span> <span style="color: #007800;">p</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$1&quot;</span>p<span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #007800;">RESULT</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$2</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/,/\n/g'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #007800;">$p</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># get the start and end times</span>
&nbsp;
getElement <span style="color: #000000;">1</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(tail -1 data.dat)</span>&quot;</span>
<span style="color: #007800;">end</span>=<span style="color: #007800;">$RESULT</span>
getElement <span style="color: #000000;">1</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(sed -n '1p' data.dat)</span>&quot;</span>
<span style="color: #007800;">start</span>=<span style="color: #007800;">$RESULT</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># get the current minimum and maximum values</span>
<span style="color: #007800;">min</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">cat</span> minval<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">max</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">cat</span> maxval<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># get the last value</span>
getElement <span style="color: #000000;">2</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(tail -1 data.dat)</span>&quot;</span>
<span style="color: #007800;">lastval</span>=<span style="color: #007800;">$RESULT</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># set new max value</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$lastval</span>&quot;</span> <span style="color: #660033;">-gt</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$max</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$lastval</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> maxval
    <span style="color: #007800;">maxval</span>=<span style="color: #007800;">$lastval</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> New maximum, <span style="color: #007800;">$lastval</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># and the new min value</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$lastval</span>&quot;</span> <span style="color: #660033;">-gt</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$lastval</span>&quot;</span> <span style="color: #660033;">-lt</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$min</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
    <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$lastval</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> minval
        <span style="color: #007800;">min</span>=<span style="color: #007800;">$lastval</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># get values for the Y axis</span>
<span style="color: #007800;">quart</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$max</span> - <span style="color: #007800;">$min</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">4</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">q1</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$min</span> + <span style="color: #007800;">$quart</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">q2</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$min</span> + <span style="color: #007800;">$quart</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">q3</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$min</span> + <span style="color: #007800;">$quart</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># extract the data using regexp:</span>
<span style="color: #666666; font-style: italic;"># 1. get every 4th line of the file, meaning hourly</span>
<span style="color: #666666; font-style: italic;"># 2. take all the values from the file</span>
<span style="color: #666666; font-style: italic;"># 3. remove the trailing comma</span>
&nbsp;
<span style="color: #007800;">data</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'NR%4==0'</span> data.dat <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;s/.*,\([0-9]*\)/\1/p&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #ff0000;">&quot;,&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;s/\(.*\),/\1/&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># build the URL to the total members chart</span>
<span style="color: #007800;">total_members</span>=<span style="color: #ff0000;">&quot;http://chart.apis.google.com/chart?chtt=Total+Members&amp;chs=600x300&amp;cht=ls&amp;chxt=x,y&amp;chxl=0:|<span style="color: #007800;">$start</span>|<span style="color: #007800;">$end</span>|1:|<span style="color: #007800;">$min</span>|<span style="color: #007800;">$q1</span>|<span style="color: #007800;">$q2</span>|<span style="color: #007800;">$q3</span>|<span style="color: #007800;">$max</span>&amp;chds=<span style="color: #007800;">$min</span>,<span style="color: #007800;">$max</span>&amp;chd=t:<span style="color: #007800;">$data</span>&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># now let's do members per hour</span>
&nbsp;
<span style="color: #007800;">lastval</span>=<span style="color: #007800;">$min</span>
<span style="color: #007800;">min</span>=<span style="color: #000000;">0</span>
<span style="color: #007800;">max</span>=<span style="color: #000000;">0</span>
<span style="color: #007800;">data</span>=<span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #007800;">inputList</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'NR%4==0'</span> data.dat <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;s/.*,\([0-9]*\)/\1/p&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> line; <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$line</span>&quot;</span> <span style="color: #660033;">-gt</span> <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
    <span style="color: #000000; font-weight: bold;">then</span> 
        <span style="color: #007800;">val</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$line</span> - <span style="color: #007800;">$lastval</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #007800;">lastval</span>=<span style="color: #007800;">$line</span>
    <span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #007800;">val</span>=<span style="color: #000000;">0</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$val</span>&quot;</span> <span style="color: #660033;">-gt</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$max</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
    <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">max</span>=<span style="color: #007800;">$val</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    <span style="color: #007800;">data</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$data</span>,<span style="color: #007800;">$val</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">done</span> <span style="color: #000000; font-weight: bold;">&lt;&lt;&lt;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$inputList</span>&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># remove comma prefix</span>
<span style="color: #007800;">data</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$data</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;s/,\(.*\)/\1/g&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># build the per hour chart</span>
<span style="color: #007800;">members_per_hr</span>=<span style="color: #ff0000;">&quot;http://chart.apis.google.com/chart?chtt=Members+per+hr&amp;chs=600x300&amp;cht=ls&amp;chxt=x,y&amp;chxl=0:|<span style="color: #007800;">$start</span>|<span style="color: #007800;">$end</span>|1:|<span style="color: #007800;">$min</span>|<span style="color: #007800;">$max</span>&amp;chds=<span style="color: #007800;">$min</span>,<span style="color: #007800;">$max</span>&amp;chd=t:<span style="color: #007800;">$data</span>&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># I then create an HTML file from some templates and upload everything to my dump</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2009/12/bash-for-xmas-number-one/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Ubuntu 9.10: works for me!</title>
		<link>http://bitplane.net/2009/11/cuddly-karmic-koalas/</link>
		<comments>http://bitplane.net/2009/11/cuddly-karmic-koalas/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 22:07:11 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=320</guid>
		<description><![CDATA[I was a bit worried about upgrading to Ubuntu 9.10 after El Reg&#8217;s scare stories claimed that nine out of ten people had problems with the automatic upgrade. I guess their stats were skewed, nine out of ten people who are complaining on the Ubuntu forums were complaining about the upgrade, which is nothing like [...]]]></description>
			<content:encoded><![CDATA[<p>I was a bit worried about upgrading to Ubuntu 9.10 after El Reg&#8217;s <a href="http://www.theregister.co.uk/2009/11/03/karmic_koala_frustration/">scare stories</a> claimed that nine out of ten people had problems with the automatic upgrade.<br />
I guess their stats were skewed, nine out of ten people who are complaining on the Ubuntu forums were complaining about the upgrade, which is nothing like nine in ten people having problems.</p>
<p>Worked fine for me on two different machines, my only problem is that the battery charge profile on my laptop was lost.</p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2009/11/cuddly-karmic-koalas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP file list using mod_rewrite</title>
		<link>http://bitplane.net/2009/09/php-file-list-using-mod_rewrite/</link>
		<comments>http://bitplane.net/2009/09/php-file-list-using-mod_rewrite/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 20:09:00 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[bitplane.net]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[piwik]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=59</guid>
		<description><![CDATA[Using the mod_rewrite engine to spice up apache file lists.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve noticed that most of the traffic to this site is actually people visiting my <a title="Permanent file storage" href="http://files.bitplane.net" target="_blank">permanent</a> and <a title="Temporary file dump" href="http://dump.bitplane.net" target="_blank">temporary</a> file dumps, which until today were literally a bunch of files dumped in a folder. <a title="My web host, a kind of web hotel" href="http://www.dreamhost.com">DreamHost</a> don&#8217;t keep my logs for over 30 days and I&#8217;d like to incorporate my file dumps into my Piwik stats, so I made a nice fancy file list in PHP. It has nice looking icons courtesy of <a href="http://www.famfamfam.com/lab/icons/silk/" target="_blank">famfamfam</a>, though may move to <a href="http://stdicon.com/" target="_blank">stdicon</a> in the future.</p>
<p>Some caveats:</p>
<ul>
<li>The file list currently tracks directory views (via the template) but not yet file downloads, as that requires a <a title="Add Piwik request by server side script" href="http://dev.piwik.org/trac/ticket/134" target="_blank">Piwik plugin</a> that isn&#8217;t final so I haven&#8217;t installed it, adding it should be trivial though.</li>
<li>As requests are passed through PHP using mod_rewrite it will result in long running scripts on your server, which may upset your shared web hosting provider.</li>
<li>Scripts are not yet excluded by rewrite rules! You won&#8217;t want to keep other scripts containing sensitive information in dirs under the path.</li>
<li>Access to files and folders beginning with &#8220;.&#8221; will be blocked.</li>
<li>It only works on Unices, not Windows servers as they don&#8217;t have the &#8220;file&#8221; command to get the MIME type.</li>
<li>You&#8217;ll obviously need an Apache installation with mod_rewrite.</li>
</ul>
<p>To install it, just copy index.php, .htaccess and .filelist/ to the directory where you store your files. You can get the script (without icons) <a href="http://svn.bitplane.net/misc/trunk/php/filelist/">from SVN</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2009/09/php-file-list-using-mod_rewrite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PISG is up again</title>
		<link>http://bitplane.net/2009/09/pisg-running-again/</link>
		<comments>http://bitplane.net/2009/09/pisg-running-again/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 03:40:50 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[Irrlicht]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[eggdrop]]></category>
		<category><![CDATA[irc]]></category>
		<category><![CDATA[irrlicht]]></category>
		<category><![CDATA[pisg]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=56</guid>
		<description><![CDATA[Eggyweggs? I like to smash em!]]></description>
			<content:encoded><![CDATA[<p>Now that I have a reliable shell, <a title="#irrlicht IRC" href="http://webchat.freenode.net/?randomnick=0&amp;channels=irrlicht">#irrlicht</a> once again has an <a title="Eggy" href="http://www.eggheads.org/" target="_blank">eggdrop</a> bot, which will be useful because we haven&#8217;t had any way to add new operators for at least two years. The bot is logging and there&#8217;s a cron job to upload <a title="Perl IRC Stats Generator" href="http://pisg.sourceforge.net/" target="_blank">PISG</a> output to the <a title="Irrlicht IRC file dump" href="http://irrlichtirc.g0dsoft.com/" target="_blank">stats page</a>.<em> So anything you do say will be taken down and may be used in evidence against you&#8230;</em></p>
<pre>bitplane also makes sailors blush, 0.3% of the time.</pre>
<p>Oh, shiiii&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2009/09/pisg-running-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Piwik in, Google Analytics out</title>
		<link>http://bitplane.net/2009/08/piwik-in-google-analytics-out/</link>
		<comments>http://bitplane.net/2009/08/piwik-in-google-analytics-out/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 03:47:29 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[bitplane.net]]></category>
		<category><![CDATA[gallery2]]></category>
		<category><![CDATA[piwik]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=51</guid>
		<description><![CDATA[I've stopped using Google Analytics and have now moved over to Piwik...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve stopped using Google Analytics and have now moved over to <a href="http://piwik.org/">Piwik</a>. I don&#8217;t have that many visitors, but there are still lots of <a href="http://piwik.org/blog/2009/06/7-reasons-why-your-commercial-site-needs-piwik/">good reasons</a> to use Piwik. It&#8217;s better for everyone if I keep hold of my own stats instead of giving it all to Google and I may even do some Piwik hacking in the future.</p>
<p>Getting it working in Gallery2 was a bit of a pain, so I <a href="http://codex.gallery2.org/Gallery2:How_To_Add_Piwik_Analytics_to_my_Gallery_2">updated their wiki</a> for them, but other than that it&#8217;s about the same as installing Google Analytics.</p>
<p>Subscribers are welcome to see my laughable stats <img src='http://bitplane.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2009/08/piwik-in-google-analytics-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

