<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:planet="http://planet.intertwingly.net/" xmlns:indexing="urn:atom-extension:indexing" indexing:index="no"><access:restriction xmlns:access="http://www.bloglines.com/about/specs/fac-1.0" relationship="deny"/>
  <title>Clug Park-Tech</title>
  <updated>2012-02-04T19:05:51Z</updated>
  <generator uri="http://intertwingly.net/code/venus/">Venus</generator>
  <author>
    <name>CLUG Webmasters</name>
    <email>webmaster@clug.org.za</email>
  </author>
  <id>http://park.clug.org.za/tech/atom.xml</id>
  <link href="http://park.clug.org.za/tech/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://park.clug.org.za/tech/" rel="alternate"/>

  <entry xml:lang="en">
    <id>http://jonathancarter.org/?p=6894</id>
    <link href="http://jonathancarter.org/2012/01/15/my-unity-5-0-experience/" rel="alternate" type="text/html"/>
    <title>Jonathan Carter (highvoltage): My Unity 5.0 Experience</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><br/>Giving Unity Another Go Yesterday I installed Unity5.0 and I was pleasantly surprised by some of its new features: I can set the panel background colour. By default, the Unity panel adapts itself to match the wallpaper colour. This doesn’t always work out, and with certain background colours it looks really horrible with the icons [...]</div>
    </summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><br/><p><img alt="" class="aligncenter  wp-image-6896" height="337" src="http://jonathancarter.org/files/images/unity-screenshot-thumb.png" style="border: none;" title="Unity" width="522"/></p>
<h3 style="padding-bottom: 20px;">Giving Unity Another Go</h3>
<p>Yesterday I installed <a href="http://en.wikipedia.org/wiki/Unity_(user_interface)">Unity</a>5.0 and I was pleasantly surprised by some of its new features:</p>
<ul>
<li><strong>I can set the panel background colour. </strong>By default, the Unity panel adapts itself to match the wallpaper colour. This doesn’t always work out, and with certain background colours it looks really horrible with the icons on it. I set mine to a none-harsh, dark grey and can now see my icons without any desire to fork out my eyes.</li>
<li><strong>I can set the launcher panel to be ever present.</strong> I have plenty of horizontal screen space and I find it annoying not having a window list present on my display. When I have to hover my mouse to the left edge and wait a few hundred milliseconds before I even see the list of open apps and where they are positioned, it just annoys me. Having them always on-screen is just so much easier.</li>
<li><strong>It’s fast and more stable.</strong> Unity 5.0 is noticeably more snappy than it’s predecessors. It also <em>feels</em> less buggy. What drove me away from Unity on Oneiric was that the window placement snapping got horribly confused now and again and the only way out of it was to kill Compiz or otherwise restart Unity. My session is 24 hours old already and still going strong</li>
</ul>
<h3>Some Areas that could do with Improvement</h3>
<p><strong>Update</strong>: I thought it’s worth mentioning that removing the Gwibber lens removed close to *500MB* of that extra 1GB RAM that was used. There also seems to be an issue where gdbus and dconf worker are way more busy than they should be (at least on my machine). I’m figuring it out and will file bugs if I can confirm them. When they behave better then memory usage in Unity and Gnome Fallback shouldn’t be that far apart.</p>
<ul>
<li><strong>Global menus still get confused about running apps.</strong> Sometimes I’d get a Thunderbird title in the menu space and Thunderbird has already been closed. This is kind of weird when you’re not aware of the bug.</li>
<li><strong>Memory usage is high.</strong> I’m currently using around 1GB more memory than I typically would when using the Gnome 3 Fallback session with the same software running. I’m hoping that it stays there and that it won’t continue to rise due to memory leaks and other memory issues. This is a deal breaker on application servers.</li>
<li><strong>The Dash isn’t very pretty or user friendly.</strong> I guess the dash didn’t get much work or research done due to the focus on getting bugs fixed, so it’s probably not all that bad. At least you can right-click on the Ubuntu icon now and get a list of installed Unity lenses. The Dash home should really be customisable, and I’m not sure how users are supposed to do some rudimentary tasks like connect to a network share.</li>
</ul>
<h3>Overall Thoughts</h3>
<p>Unity has improved a lot recently. I feel that I can continue using it if it’s memory consumption stays under control. I’m testing it on Ubuntu 12.04 which is currently in an early pre-release state. Unity crashed twice while writing this blog entry so I hope it’s just some underlying bugs that will be solved by the time Ubuntu 12.04 hits release.</p>
<p>As for deploying it at client sites, I don’t think I could recommend that until it’s memory issues are resolved. Losing 1GB of RAM is a lot. Simple day to day tasks should be more intuitive (finding recent docs, accessing menus, accessing what used to be known as ‘Places’, etc), and it would help a lot if the Dash home were customisable (I couldn’t find a way to do it from within Unity or anything about it in the documentation). The Gnome 3 Fallback session is very solid and very familiar and I think I’ll continue to recommend it for the typical user desktop. At the rate that Unity is improving though, that might soon change.</p></div>
    </content>
    <updated>2012-01-15T16:29:16Z</updated>
    <category term="Free Software"/>
    <category term="GNOME"/>
    <category term="Precise"/>
    <category term="Ubuntu"/>
    <category term="Unity"/>
    <author>
      <name>jonathan</name>
    </author>
    <source>
      <id>http://jonathancarter.org</id>
      <link href="http://jonathancarter.org/category/free-software/feed/" rel="self" type="application/atom+xml"/>
      <link href="http://jonathancarter.org" rel="alternate" type="text/html"/>
      <subtitle>rebel without a pause</subtitle>
      <title>jonathan carter » Free Software</title>
      <updated>2012-01-25T18:06:08Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://jonathancarter.org/?p=6858</id>
    <link href="http://jonathancarter.org/2012/01/05/bonjour-2012/" rel="alternate" type="text/html"/>
    <title>Jonathan Carter (highvoltage): Bonjour, 2012</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><br/>This year I just want to get more stuff done. Motto for 2012:   JFDI</div>
    </summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><br/><p>This year I just want to get more stuff done.</p>
<p>Motto for 2012:</p>
<p> </p>
<div title="JFDI: Just Freakin' Do It">JFDI</div></div>
    </content>
    <updated>2012-01-05T14:01:03Z</updated>
    <category term="Free Software"/>
    <category term="Jonathan"/>
    <author>
      <name>jonathan</name>
    </author>
    <source>
      <id>http://jonathancarter.org</id>
      <link href="http://jonathancarter.org/category/free-software/feed/" rel="self" type="application/atom+xml"/>
      <link href="http://jonathancarter.org" rel="alternate" type="text/html"/>
      <subtitle>rebel without a pause</subtitle>
      <title>jonathan carter » Free Software</title>
      <updated>2012-01-25T18:06:08Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://jonathancarter.org/?p=6817</id>
    <link href="http://jonathancarter.org/2011/11/29/principles/" rel="alternate" type="text/html"/>
    <title>Jonathan Carter (highvoltage): Principles</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><br/>The Principles Meme This morning I read the following in a blog entry: “I applaud him for sticking to his principles, and not compromising“. The person who wrote it didn’t even agree with the person he was referring too, and yet he was congratulating him for sticking to his principles. I’ve seen a bunch of [...]</div>
    </summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><br/><h3>The Principles Meme</h3>
<p>This morning I read the following in a blog entry: “<em>I applaud him for sticking to his principles, and not compromising</em>“. The person who wrote it didn’t even agree with the person he was referring too, and yet he was congratulating him for sticking to his principles. I’ve seen a bunch of similar statements recently. There’s also a similar, more self-congratulating meme where people are very proud that they are unwaveringly sticking to their principles no matter what.</p>
<p>I’m not sure where this comes from, perhaps it stems from religious roots? Perhaps from people who are afraid to admit that they are flawed in any way? Perhaps they have some agenda that they want to push?</p>
<p>What if no one ever compromised on their principles? What if, in South Africa during the Apartheid years no white person were willing to consider that anyone with a different skin colour could be considered an equal? What if people could never see women as equals and they could never get voting rights or other equal rights? There are many, many more concepts in the past that were rooted as moral principles and with the hindsight we have now, we can see that they were clearly wrong. Sticking to those principles would have been harmful. The sad thing is that today still, many concepts in society is flawed. So why do we choose to applaud people who are inflexible, unscientific and in my opinion, irrational?</p>
<h3>The Scientists</h3>
<p>I applaud the scientist types, the ones who are able to look at new information or evidence and are able to take a step back and say “Hey, maybe I should re-think this!”. I respect those who are willing to say “Perhaps I was wrong” and share they’re experiences with others to get wider feedback rather than the person who will relentlessly defend their position, typically using some absolutes to try to prove their point.</p>
<div title="I'm glad that I managed not to use the term 'idiot' or the phrase 'shut the fuck up' in this sentence.">If you’re not ever willing to compromise or re-evaluate based on facts or new information, then I don’t care much for anything you have to say.</div></div>
    </content>
    <updated>2011-11-29T09:50:06Z</updated>
    <category term="Free Software"/>
    <category term="Project Mayhem"/>
    <category term="Idiots"/>
    <category term="NoWikipediaLinks!"/>
    <category term="Principles"/>
    <author>
      <name>jonathan</name>
    </author>
    <source>
      <id>http://jonathancarter.org</id>
      <link href="http://jonathancarter.org/category/free-software/feed/" rel="self" type="application/atom+xml"/>
      <link href="http://jonathancarter.org" rel="alternate" type="text/html"/>
      <subtitle>rebel without a pause</subtitle>
      <title>jonathan carter » Free Software</title>
      <updated>2012-01-25T18:06:08Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://confluence.za.net/blog/?p=248</id>
    <link href="http://confluence.za.net/blog/?p=248" rel="alternate" type="text/html"/>
    <link href="http://confluence.za.net/blog/?p=248#comments" rel="replies" type="text/html"/>
    <link href="http://confluence.za.net/blog/?feed=atom&amp;p=248" rel="replies" type="application/atom+xml"/>
    <title xml:lang="en">Adrianna Pińska (Confluence): How to make Google Reader look less crap</title>
    <summary xml:lang="en">I switched from a desktop feed reader (Liferea) to Google Reader about a year ago, because my bandwidth is now sufficient for it not to be laggy, and because keeping Liferea synced on two machines was a huge daily waste of time.1 I was annoyed that you couldn’t filter feeds unless you installed a somewhat [...]</summary>
    <content type="xhtml" xml:lang="en"><div xmlns="http://www.w3.org/1999/xhtml"><p>I switched from a desktop feed reader (Liferea) to Google Reader about a year ago, because my bandwidth is now sufficient for it not to be laggy, and because keeping Liferea synced on two machines was a huge daily waste of time.<a href="http://confluence.za.net/blog/?p=248#1"><sup>1</sup></a></p>
<p>I was annoyed that you couldn’t filter feeds unless you installed a <a href="http://userscripts.org/scripts/show/23671" title="Google Reader Filter">somewhat obsolete user script</a> and heavily modified it (and kept your filters synced by hand), but the feed and read item syncing was a major bonus.  I can serve arbitrarily modified feeds from my own webserver if I really want to, but I recently unsubscribed from most of my noisiest feeds anyway.</p>
<p>Then Google redesigned Reader’s layout.  By now, the wavefront of caps lock rage has circled the Earth several times.  A lot of people are leaving Reader, and a lot of people are continuing to use it while complaining a lot.  These are not your only two options — thanks to the wonder of user scripts and user styles, you don’t have to suffer other people’s poor layout decisions.</p>
<p><strong>User styles</strong></p>
<p>A lot can be accomplished with a static custom stylesheet — a large collection is available at <a href="http://userstyles.org/" title="userstyles.org">userstyles.org</a>.  To install these styles on Firefox you need the <a href="https://addons.mozilla.org/en-US/firefox/addon/stylish/" title="Stylish for Firefox">Stylish extension</a>.  Chrome apparently has some limited support for styles now, but there is also a <a href="https://chrome.google.com/webstore/detail/fjnbnpbmkenffdnngjfgmeleoegfcffe" title="Stylish for Chrome">Stylish for Chrome</a>.  I hear it’s a bit crashy.  Stylish lets you toggle stylesheets on and off easily.  The order in which stylesheets are applied is random, which can cause some weirdness.</p>
<p>I currently use <a href="http://userstyles.org/styles/55756/google-reader-imho-old-blue-style" title="Google Reader IMHO - old blue style ">this redesign</a> with my own <a href="http://userstyles.org/styles/55645/google-reader-new-interface-fixes" title="Google Reader -- new interface fixes">special sauce tweaks</a>.  I also like switching to <a href="http://userstyles.org/styles/8983/google-reader-multi-column" title="Google Reader - Multi-Column">two columns</a> when reading long text feeds on a wide screen, but that doesn’t work so well for image-heavy posts — I’m thinking of writing a feed-specific script for this.</p>
<p><strong>User scripts</strong></p>
<p>Changes which require manipulation of page elements need Javascript.  You can find a wide variety of scripts at <a href="http://userscripts.org/" title="userscripts.org">userscripts.org</a>.  To use them on Firefox you need <a href="https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/" title="Greasemonkey">Greasemonkey</a> or <a href="https://addons.mozilla.org/en-US/firefox/addon/scriptish/" title="Scriptish">Scriptish</a>, and Chrome has native support.</p>
<p>I use a script which <a href="http://userscripts.org/scripts/show/40120" title="Google Reader Favicon ++">adds favicons</a> to the entry list — useful when you’re viewing multiple feeds in a folder.  The script also allows you to specify custom favicons, but I think this functionality is broken in the new design.</p>
<p><a name="1">1.</a> Yes, I know Liferea can sync with Reader.  It gives you a huge flat list of all your Reader feeds, which you can’t re-order, arrange in sub-folders or filter.  This is completely useless.</p></div>
    </content>
    <updated>2011-11-09T12:42:16Z</updated>
    <published>2011-11-09T12:39:54Z</published>
    <category scheme="http://confluence.za.net/blog" term="Tech and coding"/>
    <author>
      <name>confluence</name>
      <uri>http://confluence.za.net</uri>
    </author>
    <source>
      <id>http://confluence.za.net/blog/?feed=atom</id>
      <link href="http://confluence.za.net/blog" rel="alternate" type="text/html"/>
      <link href="http://confluence.za.net/blog/?cat=22&amp;feed=atom" rel="self" type="application/atom+xml"/>
      <subtitle xml:lang="en">Powered by space monkeys!</subtitle>
      <title xml:lang="en">Confluence » Tech and coding</title>
      <updated>2011-12-06T19:54:34Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://confluence.za.net/blog/?p=242</id>
    <link href="http://confluence.za.net/blog/?p=242" rel="alternate" type="text/html"/>
    <link href="http://confluence.za.net/blog/?p=242#comments" rel="replies" type="text/html"/>
    <link href="http://confluence.za.net/blog/?feed=atom&amp;p=242" rel="replies" type="application/atom+xml"/>
    <title xml:lang="en">Adrianna Pińska (Confluence): How to fix a laptop key when the hooks have snapped off after a surfeit of gaming</title>
    <summary xml:lang="en">This solution is blindingly obvious in retrospect, but I didn’t think of it until after I bought a new keyboard, because that’s when I got a good look at the underside. I hope to spare others the bother of replacing a keyboard unnecessarily. My right arrow key broke (I blame playing too many platformers). Upon [...]</summary>
    <content type="xhtml" xml:lang="en"><div xmlns="http://www.w3.org/1999/xhtml"><p>This solution is blindingly obvious in retrospect, but I didn’t think of it until after I bought a new keyboard, because that’s when I got a good look at the underside.  I hope to spare others the bother of replacing a keyboard unnecessarily.</p>
<p>My right arrow key broke (I blame playing too many platformers).  Upon closer examination, I discovered that the problem wasn’t with the plastic scissor mechanism attached to the key — if it had been, I could have tried to obtain a replacement kit on the intertubes.  The problem was that the tips of two of the metal hooks on the base of the keyboard onto which the scissor mechanism clips had snapped off.  They were the ones on the bottom, so whenever I pressed the key near the top the bottom would pop off.</p>
<p>So I got a new keyboard.  It may seem silly to replace a whole keyboard because of a broken right arrow key, but I really like playing platformers.</p>
<p>When I got a new keyboard, I saw that the metal underside isn’t solid metal — there are holes next to all the hooks (because it gets punched out of a flat sheet, and the hooks are bent inwards).  I tried to think of a cunning fix for the broken key, but all my solutions involved replicating the properties of the hooks with wire and glue, and nothing really seemed like a good idea.</p>
<p>Tonight (thanks, people on clug-tech discussing Dvorak!) I finally realised that I could run a piece of thread through the holes in the scissor mechanism and the holes in the back, thereby tying the bottom of the key onto the keyboard permanently.  So I did.  And it worked.  Seriously, that’s all it took.  I did have to fiddle around with needles and tweezers to thread the thread through the scissor mechanism without taking the key right off, but that was the only hard part.  It doesn’t look like the thread is ever under a lot of strain, so I used a single loop and a reef knot on the back of the board.</p>
<p>Now I have a spare keyboard.  Which I might rearrange into a Dvorak layout.</p>
<p><strong>Caveats:</strong></p>
<ul>
<li>This worked for a recent Fujitsu Siemens keyboard, but I think a lot of laptop keyboards are pretty similar.  If you’re not sure, see what the scissor mechanism and the back of the keyboard look like.</li>
<li>My right arrow is on the edge of the board, and so are the two affected hooks.  If you play platformers with WASD, fixing your key may require more tweezer acrobatics and/or the temporary removal of surrounding keys.</li>
</ul></div>
    </content>
    <updated>2011-11-05T23:24:28Z</updated>
    <published>2011-11-05T23:18:47Z</published>
    <category scheme="http://confluence.za.net/blog" term="Tech and coding"/>
    <author>
      <name>confluence</name>
      <uri>http://confluence.za.net</uri>
    </author>
    <source>
      <id>http://confluence.za.net/blog/?feed=atom</id>
      <link href="http://confluence.za.net/blog" rel="alternate" type="text/html"/>
      <link href="http://confluence.za.net/blog/?cat=22&amp;feed=atom" rel="self" type="application/atom+xml"/>
      <subtitle xml:lang="en">Powered by space monkeys!</subtitle>
      <title xml:lang="en">Confluence » Tech and coding</title>
      <updated>2011-12-06T19:54:34Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://mithrandi.net/blog/?p=377</id>
    <link href="http://mithrandi.net/blog/2011/10/nat-connection-pinning-with-iproute2-iptables/" rel="alternate" type="text/html"/>
    <link href="http://mithrandi.net/blog/2011/10/nat-connection-pinning-with-iproute2-iptables/#comments" rel="replies" type="text/html"/>
    <link href="http://mithrandi.net/blog/2011/10/nat-connection-pinning-with-iproute2-iptables/feed/" rel="replies" type="application/atom+xml"/>
    <title xml:lang="en">Tristan Seligmann (mithrandi): NAT connection pinning with iproute2 / iptables</title>
    <summary xml:lang="en">My home network has a somewhat complicated setup where I have multiple PPPoE sessions across my ADSL connection, with various different ISPs. This allows me to take advantage of varying ISP properties such as cost and latency, by routing different traffic over different connections. Naturally, each of these connections only affords me a single ...</summary>
    <content type="xhtml" xml:lang="en"><div xmlns="http://www.w3.org/1999/xhtml"><p>My home network has a somewhat complicated setup where I have multiple PPPoE sessions across my ADSL connection, with various different ISPs. This allows me to take advantage of varying ISP properties such as cost and latency, by routing different traffic over different connections. Naturally, each of these connections only affords me a single IPv4 address, so I make use of NAT to allow the rest of my network access to the Internet. A potential problem arises, however, when connections go down and come back up. In the simple case, with only one connection, <code>MASQUERADE</code> takes care of all the details; when the interface goes down, all of the NAT entries associated with the connection are removed, so when it comes back up, it’s not a problem that your IP address has changed, because all of the NAT entries associated with the old address are gone. This works just as well in the multiple connections scenario; if an interface goes down resulting in traffic being routed over another interface, all of the old NAT entries have been dropped, so new ones will be established associated with the interface they are now travelling over. The problem arises when the interface that went down comes back up; traffic will now be routed over the first interface again, while still being rewritten to the second interface’s address, and this traffic is almost guaranteed to be dropped by either your ISP, or their upstream provider.</p>
<p>What’s the solution? Well, if you absolutely definitely want to start routing traffic over the first interface as soon as it comes back up, you’re going to need to flush the associated conntrack NAT entries as soon as it comes up, and let all your users reconnect (since their connections will be interrupted); I’m not entirely sure how to do this. In my case, however, I’m more concerned with maintaining existing connections without interruption, even if that means continuing to route them over the “wrong” interface. This also applies to incoming connections; ordinarily if somebody tries to establish a connection to the public IP address of one of your connections, they will need to connect to the same interface that outbound traffic to them would be routed over, which can be somewhat inconvenient.</p>
<p>My solution is something I’m going to call “connection pinning”. The idea is that once an outbound interface has been selected for a particular connection (by the Linux routing table), we “pin” the connection to that interface, so that traffic associated with that connection always travels over that interface even if the routing table changes. In order to achieve this, we can use a combination of Linux policy routing (<code>ip rule</code>), as well as firewall / conntrack packet marking. When a connection is first established, we set a <code>connmark</code>, which is a value stored in the conntrack table entry for that connection. In the case of an incoming connection, we set the mark based on the interface the packet arrived on; in the case of an outgoing connection, we set the mark in <code>POSTROUTING</code> based on the outbound interface already selected by the routing table. Then, for future outgoing traffic associated with that connection (as determined by conntrack), we set an <code>fwmark</code> based on the <code>connmark</code>, and bypass the normal routing table using policy rules for traffic marked thusly.</p>
<p>This is implemented in three parts. Firewall rules added using <code>iptables</code>, for the netfilter/conntrack bits; an <code>ip-up</code> script for establishing policy rules and routes when a PPP connection is established; and an <code>ip-down</code> script for flushing them again when the PPP connection is terminated.</p>
<p>First, the firewall rules (using the excellent <code>ferm</code> tool):</p>
<pre class="brush: plain; title: ; notranslate">@def $DEV_PRIVATE = eth0;
@def $NET_PRIVATE_V4 = 10.0.0.0/24;

domain ip table mangle {
    # Only match new connections; established connections should
    # already have a connmark, which should not be overwritten.
    chain (INPUT FORWARD) {
        # Unfortunately the set-mark rules need to be duplicated for
        # each ppp interface we have.
        mod conntrack ctstate NEW {
            interface ppp0 CONNMARK set-mark 1;
            interface ppp1 CONNMARK set-mark 2;
            interface ppp2 CONNMARK set-mark 3;
            interface ppp3 CONNMARK set-mark 4;
            interface ppp4 CONNMARK set-mark 5;
        }
    }
    chain POSTROUTING {
        mod conntrack ctstate NEW {
            outerface ppp0 CONNMARK set-mark 1;
            outerface ppp1 CONNMARK set-mark 2;
            outerface ppp2 CONNMARK set-mark 3;
            outerface ppp3 CONNMARK set-mark 4;
            outerface ppp4 CONNMARK set-mark 5;
        }
    }
    chain PREROUTING {
        # Copy the connmark to the fwmark in order to activate the
        # policy rules for connection pinning. Only do this for
        # traffic originating from the local network; other traffic
        # (such as traffic going *to* the local network) should be
        # left unmodified, to allow return traffic to be routed over
        # the correct interface.

        interface $DEV_PRIVATE daddr ! $NET_PRIVATE_V4 CONNMARK restore-mark;
    }
    chain OUTPUT {
        # Same as above, but for locally originating traffic.

        daddr ! $NET_PRIVATE_V4 CONNMARK restore-mark;
    }
}

# I am assuming you already have something like this:
domain ip table nat {
    chain POSTROUTING outerface (ppp0 ppp1 ppp2 ppp3 ppp4) MASQUERADE;
}
</pre>
<p>If you’re not using ferm, here’s what the raw <code>iptables</code> commands would be (these are exactly what ferm will install given the above, so this is just more verbose):</p>
<pre class="brush: plain; title: ; notranslate">iptables -t mangle -A FORWARD --match conntrack --ctstate NEW --in-interface ppp0 --jump CONNMARK --set-mark 1
iptables -t mangle -A FORWARD --match conntrack --ctstate NEW --in-interface ppp1 --jump CONNMARK --set-mark 2
iptables -t mangle -A FORWARD --match conntrack --ctstate NEW --in-interface ppp2 --jump CONNMARK --set-mark 3
iptables -t mangle -A FORWARD --match conntrack --ctstate NEW --in-interface ppp3 --jump CONNMARK --set-mark 4
iptables -t mangle -A FORWARD --match conntrack --ctstate NEW --in-interface ppp4 --jump CONNMARK --set-mark 5
iptables -t mangle -A INPUT --match conntrack --ctstate NEW --in-interface ppp0 --jump CONNMARK --set-mark 1
iptables -t mangle -A INPUT --match conntrack --ctstate NEW --in-interface ppp1 --jump CONNMARK --set-mark 2
iptables -t mangle -A INPUT --match conntrack --ctstate NEW --in-interface ppp2 --jump CONNMARK --set-mark 3
iptables -t mangle -A INPUT --match conntrack --ctstate NEW --in-interface ppp3 --jump CONNMARK --set-mark 4
iptables -t mangle -A INPUT --match conntrack --ctstate NEW --in-interface ppp4 --jump CONNMARK --set-mark 5
iptables -t mangle -A POSTROUTING --match conntrack --ctstate NEW --out-interface ppp0 --jump CONNMARK --set-mark 1
iptables -t mangle -A POSTROUTING --match conntrack --ctstate NEW --out-interface ppp1 --jump CONNMARK --set-mark 2
iptables -t mangle -A POSTROUTING --match conntrack --ctstate NEW --out-interface ppp2 --jump CONNMARK --set-mark 3
iptables -t mangle -A POSTROUTING --match conntrack --ctstate NEW --out-interface ppp3 --jump CONNMARK --set-mark 4
iptables -t mangle -A POSTROUTING --match conntrack --ctstate NEW --out-interface ppp4 --jump CONNMARK --set-mark 5
iptables -t mangle -A PREROUTING --in-interface eth0 ! --destination 10.0.0.0/24 --jump CONNMARK --restore-mark
iptables -t mangle -A OUTPUT ! --destination 10.0.0.0/24 --jump CONNMARK --restore-mark

iptables -t nat -A POSTROUTING --out-interface ppp0 --jump MASQUERADE
iptables -t nat -A POSTROUTING --out-interface ppp1 --jump MASQUERADE
iptables -t nat -A POSTROUTING --out-interface ppp2 --jump MASQUERADE
iptables -t nat -A POSTROUTING --out-interface ppp3 --jump MASQUERADE
iptables -t nat -A POSTROUTING --out-interface ppp4 --jump MASQUERADE
</pre>
<p>Next, the <code>ip-up</code> script (to be placed in <code>/etc/ppp/ip-up.d/</code> and made executable):</p>
<pre class="brush: plain; title: ; notranslate">#!/bin/sh
TABLE="$PPP_IFACE"
MARK=$((${PPP_IFACE##ppp} + 1))
ip rule del lookup "$TABLE"
ip route flush table "$TABLE"
ip route add default dev "$PPP_IFACE" table "$TABLE"
ip rule add fwmark "$MARK" table "$TABLE"
</pre>
<p>Finally, the <code>ip-down</code> script (to be placed in <code>/etc/ppp/ip-down.d/</code> and made executable):</p>
<pre class="brush: plain; title: ; notranslate">#!/bin/sh
TABLE="$PPP_IFACE"
ip rule del lookup "$TABLE"
ip route flush table "$TABLE"
</pre>
<p>There are a couple of changes you will need to make to adapt these for your own network. In particular, you’ll need to duplicate the <code>pppN</code> <code>iptables</code> rules for each of the PPP interfaces you want to apply this to. Also, if you are already doing packet marking for some other reason, you’ll need to change the fwmark values I’ve used to ones that don’t interfere with your existing marks. I suspect there’s a better way to only mark outbound traffic than what I do above, but I wasn’t able to figure it out. If you have any improvements to suggest, feel free to mention them in the comments; I will try to keep this post updated with any improvements I make (either on my own, or based on other people’s suggestions).</p>
<p class="wp-flattr-button"/> <p><a href="http://mithrandi.net/blog/?flattrss_redirect&amp;id=377&amp;md5=6bfca88111c9a017f20d91f56f5e433a" target="_blank" title="Flattr"><img alt="flattr this!" src="http://mithrandi.net/blog/wp-content/plugins/flattr/img/flattr-badge-large.png"/></a></p></div>
    </content>
    <updated>2011-10-23T14:08:16Z</updated>
    <published>2011-10-23T13:59:52Z</published>
    <category scheme="http://mithrandi.net/blog" term="Uncategorized"/>
    <category scheme="http://mithrandi.net/blog" term="linux"/>
    <category scheme="http://mithrandi.net/blog" term="networking"/>
    <category scheme="http://mithrandi.net/blog" term="routing"/>
    <category scheme="http://mithrandi.net/blog" term="tech"/>
    <author>
      <name>mithrandi</name>
      <uri>http://mithrandi.net/</uri>
    </author>
    <source>
      <id>http://mithrandi.net/blog/feed/</id>
      <link href="http://mithrandi.net/blog" rel="alternate" type="text/html"/>
      <link href="http://mithrandi.net/blog/feed/" rel="self" type="application/atom+xml"/>
      <link href="http://pubsubhubbub.appspot.com" rel="hub" type="text/html"/>
      <link href="http://superfeedr.com/hubbub" rel="hub" type="text/html"/>
      <subtitle xml:lang="en">the shards of meaning</subtitle>
      <title xml:lang="en">Shattered Crystalline Matrix</title>
      <updated>2012-01-29T03:05:29Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://www.arbitraryuser.com/blog/?p=901</id>
    <link href="http://www.arbitraryuser.com/blog/2011/10/13/danny-the-capturer-of-the-world/" rel="alternate" type="text/html"/>
    <link href="http://www.arbitraryuser.com/blog/2011/10/13/danny-the-capturer-of-the-world/#comments" rel="replies" type="text/html"/>
    <link href="http://www.arbitraryuser.com/blog/2011/10/13/danny-the-capturer-of-the-world/feed/atom/" rel="replies" type="application/atom+xml"/>
    <title xml:lang="en">Jonathan Endersby (nlt): Danny the capturer of the world.</title>
    <summary xml:lang="en">Many years ago I worked at company that sold widgets. These widgets were very complicated and required lots of customisation. The company had developed a pretty large piece of software to help their sales people build complex widget quotes with lots of line items. This company also had a big off the shelf enterprise accounting [...]</summary>
    <content type="xhtml" xml:lang="en"><div xmlns="http://www.w3.org/1999/xhtml"><p>Many years ago I worked at company that sold widgets. These widgets were very complicated and required lots of customisation. The company had developed a pretty large piece of software to help their sales people build complex widget quotes with lots of line items.</p>
<p>This company also had a big off the shelf enterprise accounting system that handled their real accounts.  </p>
<p>I had worked at the company for almost 2 years as a software developer when one day I found myself sitting in the accounts department helping Danny with something unrelated. It was then that I learnt what Danny from Accounts actually did. </p>
<p>Every morning Danny would print out the previous days ‘accepted’ quotes from the quoting software resulting in a small pile of paper, one for each customer, with hundreds of line items, for every day. Then, using a ruler and pen to scratch out the lines, he would manually re-enter all of the customer data and their quote information, line item by line item, into the big accounting system. This process took him most of the day, sometimes more if business was good. He occasionally made mistakes that either cost the company lots of money or pissed off the customers.</p>
<p>As a software developer I knew that both systems ran off MSSQL databases. I knew that all the relevent information probably already existed to do the “job” programmatically. I knew that it would probably take a day or two to write a piece of software that did Danny’s job, perfectly every time, in a few milliseconds. </p>
<p>Danny had been doing that job for almost 6 years.</p>
<p>Since that day, whenever I start working with a new company, I try my best to meet everyone and get an idea for what they do and how they do it before I put my head down and start trying to solve any problems. That habit has served me well. In a team of ba/tech/strat/arch people I’m often the only one who knows how the accounts actually work, or how the stock is really procured, or what the weird hippies on the third floor do. (They’re always copywriters.) </p>
<p>But I’m not trying to pretend I have special powers. My point is that you can never assume that other people will have looked at problems like you do, with your knowledge-set. Most of the time other people won’t even see something like that as a “problem”. Danny’s boss never thought to question the process that admittedly pre-dated him. They all have no idea what SQL is and neither should they need to. It’s not their job. It’s yours. (Assuming you’re in a tech field)</p>
<p>What really excites me is how this kind of technology-discovery can be applied to people who traditionally live without the exposure to technology that we do. We now live in world where mobile phones can do things that sometimes even I think are quite magical (think SoundHound and Shazaam). I don’t know what “Danny the capturer of the world” situations exist in an under-resourced high school in a Soweto. I don’t know what efficiencies might just be waiting to be discovered in a clinic in Khayelitsha. I am however convinced that if a large corporate focused solely on profits with a really good, international, management team and a chartered accountant CFO all couldn’t spot that Danny was unintentionally wasting his time (and their money), then I can only imagine what amazing, albeit probably simple, tech-opportunities are waiting to be discovered in the “real” world.</p>
<p>I may not be ready to tackle the townships just yet, and I’m by no means assuming that there aren’t already smart people doing this kind of stuff, but I do look forward to one day being able to spend a few weeks immersed in the daily grind of a township school teacher or a minimum-wage worker, and maybe finding some way to bring a little bit of technological awesomeness and efficiency to their lives.</p>
<p>I know you’re wondering. I did write that software and Danny did need to click a button every morning and watch as the script whizzed by in less than a second, but he didn’t lose his job, instead he was able to move on to tackling more challenging things that actually needed his accounting skills. Everyone’s a winner.</p></div>
    </content>
    <updated>2011-10-14T06:36:40Z</updated>
    <published>2011-10-13T14:20:17Z</published>
    <category scheme="http://www.arbitraryuser.com/blog" term="Aggregate This"/>
    <category scheme="http://www.arbitraryuser.com/blog" term="Observation"/>
    <category scheme="http://www.arbitraryuser.com/blog" term="Philosophy"/>
    <category scheme="http://www.arbitraryuser.com/blog" term="Tech"/>
    <author>
      <name>arbitraryuser</name>
      <uri>http://www.arbitraryuser.com/blog/wp-atom.php</uri>
    </author>
    <source>
      <id>http://www.arbitraryuser.com/blog/feed/atom/</id>
      <link href="http://www.arbitraryuser.com/blog" rel="alternate" type="text/html"/>
      <link href="http://www.arbitraryuser.com/blog/category/tech/feed/atom/" rel="self" type="application/atom+xml"/>
      <subtitle xml:lang="en">Jonathan Endersby, Recovering Technologist</subtitle>
      <title xml:lang="en">arbitrary user » Tech</title>
      <updated>2012-01-08T02:48:58Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://mithrandi.net/blog/?p=356</id>
    <link href="http://mithrandi.net/blog/2011/09/browser-support-for-rfc-3749/" rel="alternate" type="text/html"/>
    <link href="http://mithrandi.net/blog/2011/09/browser-support-for-rfc-3749/#comments" rel="replies" type="text/html"/>
    <link href="http://mithrandi.net/blog/2011/09/browser-support-for-rfc-3749/feed/" rel="replies" type="application/atom+xml"/>
    <title xml:lang="en">Tristan Seligmann (mithrandi): Browser support for RFC 3749</title>
    <summary xml:lang="en">RFC 3749 defines a mechanism for compressing a TLS connection using the DEFLATE compression mechanism. When used in conjunction with https, this fills a similar role to that of Content-Encoding: gzip, except that headers benefit from compression too (as the whole connection is compressed), and I suspect there is less chance of weird proxy ...</summary>
    <content type="xhtml" xml:lang="en"><div xmlns="http://www.w3.org/1999/xhtml"><p><a href="https://tools.ietf.org/html/rfc3749">RFC 3749</a> defines a mechanism for compressing a TLS connection using the DEFLATE compression mechanism. When used in conjunction with https, this fills a similar role to that of Content-Encoding: gzip, except that headers benefit from compression too (as the whole connection is compressed), and I suspect there is less chance of weird proxy / caching bugs. I decided to do some quick tests to see which browsers actually support this, as I found approximately zero information on the subject on the internet; the results, unfortunately, are rather dismal and depressing:</p>
<ul>
<li>Chrome: supported (apparently since Chrome 9, but I only tested Chrome 15 on the dev channel)</li>
<li>Firefox: not supported (tested 8.0 Aurora)</li>
<li>Safari: not supported</li>
<li>Internet Explorer 9 on Windows 7: not supported</li>
<li>Android 2.3 default browser: not supported</li>
</ul>
<p class="wp-flattr-button"/> <p><a href="http://mithrandi.net/blog/?flattrss_redirect&amp;id=356&amp;md5=38baddb5cb19855d2c9134e9cee61db1" target="_blank" title="Flattr"><img alt="flattr this!" src="http://mithrandi.net/blog/wp-content/plugins/flattr/img/flattr-badge-large.png"/></a></p></div>
    </content>
    <updated>2011-09-01T22:11:08Z</updated>
    <published>2011-09-01T22:11:08Z</published>
    <category scheme="http://mithrandi.net/blog" term="Uncategorized"/>
    <author>
      <name>mithrandi</name>
      <uri>http://mithrandi.net/</uri>
    </author>
    <source>
      <id>http://mithrandi.net/blog/feed/</id>
      <link href="http://mithrandi.net/blog" rel="alternate" type="text/html"/>
      <link href="http://mithrandi.net/blog/feed/" rel="self" type="application/atom+xml"/>
      <link href="http://pubsubhubbub.appspot.com" rel="hub" type="text/html"/>
      <link href="http://superfeedr.com/hubbub" rel="hub" type="text/html"/>
      <subtitle xml:lang="en">the shards of meaning</subtitle>
      <title xml:lang="en">Shattered Crystalline Matrix</title>
      <updated>2012-01-29T03:05:29Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://blog.saturnlaboratories.co.za/124 at http://blog.saturnlaboratories.co.za</id>
    <link href="http://blog.saturnlaboratories.co.za/archive/2011/08/14/true-cost-open-source" rel="alternate" type="text/html"/>
    <title>Raoul Snyman (superfly): The True Cost of Open Source</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>This afternoon I came across a blog post entitled <a href="http://churchwebsites.org/the-true-cost-of-open-source/">The True Cost of Open Source</a>, in which the blogger tries to dissuade churches from using open source solutions, and thereby promote their own proprietary CMS.</p>
<p>I commented on their blog post, but I don't know if they'll post it, because I show them up for what they really seem to be doing. So with this in mind, I've posted my full, unedited reply below:</p>
<blockquote><p>Why is this so reminiscent of those Microsoft-funded studies showing how open source software is more expensive than proprietary software?</p>
<p>Ah... I see what you're doing, but first I'm going to reply to your blog post, and then I'm going to conclude with my answer to the real reason you blogged this.</p>
<p>"When a project gets mature enough to be widely useful, it can be released as open source."</p>
<p>Uh, most open source projects are open source from the get-go, even if only one person is currently using it, and that person is the developer.</p>
<p>"You may not be paying software licensing fees or monthly costs, but you will be paying for labor, expertise, or suffering through long nights and weekends without a geek who can make sense of this stuff."</p>
<p>This is a half-truth. All three content management systems in the roundup you highlighted have one or more commercial companies that provide installations, support and other services around the open source app. On top of that you seem to assume that most churches implement websites themselves, whereas in my experience, as an IT professional, most churches ask a geek to do it for them (and then said geek uses the CMS of their choice, be it open source or not).</p>
<p>"The research by DeviousMedia shows that the average setup costs for any open source system can easily top $15,000. Monthly maintenance costs are usually $250 or more."</p>
<p>Of course what you don't point out is that DeviousMedia uses Drupal themselves, and are just doing a comparison of open source CMSes, they are not trying to explain how open source is "more expensive" or something else like that. They are simply giving their visitors an accurate comparison of open source systems.</p>
<p>Also, note that those setup costs are what commercial companies (that build their businesses around open source software) charge, not the REAL cost a church might incur. So this is not a true cost, just an estimated cost if you ask a company to do it for you.</p>
<p>1. Lack of support</p>
<p>This is such a red herring. I've had more and better support from the open source community than I've had from commercial companies. Sure there's no telephone number you can call, but a most of them offer either forums or IRC (and a lot of open source projects now have a web IRC client on their websites so that you don't even need to download an IRC client), or even both. Some even have a support e-mail address.</p>
<p>I have spoken to a number of folks about this, and they all agree with me, they've gotten more support out of open source projects than commercial companies.</p>
<p>2. Requirements for ongoing maintenance</p>
<p>While you say that this is true for all software, you make this out to be something that commercial companies are not affected by. I can tell you from personal experience that this is not the case. We're upgrading the commercial issue tracking system at work for the 2nd time in less than 2 years, and we'll still be a release behind after the upgrade.</p>
<p>3. No accountability from the vendor</p>
<p>Have you read the EULA from commercial products? Have you ever read a EULA? They are far worse than the open source licenses.</p>
<p>Commercial companies completely absolve themselves of any and all responsibility of your data. So if your commercial CMS messes up your database, you're up the creek without a paddle, and (as I mentioned in the "support" section) you are without help. At least the open source projects will try to help you recover your data. Try getting a commercial company to do that.</p>
<p>4. Forced workarounds and duct-tape solutions</p>
<p>While this may be true about some open source systems, it's just as true about commercial CMSes. In addition to that, there are some open source CMSes and open source church CMSes that do not have this issue.</p>
<p>All blankets statements are wrong. (See what I did there?)</p>
<p>5. Not customer-focused</p>
<p>This has got to be the biggest myth I've ever heard. How many open source projects have you interviewed and studied to determine this?</p>
<p>Time and time again I have dealt with open source projects I have found them to be exceedingly user-focused. They have gone out their way to help their users, they accept feature requests from the users and implement them. Few commercial companies will implement feature requests from users unless it is in line with their product strategy.</p>
<p>Additionally, most commercial companies I have dealt with are mostly concerned about the money. Want support? You need a support contract.</p>
<p>Lastly, as I said earlier, I'm going to answer the reason you have blogged this.</p>
<p>I saw your link in the post and your little note at the bottom of the blog, and went to your site, and noticed that lo and behold, you're selling a proprietary content management system! No wonder this is reminiscent of those Microsoft studies. I'm guessing that you've had a number of potential customers use open source systems instead of yours, and you're trying to counter that.</p>
<p>With this in mind you pulled an infographic that you thought you could use to bolster your argument, even though that infographic actually has nothing to do with your argument.</p>
<p>However, the truth is that even with all the hidden costs, open source systems are still cheaper than commercial systems.</p>
</blockquote>
<p><strong>Update:</strong> they have <a href="http://churchwebsites.org/the-true-cost-of-open-source/#comment-51">replied to my comment</a>.</p></div>
    </summary>
    <updated>2011-08-14T17:01:56Z</updated>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/cost" term="Cost"/>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/fear-uncertainty-and-doubt" term="Fear Uncertainty And Doubt"/>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/open-source" term="Open Source"/>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/proprietary-software" term="Proprietary Software"/>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/return-investment" term="Return on Investment"/>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/true-cost" term="True Cost"/>
    <author>
      <name>raoul</name>
    </author>
    <source>
      <id>http://blog.saturnlaboratories.co.za</id>
      <link href="http://blog.saturnlaboratories.co.za" rel="alternate" type="text/html"/>
      <link href="http://blog.saturnlaboratories.co.za/rss.xml" rel="self" type="application/rss+xml"/>
      <title>Planetary Ponderings</title>
      <updated>2011-09-21T14:07:23Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://mithrandi.net/blog/?p=353</id>
    <link href="http://mithrandi.net/blog/2011/08/google-maps-navigation-south-africa-a-review/" rel="alternate" type="text/html"/>
    <link href="http://mithrandi.net/blog/2011/08/google-maps-navigation-south-africa-a-review/#comments" rel="replies" type="text/html"/>
    <link href="http://mithrandi.net/blog/2011/08/google-maps-navigation-south-africa-a-review/feed/" rel="replies" type="application/atom+xml"/>
    <title xml:lang="en">Tristan Seligmann (mithrandi): Google Maps Navigation, South Africa: a review</title>
    <summary xml:lang="en">Introduction
In case you missed the news, Google Maps Navigation (Beta) for Mobile is now available in South Africa. I tried it out briefly, and thought I'd offer some thoughts on how it compares to the primary navigation software I use, Waze. Note that as an Android user (HTC Desire HD), this review will be ...</summary>
    <content type="xhtml" xml:lang="en"><div xmlns="http://www.w3.org/1999/xhtml"><h2>Introduction</h2>
<p>In case you missed the news, <a href="http://google-africa.blogspot.com/2011/08/google-maps-navigation-beta-for-mobile.html">Google Maps Navigation (Beta) for Mobile</a> is now available in South Africa. I tried it out briefly, and thought I’d offer some thoughts on how it compares to the primary navigation software I use, <a href="http://www.waze.com/">Waze</a>. Note that as an Android user (HTC Desire HD), this review will be fairly Android-specific. If you’re using an iPhone, please write your own review and let me know; if you’re using something else, please join the rest of us in the 21st century.</p>
<h2>Integration</h2>
<p>Navigation is part of the Google Maps application; as one of the core Google apps that virtually every Android phone ships with, it’s well integrated with the rest of the system, and in particular, with Maps / Places / People. Waze isn’t quite as well integrated; for example, there’s no easy way to grab a location out of  Places and have Waze navigate to it.</p>
<h2>Voice prompts</h2>
<p>These are generated entirely via TTS, using the system-configured speech engine. This is great for road names, not so great for actually being able to comprehend the prompts; I wish they had taken the Garmin approach, and only used TTS for the road names and such, not everything. By comparison, Waze only uses pre-recorded voice prompts, although they are currently testing out TTS functionality as well (I don’t have access to that, so I don’t yet know how it compares). As far as the actual prompting goes, they seem to be about equal in terms of usefulness.</p>
<h2>Map data</h2>
<p>This is a bit harder to quantify, as the quality and coverage of map data for both Waze and Google Maps varies drastically depending on where exactly you are in the country. In general, Google Maps has much more complete data; on the other hand, it tends to be several years or more out of date. In areas with active Area Managers on Waze, coverage is likely to be far more accurate, even going so far as to include temporary road detours during construction and so on. As such, your mileage may (and very likely will) vary.</p>
<h2>Routing</h2>
<p>Waze definitely wins this one, assuming you’re navigating in an area where the map is actually sufficiently complete to allow for sensible routing. Waze tracks the average travel time along each road segment and uses this as part of its routing calculations. In addition, if there is sufficient data, it seems that this will even be broken down by day of week / time of day, so Waze knows that what might be a crawling disaster at 4pm is actually smooth sailing at lunchtime. In addition, speed data is also handled in real-time; so if there’s a traffic jam right now, and some Waze users are stuck in it, it’ll detect that the average speed *right now* is much lower than it usually is, and route you around the problematic road segments if appropriate. Google Maps, by comparison, has a real-time traffic layer which can be used for routing decisions, but there currently seems to be no traffic data for South Africa, and I’m not sure if this information is used at all for long-term routing decisions. Even if it is, it’ll take a while for them to catch up with the existing data that has already been built up by Waze, so I guess we’ll have to see how that works out.</p>
<h2>Display / UI</h2>
<p>Google Maps wins this one. While driving, you can have the satellite layer displayed for the map, not just the road layer, which makes it a lot easier to match the map to what you’re seeing out of your windscreen, assuming the map isn’t horribly out of date. In addition, once you’re making your final approach to the destination, it will show you a Street View image of the destination, making it much easier to find the exact place you’re looking for, instead of trying to estimate distances on a map. By comparison, Waze offers only the usual abstract road map; this works, of course, but could be better.</p>
<h2>Crowdsourcing</h2>
<p>In addition to using average speed data collected from users for routing decisions, Waze also does things like adjusting road segment positions, and toggling road directions (1-way to 2-way and vice-versa) automatically, based on collected driving data. Occasionally this results in errors, but it mostly saves a lot of work on the part of map editors who would otherwise have to manually fix the map up. There’s also the ability to report accidents, traffic cameras, potholes, speed traps, roadblocks, and so on, which other users will be able to see and avoid. Google Maps doesn’t really have anything similar, other than the real-time traffic info.</p>
<h2>Conclusion</h2>
<p>I’ll be sticking with Waze, for now; the real-time and routing functionality, as well as the ability to fix up the map myself, easily makes up for any of the other disadvantages. If Google Maps grows to encompass the functionality and userbase of Waze, this would definitely tip the scales in its favour, but that doesn’t look like it’s going to happen any time soon.</p>
<p class="wp-flattr-button"/> <p><a href="http://mithrandi.net/blog/?flattrss_redirect&amp;id=353&amp;md5=f90972c4e50e646986f4f2d0de945598" target="_blank" title="Flattr"><img alt="flattr this!" src="http://mithrandi.net/blog/wp-content/plugins/flattr/img/flattr-badge-large.png"/></a></p></div>
    </content>
    <updated>2011-08-04T07:34:26Z</updated>
    <published>2011-08-04T07:34:26Z</published>
    <category scheme="http://mithrandi.net/blog" term="Uncategorized"/>
    <author>
      <name>mithrandi</name>
      <uri>http://mithrandi.net/</uri>
    </author>
    <source>
      <id>http://mithrandi.net/blog/feed/</id>
      <link href="http://mithrandi.net/blog" rel="alternate" type="text/html"/>
      <link href="http://mithrandi.net/blog/feed/" rel="self" type="application/atom+xml"/>
      <link href="http://pubsubhubbub.appspot.com" rel="hub" type="text/html"/>
      <link href="http://superfeedr.com/hubbub" rel="hub" type="text/html"/>
      <subtitle xml:lang="en">the shards of meaning</subtitle>
      <title xml:lang="en">Shattered Crystalline Matrix</title>
      <updated>2012-01-29T03:05:29Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://blog.saturnlaboratories.co.za/123 at http://blog.saturnlaboratories.co.za</id>
    <link href="http://blog.saturnlaboratories.co.za/archive/2011/07/23/building-ubuntu-or-kubuntu-natty-package-choqok-11" rel="alternate" type="text/html"/>
    <title>Raoul Snyman (superfly): Building an Ubuntu or Kubuntu Natty Package for Choqok 1.1</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p><a href="http://choqok.gnufolks.org/">Choqok</a> seems to be about the only native microblogging client for KDE. It's actually a rather nice app, but I've found it to be rather buggy when it comes to Twitter authentication. For the last few months it has moaned about not being able to authenticate, after which it crashes. Starting the app again does the same thing, which means it crashes constantly, and you're left without a Twitter client.</p><p>The latest version of Choqok, version 1.1, seems to have fixed this bug. With this in mind, I looked for a PPA with version 1.1, but didn't find anything. I decided to build it myself, including a package so that I can install and uninstall it cleanly on my system, and so that it would work with the existing packages.</p><p>If you're compiling software on Ubuntu, there's a nice little application called "checkinstall" that will build a package file for you, based on the instructions in the Makefile for the "make install" step. By setting the parameters of the package correctly, you can ensure that it replaces the current package correctly, and when you upgrade to the next release of Ubuntu it will be removed in favour of the version in Ubuntu.</p><p>First, let's install some of the packages we'll need to compile Choqok:</p><pre style="margin: 1em; border: 1px solid #e0e0e0; padding: 0.5em; background-color: #f0f0f0;">$ sudo apt-get install build-essential checkinstall kdelibs5-dev libqjson-dev \<br/>libattica-dev libqca2-dev libindicate-qt-dev libqoauth-dev</pre><p>Now that we have those, we need the <a href="http://choqok.gnufolks.org/2011/04/choqok-1-1-release/">latest version of Choqok</a> itself. Download the <a href="http://sourceforge.net/projects/choqok/files/Choqok/choqok-1.1.tar.bz2/download">bzip2ed tarball</a> from SourceForge.net. Once you have that, you need to extract it:</p><pre style="margin: 1em; border: 1px solid #e0e0e0; padding: 0.5em; background-color: #f0f0f0;">$ tar -xjvf choqok-1.1.tar.bz2</pre><p>Once the files are extracted, you can compile Choqok:</p><pre style="margin: 1em; border: 1px solid #e0e0e0; padding: 0.5em; background-color: #f0f0f0;">$ cd choqok-1.1<br/>$ mkdir build<br/>$ cd build<br/>$ cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` ..<br/>$ make</pre><p>Now comes the magical part where you create a package. Normally one would run checkinstall as root so that it can install the package. I didn't want to do that, because I wanted to manually install the package myself via gdebi-kde, so I ran it as my user, and let it complain that it couldn't install the package.</p><pre style="margin: 1em; border: 1px solid #e0e0e0; padding: 0.5em; background-color: #f0f0f0;">$ checkinstall</pre><p>When you first run checkinstall, it will ask you to confirm the package details. You need to change the following fields:</p><ul><li>Maintainer: Your name and e-mail address</li><li>Summary: Choqok is a fast, efficient and simple to use micro-blogging client for KDE. It currently supports the twitter.com and identi.ca microblogging services.</li><li>Name: choqok</li><li>Version: 1.1</li><li>Release: 0ubuntu1~natty1</li><li>Group: kde</li><li>Provides: choqok</li><li>Replaces: choqok</li></ul><p>Here's what it should look like:</p><pre style="margin: 1em; border: 1px solid #e0e0e0; padding: 0.5em; background-color: #f0f0f0;">This package will be built according to these values: <br/><br/>0 -  Maintainer: [ Your Name &lt;you@example.com&gt; ]<br/>1 -  Summary: [ Choqok is a fast, efficient and simple to use micro-blogging<br/> client for KDE. It currently supports the twitter.com and identi.ca<br/> microblogging services. ]<br/>2 -  Name:    [ choqok ]<br/>3 -  Version: [ 1.1 ]<br/>4 -  Release: [ 0ubuntu1~natty` ]<br/>5 -  License: [ GPL ]<br/>6 -  Group:   [ kde ]<br/>7 -  Architecture: [ amd64 ]<br/>8 -  Source location: [ build ]<br/>9 -  Alternate source location: [  ]<br/>10 - Requires: [  ]<br/>11 - Provides: [ choqok ]<br/>12 - Conflicts: [  ]<br/>13 - Replaces: [ choqok ]</pre><p>After this checkinstall will run, but will ask you a few more questions. Just read the questions carefully, and do what checkinstall suggests. Once this is done, a package will be left in the "build" directory you created earlier. It should be called "choqok_1.1-0ubuntu1~natty1_i386.deb" or "choqok_1.1-0ubuntu1~natty1_amd64.deb" depending on your platform.</p><p>Now run gdebi-kde to install it:</p><pre style="margin: 1em; border: 1px solid #e0e0e0; padding: 0.5em; background-color: #f0f0f0;">$ gdebi-kde choqok_1.1-0ubuntu1~natty1_i386.deb</pre><p>This will notify you that there is an older version in a channnel, which is the version we're wanting to replace. This is fine, so just continue with the installation.</p><p>Once that is complete, you can start up Choqok, and you should have a working microblogging client!</p></div>
    </summary>
    <updated>2011-07-23T11:55:16Z</updated>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/build" term="Build"/>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/choqok" term="Choqok"/>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/compile" term="Compile"/>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/debian" term="Debian"/>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/kubuntu" term="Kubuntu"/>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/package" term="Package"/>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/ubuntu" term="Ubuntu"/>
    <author>
      <name>raoul</name>
    </author>
    <source>
      <id>http://blog.saturnlaboratories.co.za</id>
      <link href="http://blog.saturnlaboratories.co.za" rel="alternate" type="text/html"/>
      <link href="http://blog.saturnlaboratories.co.za/rss.xml" rel="self" type="application/rss+xml"/>
      <title>Planetary Ponderings</title>
      <updated>2011-09-21T14:07:23Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://confluence.za.net/blog/?p=239</id>
    <link href="http://confluence.za.net/blog/?p=239" rel="alternate" type="text/html"/>
    <link href="http://confluence.za.net/blog/?p=239#comments" rel="replies" type="text/html"/>
    <link href="http://confluence.za.net/blog/?feed=atom&amp;p=239" rel="replies" type="application/atom+xml"/>
    <title xml:lang="en">Adrianna Pińska (Confluence): Update-notifier; gnome-settings-daemon</title>
    <summary xml:lang="en">I used to launch update-notifier from my fluxbox startup file, but after the Maverick upgrade it stopped escalating privileges when launching update-manager and would just fail silently when I clicked the button to install upgrades. So I kept launching update-manager manually. Now I’ve got a proper fix: update-notifier --force-use-gksu &amp; As the name of the [...]</summary>
    <content type="xhtml" xml:lang="en"><div xmlns="http://www.w3.org/1999/xhtml"><p>I used to launch update-notifier from my fluxbox startup file, but after the Maverick upgrade it stopped escalating privileges when launching update-manager and would just fail silently when I clicked the button to install upgrades.  So I kept launching update-manager manually.  Now I’ve got a proper fix:</p>
<pre>update-notifier --force-use-gksu &amp;</pre>
<p>As the name of the flag suggests, this forces update-notifier to use gksu when launching subcommands.  I don’t know why it stopped doing it by itself.</p>
<p>Since Jaunty, the default behaviour of update-notifier is to pop up update-manager when it wants to notify you of updates, which I find pretty obnoxious.  To restore it to its pre-Jaunty behaviour (a notification in the system tray, which you can click on at your leisure), do this:</p>
<pre>gconftool -s --type bool /apps/update-notifier/auto_launch false</pre>
<p>In related news, I set the GTK theme with gtk-chtheme and killed gnome-settings-daemon to see what would break.  Update manager didn’t display the right theme.  This is because it runs with gksu — you have to set root’s theme to fix it.  I did this by copying my <code>.gtkrc-2.0</code> to <code>/root</code>.</p></div>
    </content>
    <updated>2011-07-21T12:10:00Z</updated>
    <published>2011-07-21T12:10:00Z</published>
    <category scheme="http://confluence.za.net/blog" term="Tech and coding"/>
    <author>
      <name>confluence</name>
      <uri>http://confluence.za.net</uri>
    </author>
    <source>
      <id>http://confluence.za.net/blog/?feed=atom</id>
      <link href="http://confluence.za.net/blog" rel="alternate" type="text/html"/>
      <link href="http://confluence.za.net/blog/?cat=22&amp;feed=atom" rel="self" type="application/atom+xml"/>
      <subtitle xml:lang="en">Powered by space monkeys!</subtitle>
      <title xml:lang="en">Confluence » Tech and coding</title>
      <updated>2011-12-06T19:54:34Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://blog.saturnlaboratories.co.za/122 at http://blog.saturnlaboratories.co.za</id>
    <link href="http://blog.saturnlaboratories.co.za/archive/2011/06/24/migrating-drupal-forums-vanilla" rel="alternate" type="text/html"/>
    <title>Raoul Snyman (superfly): Migrating Drupal forums to Vanilla</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>One of the complaints I've heard fairly often from users of <a href="http://openlp.org/">OpenLP</a> is that our forums lack somewhat in usability and features. With this in mind, as part of the OpenLP 2.0 release, I wanted to see if I can move the forums over to some alternative forum software. However, I have a few important prerequisites:</p><ol><li>I don't want users to have to re-register on the forums</li><li>I want users to be able to move seamlessly between the site and the forums without needing to log in again</li><li>I want to move my forum posts across</li></ol><h3>Current Situation</h3><p>The web site currently runs on <a href="http://drupal.org/">Drupal</a>, which is very extensible, and I had no doubt that it would be able to provide the necessary to perform its side of the job, but I wasn't so sure if any of the forum software would be able to keep its end of the bargain. And so I started my Googling...</p><p>The open source heavyweight in this category is <a href="http://phpbb.com/">phpBB</a>, but, as everybody knows they have security issues coming out of their ears. Actually, from what I've heard, version 3 of phpBB is leaps and bounds ahead of phpBB2 in terms of security. That said, after looking at it again, I still wasn't happy with it. It didn't seem to provide any real integration capabilities.</p><p>A few years ago I had also heard of <a href="http://vanillaforums.org/">Vanilla Forums</a>, which is not just new forum software, but a new type of forum software. Their addons are simply dropped into the code base to be installed, by far the easiest plugin system yet. I went to go and have a look at Vanilla again, and lo and behold they'd already released version 2.0.</p><h3>A Solution</h3><p>It looked to me like Vanilla would be my best bet. However, I still wasn't sure how to provide single sign-on for my users. With this in mind I chatted to a friend of mine who deals with these sorts of web sites on a day-to-day basis, and asked him about my forum dilemma. No problem, he said, I should use the <a href="http://vanillaforums.org/addon/472/vanilla-proxyconnect">Vanilla Proxyconnect</a> plugin. Just what I needed!</p><p>When we originally chatted about this, there was no Drupal module which could provide the integration needed from Drupal's end. My friend was happy to write one for me, but since we didn't get any further with the move to Vanilla at the time of the discussion, he hadn't done much. Fortunately for both of us, someone <em>has</em> written a module, named <a href="http://drupal.org/project/orchid">Orchid</a>, for Drupal since, and I was able to download it and install it in no time.</p><h3>Problems Encountered</h3><p>At this point, having a local instance of the site running on my development server, I set up Vanilla on my server, and proceeded to configure the seamless integration. It was pretty easy, and after about 20 minutes I had things working. But I had two problems:</p><ul><li>If you click Sign Out on the forums, nothing happens</li><li>If you click Sign In on Vanilla, which takes you to the Drupal login page, the Drupal login page does not take you back to Vanilla</li></ul><p>More Googling, and after staring at code for a few hours, I had figured out the problems. Firstly, there was a missing line of code in the Proxyconnect plugin for Vanilla, and secondly, Drupal needs to be told to redirect back to Vanilla.</p><h3>Fixing The Logout</h3><p>The logout fix was fairly simple, I just needed to add a line of code similar to the following line to the EntryController_SignOut_Handler function:</p><pre style="margin-top: 1em;">Redirect('http://www.yoursite.com/logout.php', 302);</pre><p>What I ended up with was something like this, which takes the configured logout URL into consideration (based on the login code):</p><pre style="margin-top: 1em;">public function EntryController_SignOut_Handler(&amp;$Sender) {<br/>   if (!Gdn::Authenticator()-&gt;IsPrimary('proxy')) return;<br/>   $Redirect = Gdn::Request()-&gt;GetValue('HTTP_REFERER');<br/>   $SignoutURL = Gdn::Authenticator()-&gt;GetURL(Gdn_Authenticator::URL_REMOTE_SIGNOUT, $Redirect);<br/>   Redirect($SignoutURL, 302);<br/>}</pre><h3>Fixing The Redirection: Part 1</h3><p>The Proxyconnect doucmentation suggests telling the CMS that you came from the forums via a simple "?forums=1" type of link. This was not good enough for me, I want the user to be redirected back to the exact page that they were on!</p><p>Having a look again at the login and logout code, I had an idea: What if I add a token in the configurable URLs which is replaced with the URL to redirect to?</p><p>As you can see in the logout code above, I actually already have the redirect (or 'referer') URL - I just need to use it. With that in mind, I changed the logout method to look like this:</p><pre style="margin-top: 1em;">public function EntryController_SignOut_Handler(&amp;$Sender) {<br/>   if (!Gdn::Authenticator()-&gt;IsPrimary('proxy')) return;<br/>   $Redirect = Gdn::Request()-&gt;GetValue('HTTP_REFERER');<br/>   $SignoutURL = Gdn::Authenticator()-&gt;GetURL(Gdn_Authenticator::URL_REMOTE_SIGNOUT, $Redirect);<br/>   $SignoutURL = str_replace('{REDIRECT_URL}', urlencode($Redirect), $SignoutURL);<br/>   Redirect($SignoutURL, 302);<br/>}</pre><p>Once I'd done that, I edited the code in the login method, so that it looked like this:</p><pre style="margin-top: 1em;">$Redirect = Gdn::Request()-&gt;GetValue('HTTP_REFERER');<br/>$SigninURL = Gdn::Authenticator()-&gt;GetURL(Gdn_Authenticator::URL_REMOTE_SIGNIN, $Redirect);<br/>$SigninURL = str_replace('{REDIRECT_URL}', urlencode($Redirect), $SigninURL);<br/>Redirect($SigninURL, 302);</pre><h3>Fixing The Redirection: Part 2</h3><p>Drupal provides a "destination" parameter, which directs any given back to the specified URL, so I thought I'd take advantage of that. As a first course of action, I used the above-mentioned token in the "sign in url" configuration in Vanilla. That did not work as Drupal told me that URL did not exist. It seems that the desintation parameter only works on internal Drupal URLs. Time to make use of Drupal's module hooks system!</p><p>Since I was fixing Vanilla integration I decided to just do the Drupal side of things in the Orchid module itself. Orchid already uses the hook_user hook, and specifically deals with the logging in and logging out, so I just tagged along with that, and forced Drupal to redirect if there was a "destination" GET parameter. In the orchid_user function, I added these lines in the bottom of the if statement:</p><pre style="margin-top: 1em;">if ($_GET['destination']) {<br/>  drupal_goto($_GET['destination']);<br/>}</pre><p>w00t! My seamless integration works!</p><h3>Exporting The Data</h3><p>Unfortunately, that still left me with all my forum posts sitting in Drupal, and nothing in Vanilla. So my next step was to figure out how to export the data from Drupal and then import it into Vanilla.</p> <p>Some more browsing and Googling brought me to the <a href="http://vanillaforums.org/addon/porter-core">vanilla2export.php script</a>, which can export data from a number of different forum software packages so that you can import them into Vanilla. Once again, Drupal was unsupported, but after looking at the exporter code and seeing how pluggable it is, I had a <a href="http://blog.saturnlaboratories.co.za/programs/class-drupal-php">Drupal exporter</a> up and running in less than an hour.</p><p>The only problem I had with the exporter was that Drupal's user roles don't match well to Vanilla. On top of that, the default roles in Vanilla are deleted when you import data from the vanilla2export.php script. I dropped my Vanilla database and installed Vanilla again. With a new, clean install, I extracted the permissions into <a href="http://blog.saturnlaboratories.co.za/programs/drupal2vanilla-permissions-sql">an SQL script</a>, and added a few extra tweaks to it, to assign everyone the "Member" role.</p></div>
    </summary>
    <updated>2011-06-24T23:12:16Z</updated>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/database" term="Database"/>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/drupal" term="Drupal"/>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/export" term="Export"/>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/forums" term="Forums"/>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/import" term="Import"/>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/port" term="Port"/>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/sql" term="SQL"/>
    <category scheme="http://blog.saturnlaboratories.co.za/tags/vanilla" term="Vanilla"/>
    <author>
      <name>raoul</name>
    </author>
    <source>
      <id>http://blog.saturnlaboratories.co.za</id>
      <link href="http://blog.saturnlaboratories.co.za" rel="alternate" type="text/html"/>
      <link href="http://blog.saturnlaboratories.co.za/rss.xml" rel="self" type="application/rss+xml"/>
      <title>Planetary Ponderings</title>
      <updated>2011-09-21T14:07:23Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://www.arbitraryuser.com/blog/?p=834</id>
    <link href="http://www.arbitraryuser.com/blog/2011/05/26/pystack-and-djangoverflow/" rel="alternate" type="text/html"/>
    <link href="http://www.arbitraryuser.com/blog/2011/05/26/pystack-and-djangoverflow/#comments" rel="replies" type="text/html"/>
    <link href="http://www.arbitraryuser.com/blog/2011/05/26/pystack-and-djangoverflow/feed/atom/" rel="replies" type="application/atom+xml"/>
    <title xml:lang="en">Jonathan Endersby (nlt): Pystack and Djangoverflow</title>
    <summary xml:lang="en">A while back I was chatting with Brad and said “Someone should create a Twitter feed of popular Stack Overflow questions“.  I think he said “Yes, someone should“. Later that night I created @pystack and @djangoverflow. Sometimes you just have to code.</summary>
    <content type="xhtml" xml:lang="en"><div xmlns="http://www.w3.org/1999/xhtml"><p>A while back I was chatting with Brad and said “<em>Someone should create a Twitter feed of popular Stack Overflow questions</em>“.  I think he said “<em>Yes, <strong>someone</strong> should</em>“.</p>
<p>Later that night I created <a href="http://twitter.com/#!/pystack">@pystack</a> and <a href="http://twitter.com/#!/djangoverflow" title="Djangoverflow">@djangoverflow</a>.</p>
<p>Sometimes you just have to code.</p></div>
    </content>
    <updated>2011-05-26T06:31:03Z</updated>
    <published>2011-05-26T06:30:30Z</published>
    <category scheme="http://www.arbitraryuser.com/blog" term="Tech"/>
    <category scheme="http://www.arbitraryuser.com/blog" term="hacking"/>
    <author>
      <name>arbitraryuser</name>
      <uri>http://www.arbitraryuser.com/blog/wp-atom.php</uri>
    </author>
    <source>
      <id>http://www.arbitraryuser.com/blog/feed/atom/</id>
      <link href="http://www.arbitraryuser.com/blog" rel="alternate" type="text/html"/>
      <link href="http://www.arbitraryuser.com/blog/category/tech/feed/atom/" rel="self" type="application/atom+xml"/>
      <subtitle xml:lang="en">Jonathan Endersby, Recovering Technologist</subtitle>
      <title xml:lang="en">arbitrary user » Tech</title>
      <updated>2012-01-08T02:48:58Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://www.arbitraryuser.com/blog/?p=802</id>
    <link href="http://www.arbitraryuser.com/blog/2011/02/02/content-and-delivery/" rel="alternate" type="text/html"/>
    <link href="http://www.arbitraryuser.com/blog/2011/02/02/content-and-delivery/#comments" rel="replies" type="text/html"/>
    <link href="http://www.arbitraryuser.com/blog/2011/02/02/content-and-delivery/feed/atom/" rel="replies" type="application/atom+xml"/>
    <title xml:lang="en">Jonathan Endersby (nlt): Content and delivery.</title>
    <summary xml:lang="en">Recently a friend who’s in the magazine industry was complaining about how their company (who is a very large media company) continually cuts the budget of the magazine people (ie. Those who actually produce content) while at the same time spending gob-loads of money on their “Online” and “Mobile” people. I’m hearing stories of games [...]</summary>
    <content type="xhtml" xml:lang="en"><div xmlns="http://www.w3.org/1999/xhtml"><p>Recently a friend who’s in the magazine industry was complaining about how their company (who is a very large media company) continually cuts the budget of the magazine people (ie. Those who actually produce content) while at the same time spending gob-loads of money on their “Online” and “Mobile” people. I’m hearing stories of games rooms and guys walking down the passage with an iPad in one hand and a Macbook Pro in the other, while just down the passage there are magazine teams running on 10 year old macs.</p>
<p>The print-media industry is no doubt floundering. Seeing demand for its product dropping by significant numbers every year (We’re talking overall sales figures around 20% of what they were 10 years ago) while ad-sales are becoming more and more brutal due to the “global economy” and, probably more scarily, losing ad sales to online channels. Fewer people want to buy their stuff and they’re making less and less off that reduced number.</p>
<p>So you can imagine the kind of pressure the industry is in and how incredibly easy it would be to come to the very foolish conclusion that the correct remedy is to spend those gob-loads on “Online” or “Mobile” to the detriment of the content producers.</p>
<p>My father was a printer, technically an offset lithography “machine minder”. Practically that meant that he was badly paid, worked long shifts, went to work in blue overalls and came home covered in ink. The work was tough. You needed to have an expert eye, understand some of the chemistry, have delicate hands and be able to perform running repairs on the printers. We’re talking about giant room sized machines and having the ability to hear that the third roller bearing on the transfer shaft dingle dangle needed oil in the next 30 minutes or the machine would fail. (I’m paraphrasing)</p>
<p>The reason my dad was badly paid even though his job required so much skill was because lithography was an old technology. The mystique had been removed from the process about 100 years earlier and the machines looked after themselves just enough to be able to have an unskilled worker become fully skilled in 3 years of on the job training.  </p>
<p>The technology was mature and there was solid competition in the market. That drove the printing prices down, which pushed the salaries down, which meant that eventually it was only slightly more attractive as a career than something like panel beating. </p>
<p>In the last 30 years printing has evolved to the point where the machines are easier to use, faster and even more reliable. Instead of hiring one or two guys per machine you can now have a few roaming engineers for an entire factory of printers. Putting ink on paper has never been cheaper.</p>
<p>My father moved to the publishing world about 30 years ago and has been wearing chinos to work ever since… Though I’m pretty sure he would still prefer to deal with machines than colleagues.</p>
<p>The cost and skill involved in delivering content will always drop. Technology takes care of that. However we will never have Artificial Intelligence that can honestly go to Darling and write about an Evita Bezuidenhout show, take photographs of the flowers in the Karoo, write about swimming with dolphins on a cool Sunday morning or editorialise about crappy Egyptian presidents.</p>
<p>100 years ago quality content made money… That is still the situation and it is unlikely to ever change. How that content is delivered should never become more important than the content itself.</p>
<p>You might be able to wow people with your swanky iPad application with annoying faux-turning-pages animations, but eventually the technology will mature and everyone will have swanky iPad apps. The cost involved in building those apps will drop and the big boys will be consistently competing against small, leaner, startup content producers. And as if to amplify the situation the technology is changing much much faster. It took hundreds of years to get the cost of printing on paper so low that we could afford to print a daily newspaper and sell it to the masses. The cost of producing an Ipad app halves every six month and, as the technology evolves, it becomes trivially easy for anyone with some good ideas and camera to create something that other people want… and god forbid, would actually pay money for.</p>
<p>So, if you happen to be the CEO of some big ass media giant, spare a thought for Gutenberg and then Google “<i>ios and android development frameworks</i>” before deciding not to buy your content producers some decent computers. You could even do it on your iPad.</p></div>
    </content>
    <updated>2011-02-02T08:51:45Z</updated>
    <published>2011-02-02T07:11:50Z</published>
    <category scheme="http://www.arbitraryuser.com/blog" term="Blogroll"/>
    <category scheme="http://www.arbitraryuser.com/blog" term="Life"/>
    <category scheme="http://www.arbitraryuser.com/blog" term="Observation"/>
    <category scheme="http://www.arbitraryuser.com/blog" term="Tech"/>
    <author>
      <name>arbitraryuser</name>
      <uri>http://www.arbitraryuser.com/blog/wp-atom.php</uri>
    </author>
    <source>
      <id>http://www.arbitraryuser.com/blog/feed/atom/</id>
      <link href="http://www.arbitraryuser.com/blog" rel="alternate" type="text/html"/>
      <link href="http://www.arbitraryuser.com/blog/category/tech/feed/atom/" rel="self" type="application/atom+xml"/>
      <subtitle xml:lang="en">Jonathan Endersby, Recovering Technologist</subtitle>
      <title xml:lang="en">arbitrary user » Tech</title>
      <updated>2012-01-08T02:48:58Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.bloggroll.com/view/28</id>
    <link href="http://www.bloggroll.com/view/add-subtitles-to-a-dvd" rel="alternate" type="text/html"/>
    <title>Jonathan Groll (eyesonly): Add subtitles to a DVD</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p><img alt="" class="l" src="http://www.bloggroll.com/stat/je_reve.png"/><br/>
Many people want to add subtitles to a <span class="caps">DVD</span> in their own language, and often <span class="caps">DVD</span> disks don’t come with subtitles in a language you want. For instance, if you’re staying in a foreign country and want English subtitles added to your rental movie. Or in my case, the library at the local Alliance Française has a lot of interesting movies completely in French, without English subtitles, and my french isn’t yet good enough to fully understand everything that is being said.</p>
<p>What is interesting is that there are sites on the internet that offer downloadable subtitle files for many movies. Simply type the name of your movie, plus the word “subtitle” into google and provided the movie is popular or well known enough you should be able to find a site offering the subtitle file for download. Mostly it seems that these subtitles were extracted from a <span class="caps">DVD</span> owned by someone else with the right languages. In other cases, it is purely fans of the movie who loved it so much and wanted to translate the words of the movie into a language that they know so that others can also enjoy the movie. I’m not so sure about the legality of the subtitles obtained in the first case, but certainly an argument may be made that since you own or have legally rented a copy of the movie it does seem to fall within “fair usage” to watch this movie with subtitles in a language you require.</p>
<p>So, you may be lucky. You may find the (fan-written) subtitle file that exactly matched your movie. By this I mean that the person who created your file had exactly the same version of the <span class="caps">DVD</span>, so that the lead in at the beginning of the movie is exactly the same length and in this case the subtitles remain perfectly in synch with the video.</p>
<p>However, don’t expect to watch the movie in your living room just yet. Most stand-alone <span class="caps">DVD</span> players that I’ve used do not have a facility to specify an external subtitles file, but almost all of the software based players on your computer do have this facility. So provided you got lucky, and got the correct subtitles file that matched your <span class="caps">DVD</span>, and are also content to watch movies in front of your computer that will be sufficient and you don’t need to read further.</p>
<p>Mostly though, the subtitles file doesn’t have the right timings for your <span class="caps">DVD</span>, or you might really really want to watch it on your TV in the lounge rather than with bowls of popcorn balanced on your lap in front of the computer. The guide that follows is for people who are running Linux, are comfortable with the command line, and who wish to hardcode <sup class="footnote"><a href="http://feeds2.feedburner.com/BloggrollTech#fn1">1</a></sup> subtitles into a <span class="caps">XVID</span> file for watching on a (living-room) player that can play <span class="caps">DIVX</span> movies. If this is not exactly what you want there still may be something for you in this blog post. I’ll outline my six-step method:</p>
<ol>
	<li>Rip (extract) contents of the <span class="caps">DVD</span> disk.</li>
	<li>Attempt to play <span class="caps">DVD</span> file with subtitle files on desktop.</li>
	<li>Create a <span class="caps">XVID</span> file without subtitles.</li>
	<li>Transform the subtitle file so that subtitles are synchronized with the video.</li>
	<li>Create a <span class="caps">XVID</span> file with subtitles hardcoded in.</li>
	<li>Break up this file into smaller segments for players that cannot handle large files.</li>
</ol>
<p>I myself don’t follow the above recipe every time – depending on the circumstances some of these steps may not be needed. And you may very well want a different outcome – it may be enough for you just to align the subtitles with the video, or you may want more such as recreating a <span class="caps">DVD</span> with subtitles. You may even despise <span class="caps">XVID</span> files with harcoded subtitles in them!</p><p>If you are running Debian/Ubuntu you’ll need a lot of packages to be installed – at least: mplayer mencoder ogmtools libdvdcss dvdbackup gaupol ffmpeg gstreamer0.10-x plus dependancies and probably gnome-codec-install.</p>
<p>The principal tools involved are the wonderful <a href="http://www.mplayerhq.hu/">mplayer/mencoder command line tools</a> :- they give fine control, are scriptable, and are compatible with each other in terms of command line flags.</p>
<p>For <strong>step 1</strong>, extract the <span class="caps">DVD</span> to your hard disk:</p>
<pre>dvdbackup -i /dev/dvd -M -o name_of_movie
</pre>
<p>This will create a folder called name_of_movie in the current directory. If your <span class="caps">DVD</span>-device is not /dev/dvd put the correct device name there.</p>
<p>In <strong>step 2</strong>, you’ll need to work out which of the titles on the <span class="caps">DVD</span> disk contains the movie, start by typing:</p>
<pre>mplayer -v -dvd-device name_of_movie/VIDEO_TS/ dvd://1
</pre>
<p>Keep on increasing the number at the end – from 1 to 2 to 3 etc until you find the actual movie and not just the adverts and bonus features. In the examples that follow I refer to title 1, you will need to replace that with your correct title number.</p>
<p>The next thing to do is test the downloaded subtitle file:</p>
<pre>mplayer -v -dvd-device name_of_movie/VIDEO_TS/ dvd://1 -sub downloaded_sub.srt
</pre>
<p>The subtitle file doesn’t have to end in .srt – mplayer supports multiple formats. Make a careful note if the subtitles are in synch, namely do the spoken words match the subtitles. Press the right arrow key on your keyboard to advance the video. Ensure that subtitles remain in synch until the end of the movie.</p>
<p>For <strong>step 3</strong>, create an initial <span class="caps">XVID</span> file without subtitles. Yes, I know this can be lossy. And it really is not a required step if your subtitles are already in synch, if they are you can move straight on to step 5. However, if you do need to adjust the subtitle file to match the video, then in order to do so it may be necessary to work with the entire movie as a single file, instead of multiple individual <span class="caps">VOB</span> files.</p>
<p>So, here is a simple two-pass recipe for encoding a movie to <span class="caps">XVID</span> without subtitles:</p>
<pre>mencoder -idx -dvd-device name_of_movie/VIDEO_TS/ dvd://1 -ovc xvid -oac pcm -xvidencopts pass=1:bitrate=1200:aspect=16/9 -o /dev/null</pre>
<pre>mencoder -idx -dvd-device name_of_movie/VIDEO_TS/ dvd://1 -ovc xvid -oac pcm -xvidencopts pass=2:bitrate=1200:aspect=16/9 -o movie.avi</pre>
<p>Note the bitrate in the above call (1200) can be adjusted as required (higher numbers mean higher quality but also larger files). You will obviously need to make sure this call has the correct path for your VIDEO_TS folder, and also for the title track from the <span class="caps">DVD</span> (replace the dvd://1 with the appropriate title). Experienced mencoder users will possibly also want to add extra mencoder flags. Transcoding to <span class="caps">XVID</span> can take some time, depending on the speed of your computer.</p>
<p>Next up is <strong>step 4</strong> – adjusting the subtitle file if that is needed. To do this, I prefer using the <a href="http://home.gna.org/gaupol/">gaupol</a> application under Linux. So, open gaupol and within gaupol select your subtitle file, and at the bottom of the gaupol screen select your .avi video file that you produced in the previous step. The trick to adjusting is to note exactly the time at which the first useful spoken words occur for which you have a matching subtitle, and the same for the last spoken words (unfortunately, knowing the last spoken words may spoil the end of the movie for you!). So, if you click the green play icon in gaupol it will play the video file with a clock at the top of the screen which you can use for noting when the spoken words occur. Based on the above, in an example I worked out that someone said subtitle #2 (you should be able to recognise the words based on context, even if you don’t speak the language) at 00:02:54.000 and that the one of the last spoken texts occurred for subtitle #613 at 01:29:17.000. The important thing is to get the timing of the first subtitle as accurate as possible, for the last subtitle it doesn’t matter if you’re a second or two out. To do the actual synchronization choose the “Transform Positions” tool from the subtitle menu (see screenshot below), specify the times you observed and the positions of the other subtitles will be adjusted proportionally.</p>
<p><img alt="" src="http://www.bloggroll.com/stat/gaupol_transform.png"/></p>
<p>To test the subtitle file is now correct, play the middle of the movie and see if the subtitles are fully in sync there as well. Repeat, if necessary with other time points, and if necessary adjusting only part of the file (“Transform selected subtitles”) rather than the entire file (“Transform current project”).</p>
<p>Now, for <strong>step 5</strong> we are going to hardcode the subtitles into a new <span class="caps">XVID</span> file which we produce. We can choose to either start with the source coming from the original <span class="caps">DVD</span>-rip folder produced by step one, or we can choose to work with the <span class="caps">XVID</span> file produced in step three as the source. Obviously, working with the <span class="caps">XVID</span> file will be lossy, as one can expect some picture degradation using the <span class="caps">XVID</span> file as a source file. However, if this file were to be used, you would know for sure that your subtitles will sync up with the file. Think back to the <span class="caps">DVD</span> extract step with dvdbackup – did it report any errors at all during the extract from the <span class="caps">DVD</span>? For instance, if there was a scratch on the <span class="caps">DVD</span> disk dvdbackup would still be able to work around it by block filling in the file produced, but I have observed such a “repaired error”  might cause problems with the timing and sync of subtitles in the step to follow if the original <span class="caps">DVD</span> extract is used as the source. Generally, because of this I prefer to work with the <span class="caps">XVID</span> file as the source, even though it may be lossy.</p>
<p>Before starting, remove any file in the current folder called “divx2pass.log”, this file will have been produced if you did a two-pass encoding as above and will interfere with the two-pass encode we are about to do.</p>
<p>To hardcode in the subtitles, using the divx file produced in step three as the source, here are the commands that will perform the two-pass encode for you:</p>
<pre>mencoder -idx movie.avi -ovc xvid -sub subtitles_adjusted.srt -subpos 96 -oac pcm -xvidencopts pass=1:bitrate=1200:aspect=16/9 -o /dev/null</pre>
<pre>mencoder -idx movie.avi -ovc xvid -sub subtitles_adjusted.srt -subpos 96 -oac pcm -xvidencopts pass=2:bitrate=1200:aspect=16/9 -o hardcoded.avi
</pre>
<p>Now, if you wanted to work with the original <span class="caps">DVD</span>-rip folder as the source, rather than perform the lossy re-encoding of the <span class="caps">DIVX</span> file, then replace “movie.avi” in the above with “-dvd-device name_of_movie/VIDEO_TS/ dvd://1” adjusted where appropriate.</p>
<p>Also, note in the above that “subtitles_adjusted.srt” refers to your subtitle file that you produced with gaupol, and also note that I prefer specifying that my subtitles appear at position 96 (you can leave this out if it doesn’t bother you).</p>
<p>And also note that there is <a href="http://wiki.showmedo.com/index.php/Video_editing_Ubuntu#Merge_video_with_subtitles">another way to hardcode in subtitles</a> but this way can result in enormous files.</p>
<p>Finally, in <strong>step 6</strong> I break up the resultant <span class="caps">DIVX</span> file (which would be called “harcoded.avi” if you followed step 5 exactly). Why do I do this? For two possible reasons:</p>
<ol>
	<li>If you are playing off a <span class="caps">VFAT</span> formatted memory stick files cannot be larger than 2GB in size.</li>
	<li>My player can play <span class="caps">DIVX</span> files, but once the file exceeds 1GB in size the playback simply stops.</li>
</ol>
<p>Now, there are two possible workarounds. You could have simply lowered the bitrate so that the final <span class="caps">XVID</span> file was less than 1GB in size. Or you could chop up a big file as I do below. Of course, if your player can play big <span class="caps">DIVX</span> files and you’re not working with a <span class="caps">VFAT</span> memory stick then there is no need to perform this step.</p>
<p>In this example I am working with a 3.1G file. Firstly, to determine how long the video is, I issue:</p>
<pre>ffmpeg -i hardcoded.avi
</pre>
<p>In my case, it tells me that my video has</p>
<pre>Duration: 02:05:16.88.
</pre>
<p>So, I’d like to split that into four parts, so that each part will come to less than 1GB in size (roughly) – so after some quick mental arithmetic I think I’d like each piece to be 32 minutes long.</p>
<p>Based on the above example, these are the four mencoder commands to splice the video into four 32 minute chunks (the last chunk will be less than 32 minutes):</p>
<pre>mencoder -ovc copy -oac copy -endpos 0:32:00 -o hardcoded1.avi hardcoded.avi
mencoder -ovc copy -oac copy -ss 0:32:00 -endpos 0:32:00 -o hardcoded2.avi hardcoded.avi
mencoder -ovc copy -oac copy -ss 1:04:00 -endpos 0:32:00 -o hardcoded3.avi hardcoded.avi
mencoder -ovc copy -oac copy -ss 1:36:00  -o hardcoded4.avi hardcoded.avi
</pre>
<p>Granted, this is an extreme example (normally you don’t let the <span class="caps">XVID</span> file get so big!) but it does show how to splice up a video using the -ss and -endpos flags. Unlike the transcoding to <span class="caps">XVID</span> steps, this step executes very quickly as all it does is copy the video and audio streams.</p>
<p>And voilà, copy the split files to your memory stick, and take it to the lounge to enjoy with your popcorn, knowing that you’ve managed to render a previously unwatchable video into something you’ll enjoy, and somehow all this extra work makes the video more enjoyable too.</p>
<p class="footnote" id="fn1"><sup>1</sup> Hardcoding means the actual video file is altered so that the subtitle is in the video stream. It’s a little nasty, and I agree softcoding (keeping the subtitles separate from the video stream) is better. The only problem is that my player refuses to accept files where the subtitles have been muxed in. If you’re curious about softcoding, I can recommend <a href="http://www.alexander-noe.com/video/amg/"><span class="caps">AVI</span>-Mux <span class="caps">GUI</span></a> which does run under wine.</p></div>
    </summary>
    <updated>2010-12-05T15:29:46Z</updated>
    <source>
      <id>http://www.bloggroll.com/</id>
      <author>
        <name>Jonathan Groll (eyesonly)</name>
      </author>
      <link href="http://www.bloggroll.com/" rel="alternate" type="text/html"/>
      <link href="http://feeds.feedburner.com/BloggrollTech" rel="self" type="application/rss+xml"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>The webshite of Jonathan Groll</subtitle>
      <title>The Bloggroll</title>
      <updated>2011-09-21T14:07:18Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.bloggroll.com/view/27</id>
    <link href="http://www.bloggroll.com/view/tunnel-through-isa-proxy-with-cntlm" rel="alternate" type="text/html"/>
    <title>Jonathan Groll (eyesonly): Tunnel through ISA proxy</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p><img alt="Image of tunnel attributed to Richard Freeman" class="r" src="http://bloggroll.com/stat/tunnel.png" title="Image of tunnel attributed to Richard Freeman"/> Geeks often need to access their *nix computers from work. Doesn’t everyone want to do that? True geeks control their computers strictly using the command-line, of course, and the tool that is used to control a remote command-line session is <a href="http://openssh.org/">ssh</a>.</p>
<p>What one usually does is use a tool like <a href="http://www.agroman.net/corkscrew/">corkscrew</a> to send ssh traffic through an <span class="caps">HTTP</span> proxy.</p>
<p>At one place of employment, a known trick of using corkscrew to tunnel out using the work proxy failed, with this message:</p>
<p>Proxy Authentication Required ( The <span class="caps">ISA</span> Server requires authorization to fulfill the request. Access to the Web Proxy service is denied.  )</p>
<p>I tried all combinations of <i><span class="caps">DOMAIN</span></i>\<i><span class="caps">USERNAME</span></i>:<i><span class="caps">PASSWORD</span></i> in my corkscrew auth file but nothing worked.</p>
<p>If you see this message have no fear! What you need is a utility that can negotiate <a href="http://en.wikipedia.org/wiki/NTLM"><span class="caps">NTLM</span></a> authorization with the proxy.</p><p>There are several open source tools that can do <span class="caps">NTLM</span>, of these I chose <a href="http://iitmlug.a.wiki-site.com/index.php/Cntlm">cntlm</a>. Often <a href="http://ntlmaps.sourceforge.net/">ntlmaps</a> is recommended as a utility to negotiate the authorization. The cntlm man page indicates that cntlm is far more efficient than ntlmaps, both in terms of memory and <span class="caps">CPU</span> usage.</p>
<p>One oddity about cntlm relative to other software that you may have worked with is that configuration is a two-step procedure: firstly you configure the software with a default config file, like the following (the settings that need to be configured for now in the first-step are in the first paragraph: username, domain, password, proxy, proxy-port):</p>
<pre>#
# Cntlm Authentication Proxy Configuration
#
# NOTE: all values are parsed literally, do NOT escape spaces,
# do not quote. Use 0600 perms if you use plaintext password.
#
<br/>
Username	__username__
Domain		__domain__
Password	__password__		# Use hashes instead (-H)
#Workstation	netbios_hostname	# Should be auto-guessed
<br/>
Proxy		__PROXY__:__PROXY_PORT__
<br/>
#
# This is the port number where Cntlm will listen
#
Listen		3128
<br/>
#
# If you wish to use the SOCKS5 proxy feature as well, uncomment
# the following option, SOCKS5. It can be used several times
# to have SOCKS5 on more than one port or on different network
# interfaces (specify explicit source address for that).
#
# WARNING: The service accepts all requests, unless you use
# SOCKS5User and make authentication mandatory. SOCKS5User
# can be used repeatedly for a whole bunch of individual accounts.
#
#SOCKS5Proxy	8010
#SOCKS5User	dave:password
<br/>
#
# Use -M first to detect the best NTLM settings for your proxy.
# Default is to use the only secure hash, NTLMv2, but it is not
# as available as the older stuff.
#
# This example is the most universal setup known to man, but it
# uses the weakest hash ever. I won't have it's usage on my
# conscience. :) Really, try -M first.
#
#
<br/>Auth		LM
#Flags		0x06820000
#
# Enable to allow access from other computers
#
#Gateway	yes
<br/>
#
# Useful in Gateway mode to allow/restrict certain IPs
#
#Allow		127.0.0.1
#Deny		0/0
<br/>
#
# GFI WebMonitor-handling plugin parameters, disabled by default
#
#ISAScannerSize	1024
#ISAScannerAgent	Wget/
#ISAScannerAgent	APT-HTTP/
#ISAScannerAgent	Yum/
<br/>
#
# Headers which should be replaced if present in the request
#
#Header		User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)
<br/>
#
# Tunnels mapping local port to a machine behind the proxy
# 
Tunnel		11443:__OUTSIDE_HOST.COM__:443
</pre><p>Then, run <br/>
<code>
cntlm -v -M http://google.com      (or any other external site)
</code></p>
<p>Cntlm will use this to assess the type of auth your proxy can handle. In my case I got back something like the following output:</p>
<pre>Config profile  1/11... OK (HTTP code: 301)
----------------------------[ Profile  0 ]------
Auth            NTLMv2
PassNTLMv2      AE1234567890123234567890123456C4
------------------------------------------------
</pre><p>For the second configuration step, these two lines need to be pasted back into your configuration file replacing the line that said “Auth LM” (and you must do this for your own situation, you can’t reuse my lines).</p>
<p>Then, startup the cntlm daemon:</p>
<pre><code>
cntlm
</code></pre>
<p>Let’s test if it works. Note that in the above config file I have a tunnel defined (the last line of the config file). Now, in order to ssh to port 443 of host __outside_host.com__ which is outside the proxy, one can do so using:</p>
<pre><code>
ssh -p 11443 localhost
</code></pre>
<p>The above assumes that outside_host.com has an sshd listening on port 443.</p>
<p>Cntlm also works fine under windows. If you don’t have “administrator” authorisation under windows, you can still run the cntlm executable, but need to specify which cntlm.ini file to use, in other words, something like:</p>
<pre><code>
cntlm.exe -c cntlm.ini
</code></pre>

<p>Of course, if you’re running on windows you won’t have an ssh command line client, but putty can be used nicely for this purpose. Bear in mind that putty needs to be configured (for the default cntlm configuration above) to use an <span class="caps">HTTP</span> proxy on host “localhost” listening on port 3128.</p></div>
    </summary>
    <updated>2010-11-03T14:30:33Z</updated>
    <source>
      <id>http://www.bloggroll.com/</id>
      <author>
        <name>Jonathan Groll (eyesonly)</name>
      </author>
      <link href="http://www.bloggroll.com/" rel="alternate" type="text/html"/>
      <link href="http://feeds.feedburner.com/BloggrollTech" rel="self" type="application/rss+xml"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>The webshite of Jonathan Groll</subtitle>
      <title>The Bloggroll</title>
      <updated>2011-09-21T14:07:18Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.bloggroll.com/view/26</id>
    <link href="http://www.bloggroll.com/view/split-encrypt-google-docs" rel="alternate" type="text/html"/>
    <title>Jonathan Groll (eyesonly): Split and encrypt files for google docs</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p><img alt="Creative commons image of meat grinder from http://www.flickr.com/photos/amayu/3629064681/" class="l" src="http://www.bloggroll.com/stat/meat_grinder2.jpg" title="Creative commons image of meat grinder from http://www.flickr.com/photos/amayu/3629064681/"/>Since January 2010, <a href="http://googlecode.blogspot.com/2010/01/documents-list-api-upload-any-file-type.html">Google docs has allowed you to store any type of file</a>, even arbitrary binary files. However, there are a couple of gotchas: one cannot upload files greater than 1GB in size, and you may want to encrypt your files so that not just anyone can read them (for instance server backup files).</p>
<p>The two bash scripts below provide a solution for the above. I call them the ‘mince’ scripts ‘cos they slice and dice your files and hopefully you’ll get hamburgers back at the end of the day. These scripts depend on you having a fairly new version of bash on your unix-like system, the ‘split’ utility and gnupg (<span class="caps">GPG</span>) which is used for the encryption/decryption. If you’re unsure of <span class="caps">GPG</span>, a good getting started guide can be found <a href="http://www.madboa.com/geek/gpg-quickstart/">here</a>.</p>
<p>It must be said that google docs is (in my opinion) currently not the best way to store your files in the cloud. In fact, I wrote another blog post describing the  “google storage” options in <a href="http://www.bloggroll.com/view/25">greater depth</a>.</p><p>The encrypt&amp;split script is mince.sh and it takes two parameters, the first one a directory or archive, the second the email address for an already imported public key:<br/>

</p><pre><span class="comment-delimiter-face-0000">#</span><span class="comment-face-0001">!/bin/</span><span class="keyword-face-0002">bash</span><span class="comment-face-0001">
</span><span class="comment-delimiter-face-0000"># </span><span class="comment-face-0001">gpg encrypt archive and split into chunks
</span><span class="comment-delimiter-face-0000"># </span><span class="comment-face-0001">$1 specifies base directory or compressed archive to encrypt.
</span><span class="comment-delimiter-face-0000"># </span><span class="comment-face-0001">$2 is the recipients public key, eg. 'myfriend@his.isp.net'
</span><span class="builtin-face-0003">set</span> -e
<br/>
<span class="variable-name-face-0004">CHUNK_SIZE</span>=1000000000 <span class="comment-delimiter-face-0000">#</span><span class="comment-face-0001">1000000000==1GB (not 1GiB!</span><span class="comment-face-0001">)</span><span class="comment-face-0001">
</span><span class="variable-name-face-0004">SCRATCH_DIR</span>=~/scratch_space
<span class="variable-name-face-0004">TAR_REGEX</span>=<span class="string-face-0005">'\.tar'</span>
<br/>
usage() {
    <span class="builtin-face-0003">echo</span> <span class="string-face-0005">"ERROR: "</span>
    <span class="builtin-face-0003">echo</span> <span class="string-face-0005">" $*"</span>
    <span class="builtin-face-0003">echo</span> <span class="string-face-0005">"USAGE: "</span>
    <span class="builtin-face-0003">echo</span> <span class="string-face-0005">" mince.sh [DIRECTORY|ARCHIVE] PUBLIC_KEY_NAME"</span>
    <span class="builtin-face-0003">echo</span> <span class="string-face-0005">"EXAMPLE: "</span>
    <span class="builtin-face-0003">echo</span> <span class="string-face-0005">" ./mince.sh directory myfriend@her.isp.net"</span>
    <span class="builtin-face-0003">echo</span> <span class="string-face-0005">"FURTHER COMMENTS: "</span>
    <span class="builtin-face-0003">echo</span> <span class="string-face-0005">" if an ARCHIVE is supplied instead of a directory, it must have a name like file.tar or file.tar.gz or file.tar.bz2 "</span>
}
<br/>
<span class="comment-delimiter-face-0000">#</span><span class="comment-face-0001">check parameters entered are valid
</span>[ $# -ne 2 ] &amp;&amp; usage <span class="string-face-0005">"Two parameters are required."</span> &amp;&amp; <span class="keyword-face-0002">exit</span> 1
<span class="keyword-face-0002">if</span> [ ! -d <span class="string-face-0005">"$1"</span> ] &amp;&amp; [[ ! $<span class="variable-name-face-0004">1</span> =~ $<span class="variable-name-face-0004">TAR_REGEX</span> ]]; <span class="keyword-face-0002">then</span>
    usage <span class="string-face-0005">"$1 is not a directory or tar/tar.gz/tar.bz2 archive."</span>
    <span class="keyword-face-0002">exit</span> 1
<span class="keyword-face-0002">fi</span>
<br/>
<span class="comment-delimiter-face-0000">#</span><span class="comment-face-0001">if 1st parameter is a directory, then tar it up in the scratch space
</span><span class="keyword-face-0002">if</span> [ -d <span class="string-face-0005">"$1"</span> ]; <span class="keyword-face-0002">then</span>
    <span class="variable-name-face-0004">absolute</span>=<span class="string-face-0005">"`cd $1; pwd` "</span>
    mkdir -p $<span class="variable-name-face-0004">SCRATCH_DIR</span>
    <span class="builtin-face-0003">cd</span> $<span class="variable-name-face-0004">SCRATCH_DIR</span>
    <span class="variable-name-face-0004">nameonly</span>=${<span class="variable-name-face-0004">absolute</span>##*/}
    <span class="variable-name-face-0004">nameonly</span>=${<span class="variable-name-face-0004">nameonly</span>/ /} <span class="comment-delimiter-face-0000">#</span><span class="comment-face-0001">remove trailing spaces
</span>    tar -cf $<span class="variable-name-face-0004">nameonly</span>.tar $<span class="variable-name-face-0004">absolute</span>
    <span class="variable-name-face-0004">arch</span>=<span class="string-face-0005">"${SCRATCH_DIR}/${nameonly}.tar"</span>
    <span class="variable-name-face-0004">created</span>=true
    <span class="builtin-face-0003">echo</span> <span class="string-face-0005">"Created temporary archive $arch"</span>
<span class="keyword-face-0002">else</span>
    <span class="variable-name-face-0004">arch</span>=<span class="string-face-0005">"`</span><span class="string-face-0005">readlink -f $1`"</span>
    <span class="variable-name-face-0004">created</span>=false
    <span class="builtin-face-0003">echo</span> <span class="string-face-0005">"Working with existing archive $arch"</span>
<span class="keyword-face-0002">fi</span>
<br/>
<span class="comment-delimiter-face-0000">#</span><span class="comment-face-0001">call for GPG encryption and compression of the archive
</span><span class="variable-name-face-0004">target</span>=<span class="string-face-0005">"${arch</span><span class="string-face-0005">##</span><span class="string-face-0005">*/}.gpg"</span>
<span class="variable-name-face-0004">name</span>=${<span class="variable-name-face-0004">target</span>%<span class="string-face-0005">\.</span>gpg}
mkdir -p $<span class="variable-name-face-0004">SCRATCH_DIR</span>
<span class="builtin-face-0003">cd</span> $<span class="variable-name-face-0004">SCRATCH_DIR</span>
<span class="builtin-face-0003">echo</span> <span class="string-face-0005">"Commencing GPG encryption, please be patient"</span>
gpg --bzip2-compress-level 6 --compress-algo bzip2 --output $<span class="variable-name-face-0004">target</span> --encrypt --recipient $<span class="variable-name-face-0004">2</span> $<span class="variable-name-face-0004">arch</span>
<br/>
<span class="comment-delimiter-face-0000">#</span><span class="comment-face-0001">split .gpg file into chunks of size CHUNK_SIZE
</span><span class="variable-name-face-0004">outdir</span>=<span class="string-face-0005">"${SCRATCH_DIR}/output"</span>
mkdir -p <span class="string-face-0005">"$outdir"</span>
mkdir -p <span class="string-face-0005">"$outdir/$name"</span>
<span class="builtin-face-0003">cd</span> $<span class="variable-name-face-0004">outdir</span>/$<span class="variable-name-face-0004">name</span> &amp;&amp; rm -f $<span class="variable-name-face-0004">name</span>*
<span class="builtin-face-0003">echo</span> <span class="string-face-0005">"Splitting files"</span>
split -b $<span class="variable-name-face-0004">CHUNK_SIZE</span> <span class="string-face-0005">"${SCRATCH_DIR}/$target"</span>
<span class="keyword-face-0002">for</span> x<span class="keyword-face-0002"> in</span> *
<span class="keyword-face-0002">do</span>
  mv $<span class="variable-name-face-0004">x</span> <span class="string-face-0005">"../${name}__$x"</span>
<span class="keyword-face-0002">done</span>
<br/>
<span class="comment-delimiter-face-0000">#</span><span class="comment-face-0001">clean up - remove .gpg and temporary archive and temporary directory
</span><span class="builtin-face-0003">cd</span> $<span class="variable-name-face-0004">SCRATCH_DIR</span>
rmdir <span class="string-face-0005">"$outdir/$name"</span>
rm $<span class="variable-name-face-0004">target</span>
<span class="keyword-face-0002">if</span> [ $<span class="variable-name-face-0004">created</span> == true ]; <span class="keyword-face-0002">then</span>
    <span class="builtin-face-0003">echo</span> <span class="string-face-0005">"Removing temporary archive $arch"</span>
    rm $<span class="variable-name-face-0004">arch</span>
<span class="keyword-face-0002">fi</span>
<br/><span class="builtin-face-0003">echo</span> <span class="string-face-0005">"All file splits produced placed in $outdir"</span></pre><p/>
<p>Download link for <a href="http://www.bloggroll.com/stat/mince.sh">mince.sh</a></p>
<p>The bash script to reconstitute the file is called unmince.sh and takes one parameter – the name of the first file downloaded from google docs:<br/>
</p><pre><span class="comment-delimiter-face-0000">#</span><span class="comment-face-0001">!/bin/</span><span class="keyword-face-0002">bash</span><span class="comment-face-0001">
</span><span class="comment-delimiter-face-0000"># </span><span class="comment-face-0001">reassemble an archive from chunks of a file that have been gpg-encrypted
</span><span class="comment-delimiter-face-0000"># </span><span class="comment-face-0001">$1 specifies the first file produced from the mincing process, eg, file__xaa
</span><span class="builtin-face-0003">set</span> -e
<br/>
<span class="variable-name-face-0004">SCRATCH_DIR</span>=~/scratch_space
<span class="variable-name-face-0004">REGEX</span>=<span class="string-face-0005">'__xaa'</span>
<br/>
usage() {
    <span class="builtin-face-0003">echo</span> <span class="string-face-0005">"ERROR: "</span>
    <span class="builtin-face-0003">echo</span> <span class="string-face-0005">" $*"</span>
    <span class="builtin-face-0003">echo</span> <span class="string-face-0005">"USAGE: "</span>
    <span class="builtin-face-0003">echo</span> <span class="string-face-0005">" unmince.sh file$REGEX"</span>
    <span class="builtin-face-0003">echo</span> <span class="string-face-0005">"WHERE: "</span>
    <span class="builtin-face-0003">echo</span> <span class="string-face-0005">" file$REGEX is the first file produced by the mince script"</span>
}
<br/>
<span class="comment-delimiter-face-0000">#</span><span class="comment-face-0001">check parameters
</span>[ $# -ne 1 ] &amp;&amp; usage <span class="string-face-0005">"Only one parameter is required"</span> &amp;&amp; <span class="keyword-face-0002">exit</span> 1
<span class="keyword-face-0002">if</span> [ -d <span class="string-face-0005">"$1"</span> ] || [[ ! $<span class="variable-name-face-0004">1</span> =~ <span class="string-face-0005">'_xaa'</span> ]]; <span class="keyword-face-0002">then</span>
    usage <span class="string-face-0005">"$1 cannot be a directory and must end in _xaa."</span>
    <span class="keyword-face-0002">exit</span> 1
<span class="keyword-face-0002">fi</span>
<br/>
<span class="comment-delimiter-face-0000">#</span><span class="comment-face-0001">combine all chunks of the file
</span><span class="variable-name-face-0004">sourcepath</span>=<span class="string-face-0005">"`readlink -f $1`"</span>
<span class="variable-name-face-0004">pathonly</span>=<span class="string-face-0005">"`</span><span class="string-face-0005">dirname $sourcepath`"</span>
<br/>
<span class="variable-name-face-0004">just</span>=${<span class="variable-name-face-0004">sourcepath</span>##*/}
<span class="variable-name-face-0004">basenam</span>=${<span class="variable-name-face-0004">just</span>%$<span class="variable-name-face-0004">REGEX</span>}
<span class="variable-name-face-0004">indir</span>=<span class="string-face-0005">"${SCRATCH_DIR}/reconstituted"</span>
mkdir -p $<span class="variable-name-face-0004">indir</span>
<span class="builtin-face-0003">cd</span> $<span class="variable-name-face-0004">indir</span>
[ -e $<span class="variable-name-face-0004">indir</span>/combined.gpg ] &amp;&amp; rm $<span class="variable-name-face-0004">indir</span>/combined.gpg
<span class="keyword-face-0002">for</span> x<span class="keyword-face-0002"> in</span> $<span class="variable-name-face-0004">pathonly</span>/$<span class="variable-name-face-0004">basenam</span>*
<span class="keyword-face-0002">do</span>
    cat $<span class="variable-name-face-0004">x</span> &gt;&gt; combined.gpg
<span class="keyword-face-0002">done</span>
<br/>
<span class="comment-delimiter-face-0000">#</span><span class="comment-face-0001">decrypt the .gpg file
</span><span class="builtin-face-0003">echo</span> <span class="string-face-0005">"Commencing GPG decryption, please be patient"</span>
gpg --output $<span class="variable-name-face-0004">basenam</span> --decrypt combined.gpg
<br/>
<span class="comment-delimiter-face-0000">#</span><span class="comment-face-0001">tidy up - remove the gpg file
</span>rm combined.gpg
<br/>
<span class="builtin-face-0003">echo</span> <span class="string-face-0005">"The reconstituted archive $indir/$basenam was created"</span></pre><p/>
<p>Download link for <a href="http://www.bloggroll.com/stat/unmince.sh">unmince.sh</a></p>
<p>Since I might still tinker and improved these scripts, to get the newest version of these files take a look at my github repo at <a href="http://github.com/eyesonly/kenwood">http://github.com/eyesonly/kenwood</a> (Named after the Kenwood Chef, a famous mincer!)</p></div>
    </summary>
    <updated>2010-10-29T13:25:12Z</updated>
    <source>
      <id>http://www.bloggroll.com/</id>
      <author>
        <name>Jonathan Groll (eyesonly)</name>
      </author>
      <link href="http://www.bloggroll.com/" rel="alternate" type="text/html"/>
      <link href="http://feeds.feedburner.com/BloggrollTech" rel="self" type="application/rss+xml"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>The webshite of Jonathan Groll</subtitle>
      <title>The Bloggroll</title>
      <updated>2011-09-21T14:07:18Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://michael.gorven.za.net/blog/2010/03/10/ibid-finally-released</id>
    <link href="http://michael.gorven.za.net/blog/2010/03/10/ibid-finally-released" rel="alternate" type="text/html"/>
    <title>Michael Gorven (cocooncrash): Ibid finally released!</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>After over a year of development, we have finally released <a href="http://ibid.omnia.za.net/">Ibid</a>. Ibid is a general purpose chat bot written in Python. We've suffered from a bit of feature creep, so despite being a 0.1 release it can talk 7 messaging protocols and has over 100 features provided by plugins. I think we also have an excellent architecture and very developer friendly plugin API. The <a href="https://launchpad.net/ibid/+milestone/0.1.0">0.1.0</a> release can be <a href="https://launchpad.net/ibid/+download">downloaded</a> from <a href="https://launchpad.net/ibid">Launchpad</a> or installed from our <a href="https://launchpad.net/~ibid-core/+archive/ppa">PPA</a>.</p></div>
    </summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>After over a year of development, we have finally released <a href="http://ibid.omnia.za.net/">Ibid</a>. Ibid is a general purpose chat bot written in Python. We've suffered from a bit of feature creep, so despite being a 0.1 release it can talk 7 messaging protocols and has over 100 features provided by plugins. I think we also have an excellent architecture and very developer friendly plugin API. The <a href="https://launchpad.net/ibid/+milestone/0.1.0">0.1.0</a> release can be <a href="https://launchpad.net/ibid/+download">downloaded</a> from <a href="https://launchpad.net/ibid">Launchpad</a> or installed from our <a href="https://launchpad.net/~ibid-core/+archive/ppa">PPA</a>.</p></div>
    </content>
    <updated>2010-03-10T10:08:51Z</updated>
    <published>2010-03-10T10:07:09Z</published>
    <category term="bots"/>
    <category term="code"/>
    <category term="ibid"/>
    <category term="irc"/>
    <category term="jabber"/>
    <category term="python"/>
    <category term="technical"/>
    <author>
      <name>mgorven</name>
    </author>
    <source>
      <id>http://michael.gorven.za.net/taxonomy/term/3/atom/feed</id>
      <link href="http://michael.gorven.za.net/tags/technical" rel="alternate" type="text/html"/>
      <link href="http://michael.gorven.za.net/taxonomy/term/3/atom/feed" rel="self" type="application/atom+xml"/>
      <subtitle>Posts containing technical information.</subtitle>
      <title>technical</title>
      <updated>2008-10-01T15:12:23Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://morgancollett.wordpress.com/?p=190</id>
    <link href="http://morgancollett.wordpress.com/2010/02/05/betavine-cape-town-developer-day-2010/" rel="alternate" type="text/html"/>
    <link href="http://morgancollett.wordpress.com/2010/02/05/betavine-cape-town-developer-day-2010/#comments" rel="replies" type="text/html"/>
    <link href="http://morgancollett.wordpress.com/2010/02/05/betavine-cape-town-developer-day-2010/feed/atom/" rel="replies" type="application/atom+xml"/>
    <title xml:lang="en">Morgan Collett (morgs): Betavine Cape Town Developer Day 2010</title>
    <summary type="xhtml" xml:lang="en"><div xmlns="http://www.w3.org/1999/xhtml">I used to work for OLPC, whose mission is to distribute low cost laptops for education, without necessarily the connectivity with the outside world. Now at Praekelt we’re focusing on using connectivity as the power – harnessing the deployed base of mobile phones in Africa without requiring them to be smartphones or computing devices. As [...]<img alt="" border="0" height="1" src="http://stats.wordpress.com/b.gif?host=morgancollett.wordpress.com&amp;blog=494363&amp;post=190&amp;subd=morgancollett&amp;ref=&amp;feed=1" width="1"/></div>
    </summary>
    <content type="xhtml" xml:lang="en"><div xmlns="http://www.w3.org/1999/xhtml"><p>I used to work for <a href="http://www.laptop.org/">OLPC</a>, whose mission is to distribute low cost laptops for education, without necessarily the connectivity with the outside world. Now at Praekelt we’re focusing on using connectivity as the power – harnessing the deployed base of mobile phones in Africa without requiring them to be smartphones or computing devices. As part of this <a href="http://www.praekeltfoundation.org/">Praekelt Foundation</a> and Vodacom are hosting the <a href="http://capetowndevday.eventbrite.com/">Betavine Social Exchange Cape Town Developer Day 2010</a>.</p>
<p>I’ve asked Steve Wolak to tell us more about <a href="http://www.betavine.net/">Betavine</a> and the event.<br/>
<strong><br/>
Who is Steve Wolak?</strong></p>
<p><img alt="" class="alignleft" height="117" src="http://www.betavine.net/betavine-content/images/homepage/promos/steve.gif" title="Steve Wolak" width="118"/>Stephen Wolak, Founder and Head of Betavine, has worked in mobile technology and software since graduating from Imperial College, London. Stephen joined Vodafone Group R&amp;D in 2000 and in 2006 put forward the idea of an open platform for engaging the wider technology community with R&amp;D activities.  The rest, as they say, is history.</p>
<p><strong>MC: I first became aware of Betavine when looking for 3G drivers for Linux, but I’m sure there is more to it than that. What is Betavine and how did it start?</strong></p>
<p>SW: Betavine was launched in January 2007 and has been evolving ever since, with new features being added in response to new requirements and feedback from the user base.  One area of success has been the linux software for the Vodafone Mobile Connect (VMC) card which has been downloaded over 750,000 times and has created a lively community around it.</p>
<p>We have also run a number of successful competitions on the website and created a lively Widget Zone. The website continues to evolve and we try out new things.</p>
<p><strong>MC: What is the Betavine Social Exchange?<br/>
</strong></p>
<p>SW: This is our latest idea.. creating “social and sustainable” mobile solutions.  The Betavine Social Exchange seeks to bring together 3 communities; the mobile community, the social sector and the entrepreuners.  Together these communities can create mobile solutions for the social sector.  Community organisations create challenges on the website and mobile developers / social entrepreneurs create solutions. The website then supports the deployment of these solutions on the ground.</p>
<p><strong>MC: The BSX’s success certainly depends on connecting the right people: those with needs – the NGOs and community organisations – and the developers. How do you publicise the BSX to reach them?<br/>
</strong></p>
<p>SW: We are running our pilot in South Africa and so we are working with Sangonet to help us get in touch with South African NGOs.  We are running a <a href="http://capetowndevday.eventbrite.com/">developer day in Cape Town</a> to help us engage with the local developer community.<br/>
<strong><br/>
MC: What do the resulting solutions include – are they apps for mobile phones, mobi websites, SMS solutions or all of the above?</strong></p>
<p>SW: All of the above.  It is important that the solution is appropriate for the challenge and the local community that will ultimately use the solution.</p>
<p><strong>MC: What can developers expect from participating in the BSX?</strong></p>
<p>SW: They can find real world challenges that people are seeking solutions to.  They can meet other developers and find useful resources to help them create a business.  The full resources section is coming soon.</p>
<p><strong>MC: Which leads us on to the Developer Day being hosted in Cape Town next month. What’s going to be happening at the event, and how does it tie in with the BSX?</strong></p>
<p>SW: We are keen to encourage mobile developers based in South Africa to engage with the real challenges that have been posted on the Betavine Social Exchange.  The developer day will include presentations on mobile technology and some exciting mobile solutions plus a developer competition and lots of creative energy and networking.</p>
<p><strong>MC: You’re going to be speaking at the event. Who would you like to see there?<br/>
</strong></p>
<p>SW: I would like to see mobile developers plus those with design skills and a passion for using mobile technology for social change.</p>
<p><strong>MC: We’re having a developer competition on the day. Can you tell us anything about the prizes/incentives you’re planning to bring?</strong></p>
<p>SW: Well, the developer day is free and includes lots of food and drink plus some beer at the end of the day … :-)  We also intend to offer a few prizes for the competition winners .. But we have not decided exactly what yet.  You will have to come along and see but tickets are going fast!</p>
<p><strong>Developer Day details<br/>
</strong></p>
<p>Date: Wednesday, March 10, 2010 from 9:30 AM – 7:00 PM</p>
<p>Location: <a href="http://www.lightbox.co.za/">The Lightbox Daylight Studio</a>, Green Point, Cape Town</p>
<p>More information and free tickets are available at <a href="http://capetowndevday.eventbrite.com/">eventbrite</a>. Due to the demand, the event has been expanded to 70 people.</p>
<br/>  <a href="http://feeds.wordpress.com/1.0/gocomments/morgancollett.wordpress.com/190/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/morgancollett.wordpress.com/190/"/></a> <a href="http://feeds.wordpress.com/1.0/godelicious/morgancollett.wordpress.com/190/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/morgancollett.wordpress.com/190/"/></a> <a href="http://feeds.wordpress.com/1.0/gofacebook/morgancollett.wordpress.com/190/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/morgancollett.wordpress.com/190/"/></a> <a href="http://feeds.wordpress.com/1.0/gotwitter/morgancollett.wordpress.com/190/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/morgancollett.wordpress.com/190/"/></a> <a href="http://feeds.wordpress.com/1.0/gostumble/morgancollett.wordpress.com/190/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/morgancollett.wordpress.com/190/"/></a> <a href="http://feeds.wordpress.com/1.0/godigg/morgancollett.wordpress.com/190/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/morgancollett.wordpress.com/190/"/></a> <a href="http://feeds.wordpress.com/1.0/goreddit/morgancollett.wordpress.com/190/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/morgancollett.wordpress.com/190/"/></a> <img alt="" border="0" height="1" src="http://stats.wordpress.com/b.gif?host=morgancollett.wordpress.com&amp;blog=494363&amp;post=190&amp;subd=morgancollett&amp;ref=&amp;feed=1" width="1"/></div>
    </content>
    <updated>2010-02-05T12:13:51Z</updated>
    <published>2010-02-05T12:13:51Z</published>
    <category scheme="http://morgancollett.wordpress.com" term="open source"/>
    <category scheme="http://morgancollett.wordpress.com" term="south africa"/>
    <category scheme="http://morgancollett.wordpress.com" term="ubuntu"/>
    <author>
      <name>Morgan</name>
      <uri>http://morgancollett.wordpress.com/</uri>
    </author>
    <source>
      <id>http://morgancollett.wordpress.com/feed/atom/</id>
      <link href="http://morgancollett.wordpress.com" rel="alternate" type="text/html"/>
      <link href="http://morgancollett.wordpress.com/osd.xml" rel="search" type="application/opensearchdescription+xml"/>
      <link href="http://wordpress.com/opensearch.xml" rel="search" type="application/opensearchdescription+xml"/>
      <link href="http://feeds.feedburner.com/FeedingThePenguins" rel="self" type="application/atom+xml"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://morgancollett.wordpress.com/?pushpress=hub" rel="hub" type="text/html"/>
      <subtitle xml:lang="en">Thoughts of an Ubunut</subtitle>
      <title xml:lang="en">Feeding the Penguins</title>
      <updated>2012-01-05T19:02:25Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://michael.gorven.za.net/blog/2009/06/18/supergenpass-cellphones-command-line</id>
    <link href="http://michael.gorven.za.net/blog/2009/06/18/supergenpass-cellphones-command-line" rel="alternate" type="text/html"/>
    <title>Michael Gorven (cocooncrash): SuperGenPass for cellphones and the command line</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p><a href="http://supergenpass.com/">SuperGenPass</a> and <a href="http://www.xs4all.nl/~jlpoutre/BoT/Javascript/PasswordComposer/">Password Composer</a> are password generators, which
generate different passwords for each site you use based on a single master
password. This gives you the convenience of only remembering one password as
well as the security of using different (and strong) passwords for each site.
This means that you won't have all your accounts compromised when<sup id="fnref:1"><a href="http://michael.gorven.za.net/taxonomy/term/3/atom/feed#fn:1" rel="footnote">1</a></sup> one of
them is <a href="http://www.codinghorror.com/blog/archives/000953.html">compromised</a>.</p>

<p>Most password generators are implemented as browser extensions or
<a href="http://en.wikipedia.org/wiki/Bookmarklet">bookmarklets</a>, since they are most frequently needed in a web browser. I've
been wanting to start using a password generator, but I wanted to be sure that I
could access my accounts even if I didn't have a web browser accessible. The two
situations I could think of were a command line only system (e.g. SSH) and my
cellphone<sup id="fnref:2"><a href="http://michael.gorven.za.net/taxonomy/term/3/atom/feed#fn:2" rel="footnote">2</a></sup>.</p>

<p>Surprisingly, I couldn't find a command line implementation of SuperGenPass, so
I <a href="http://michael.gorven.za.net/files/supergenpass.py">wrote one</a> in Python. I also couldn't find any <a href="http://en.wikipedia.org/wiki/Java_Platform,_Micro_Edition">J2ME</a> or <a href="http://en.wikipedia.org/Symbian_OS">Symbian</a>
implementations, and so wrote my <a href="http://mene.za.net/passgen/">own one</a> in J2ME. They both support subdomain
stripping and configurable password lengths. They don't support <a href="http://supergenpass.com/faq/#Technical-Details">salted
passwords</a>.</p>

<p>I chose SuperGenPass over Password Composer because it uses a better scheme.
Password Composer only uses hex characters, whereas SuperGenPass uses a
<a href="http://en.wikipedia.org/wiki/Base64">base64</a> encoded hash. SuperGenPass also hashes the password multiple times
(which would slow down a brute force attack to find the master password) and
imposes complexity requirements on the generated password (which reduces the
chances that the generated password can be brute forced).</p>

<div class="footnotes">
<hr/>
<ol>

<li id="fn:1">
<p>"When", not "if". <a href="http://michael.gorven.za.net/taxonomy/term/3/atom/feed#fnref:1" rev="footnote">↩</a></p>
</li>

<li id="fn:2">
<p>Although my phone's browser does support JavaScript, the JavaScript MD5
implementation commonly used by password generators doesn't work correctly on
it. <a href="http://michael.gorven.za.net/taxonomy/term/3/atom/feed#fnref:2" rev="footnote">↩</a></p>
</li>

</ol>
</div></div>
    </summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p><a href="http://supergenpass.com/">SuperGenPass</a> and <a href="http://www.xs4all.nl/~jlpoutre/BoT/Javascript/PasswordComposer/">Password Composer</a> are password generators, which
generate different passwords for each site you use based on a single master
password. This gives you the convenience of only remembering one password as
well as the security of using different (and strong) passwords for each site.
This means that you won't have all your accounts compromised when<sup id="fnref:1"><a href="http://michael.gorven.za.net/taxonomy/term/3/atom/feed#fn:1" rel="footnote">1</a></sup> one of
them is <a href="http://www.codinghorror.com/blog/archives/000953.html">compromised</a>.</p>

<p>Most password generators are implemented as browser extensions or
<a href="http://en.wikipedia.org/wiki/Bookmarklet">bookmarklets</a>, since they are most frequently needed in a web browser. I've
been wanting to start using a password generator, but I wanted to be sure that I
could access my accounts even if I didn't have a web browser accessible. The two
situations I could think of were a command line only system (e.g. SSH) and my
cellphone<sup id="fnref:2"><a href="http://michael.gorven.za.net/taxonomy/term/3/atom/feed#fn:2" rel="footnote">2</a></sup>.</p>

<p>Surprisingly, I couldn't find a command line implementation of SuperGenPass, so
I <a href="http://michael.gorven.za.net/files/supergenpass.py">wrote one</a> in Python. I also couldn't find any <a href="http://en.wikipedia.org/wiki/Java_Platform,_Micro_Edition">J2ME</a> or <a href="http://en.wikipedia.org/Symbian_OS">Symbian</a>
implementations, and so wrote my <a href="http://mene.za.net/passgen/">own one</a> in J2ME. They both support subdomain
stripping and configurable password lengths. They don't support <a href="http://supergenpass.com/faq/#Technical-Details">salted
passwords</a>.</p>

<p>I chose SuperGenPass over Password Composer because it uses a better scheme.
Password Composer only uses hex characters, whereas SuperGenPass uses a
<a href="http://en.wikipedia.org/wiki/Base64">base64</a> encoded hash. SuperGenPass also hashes the password multiple times
(which would slow down a brute force attack to find the master password) and
imposes complexity requirements on the generated password (which reduces the
chances that the generated password can be brute forced).</p>

<div class="footnotes">
<hr/>
<ol>

<li id="fn:1">
<p>"When", not "if". <a href="http://michael.gorven.za.net/taxonomy/term/3/atom/feed#fnref:1" rev="footnote">↩</a></p>
</li>

<li id="fn:2">
<p>Although my phone's browser does support JavaScript, the JavaScript MD5
implementation commonly used by password generators doesn't work correctly on
it. <a href="http://michael.gorven.za.net/taxonomy/term/3/atom/feed#fnref:2" rev="footnote">↩</a></p>
</li>

</ol>
</div></div>
    </content>
    <updated>2009-06-18T16:17:43Z</updated>
    <published>2009-06-18T16:17:43Z</published>
    <category term="j2me"/>
    <category term="java"/>
    <category term="password composer"/>
    <category term="passwords"/>
    <category term="supergenpass"/>
    <category term="technical"/>
    <author>
      <name>mgorven</name>
    </author>
    <source>
      <id>http://michael.gorven.za.net/taxonomy/term/3/atom/feed</id>
      <link href="http://michael.gorven.za.net/tags/technical" rel="alternate" type="text/html"/>
      <link href="http://michael.gorven.za.net/taxonomy/term/3/atom/feed" rel="self" type="application/atom+xml"/>
      <subtitle>Posts containing technical information.</subtitle>
      <title>technical</title>
      <updated>2008-10-01T15:12:23Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://morgancollett.wordpress.com/?p=182</id>
    <link href="http://morgancollett.wordpress.com/2009/05/13/ubuntu-server-versioning-etc-with-etckeeper-rocks/" rel="alternate" type="text/html"/>
    <link href="http://morgancollett.wordpress.com/2009/05/13/ubuntu-server-versioning-etc-with-etckeeper-rocks/#comments" rel="replies" type="text/html"/>
    <link href="http://morgancollett.wordpress.com/2009/05/13/ubuntu-server-versioning-etc-with-etckeeper-rocks/feed/atom/" rel="replies" type="application/atom+xml"/>
    <title xml:lang="en">Morgan Collett (morgs): Ubuntu Server: Versioning /etc with etckeeper rocks!</title>
    <summary type="xhtml" xml:lang="en"><div xmlns="http://www.w3.org/1999/xhtml">Deploying a new server at work – a dedicated server hosted at Hetzner. Fortunately Jaunty (Ubuntu 9.04) was released before we had anything hosted on the machine, so I took the decision to upgrade it before we do serious deployment. One of the shiny new features of Ubuntu Server 9.04 is etckeeper, documented here by [...]<img alt="" border="0" height="1" src="http://stats.wordpress.com/b.gif?host=morgancollett.wordpress.com&amp;blog=494363&amp;post=182&amp;subd=morgancollett&amp;ref=&amp;feed=1" width="1"/></div>
    </summary>
    <content type="xhtml" xml:lang="en"><div xmlns="http://www.w3.org/1999/xhtml"><p>Deploying a new server at <a href="http://www.praekelt.com">work</a> – a dedicated server hosted at <a href="http://www.hetzner.co.za/">Hetzner</a>. Fortunately Jaunty (Ubuntu 9.04) was released before we had anything hosted on the machine, so I took the decision to upgrade it before we do serious deployment.</p>
<p>One of the shiny new features of Ubuntu Server 9.04 is etckeeper, documented <a href="http://fnords.wordpress.com/2009/03/05/etckeeper-chronicles-4/">here by </a><span class="fn"><a href="http://fnords.wordpress.com/2009/03/05/etckeeper-chronicles-4/">Thierry Carrez</a>. In particular, on 9.04 etckeeper plays well with bzr and shows the real user who typed “sudo etckeeper commit” in the bzr log, not just “root”.</span></p>
<p><span class="fn">As we have a (small but distributed) team adminning the server, this will help a great deal to keep track of who did what when.<br/>
</span></p>
<br/>  <a href="http://feeds.wordpress.com/1.0/gocomments/morgancollett.wordpress.com/182/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/morgancollett.wordpress.com/182/"/></a> <a href="http://feeds.wordpress.com/1.0/godelicious/morgancollett.wordpress.com/182/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/morgancollett.wordpress.com/182/"/></a> <a href="http://feeds.wordpress.com/1.0/gofacebook/morgancollett.wordpress.com/182/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/morgancollett.wordpress.com/182/"/></a> <a href="http://feeds.wordpress.com/1.0/gotwitter/morgancollett.wordpress.com/182/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/morgancollett.wordpress.com/182/"/></a> <a href="http://feeds.wordpress.com/1.0/gostumble/morgancollett.wordpress.com/182/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/morgancollett.wordpress.com/182/"/></a> <a href="http://feeds.wordpress.com/1.0/godigg/morgancollett.wordpress.com/182/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/morgancollett.wordpress.com/182/"/></a> <a href="http://feeds.wordpress.com/1.0/goreddit/morgancollett.wordpress.com/182/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/morgancollett.wordpress.com/182/"/></a> <img alt="" border="0" height="1" src="http://stats.wordpress.com/b.gif?host=morgancollett.wordpress.com&amp;blog=494363&amp;post=182&amp;subd=morgancollett&amp;ref=&amp;feed=1" width="1"/></div>
    </content>
    <updated>2009-05-13T19:43:12Z</updated>
    <published>2009-05-13T19:43:12Z</published>
    <category scheme="http://morgancollett.wordpress.com" term="ubuntu"/>
    <author>
      <name>Morgan</name>
      <uri>http://morgancollett.wordpress.com/</uri>
    </author>
    <source>
      <id>http://morgancollett.wordpress.com/feed/atom/</id>
      <link href="http://morgancollett.wordpress.com" rel="alternate" type="text/html"/>
      <link href="http://morgancollett.wordpress.com/osd.xml" rel="search" type="application/opensearchdescription+xml"/>
      <link href="http://wordpress.com/opensearch.xml" rel="search" type="application/opensearchdescription+xml"/>
      <link href="http://feeds.feedburner.com/FeedingThePenguins" rel="self" type="application/atom+xml"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://morgancollett.wordpress.com/?pushpress=hub" rel="hub" type="text/html"/>
      <subtitle xml:lang="en">Thoughts of an Ubunut</subtitle>
      <title xml:lang="en">Feeding the Penguins</title>
      <updated>2012-01-05T19:02:25Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://morgancollett.wordpress.com/?p=179</id>
    <link href="http://morgancollett.wordpress.com/2009/04/23/surviving-an-ubuntu-release-day/" rel="alternate" type="text/html"/>
    <link href="http://morgancollett.wordpress.com/2009/04/23/surviving-an-ubuntu-release-day/#comments" rel="replies" type="text/html"/>
    <link href="http://morgancollett.wordpress.com/2009/04/23/surviving-an-ubuntu-release-day/feed/atom/" rel="replies" type="application/atom+xml"/>
    <title xml:lang="en">Morgan Collett (morgs): Surviving an Ubuntu Release Day</title>
    <summary type="xhtml" xml:lang="en"><div xmlns="http://www.w3.org/1999/xhtml">Some observations on the last n releases: Throughout the Ubuntu development cycle, there are daily “snapshot” CD images produced. If you’re fortunate to live in a country where most of the “broadband” online population are not capped at 1GB per month (and a presidential hopeful who doesn’t keep singing “bring me my machine gun“) then [...]<img alt="" border="0" height="1" src="http://stats.wordpress.com/b.gif?host=morgancollett.wordpress.com&amp;blog=494363&amp;post=179&amp;subd=morgancollett&amp;ref=&amp;feed=1" width="1"/></div>
    </summary>
    <content type="xhtml" xml:lang="en"><div xmlns="http://www.w3.org/1999/xhtml"><p>Some observations on the last n releases:</p>
<p>Throughout the Ubuntu development cycle, there are <a href="http://cdimage.ubuntu.com/">daily “snapshot” CD images</a> produced. If you’re fortunate to live in a country where most of the “broadband” online population are not capped at 1GB per month (and a presidential <acronym title="The votes are being counted as I write this, and he doesn't need much hope">hopeful</acronym> who doesn’t keep singing “<a href="http://en.wikipedia.org/wiki/Umshini_wami">bring me my machine gun</a>“) then you can download these during the development cycle to boot (<a href="http://cdimage.ubuntu.com/daily-live/">daily-live</a>) or install (perhaps in a virtual machine) to check on the progress or help with testing. These culminate in the actual “gold” release image.</p>
<p>Therefore, if you have one of these images from near the end of the development cycle, such as the release candidate, you can <a href="https://help.ubuntu.com/community/RsyncCdImage">rsync to the latest image</a> available on release day, and that will download the differences between the iso you have, and the final daily image – which will be identical to the release image, even though the daily image will be named something like <em>jaunty-desktop-i386.iso</em> and the corresponding release image named <em>ubuntu-9.04-desktop-i386.iso</em>. Rename it, and you’re done!</p>
<p>(Check the <a href="http://releases.ubuntu.com/jaunty/MD5SUMS">MD5SUMS</a> after the release is announced, to be 100% sure you have it. There is always a small chance of a change to the ISOs on release day if some major “ate all my data” bug is found – so if you do have problems, remember that it comes with <a href="http://www.gnu.org/copyleft/gpl.html">no warranty</a>…)</p>
<p>Now, for kicks, go and lurk on IRC in #ubuntu-release-party and watch the masses rocking up to ask “<a href="http://popey.com/Is_it_out_yet">Is it out yet</a>?” Note Alan Pope’s list of <a href="http://popey.com/Things_Not_To_Say">Things Not To Say</a>, and don’t go gloating that you have it already – you’ll only be kicked from the channel by the ironically named partybot.</p>
<p>Instead, <span style="text-decoration: line-through;">burn</span> write it to a USB stick (CDs are so early 2008) and get installing!</p>
<br/>  <a href="http://feeds.wordpress.com/1.0/gocomments/morgancollett.wordpress.com/179/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/morgancollett.wordpress.com/179/"/></a> <a href="http://feeds.wordpress.com/1.0/godelicious/morgancollett.wordpress.com/179/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/morgancollett.wordpress.com/179/"/></a> <a href="http://feeds.wordpress.com/1.0/gofacebook/morgancollett.wordpress.com/179/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/morgancollett.wordpress.com/179/"/></a> <a href="http://feeds.wordpress.com/1.0/gotwitter/morgancollett.wordpress.com/179/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/morgancollett.wordpress.com/179/"/></a> <a href="http://feeds.wordpress.com/1.0/gostumble/morgancollett.wordpress.com/179/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/morgancollett.wordpress.com/179/"/></a> <a href="http://feeds.wordpress.com/1.0/godigg/morgancollett.wordpress.com/179/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/morgancollett.wordpress.com/179/"/></a> <a href="http://feeds.wordpress.com/1.0/goreddit/morgancollett.wordpress.com/179/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/morgancollett.wordpress.com/179/"/></a> <img alt="" border="0" height="1" src="http://stats.wordpress.com/b.gif?host=morgancollett.wordpress.com&amp;blog=494363&amp;post=179&amp;subd=morgancollett&amp;ref=&amp;feed=1" width="1"/></div>
    </content>
    <updated>2009-04-23T18:46:54Z</updated>
    <published>2009-04-23T18:46:54Z</published>
    <category scheme="http://morgancollett.wordpress.com" term="ubuntu"/>
    <author>
      <name>Morgan</name>
      <uri>http://morgancollett.wordpress.com/</uri>
    </author>
    <source>
      <id>http://morgancollett.wordpress.com/feed/atom/</id>
      <link href="http://morgancollett.wordpress.com" rel="alternate" type="text/html"/>
      <link href="http://morgancollett.wordpress.com/osd.xml" rel="search" type="application/opensearchdescription+xml"/>
      <link href="http://wordpress.com/opensearch.xml" rel="search" type="application/opensearchdescription+xml"/>
      <link href="http://feeds.feedburner.com/FeedingThePenguins" rel="self" type="application/atom+xml"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://morgancollett.wordpress.com/?pushpress=hub" rel="hub" type="text/html"/>
      <subtitle xml:lang="en">Thoughts of an Ubunut</subtitle>
      <title xml:lang="en">Feeding the Penguins</title>
      <updated>2012-01-05T19:02:25Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://michael.gorven.za.net/blog/2009/04/12/serving-static-files-without-file-extensions-using-lighttpd-lua</id>
    <link href="http://michael.gorven.za.net/blog/2009/04/12/serving-static-files-without-file-extensions-using-lighttpd-lua" rel="alternate" type="text/html"/>
    <title>Michael Gorven (cocooncrash): Serving static files without file extensions using Lighttpd and Lua</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p><a href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator"><abbr title="uniform resource locator">URL</abbr></a>s shouldn't really contain file extensions (like <span class="geshifilter"><code class="text geshifilter-text">.html</code></span>, <span class="geshifilter"><code class="text geshifilter-text">.png</code></span>)
since they are supposed to identify a resource and not a particular
representation/format thereof. The format is indicated by the <span class="geshifilter"><code class="text geshifilter-text">Content-Type</code></span>
header sent in the response. Modern <a href="http://en.wikipedia.org/wiki/Content_management_system"><abbr title="content management system">CMS</abbr></a>s do this already (for example, the
<abbr title="uniform resource locator">URL</abbr> of this page doesn't include <span class="geshifilter"><code class="text geshifilter-text">.html</code></span>).</p>

<p>Doing the same for static files (i.e. files served directly by the webserver)
isn't straightforward because most webservers use the file extension to
determine the <a href="http://en.wikipedia.org/wiki/Mime_type">MIME type</a> to send in the <span class="geshifilter"><code class="text geshifilter-text">Content-Type</code></span> header. This means
that simply removing the file extension from the filename (or even creating a
symlink without a file extension) will cause the webserver to send the wrong
<span class="geshifilter"><code class="text geshifilter-text">Content-Type</code></span> header.</p>

<p>I decided to try find a solution to this for my webserver of choice,
<a href="http://en.wikipedia.org/wiki/Lighttpd">Lighttpd</a>. Lighttpd has a <a href="http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModMagnet">module</a> which embeds a <a href="http://en.wikipedia.org/wiki/Lua_(programming_language)">Lua</a> interpreter and
allows you to write scripts which modify (or even handle) requests. So I wrote
a <a href="http://michael.gorven.za.net/files/extension.lua">script</a> which searches the directory for files with the same name as
requested but with an extension. This means that any file can be accessed with
the file extension removed from the <abbr title="uniform resource locator">URL</abbr> while still having the correct
<span class="geshifilter"><code class="text geshifilter-text">Content-Type</code></span>.</p>

<p>The script currently chooses the first matching file, which means that having
multiple files with the same name but different extensions doesn't do anything
useful. The proper method however is to actually do <a href="http://en.wikipedia.org/wiki/Content_negotiation">content negotiation</a>,
which chooses the format based on the preferences indicated by the HTTP client
in the <span class="geshifilter"><code class="text geshifilter-text">Accept</code></span> header.</p>

<p>To use this script, download it and save it somewhere (I use <span class="geshifilter"><code class="text geshifilter-text">/etc/lighttpd/</code></span>).
Enable <span class="geshifilter"><code class="text geshifilter-text">mod_magnet</code></span>, and add the following line to the site definition.</p>

<pre><div class="geshifilter"><pre class="text geshifilter-text" style="font-family: monospace;">magnet.attract-physical-path-to = ("/etc/lighttpd/extension.lua")</pre></div></pre></div>
    </summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p><a href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator"><abbr title="uniform resource locator">URL</abbr></a>s shouldn't really contain file extensions (like <code>.html</code>, <code>.png</code>)
since they are supposed to identify a resource and not a particular
representation/format thereof. The format is indicated by the <code>Content-Type</code>
header sent in the response. Modern <a href="http://en.wikipedia.org/wiki/Content_management_system"><abbr title="content management system">CMS</abbr></a>s do this already (for example, the
<abbr title="uniform resource locator">URL</abbr> of this page doesn't include <code>.html</code>).</p>

<p>Doing the same for static files (i.e. files served directly by the webserver)
isn't straightforward because most webservers use the file extension to
determine the <a href="http://en.wikipedia.org/wiki/Mime_type">MIME type</a> to send in the <code>Content-Type</code> header. This means
that simply removing the file extension from the filename (or even creating a
symlink without a file extension) will cause the webserver to send the wrong
<code>Content-Type</code> header.</p>

<p>I decided to try find a solution to this for my webserver of choice,
<a href="http://en.wikipedia.org/wiki/Lighttpd">Lighttpd</a>. Lighttpd has a <a href="http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModMagnet">module</a> which embeds a <a href="http://en.wikipedia.org/wiki/Lua_(programming_language)">Lua</a> interpreter and
allows you to write scripts which modify (or even handle) requests. So I wrote
a <a href="http://michael.gorven.za.net/files/extension.lua">script</a> which searches the directory for files with the same name as
requested but with an extension. This means that any file can be accessed with
the file extension removed from the <abbr title="uniform resource locator">URL</abbr> while still having the correct
<code>Content-Type</code>.</p>

<p>The script currently chooses the first matching file, which means that having
multiple files with the same name but different extensions doesn't do anything
useful. The proper method however is to actually do <a href="http://en.wikipedia.org/wiki/Content_negotiation">content negotiation</a>,
which chooses the format based on the preferences indicated by the HTTP client
in the <code>Accept</code> header.</p>

<p>To use this script, download it and save it somewhere (I use <code>/etc/lighttpd/</code>).
Enable <code>mod_magnet</code>, and add the following line to the site definition.</p>

<pre><code>magnet.attract-physical-path-to = ("/etc/lighttpd/extension.lua")
</code></pre></div>
    </content>
    <updated>2009-04-13T15:39:28Z</updated>
    <published>2009-04-12T11:49:25Z</published>
    <category term="code"/>
    <category term="http"/>
    <category term="lighttpd"/>
    <category term="lua"/>
    <category term="technical"/>
    <author>
      <name>mgorven</name>
    </author>
    <source>
      <id>http://michael.gorven.za.net/taxonomy/term/3/atom/feed</id>
      <link href="http://michael.gorven.za.net/tags/technical" rel="alternate" type="text/html"/>
      <link href="http://michael.gorven.za.net/taxonomy/term/3/atom/feed" rel="self" type="application/atom+xml"/>
      <subtitle>Posts containing technical information.</subtitle>
      <title>technical</title>
      <updated>2008-10-01T15:12:23Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://tumbleweed.org.za/148 at http://tumbleweed.org.za</id>
    <link href="http://tumbleweed.org.za/2008/10/06/joy-sysrq" rel="alternate" type="text/html"/>
    <title>Stefano Rivera (tumbleweed): The joy that is SysRq</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>I’m constantly surprised when I come across long-time Linux users who don’t know about SysRq.
The Linux Magic System Request Key Hacks are a magic set of commands that you can get the Linux kernel to follow no matter what’s going on (unless it has panicked or totally deadlocked).</p>

<p>Why is this useful? Well, there are many situations where you can’t shut a system down properly, but you need to reboot. Examples:</p>

<ul>
<li>You’ve had a kernel <span class="caps">OOPS</span>, which is not quite a panic but there could be memory corruption in the kernel, things are getting pretty weird, and quite honestly you don’t want to be running in that condition for any longer than necessary.</li>
<li>You have reason to believe it won’t be able to shut down properly.</li>
<li>Your system is almost-locked-up (i.e. the above point)</li>
<li>Your <span class="caps">UPS</span> has about 10 seconds worth of power left</li>
<li>Something is on fire (<code>lp0</code> possibly?)</li>
<li>…Insert other esoteric failure modes here…</li>
</ul>

<p>In any of those situations, grab a console keyboard, and type Alt+SysRq+s (sync), Alt+SysRq+u (unmount), wait for it to have synced, and finally Alt+SysRq+b (reboot <span class="caps">NOW</span>!).
If you don’t have a handy keyboard attached to said machine, or are on another continent, you can</p>

<div class="geshifilter"><div class="text geshifilter-text" style="font-family: monospace;"># echo u &gt; /proc/sysrq-trigger</div></div>

<p>In my books, the useful SysRq commands are:</p>

<dl>
<dt>b</dt>
<dd>Reboot</dd>

<dt>f</dt>
<dd>Call the oom_killer</dd>

<dt>h</dt>
<dd>Display SysRq help</dd>

<dt>l</dt>
<dd>Print a kernel stacktrace</dd>

<dt>o</dt>
<dd>Power Off</dd>

<dt>r</dt>
<dd>Set your keyboard to <span class="caps">RAW</span> mode (required after some X breakages)</dd>

<dt>s</dt>
<dd>Sync all filesystems</dd>

<dt>u</dt>
<dd>Remount all filesystems read-only</dd>

<dt>0-9</dt>
<dd>Change console logging level</dd>
</dl>

<p>In fact, read the <a href="http://kernel.org/doc/Documentation/sysrq.txt">rest of the SysRq documentation</a>, print it out, and tape it above your bed.
Next time you reach for the reset switch on a Linux box, stop your self, type the S,U,B sequence, and watch your system come up as if nothing untoward has happened.</p>

<p><strong>Update</strong>: I previously recommended U,S,B but after a bit of digging, I think S,U,B may be correct.</p></div>
    </summary>
    <updated>2008-10-06T11:31:20Z</updated>
    <category scheme="http://tumbleweed.org.za/tags/linux" term="linux"/>
    <category scheme="http://tumbleweed.org.za/tags/sysadmin" term="sysadmin"/>
    <category scheme="http://tumbleweed.org.za/tags/sysrq" term="sysrq"/>
    <category scheme="http://tumbleweed.org.za/tags/technical" term="technical"/>
    <category scheme="http://tumbleweed.org.za/tags/ubuntu" term="ubuntu"/>
    <author>
      <name>tumbleweed</name>
    </author>
    <source>
      <id>http://tumbleweed.org.za/taxonomy/term/152/0</id>
      <link href="http://tumbleweed.org.za/taxonomy/term/152/0" rel="alternate" type="text/html"/>
      <link href="http://tumbleweed.org.za/tags/technical/feed" rel="self" type="application/rss+xml"/>
      <title>Tumbleweed Rants - technical</title>
      <updated>2011-09-21T14:07:16Z</updated>
    </source>
  </entry>
</feed>

