May 14, 2012

Dave Airlie

ripping the X server a new driver API

So I've been slowly writing the hotplug support v3 in between all the real jobs I have to do.

[side note: When I started out on hotplug. one of my goals was to avoid changing the server API/ABI too much so I could continue side by side testing.]

how did I get to v3?
v0.1: was called dynerama it failed miserably and proved that using Xinerama as the plugging layer was a bad plan.
v1: was the first time I decided to use an impedance layer between some server objects and driver objects.
v2: was the a major rebase of v1.

v2 was trucking along nicely and I managed to get the design to the stage where PRIME offloading intel/nouveau worked, USB device hotplug with udl worked, and GPU switch worked between two drivers. However v2 duplicated a lot of code and invented a whole new set of API objects called DrvXRec, so DrvScreenRec, DrvPixmapRec, DrvGCRec etc, this lead me to looking at the pain of merging this into the drivers and the server, and my goals of avoiding changing the API/ABI was getting in my way.

So before starting v3 I decided to rework some of the server "APIs".

The X server has two main bodies of code, one called DIX, and one called DDX. The DIX (device independent X) code and the DDX (Device dependent X code). In the X.org tree the dix lives up in the top level dirs, and for X.org server the DDX lives in hw/xfree86. The main object with info about protocol screens and GPUs is called ScreenRec in the DDX and ScrnInfoRec in the DIX. These are stored in two arrays, screenInfo.screens in the DIX and xf86Screens in the DDX, when code wants to convert between these it can do one of a few things.

a) lookup by index, both structs have an index value, so to go from ScrnInfo to Screen you look at screenInfo.screens[scrninfo->scrnIndex] and other way is xf86Screens[screen->myNum]. This is like the I didn't try and make an API, I just exposed everything.

b) ScrnInfo has a ScreenPtr in it, so some code can do ScrnInfo->pScreen to get the pointer to the dix struct. But this pointer is initialised after a bunch of code is called, so you really can't guarantee this pointer is going to be useful for you.

c) XF86SCRNINFO uses the DIX private subsystem to lookup the Scrn in the Screen's privates. This is the least used and probably slowest method.

So also screenInfo.screens contains the protocol screens we exposed to the clients, so this array cannot really change or move around. So I'd like to add screeninfo.gpuscreens and xf86GPUScreens and not have drivers know which set of info they are working on, however (a) totally screws this idea, since the indices are always looked up directly in the global arrays.

Now lots of the Screen/ScrnInfo APIs exposed to the drivers pass an int index as the first parameter, the function in the driver then goes and looks up the global arrays.

So my first API changes introduce some standard conversion functions xf86ScreenToScrn and xf86ScrnToScreen, and converts a lot of the server to use those. Yay an API. The second set of changes then changes all of the index passing APIs to pass ScrnInfoPtr or ScreenPtr, so the drivers don't go poking into global arrays. Now this is a major API change, it will involve slightly messy code in drivers that want to work with both servers, but I can't see a nicer way to do it. I've done a compat header file that will hopefully allows to cover a lot of this stuff where we don't see it.

I've ono other API introduction on the list, Glyph Pictures are another global array indexed by screen index, I've gone and added an accessor function so that drivers don't use the index anymore to get at the array contents directly.

Once this stuff lands in the server, a team of people will go forward and port the drivers to the new APIs (who am I kidding).

May 14, 2012 05:05 PM

Sonia Hamilton

Emacs Paredit Notes

Some notes on Emacs’ Paredit mode. More so I can stop fighting with Paredit and do some Clojure programming than show any expertise – see Mudphone’s Paredit Preso for the real deal, and hagelb’s Paredit screencast notes.

  • M-(  wrap parens around something. Also for { [ “
  • M-s  remove parens from something
  • M-S-s  split sexpr into two
  • M-S-j  join sexprs
  • C-q ♦  just do what I say, dammit! force insert of paren or bracket ♦
  • C-u DEL  force delete paren or bracket

“Barfage and slurpage” - ()‘s expand, {}‘s contract:

  • M-)  move right paren rightward
  • C-}  move right paren leftwards
  • C-(  move left paren leftwards
  • C-{ move left paren rightwards

 

Paredit Cheat from http://www.emacswiki.org/pics/static/PareditCheatsheet.png

 

Lisp Parens

May 14, 2012 01:06 PM

May 13, 2012

Matthew Palmer's hackergotchi

Matthew Palmer

vmdksync helps you escape from VMware

When I wrote lvmsync late last year, I didn’t realise I was being typecast. Before too long, I realised that the logic that I’d implemented for lvmsync would also help me with a separate migration project I’d been dreading – getting the day job off VMware.

Back in the early days of virtualisation, management made the decision to run VMware, for all the usual reasons (“commercially supported!”, “industry standard!”, and so on). Unsurprisingly (to me, anyway) it didn’t take too long for management to realise that it wasn’t the best choice for us. When you’ve got umpty-billion dollars to spend on hardware, software, and support, VMware might be the right option (although Amazon doesn’t seem to think so). Anchor’s company culture, on the other hand, is build around “smart staff, simple systems” over “dumb staff, smart vendors”, because no vendor is ever going to care about our customers as much as we do. So VMware was never going to work for us.

Unfortunately, as happens all too often, once VMware was in place, there was very little motivation to get rid of it and move those customers onto the chosen replacement (that we were deploying all new customers on). I happen to think this is a terrible attitude in general – one that makes life so much harder in the long term. I believe strongly in retrofitting old systems to keep them up-to-date with the current state of the art, and keeping technical debt under control. But, I wasn’t running the show back when we stopped putting new customers on VMware, so the few VMware servers we had stayed around far longer than they should have.

Recently, though, bad things started to happen. The VMware servers were starting to fall apart. The Windows machine we had to keep around to use the VMware management console started crapping out, and when the choice was between doing unspeakable things to Windows, and just ditching VMware… well, it wasn’t much of a choice. The only remaining question was how to do the migration off VMware with the least amount of downtime to our customers.

I was really quite surprised that nobody out in Internet land appeared to have come up with a simple, robust tool to do this. Sure, some vendors had all-singing, all-dancing toolkits that cost ridiculous amounts of money, required you to install their agent on the machine involved, and promised the earth, but it all smelt of snakeoil and bullshit.

In true hacker style, then, I decided to write something myself. The model I came up with mirrored lvmsync’s quite closely – because that one worked, and it turned out to be surprisingly easy to implement once I managed to reverse-engineer the file format (VMware has a PDF spec of a bunch of it’s file formats, but whoever wrote it was enough of an evil genius to make it utterly incomprehensible to anyone who doesn’t already know the file format, whilst making perfect sense to anyone who already does).

The result: vmdksync. It is nothing but 80-odd lines of ruby whose sole purpose is to take a delta.vmdk file and write the changes that are stored in that file to a file or block device that is a copy of the flat.vmdk file that you can copy while the VM is still running (after you’ve made a snapshot, of course). It helped me provide a painless migration path away from VMware, and I’d be really pleased if it helped some other people do the same. Share and enjoy!

May 13, 2012 05:00 AM

Pia Waugh's hackergotchi

Pia Waugh

Twitter Weekly Updates for 2012-05-13

  • Aww, thx! :) #
  • .@John_Hanna Hmmm, not really that I know of. Was international list. Most people in the industry are great, men & women alike. A few tools #
  • .@williamparry don't hate, then the terrorists win ;) #
  • . @John_Hanna The argument devolves too quickly into one about free speech. I want to understand why anyone would think this way & address. #
  • Wow, amazing that some ppl actually speak & think this way. A minority but a loud minority. http://t.co/nkBxqqKe #womenhaters #
  • "i find out who I am when I'm climbing the mountains of mars" http://t.co/kEWY8Xze /cc @kelisha @swearyanthony #
  • Check out these guys, they do "literal trailers" for movies.and games. Much lols. #ac3 For @swearyanthony http://t.co/KcT6ND2C #
  • "If it bleeds we can kill it". So much lols. http://t.co/KG7vEY06 #
  • Ohcrap, thx @Wittylama RT Klout http://t.co/lHJGzhPi #
  • OK, I'm really at the end of my tether, anyone in the Canberra area able to loan me a fast laptop for a week or two? Just need web browsers. #
  • Some #govhack media, thanks for the coverage :) @jamie_kirk http://t.co/CqCOKYK6 & a kinda-shout-out from @stilgherrian http://t.co/nKnAQ85U #
  • HAH! Your mum must be proud ;) RT @FakePaulKeating: @piawaugh pfft. Lightweight. http://t.co/uaGZLifw "Facepalm central" #
  • MWAH hahaha! Thanks @akshatj_96 & @purserj for Klouchebag lulz. My score is 27, or 'mostly alright', hah! http://t.co/9WPFx619 #
  • Wow, just joined @Klout. Fascinating! Wish it included Soundcloud ;) "According to @klout, my Klout score is 45." http://t.co/qtrphA1x #
  • An awesome song to start work to. Enjoy http://t.co/3TK8YN8s #music #
  • "Where to ebooks go when you do?" Great article, tackles the major challenge of digital culture wrapped up in DRM http://t.co/fyu0i3pV #
  • It's funny how we feel most safe in motion, but only when still are we able to really see what's around us. Kung Fu thought for the day. #fb #
  • Dammit! RT @ACTwonkdrinks: Not enough interest for a Budget Edition of #actwonkdrinks Why kind of wonks are you lot? #fail #
  • Have had to limit the size of Sydney #GovHack due to venue, so get in quick before we hit capacity! http://t.co/YS5Zwh26 28 seats left atm #
  • Right, thanks all, looks like CC-BY is on individual #budget papers, but not on copyright page http://t.co/lqwgNZn0 Be good to fix that :) #
  • What happened to the CC-BY for the Budget papers? http://t.co/9ZHNJThm That's quite unfortunate, seems a backwards step. #
  • Went to write democracy and typo'd demoncracy. I think there's something in that for all of us. #
  • Kudos to the Adobe http://t.co/EZzCyBnH tool. It''s a bit slow but works really nicely :) #
  • I lie, it works in IE6 and IE9, but not well in IE8 and not at all in IE7. Wonderful. #
  • Internet Explorer, the bane of web developers everywhere. How could it work in IE6, 7 & 9, but not 8. FFS. #backtodrawingboard #
  • cool, done :) #
  • Nice, now over 100 ppl registered for #govhack Hoping for 300 so go register (Sydney or Canberra). Will be awesome :) http://t.co/aXgjAzLL #
  • . @gavintapp Shiny, but seriously, promoting a "developers" laptop and then saying "key tools and utilities (emacs, Vim, Chromium etc)" ;) #
  • Funny. I get so much spam on Google+. Facebook and Twitter are wonderful by comparison. #
  • Wow, the @SensisAPI zombie app challenge is teh awesome! http://t.co/LjdrcZT8 #gov2au #
  • Putting together a #GovHack team to compete 1-3 June? Check out some previous mashups/hacks on http://t.co/ab5WZIGh http://t.co/p04DDIz4 #
  • Interesting RT @wtfsheep: @parisba I thought this was an awesome open data mashup: http://t.co/YWFaporR #CHI2012 #govhack #
  • So, going to see Smashing Pumpkins and Tea Party in July, all I need is Tool, Kyuss, Stabbing Westward, NIN, Lamb and I'd be in heaven :) #
  • I know, crazy hey, but I tweeted a new song of theirs earlier today which was surprisingly good. So am excited :) #
  • WOW! I am now also going to Smashing Pumpkins with @alexmyoug, looks like July will be #relivemyyouth month! :) SOOOOO EXCITED! #music #
  • Just received the Tea Party tickets in the post!!! Hey @alexmyoung, I can't wait! #
  • Fascinating RT @OZloop: APS - The perfect storm. Cutbacks, culture and abuse http://t.co/ZKJitFQS #gov2au #opengov #innovationweek #govcamp #
  • . @1159 Heh :) Saw Tool in '97, still one of my favourite gigs ever. They covered Hurt too, double perfect! :) #
  • "See my shadow changing, stretching up and over me. Soften this old armour, hoping I can clear the way". Tool is helping me work today :) #
  • I love Linux. Some useful ffmpeg for converting and manipulating video/audio without having to open video editing suite http://t.co/uBGQ8dUn #
  • Have you registered for #GovHack yet? Over $30k in prize funding for awesome apps, mashups & datavis, so come get some! http://t.co/aXgjAzLL #
  • Wow. New Smashing Pumpkins, and surprisingly awesome. http://t.co/gHWBu29J #music #

May 13, 2012 12:00 AM

Twitter Weekly Updates for 2012-05-13

  • Aww, thx! :) #
  • .@John_Hanna Hmmm, not really that I know of. Was international list. Most people in the industry are great, men & women alike. A few tools #
  • .@williamparry don't hate, then the terrorists win ;) #
  • . @John_Hanna The argument devolves too quickly into one about free speech. I want to understand why anyone would think this way & address. #
  • Wow, amazing that some ppl actually speak & think this way. A minority but a loud minority. http://t.co/nkBxqqKe #womenhaters #
  • "i find out who I am when I'm climbing the mountains of mars" http://t.co/kEWY8Xze /cc @kelisha @swearyanthony #
  • Check out these guys, they do "literal trailers" for movies.and games. Much lols. #ac3 For @swearyanthony http://t.co/KcT6ND2C #
  • "If it bleeds we can kill it". So much lols. http://t.co/KG7vEY06 #
  • Ohcrap, thx @Wittylama RT Klout http://t.co/lHJGzhPi #
  • OK, I'm really at the end of my tether, anyone in the Canberra area able to loan me a fast laptop for a week or two? Just need web browsers. #
  • Some #govhack media, thanks for the coverage :) @jamie_kirk http://t.co/CqCOKYK6 & a kinda-shout-out from @stilgherrian http://t.co/nKnAQ85U #
  • HAH! Your mum must be proud ;) RT @FakePaulKeating: @piawaugh pfft. Lightweight. http://t.co/uaGZLifw "Facepalm central" #
  • MWAH hahaha! Thanks @akshatj_96 & @purserj for Klouchebag lulz. My score is 27, or 'mostly alright', hah! http://t.co/9WPFx619 #
  • Wow, just joined @Klout. Fascinating! Wish it included Soundcloud ;) "According to @klout, my Klout score is 45." http://t.co/qtrphA1x #
  • An awesome song to start work to. Enjoy http://t.co/3TK8YN8s #music #
  • "Where to ebooks go when you do?" Great article, tackles the major challenge of digital culture wrapped up in DRM http://t.co/fyu0i3pV #
  • It's funny how we feel most safe in motion, but only when still are we able to really see what's around us. Kung Fu thought for the day. #fb #
  • Dammit! RT @ACTwonkdrinks: Not enough interest for a Budget Edition of #actwonkdrinks Why kind of wonks are you lot? #fail #
  • Have had to limit the size of Sydney #GovHack due to venue, so get in quick before we hit capacity! http://t.co/YS5Zwh26 28 seats left atm #
  • Right, thanks all, looks like CC-BY is on individual #budget papers, but not on copyright page http://t.co/lqwgNZn0 Be good to fix that :) #
  • What happened to the CC-BY for the Budget papers? http://t.co/9ZHNJThm That's quite unfortunate, seems a backwards step. #
  • Went to write democracy and typo'd demoncracy. I think there's something in that for all of us. #
  • Kudos to the Adobe http://t.co/EZzCyBnH tool. It''s a bit slow but works really nicely :) #
  • I lie, it works in IE6 and IE9, but not well in IE8 and not at all in IE7. Wonderful. #
  • Internet Explorer, the bane of web developers everywhere. How could it work in IE6, 7 & 9, but not 8. FFS. #backtodrawingboard #
  • cool, done :) #
  • Nice, now over 100 ppl registered for #govhack Hoping for 300 so go register (Sydney or Canberra). Will be awesome :) http://t.co/aXgjAzLL #
  • . @gavintapp Shiny, but seriously, promoting a "developers" laptop and then saying "key tools and utilities (emacs, Vim, Chromium etc)" ;) #
  • Funny. I get so much spam on Google+. Facebook and Twitter are wonderful by comparison. #
  • Wow, the @SensisAPI zombie app challenge is teh awesome! http://t.co/LjdrcZT8 #gov2au #
  • Putting together a #GovHack team to compete 1-3 June? Check out some previous mashups/hacks on http://t.co/ab5WZIGh http://t.co/p04DDIz4 #
  • Interesting RT @wtfsheep: @parisba I thought this was an awesome open data mashup: http://t.co/YWFaporR #CHI2012 #govhack #
  • So, going to see Smashing Pumpkins and Tea Party in July, all I need is Tool, Kyuss, Stabbing Westward, NIN, Lamb and I'd be in heaven :) #
  • I know, crazy hey, but I tweeted a new song of theirs earlier today which was surprisingly good. So am excited :) #
  • WOW! I am now also going to Smashing Pumpkins with @alexmyoug, looks like July will be #relivemyyouth month! :) SOOOOO EXCITED! #music #
  • Just received the Tea Party tickets in the post!!! Hey @alexmyoung, I can't wait! #
  • Fascinating RT @OZloop: APS - The perfect storm. Cutbacks, culture and abuse http://t.co/ZKJitFQS #gov2au #opengov #innovationweek #govcamp #
  • . @1159 Heh :) Saw Tool in '97, still one of my favourite gigs ever. They covered Hurt too, double perfect! :) #
  • "See my shadow changing, stretching up and over me. Soften this old armour, hoping I can clear the way". Tool is helping me work today :) #
  • I love Linux. Some useful ffmpeg for converting and manipulating video/audio without having to open video editing suite http://t.co/uBGQ8dUn #
  • Have you registered for #GovHack yet? Over $30k in prize funding for awesome apps, mashups & datavis, so come get some! http://t.co/aXgjAzLL #
  • Wow. New Smashing Pumpkins, and surprisingly awesome. http://t.co/gHWBu29J #music #

May 13, 2012 12:00 AM

May 11, 2012

Craige McWhirter

How the Others View DVDs

AttachmentSize
GxzeV.jpg163.41 KB

This picture was interesting. Not having watched a DVD on anything other than Linux, it was truly eye opening to see what the media companies put those who don't use Free Software, the majority of the population, through. What's more amazing is that people accept this:

Thanks Bruce!

Blog topics: 

May 11, 2012 10:45 AM

Sonia Hamilton

Learning Clojure – my books

I’ve been playing with Lisp and now Clojure for a couple of years now. Here’s a list of the books I’ve read on my journey to Clojure enlightenment (I’ve still got a long way to go…).

Land of Lisp

 

 

My first Clojure book wasn’t even about Clojure, it was about Lisp! One Sunday afternoon I was lurking in the computer section of a local bookshop (a great way to spend a Sunday afternoon), and came across Land of Lisp.  I’d heard about Lisp, that “obsolete” language that used to be used for Artificial Intelligence but who uses it nowadays? Anyway, the cover was colourful and the cartoons were great, and before I knew it I’d read a couple of chapters and wanted to know about this Lisp stuff and I bought the book.

 

 

SICP book

 

 

But after reading it for a while and getting sidetracked by Scheme and the greatest book every written about programming, Land of Lisp languished on my bookshelf. The example used in the book (yet another game) didn’t relate to my day-to-day use of programming. I was getting lost because I wasn’t doing any exercises, and Lisp just didn’t seem to be an acceptable Lisp.

 

 

Seven Languages in Seven Weeks

 

 

Seven Languages in Seven Weeks pointed me towards Erlang, Haskell and Clojure. Ah-hah! Clojure – runs on the JVM (so I can use it machines where I can’t/don’t want to install stuff, just like JRuby). A modern Lisp with cleaned up syntax that has access to all the Java libraries for doing real world stuff. I’m hooked!

 

 

The Joy of Clojure

 

 

At a Ruby on Rails Oceania (RORO) meetup someone was raving about The Joy of Clojure. So I drank from the firehose and my brain exploded and nothing made sense. As Steve Yegge (a fellow Googler) says in the intro, “you’ll learn fast” – but only if you’re already comfortable with Lisp. The book moves too fast, the explanations are cryptic, and it seems to bounce all over the place. Another book to languish on my book shelf.

 

 

Practical Clojure

 

 

My next book Practical Clojure was where things started to make sense. It’s more directed at beginners and just explains how the language works. But it’s a thin book (not enough detail) and some sections just seem to be reprints of the API (function foo does this and here’s a 5 line example; function bar does this and here’s a 5 line example). No real digging into the how and why of using Clojure.

 

 

Clojure Programming

 

 

And onto my favourite Clojure book – Clojure Programming by Emerick et al. Like many O’Reilly books it’s definitive. Lots of detailed examples, clear explanations, great diagrams, coverage of related areas (eg Clojure for web programming). Example code comparing how you do things in Clojure with other languages (Java, Python, Ruby). This is the book where I’ve really started to understand Clojure.

 

 

On Lisp

 

 

Now I’m working through the 4clojure problem list (really interesting). Then I’ll probably buy some more books from The Clojure Bookshelf. And continue reading Paul Graham’s On Lisp (I got it printed through Lulu). And one day I’ll reach enlightenment :-)

 

 

 

Lisp

May 11, 2012 10:06 AM

May 09, 2012

Sridhar Dhanapalan's hackergotchi

Sridhar Dhanapalan

Twitter Weekly Updates for 2012-05-09

  • moved to new flat, bought furniture and appliances, set up utilities, got engaged, enrolled at uni, went to jury service… all in 2 weeks! #
  • $11.7m for OLPC Australia in the federal govt budget! Huzzah! http://t.co/zgmqAnMP #

May 09, 2012 06:15 AM

May 08, 2012

Craige McWhirter

TasLUG (Hobart) May Meeting has Been Announced

TasLUG have announced the details for this month's meeting:

When: Wednesday, May 16th
Time: 18:00 for an 18:30 start
Venue: 57F Brisbane St, Hobart

Agenda:

  • Welcome!
  • New venue Review / Discussion
  • Statewide Meeting Review / Discussion
  • Distro Wars!
    Line up and give us 10 minutes on your favourite distro framed around:
    • What's the target audience / usage
    • What makes it rock
    • What could be done better
    • Current Talks:
  • Decide on what we'd like Karl to talk on in June:
    • Debian (random stuff, requests?)
    • Gnewsense (DIY ubuntu/debian derivative, requests?)
    • ITShare (computer refurbishing)
    • ITShare's work in Papua new guinea, or 'stuff' about Goroka/PNG
    • Issues from running the computers of an NGO (The Hut community centre)
    • Any other things? By request ;)
  • General Questions Session
  • Call for talks
  • Next Meeting?
  • add something else here!

Coming Attractions:

  • June: Karl will be talking on what we request :)
  • July: Julius will be giving a system administrator's over view of ZFS.
Blog topics: 

May 08, 2012 01:12 PM

May 07, 2012

James Polley

If you’re going to compare Terms of Service, kindly do so based on facts.

ObDisc: I used to work for Google. I still have lots of friends at Google. I have a bias towards trusting Google that’s largely based on knowing people who work there and trusting them personally. I pay money for many Google services – several Apps domains, for instance. I am also a paying customer of both Dropbox and iCloud.

I had thought that the nonsense about Google’s Terms of Service and their impact on Google Drive was dead with Nilay Patel‘s comprehensive summary of Dropbox, Skydrive, Google Drive, and iCloud Terms of Service, but then I saw this tweet and realised that the nonsense is continuing. The article linked (published on Trend Micro’s “Cloud Security” blog) to was written on the same day as Nilay’s piece, so it’s not new – but apparently this nonsense is still being spread.

Trend Micro also have a similar service, called Safe Sync. In the footnotes below, I’ve included (as well as the comparison from Nilay’s article) the equivalent sections from Safe Sync’s own EULA for you to compare.

All of these Terms are fairly standard. Amongst their many similarities, each of them has a “You retain ownership” clause[1], and a “You grant us the right to” clause[2]. [3]

Without exception, every bit of FUD I’ve seen has been predicated around comparing the “You retain ownership” clauses from the other services with Google’s “You grant us the right to” clause. Today’s bit of nonsense does exactly the same thing: it lists the “You retain ownership” clauses from Skydrive and Dropbox against the “You grant us rights” clause from Google. This one goes one step further though: it first argues that the “You retain ownership” clauses in the other Terms are vital for establishing a Reasonable Expectation of Privacy under US law; then makes the explicit claim that Google’s terms destroy any argument that content uploaded to your cloud storage service has a reasonable expectation of privacy – implying (although never actually stating) that Google’s Terms, unlike the others, lack the vital “You retain ownership” clause.

Utter nonsense.

It’s quite possible that not having a “You retain ownership” clause might have consequences on a Reasonable Expectation of Privacy; but as Google’s Terms are equivalent to the others, this would apply equally to the other services. I don’t see how this could arise from a genuinely mistaken reading of Google’s Terms, either: the “You retain ownership” clause is quite literally in the previous sentence to the one quoted in the Trend Micro article – I don’t see how any honest attempt at understanding the Terms could miss the clause. I don’t see how this can be anything other than a deliberate attempt to create FUD.

The Trend Micro ends with a plug for their own product. The penultimate sentence says:

Here’s hoping the EFF shames Google into at least being less evil.

Good news! Ars Technica got in touch with the EFF and asked them to read over Google’s policy.. Was the result the shaming that Trend Micro were hoping would be bestowed on their competitors?

When Ars spoke to the Electronic Frontier Foundation about Google Drive’s terms of service, the EFF found little about them that was more suspicious than in any other similar cloud service.

I’m sure that Google is indeed positively burning with shame.

Edited to add: Just to be clear, I’m not intending to imply that there is no reason to be concerned about putting your private data on any of these services. Any time you decided to use any of these services (or any cloud Webmail service, or an online photo sharing site, or a social network…) you need to carefully balance the utility you get from the service against the very real privacy and security issues associated with the service. However, these decisions need to be based on *facts*: what the relevant Terms and Policies actually say. Spreading FUD about the contents of the policies doesn’t help anyone make a decision about which services to use (or not to use).


[1]
Google Drive
Some of our Services allow you to submit content. You retain ownership of any intellectual property rights that you hold in that content. In short, what belongs to you stays yours.
Dropbox
By using our Services you provide us with information, files, and folders that you submit to Dropbox (together, “your stuff”). You retain full ownership to your stuff. We don’t claim any ownership to any of it.
Skydrive
Except for material that we license to you, we don’t claim ownership of the content you provide on the service. Your content remains your content
iCloud
Except for material we may license to you, Apple does not claim ownership of the materials and/or Content you submit or make available on the Service
SafeSync
You are the owner of your files and are solely responsible
for your conduct and content of your files, as well as any of the content contained in communications with other
users of the Trend Micro Products/Services.
<snip>
Trend Micro does not claim any ownership rights
in your files.

[2]

Google Drive
you give Google (and those we work with) a worldwide license to use, host, store, reproduce, modify, create derivative works (such as those resulting from translations, adaptations or other changes we make so that your content works better with our Services), communicate, publish, publicly perform, publicly display and distribute such content. The rights you grant in this license are for the limited purpose of operating, promoting, and improving our Services, and to develop new ones.
Dropbox
We may need your permission to do things you ask us to do with your stuff, for example, hosting your files, or sharing them at your direction. This includes product features visible to you, for example, image thumbnails or document previews. It also includes design choices we make to technically administer our Services, for example, how we redundantly backup data to keep it safe. You give us the permissions we need to do those things solely to provide the Services.
Skydrive
You understand that Microsoft may need, and you hereby grant Microsoft the right, to use, modify, adapt, reproduce, distribute, and display content posted on the service solely to the extent necessary to provide the service.
iCloud
you grant Apple a worldwide, royalty-free, non-exclusive license to use, distribute, reproduce, modify, adapt, publish, translate, publicly perform and publicly display such Content on the Service solely for the purpose for which such Content was submitted or made available, without any compensation or obligation to you.
<snip>
You understand that in order to provide the Service and make your Content available thereon, Apple may transmit your Content across various public networks, in various media, and modify or change your Content to comply with technical requirements of connecting networks or devices or computers. You agree that the license herein permits Apple to take any such actions.
SafeSync
In order to make the Trend Micro Products/Services available to you, you agree to grant Trend Micro a limited, nonexclusive, perpetual, fully-paid and royalty-free, sub-licensable and worldwide license: (i) to use, copy, transmit, distribute, store and cache files that you choose to sync; and (ii) to copy, transmit, publish, and distribute to others the files as you designate

[3]All of the service have Privacy Policys which modify the Terms of Service in various ways. It’s interesting comparing these too.

  • Google’s Privacy Policy mostly limits what they can do with the rights you’ve granted them under the ToS. For instance, although the Terms of Service require that you grant Google the right to use your data for “the limited purpose of … promoting … our Services”, the Privacy Policy seems to restrict Google’s ability to actually do this – as far as I can tell, only data you have expressly chosen to make world-visible could ever be used in this way.
  • Dropbox’ Privacy Policy, by contrast, greatly *expands* the rights Dropbox have. For instance, the Terms say that “aside from the rare exceptions we identify in our Privacy Policy, no matter how the Services change, we won’t share your content with … law enforcement, for any purpose unless you direct us to”. On the surface, this seems much more restricted than Google’s equivalent terms – until you find this in the Privacy Policy: We may disclose to parties outside Dropbox files stored in your Dropbox and information about you that we collect when we have a good faith belief that disclosure is reasonably necessary to (a) comply with a law, regulation or compulsory legal request. In short, despite the misleading wording in the Terms, Dropbox can and will share your data with law enforcement just as readily as any other corporation.

May 07, 2012 11:03 AM

May 06, 2012

Pia Waugh's hackergotchi

Pia Waugh

Twitter Weekly Updates for 2012-05-06

May 06, 2012 12:00 AM

May 04, 2012

James Polley

Precise Pangolin install hints

My desktop at work is a Dell Precision T5500 - a fairly standard desktop, you’d think. My video card is an NVIDIA Quadro FX 580.

I recently spent most of 3 days trying to upgrade from Lucid to Pangolin. I’m not going to bore you with the details, but here are some things I wish I’d known.

  • I have two monitors, one on each of the DisplayPort outputs. The LiveCD will not use either of them *unless you have a third monitor plugged in to the DVI port*. My monitors happen to be able to handle Picture-by-Picture, so I can actually make one of them track both the DisplayPort and DVI inputs, which comes in handy.
  • Although the installer can use the graphics card just fine, the system it installs by default is broken. At the very first part of the installer (a purple screen with a keyboard and a human – at least, I think that’s what those two fuzzy blobs are meant to be), press any key. You’ll be asked to choose a language, then you’ll get a menu with options like “Try Ubuntu without installing” and “Install Ubuntu”. Press F6, arrow-down to “nomodeset”, and press x to activate it. This makes no difference at all to the installer, but does result in it installing a system that can use your graphics card later.
  • This part of the installer uses the DVI input to your monitor. Take the time to set up Picture-by-Picture so you can track the install as it flips back and forth between DVI and DisplayPort throughout the rest of the process.
  • Now choose “Try Ubuntu without installing”. Despite the misleading name, this gives you a chance to set your system up before running the installer.
  • The installer may now switch from DVI to DisplayPort, but then again, sometimes it won’t. Be glad you set up PbP so you can catch it wherever it appears. If it’s on DisplayPort, you probably didn’t set nomodeset correctly. Don’t waste your time continuing with the installer, even though it seems to be working fine – just restart it.
  • The standard LiveCD does not support LVM, so will not handle the LVM partitions already on your desktop (you do use LVM, right?). You can switch to a terminal by pressing alt+F1, and then:
    • sudo apt-get install lvm2
    • sudo vgchange -ay

    You can then use alt+F7 to get back to the GUI and kick off the installer.

  • The installer doesn’t seem to be able to cope with existing swap partitions – at least, not when you have several swap partitions. It does amusing things like popping up modal dialogs to tell you that creating the swap space failed – and then doesn’t let you dismiss the dialog, so your only option is a hard power-down. Don’t waste your time, just tell the partitioner not to use any swap partitions at all.
  • If you choose to use encrypted homedirs, the process that creates the homedirs assumes you have at least one swap partition. Because you’ve had to choose not to use any swap partitions, this will fail – but it does so in a recoverable way. Just use alt+F1 again, “sudo swapon /dev/sdXY”, (assuming that /dev/sdXY is your swap partition), then switch back to the GUI and click “Try Again” on the installer.
  • When you’re setting up your partitions, you will be asked to choose a device for boot loader installation. Choose your hard drive, not your USB stick. Near the end of the installer, sometimes the installer will try to install grub on the USB stick anyway. This will fail, but you will get the chance to pick another partition to install GRUB to. Pick your actual hard drive again.
  • If you cancel the installer, it will think something went wrong and ask if you want to send a message with details to Ubuntu developers. If you cancel this, the window never dies. If you start the installer again, it will eventually reach a point where it’s blocked waiting for the original window to go away. Switch back to the console and use “kill $(ps auxwww | grep [a]pport)” to terminate the original process.
  • Even though you’ve manually installed lvm2 and are installing onto LVM, ubuntu won’t bother installing LVM into the system it creates. Make sure you follow step 7 of this guide before you reboot. If you forget, you can always boot up the LiveCD again and run through this step.

Edited to add: One more tip: Once you’re done, unplug the DVI cable. If you leave it plugged in, a reboot will see the system using the DVI output and ignoring the two DisplayPort outputs again. If I ever do a reboot and the screens go to sleep, I’m going to try plugging in the DVI cable again. The system really seems to love that DVI output.

May 04, 2012 01:50 AM

May 02, 2012

Andrew Cowie's hackergotchi

Andrew Cowie

Upgrading to Precise

The latest release of Ubuntu, version 12.04 aka Precise, has a lot of updates we’ve been waiting on for a while — GNOME 3.4, Haskell 7.4.1, and a huge stack of bugfixes. On the desktop side, quite a number of Linux kernel vs X video modes vs suspend glitches have gone away. That’s fantastic. During most of Oneiric, my laptop was freezing and needing a hard reset at least once a day. Tedious. So I’m quite pleased to report that running Precise, Linux 3.2, gdm, and GNOME 3.4, things are vastly more stable.

Getting upgraded to Precise, however, has not been a pleasant experience.

First we’ve had unattended-upgrades overwriting any configuration stating “no automatic upgrades”. The number of non-technical friends who were set to “security updates only” calling in wondering why a “big upgrade” happened and now their computers don’t work has been staggering. Needless to say we nuked unattended-upgrades from all of our systems a hurry, but for those people it was already too late.

Several desktop upgrades failed half-way through because dpkg suddenly had unresolved symbol errors. Fortunately I was able to work out the missing library binary and manually copy it in from another machine, which was enough to get package system working. Hardly auspicious.

Server side was fraught with difficulty. You cannot yet upgrade from Lucid to Precise. It breaks horribly.

E: Could not perform immediate configuration on 'python-minimal'. Please
see man 5 apt.conf under APT::Immediate-Configure for details. (2)

Brutal. I tried working around it on one system by manually using dpkg, but that just led me into recursive dependency hell:

# cd /var/cache/apt/archvies
# dpkg -r libc6-i686
# dpkg -i libc6_2.15-0ubuntu10_i386.deb
# dpkg -i libc-bin_2.15-0ubuntu10_i386.deb
# dpkg -i multiarch-support_2.15-0ubuntu10_i386.deb
# dpkg -i xz-utils_5.1.1alpha+20110809-3_i386.deb
# dpkg -i liblzma5_5.1.1alpha+20110809-3_i386.deb
# dpkg -i dpkg_1.16.1.2ubuntu7_i386.deb
# apt-get dist-upgrade

Huh. That actually worked on one system. But not on another. Still slammed into the python-minimal failure. For that machine I couldn’t mess around, so I had to give up and did a re-install from scratch. That’s not always feasible and certainly isn’t desirable; if I wanted to be blowing systems away all the time and re-installing them I’d be running Red Hat.

Anyway, I then located this bug about being unable to upgrade (what the hell kind of QA did these people do before “releasing”?) where, very helpfully, Stefano Rivera suggested a magic incantation that gets you past this:

# apt-get install -o APT::Immediate-Configure=false -f apt python-minimal
# apt-get dist-upgrade

(I had tried something very close to this, but didn’t think of doing both apt and python-minimal. Also, it hadn’t occurred to me to use -f. Ahh. For some reason one always sees apt-get -f install not apt-get -f install whatever-package-name).

Ta-da.

AfC

May 02, 2012 02:21 AM

April 29, 2012

Pia Waugh's hackergotchi

Pia Waugh

Twitter Weekly Updates for 2012-04-29

  • Turns out the Tea Party have a bunch of txt for pre-sale, so I'm in ! Am going with teh awesome @alexmyoung :) http://t.co/NRp9JbIE YAY! #
  • Gar, no @blackdogride for me, had to pull out due to stupid circumstances. Was *really* looking fwd to it! Will make up for it next weekend! #
  • YES! Will be logging on tomorrow to snag txts to Tea Party, who's with me?!? (Sydney Show) http://t.co/29Faqag9 #
  • Getting ready for @blackdogride Canberra! Very excited :) It's a beautiful day for some motorbike riding! #needcaffeine #
  • Just to ruin your afternoon productivity http://t.co/oxqi3ZYP "Dance magic dance!" #
  • Reading Lawrence Review of Australian #geospatial capability & gov response. Interesting stuff! Vital for #gov2au http://t.co/v0WNJLF3 #
  • Was there anything to it? RT @GeordieGuy: Meeting derailed while security guy goes on a five minute incomprehensible rant. ????? #
  • Walking past a closing restaurant which has the Labyrinth soundtrack on. So awesome. #
  • Hilarious. "President of the United Sates (sic) Barack Obama & Campbell High Students". No one else? OurCity mag :) http://t.co/uTK7hkr2 #
  • Have officially shifted from NSW @blackdogride to ACT. Sorry to NSW friends, but excited about ACT ride! :) http://t.co/dn2XpFo1 #
  • .@cgiffard maybe… next weekend, not this one? Who else would be up for a movie night to watch The Raid? :) #
  • Tasking some time out from an intense day! Some Shank 2 to chill :) Such a fun but simple game! #
  • Have been flat out all day today, between contract work and #govhack #govcamp preparation. Both launching Monday! :) #gov2au Very excited! #
  • Thanks all, mystery solved :) @timClicks: @nzfi @piawaugh feijoa, yum! see http://t.co/Rk0siHD1 #
  • It kills me to say but I may have to switch to ACT @blackdogride. Too many deadlines pressing in :/ @hollingsworth @moldor @MrsMoldor @Rog42 #
  • Does anyone know what this is? Fruit (?) tree where I live http://t.co/Xiz9W0qT #
  • Really looking toward to @blackdogride this weekend, just me, the open road, and a few hundred other bikes :) #shortholidayforagoodcause #
  • I know lots of you will know this, but handy way to get RSS from Twitter http://t.co/ZseB9Scw Just switch my username with yours :) #
  • Hey guys, sry I've been flat out. @moldor could you dm me phone number to coord meet spots. I've a long way to come beforehand :) /cc @Rog42 #
  • YES! RT :) @kelisha: @piawaugh damn, now I'm going to have to watch it!! LOL #
  • Yes! RT @peenydeeny: @piawaugh the start of Wayne's World , with Bohemian Rhapsody is one of the best happytime moments in cinema :-) #
  • Totally! :) RT @timl: There is so much awesome & references I'd not noticed before! Like this part, 2nd Mission Impossible reference so far! #
  • MWAH HAHAHA! Watching Wayne's World for the first time in years, had totally forgotten the Terminator cameo. "Have you seen this boy?" LOL! #

April 29, 2012 12:00 AM

Twitter Weekly Updates for 2012-04-29

  • Turns out the Tea Party have a bunch of txt for pre-sale, so I'm in ! Am going with teh awesome @alexmyoung :) http://t.co/NRp9JbIE YAY! #
  • Gar, no @blackdogride for me, had to pull out due to stupid circumstances. Was *really* looking fwd to it! Will make up for it next weekend! #
  • YES! Will be logging on tomorrow to snag txts to Tea Party, who's with me?!? (Sydney Show) http://t.co/29Faqag9 #
  • Getting ready for @blackdogride Canberra! Very excited :) It's a beautiful day for some motorbike riding! #needcaffeine #
  • Just to ruin your afternoon productivity http://t.co/oxqi3ZYP "Dance magic dance!" #
  • Reading Lawrence Review of Australian #geospatial capability & gov response. Interesting stuff! Vital for #gov2au http://t.co/v0WNJLF3 #
  • Was there anything to it? RT @GeordieGuy: Meeting derailed while security guy goes on a five minute incomprehensible rant. ????? #
  • Walking past a closing restaurant which has the Labyrinth soundtrack on. So awesome. #
  • Hilarious. "President of the United Sates (sic) Barack Obama & Campbell High Students". No one else? OurCity mag :) http://t.co/uTK7hkr2 #
  • Have officially shifted from NSW @blackdogride to ACT. Sorry to NSW friends, but excited about ACT ride! :) http://t.co/dn2XpFo1 #
  • .@cgiffard maybe… next weekend, not this one? Who else would be up for a movie night to watch The Raid? :) #
  • Tasking some time out from an intense day! Some Shank 2 to chill :) Such a fun but simple game! #
  • Have been flat out all day today, between contract work and #govhack #govcamp preparation. Both launching Monday! :) #gov2au Very excited! #
  • Thanks all, mystery solved :) @timClicks: @nzfi @piawaugh feijoa, yum! see http://t.co/Rk0siHD1 #
  • It kills me to say but I may have to switch to ACT @blackdogride. Too many deadlines pressing in :/ @hollingsworth @moldor @MrsMoldor @Rog42 #
  • Does anyone know what this is? Fruit (?) tree where I live http://t.co/Xiz9W0qT #
  • Really looking toward to @blackdogride this weekend, just me, the open road, and a few hundred other bikes :) #shortholidayforagoodcause #
  • I know lots of you will know this, but handy way to get RSS from Twitter http://t.co/ZseB9Scw Just switch my username with yours :) #
  • Hey guys, sry I've been flat out. @moldor could you dm me phone number to coord meet spots. I've a long way to come beforehand :) /cc @Rog42 #
  • YES! RT :) @kelisha: @piawaugh damn, now I'm going to have to watch it!! LOL #
  • Yes! RT @peenydeeny: @piawaugh the start of Wayne's World , with Bohemian Rhapsody is one of the best happytime moments in cinema :-) #
  • Totally! :) RT @timl: There is so much awesome & references I'd not noticed before! Like this part, 2nd Mission Impossible reference so far! #
  • MWAH HAHAHA! Watching Wayne's World for the first time in years, had totally forgotten the Terminator cameo. "Have you seen this boy?" LOL! #

April 29, 2012 12:00 AM

April 28, 2012

Craige McWhirter

Freedom From Choice

At today's statewide meeting of the Tasmanian Linux Users Group a little distro wardiscussion broke out (sorry!) which quickly diverged into "WTF is with Unity/GNOME3" etc. I made the point that while I choose to use Enlightenment on Debian, I think that the direction that GNOME3/Unity are heading in is spot on for mass as adoption, if everyone hasn't moved to some cloud paradigm before we finish :)

My primary argument was that Devo had it right in Freedom of Choice with lines like "Freedom of choice, is what you've got. Freedom from choice, is what you want".

This video is for those who smiled in recognition, those who stared blankly at the reference and for those who like rollerball, Roman role play and bad costume aliens in their music videos...

Blog topics: 

April 28, 2012 03:08 PM

TasLUG...Striding Into the Future

I had a great deal of pleasure meeting a stack of Freedom Lovers from across Tasmania today at the Ross Town Hall in the Tasmanian Midlands. Josh had scored us a surprisingly well fitted out venue that we might well end up using in the future again.

The venue was in the middle of Tassie, so as to equally inconvenience everyone ;) but it was a beautiful colonial town with good food, great scenery and a damn fine venue (did I mention I liked it?).

View TasLUG Statewide Gathering 2012 in a larger map

Thomas proved himself a dab hand at minute taking and posted some minutes here. The main thrust though is that we're going to poll the TasLUG community to determine which of the structures, if any, are appropriate for the community going forward. The meeting appointed a steering committee (see minutes) to publish the three proposed options and the pros/cons related to each so that everyone can be as informed as possible about which direction they'd prefer us too take.

There's also some enthusiasm around holding a Software Freedom Day event in Hobart to complement the one already being hosted successfully in Launceston and in having further statewide meetups, which would be just brilliant, IMHO :)

April 28, 2012 12:50 PM

April 27, 2012

Craige McWhirter

Mormon Flow Chart for Your Soul

It's a guilty pleasure poking fun at the superstitions of religious folk and I do try to restrain myself but here's a classic post that provides a Mormon flow chart for your soul.

Guaranteed to have you snorting in your cereal. I've posted an excerpt below, click through for the whole thing. Spoiler alert for the religious:

I like jwz's idea of turning this into a board game....

AttachmentSize
Sample of the Mormon Soul Flowchart48.37 KB

April 27, 2012 10:49 PM

April Statewide TasLUG Gathering

As announced here on the TasLUG website, tomorrow is the state-wide Tasmanian Linux users meetup.

So come along Freedom Lovers and catch-up with some like-minded Freedom enthusiasts here in Tassie and participate in the decision making around the direction TasLUG will take over the next few years! The details in brief are:

Saturday April 28th
Ross Town Hall

  • 12:00pm - 2:00pm: Mill around, get to know each other, show off any gear/projects we may have brought with us
  • 2:00pm - 3:30pm: Meeting (covering voting on an organisational structure for TasLUG, maybe discussing SFD 2012 and anything else that gets raised),
  • 3:30pm - 4:00pm: Pack up
  • 4:00pm onwards: Go home/BBQ/whatever anybody is up for
    • Google Maps link

      The rough agenda we have for the meeting part is:

      • TasLUG Organisational Structure Vote (and nominate some people to move us forward in whatever direction we end up going)
      • SFD Planning
      • Next Year's Meetup,

      For more complete details, go here for the full announcement

Blog topics: 

April 27, 2012 06:18 AM

April 26, 2012

Sonia Hamilton

Vim Buffers Cheatsheet

A small Vim Buffers cheatsheet:

:bu <tab>    - select a buffer
:buN         - select buffer N
:ls          - list buffers
:sb tab      - split screen on another buffer
:sbN         - split screen on buffer N
:only        - make this the only buffer (ie maximise)
^w^o         - make this the only buffer (ie maximise)
:ball        - split screen on all buffers
:hide        - hide this buffer
:bdel        - remove buffer from list

Vim buffers don’t seem as flexible as the Emacs equivalent, but then nothing is as flexible as Emacs:

Xkcd Emacs

http://xkcd.com/378/

April 26, 2012 05:28 AM

April 24, 2012

Robert Collins

Less SPOFs: pyjunitxml, testscenarios

I’ve made the Testtools committers team own both the project and the trunk branch for both pyjunitxml and testscenarios. This removes me as a SPOF if anything needs doing in those projects – any Testtools committer can now do it. (Including code review and landing). If you are a testtools committer and need PyPI release rights, ping me and I’ll add you. (I wish PyPI had group management).


April 24, 2012 05:08 AM

April 22, 2012

Robert Collins

Reading list

I’ve recently caught up on a bunch of reading some of which are worth commending.

  • Switch – documents the factors that cause changes to fail  (both in organisations and personal stuff), and provides a recipe for ensuring you have addressed those factors in any change you are planning.
  • The Lean Startup – Applies Lean principles to the learning what customers respond well to – in the same way that Lean removes waste from the process of building some X, this removes waste from the process of determining what that X should be.
  • The Innovator’s Solution – Pop science report of research done on why disruptive innovation at existing companies fails; covers structure, management, funding, market analysis, has recommendations to remove these sure-fail cases.
  • The Innovator’s DNA – Pop science report of research done into how people innovate : turns out that there are a lot of things that one can do to be a better innovator.

Read them all, or none. I enjoyed them all.


April 22, 2012 04:08 AM

Pia Waugh's hackergotchi

Pia Waugh

Twitter Weekly Updates for 2012-04-22

  • Heh, interesting RT @greenat16: Does God exist? 77.2% of the voters got it wrong http://t.co/LanNnhPO #
  • So who else is stuck at Melbourne atm? :) 3 hours and counting, rearranging flights now. Fog fog fog. #
  • Interesting RT @mashable: Will This Open-Source Animated Film Change the Movie Industry Forever? http://t.co/x83abWdx #
  • "Got a letter from a messenger, I read it when it came". Ah Tea Party, such a great start to the morning. #webdevel #
  • Filling faster now. Hai :) RT @Simbera: FWIW, I am at #wladd it's due to start and the place is less than half full #
  • . @woolfe Hah! I didn't say pure evil. I don't deal on extremes (or good/evil for that matter) :P @wombat1974 @mikestuchbery #
  • . @wombat1974 the problem is where greed is systematic, eg,stockmarket. Individual greed rarely so destructive. /cc @mikestuchbery @woolfe #
  • . @wombat1974 Hah, terminators eh? Where "babysitting" is quite literal? I think enlightened self interest is good ;) @mikestuchbery @woolfe #
  • Haaaa hahaha RT @peterbayley: @_Pandy @PETA @piawaugh #EFFOFF Smart Arse ;) #
  • . @kattekrab is truly one of my favourite ppl :) Also, am working on migrating a Dreamweaver site to WordPress. My brain hurts. #
  • I for 1 welcome our new overlords MT @mikestuchbery: In short the sooner Earth is quarantined by biomechanical alien peacekeepers the better #
  • .@VirginMobileAus Thanks heaps. I can't dial the 1300555100 number and was gobsmacked by the (obv auto) email response. Will DM now. #
  • Really, REALLY cranky right now. #mobilecompaniesFAIL #

April 22, 2012 12:00 AM

Twitter Weekly Updates for 2012-04-22

  • Heh, interesting RT @greenat16: Does God exist? 77.2% of the voters got it wrong http://t.co/LanNnhPO #
  • So who else is stuck at Melbourne atm? :) 3 hours and counting, rearranging flights now. Fog fog fog. #
  • Interesting RT @mashable: Will This Open-Source Animated Film Change the Movie Industry Forever? http://t.co/x83abWdx #
  • "Got a letter from a messenger, I read it when it came". Ah Tea Party, such a great start to the morning. #webdevel #
  • Filling faster now. Hai :) RT @Simbera: FWIW, I am at #wladd it's due to start and the place is less than half full #
  • . @woolfe Hah! I didn't say pure evil. I don't deal on extremes (or good/evil for that matter) :P @wombat1974 @mikestuchbery #
  • . @wombat1974 the problem is where greed is systematic, eg,stockmarket. Individual greed rarely so destructive. /cc @mikestuchbery @woolfe #
  • . @wombat1974 Hah, terminators eh? Where "babysitting" is quite literal? I think enlightened self interest is good ;) @mikestuchbery @woolfe #
  • Haaaa hahaha RT @peterbayley: @_Pandy @PETA @piawaugh #EFFOFF Smart Arse ;) #
  • . @kattekrab is truly one of my favourite ppl :) Also, am working on migrating a Dreamweaver site to WordPress. My brain hurts. #
  • I for 1 welcome our new overlords MT @mikestuchbery: In short the sooner Earth is quarantined by biomechanical alien peacekeepers the better #
  • .@VirginMobileAus Thanks heaps. I can't dial the 1300555100 number and was gobsmacked by the (obv auto) email response. Will DM now. #
  • Really, REALLY cranky right now. #mobilecompaniesFAIL #

April 22, 2012 12:00 AM

April 17, 2012

Craige McWhirter

Keeping In Touch With TasLUG

TasLUG has a bit a of a split community communication arrangement. They have both a mailing list and web forums. It's a situation the community is working to rectify but in the interim, as a new member who wants to contribute as much as possible and keep in touch, here are the methods I use to keep up with the split mailing list / forum arrangement with as little effort as possible:

Hopefully this helps you keep in touch with TasLUG too :)

Blog topics: 

April 17, 2012 12:17 PM

April 15, 2012

Pia Waugh's hackergotchi

Pia Waugh

Twitter Weekly Updates for 2012-04-15

  • It's my own fault. I should have obviously provided more whiteboard :) The 2.5 yr old got creative. #babysittinglessons http://t.co/bQ6YTikH #
  • . @MrsMoldor @moldor YAY! :) I hope you can organise one, it'd be great to meet you both in meatspace ("IRL" is stupid, this *is* RL!) #
  • .@TimDLittle I don't think it is that simple. Brands simply aren't as manageable these days, better to have connected workforce /cc @donkey #
  • Ben 10 is awesome, I completely understand it having a significant following :) Spider Monkey! #
  • .@donkey I've heard of employers (in the US, of course) asking for all social media passwords as a condition of employment. #securitytheatre #
  • Currently browsing the AGIMO Gov 2.0 Register, some interesting stuff http://t.co/d7k0Z4hs #gov2au #opengov #gov20 #
  • We've got some initial info & regos open for #govhack #govcamp & #govjam in June. Details coming soon! http://t.co/QBUULzzN #gov2au #
  • Ok, Canberra peeps, anyone got a responsible teenager who can babysit two lovey girls Friday night for some cash? Please DM me :) #
  • .@nearyd I know guy who did martial choreography, inc dual pole for gandalf & dwarves axe styles. Exciting! He's an amazing dude :) #hobbit #
  • I feel I should share for ppl considering attending Shen Yun, I found it pretty awful. I walked out. #justsayin #
  • Just met dissatisfied girl working in a beauty salon. Through the conversation she is now super keen to do computer forensics. Awesome :) #
  • Got a friend who is looking at ways to assess "openness" of technologies. I wrote this a few years ago, still useful :) http://t.co/HuItxm4M #
  • Nah, that's just silly ;) sudo is enough kthxbai RT @Zemmiph0bia: True love is giving your partner root access #
  • Every country tries this at least once RT @rtaibah: Iran plans to unplug the Internet, launch its own "clean" alt http://t.co/lOEx8yEH #
  • .@MrsMoldor Awww! Please come too! Would be awesome to meet you, and we could pay out on @moldor together ;) /cc @Rog42 @hollingsworth #
  • .@cgiffard @peter_tonoli @xtfer Heh, totally! I've taught loads of workshops to kids by cracking a computer open, it never fails to amuse :) #
  • .@johnallsopp I wasn't allowed a gaming console in my house. <violins=tiny> /cc @_chesty_ @csimps0n @davidramli #
  • .@peter_tonoli @cgiffard Heh :) Well one floppy loaded the OS, and the other was for loading programs :) #
  • .@cgiffard Hah! :) I initially used a dual 5 1/4 inch disk drive computer, no hard disk, don't remember the CPU :) #
  • .@csimps0n Pentium 4s! I remember when I realised 2 slots on front of my PC weren't enough to show a *3* digit CPU speed ;) /cc @davidramli #
  • .@Davidramli @csimps0n "vinyl, bah! I remember when we made punchcards by hand w rusty hole punchers by candlelight, a UPS to keep us warm!" #
  • "I am alive" game review, fun, challenging, good story but finished in 6 hrs gameplay :/ #
  • Gar, tweet vs DM just bit me for the first time :) #

April 15, 2012 12:00 AM

April 13, 2012

Craige McWhirter

TasLUG (South) - April Meetup!

TasLUG are happy to confirm that the April TasLUG (South) meeting is all systems GO for April!

When: Wednesday, April 18th
Time: 18:00 for an 18:30 start
Venue: 57F Brisbane St, Hobart (map)

Agenda:

  • Welcome!
  • Dale will be speaking about Drupal using his redesign of the TasLUG website as an example.
  • Chris will be speaking about how Android works from the perspective of a Linux user
  • Any 5 minute talks
  • General Questions Session
  • Call for talks
  • Next Meeting?

See you then?

Blog topics: 

April 13, 2012 12:43 AM

April 11, 2012

James Purser's hackergotchi

James Purser

Brogrammers in the Wild

I know it's usually bad form to read the comments on an article, but I recommend you read these if you want to see the brogrammer in the wild.

If you don't want to dig through the dross, the article itself is about Etsy (that craft site that allows you to sell you crafty items) offering $5000 grants to women who might want to be involved in the Hacker School programme but can't afford to.

Now it's probably fair to say that a large portion of Etsy visitors are women so this isn't exactly something out of the ordinary, however it very quickly attracted the comments of those who view any attempt to help women as putting men down and upsetting the natural balance of the sexes.

I'd just like to say two things:

  • To those bitching about women or other "minority" groups getting assistance moving into industries that have been difficult to get into, grow a pair. Stop your whinging, welcome the diversity and move on. If this threatens you it says more about you than it says about the world in general
  • I'd love to see the time when there is no need for people to be incentivised to get into certain industries, when there isn't a culture that blocks people based on their gender or race. But that time isn't now. Sadly having your reproductive organs on the inside still means you have to deal with some pretty shocking behaviour.

Sigh.

April 11, 2012 11:58 PM

Wireless doesn't mean the death of the NBN

Sigh,

Yet another article running the line that because we're all moving to wireless devices (such as smartphones, tablets and laptops) the NBN is now about as useful as clay tablets.

Look, let me use our home as an example.

We have a number of different devices that use wireless:

1 x iPad 1

1 x Xoom

1 x Nexus S (smartphone)

1 x Huwei Android Phone (smartphone)

1 x iPod 3

The two tablets and the iPod are wireless only while the two smartphones are mobile data capable. I have data on the nexus S while the Huwei doesn't.

When they're in the house, all of those devices run off the wireless, which relies entirely on the ADSL2 connection (currently running at 5MBit/s). They do this because frankly, mobile data just isn't good enough to handle the sort of demands that we put on it.

Now we're probably not a "typical family" we tend to be early adopters and are heavy internet users (we're definitely moving towards the interwebs as our primary source of entertainment), however I think our use case is going to be more representative of the future than a mobile only existance.

The other thing is that wireless is different to mobile. Wireless in this context is generally supported by fixed internet, especially in the home or workplace. The NBN means that the wireless in my house becomes even more effective, while mobile is entirely dependent on the network built by the telcos and has to support so many more devices at the same time.

I'm probably not being super coherent (headache is headachy), but I'm really getting tired of people running the "wireless will kill the NBN" line without any idea of what they're talking about.

Blog Catagories: 

April 11, 2012 11:12 PM

Sridhar Dhanapalan's hackergotchi

Sridhar Dhanapalan

Twitter Weekly Updates for 2012-04-11

  • Music was better back when it was performed by talented people who could write, play and sing. #
  • Why raise something in conversation if you _don’t_ want to talk about it? #
  • Bombarded with pop/urban/rap music clips. I knew that the industry was mysogynistic, but OMG there is something seriously wrong with society #
  • I don’t want to see your underwear. Please for the love of god pull up your trousers. #
  • We’re selling out our children
    http://t.co/tdyHVyzN #

April 11, 2012 06:15 AM

April 04, 2012

James Purser's hackergotchi

James Purser

Clover Bad, Joanna Good?

So the Coalition government in New South Wales passed their "It's not really about Clover at all" legislation through the upper house last night. This legislation will make it verbotten for State Members of Parliament to hold both the office of MP and the office of Local Government Councillor at the same time.

The justification presented is that by occupying both roles the person is not able to give either job the attention that it deserves. Also it's somehow not fair that one person should be able to draw two wages (though lets be honest, what Councillors get for their efforts is pretty piddling unless they're the mayor of a major town).

However there is a slight fly in the ointment for the Coalition as it tries to present this as something for the good of the people of NSW.

That fly is one Joanna Gash. Joanna Gash is the current federal member for the seat of Gilmore (located on the south coast of NSW) however she has decided that she wants to stand down at the next election, sometime in 2013. In the mean time she wants to get more involved with local politics by running for Mayor in the September elections, and she wants to run without stepping down from her seat in federal parliament.

So Barry O'Farrell now has to justify why it's a bad thing for state mps to be councillors, but it's perfectly okay for federal mps'.

The latest reasoning that I've heard is that there might be some sort of constitutional issue preventing the state from legislating federal mps, however the only "constitutional issue" I can find is clause 4 of section 44 of the federal constitution that states:

Anyone who holds any office of profit under the Crown, or any pension payable during the pleasure of the Crown out of any of the revenues of the Commonwealth:

Is ineligable to hold federal office. However there is a bit of conjecture as to whether Local Government Councillors hold an office of profit under the Crown.

I've had a look in the NSW constitution and Section 51 is the bit that deals with Local Government and there is nothing in there that would prevent the State Government from banning federal mps from holding Councillor positions. In fact clause 2 explicitly states that:

The manner in which local government bodies are constituted and the nature and extent of their powers, authorities, duties and functions shall be as determined by or in accordance with laws of the Legislature.

Which to my non-lawyerly mind pretty much says "the State legislature can do what they want with local government". It's this clause that forms the foundation for much of the power that the State has over the Local Government sector.

Anyway the legislation is passed and Clover has already stated that she's going to be leaving Parliament in favour of remaining the Mayor of the City of Sydney. I'm not really sure what the Coalition thinks it's won with this, but there ya go.

Blog Catagories: 

April 04, 2012 11:48 AM

Sridhar Dhanapalan's hackergotchi

Sridhar Dhanapalan

Twitter Weekly Updates for 2012-04-04

  • “Love is like a lost fart, if you have to force it. It’s probably shit.” — Stephen K. Amos, Melbourne International Comedy Festival #

April 04, 2012 06:15 AM

April 02, 2012

Craige McWhirter

"War On Drugs" Epic Failure

You know things are really bad when the establishment comes out and states the obvious:

"The Foreign Affairs Minister, Bob Carr, is among a group of prominent Australians who have declared the 'war on drugs' a failure in the most significant challenge to drug laws in decades."

Hopefully we're one step closer to treating drugs as a health issue, not an alarmist political football.

What gave me a chuckle though was this line:

"The key as I see it is to try to reduce substantially the profit potentially able to be made by criminal activity in the drug trade and the only way to do that as I see it, ultimately, is to legalise, regulate, control and tax all drugs."

Nothing better than government regulation to kill profitability ;)

Blog topics: 

April 02, 2012 11:39 PM

James Purser's hackergotchi

James Purser

Xooming along

So I've finally acquired an android tablet to with my Android phone. I went down to my local ebgames yesterday and bought myself a Motorola Xoom. 

Of course the first thing I did was to root the thing and put ice cream sandwich on it. It's running smoothly so far and I'll be looking into what else I can do with it.

Blog Catagories: 

April 02, 2012 12:31 PM

March 30, 2012

Sridhar Dhanapalan's hackergotchi

Sridhar Dhanapalan

XO-AU OS 12.0 Release Candidate 2 released

Release Candidate 2 of the 2012 OLPC Australia operating system, XO-AU OS 12, has been released. We hope to make a final release in two weeks, in time for the start of term 2 of school in Queensland and Northern Territory.

To get started, visit our release notes page.

Installing the Release Candidate is no different from installing the XO-AU USB 3 stable release: extract the zip file to a USB stick and you’re ready to go.

The “What’s New” section outlines the changes in this release.

To provide feedback, please join our technical mailing list.

Following this, you can send your comments or ask questions on the list. The OLPC Australia Engineering team are active participants on this list, and we will reply. Remember, the better you can help us with quality information, the better we can make the product for you :)

March 30, 2012 11:18 AM

March 29, 2012

James Purser's hackergotchi

James Purser

10 years ago today

You know something?

Being my wife isn't an easy job. You have to put up with a lot.

  • I get angry with world
  • I get depressed
  • I'm not exactly the cleanest, most organised person in the world
  • I go off on tangents
  • I'm full of useless information that I like to talk about all the time
  • I keep fiddling with the tv and adding new things to it
  • I disagree on kids getting their ears piereced before they're 13
  • I don't suffer fools gladly
  • I can be hyperbolic
  • I take on the worries of the world
  • I get angry at the kids when they don't do what they're told

And so much more.

Karin, you are everything to me. You have provided us with two wonderful girls and have been a mother to all three of our children. You have been my confidant, my critic, my mentor and my friend. You have comforted me during the worst times of my life and helped me celebrate the best.

You are my all and everything and may we move into the future side by side for eternity.

March 29, 2012 09:38 PM

Sonia Hamilton

Ghostscript ImageMagick RHEL libgs.so errors

A little problem I came across today. When you install ImageMagick (IM) on RHEL (or OEL or similar), IM fails when converting pdfs. You can see the problem (libgs.so) by logging the output of IM. For example, here’s an attempted conversion of test.pdf to test.tif:

% convert -debug all -log "%u %m:%l %e" test.pdf test.tif 2>&1 | less

This gives errors like this:

0.000u module.c:1278 unable to load module `/usr/lib/ImageMagick-6.7.5/modules-Q16/coders/pdf.la': libgs.so.8: cannot open shared object file: No such file or directory

So, I downloaded and unpacked a RHEL ghostscript rpm – it turns out that the rpms have symlinks to libgs.so in the package, but no libgs.so :-(

/var/tmp/usr/lib # ls -al libgs.so*
lrwxrwxrwx 1 root root    13 Mar 28 20:41 libgs.so -> libgs.so.8.15
lrwxrwxrwx 1 root root    13 Mar 28 20:41 libgs.so.8 -> libgs.so.8.15

Easy you think, just install something like libgs.123.rpm, and everything will work. But there isn’t such an rpm…

So, download the ghostscript source, build it as a shared library (using the not quite obvious make so), copy the lib to /usr/lib, fix up the symlinks. Then all is  happiness and light:

% cd /var/tmp
% wget http://downloads.ghostscript.com/public/ghostscript-8.71.tar.xz
% tar zxvf ghostscript-8.71.tar.xz
% cd ghostscript-8.71
% ./configure
% make so
% rm -i /usr/lib/libgs.so*
% cp sobin/libgs.so.8.71 /usr/lib
% ln -s libgs.so.8.71 libgs.so
% ln -s libgs.so.8.71 libgs.so.8

Oh the pain – why can’t the world just use The Universal Operation System – Debian?!

March 29, 2012 05:40 AM

March 27, 2012

James Purser's hackergotchi

James Purser

We'll all be extincted!

You know, there are times when I'm thiiiss close to really considering the Australian Greens as the party that could fill the void on the centre-left left by the Labor party, but then I see stuff like the 3rd Annual Green Oration and I go back to wondering whether we'll ever fill that niche again. 

The Oration itself is an annual event setup by Bob Brown with the following focus:

"The Green Oration is the idea of Australian Greens Leader, Senator Bob Brown, who has always recognised the global importance of Tasmania producing the world’s first Green political party.

Senator Brown wanted to stage an annual oration that would bring the world’s brightest green minds back to the birthplace of the political movement."

Now in its third year, previous Orators have included former Columbian Senator and FARC hostage Ingrid Betancourt and noted environmentalist Dr David Suzuki.

This time around it was Bobs turn to give the Oration.

Bobs speech had a decidedly galactic feel to it, opening with "Fellow Earthians" he launched into an impassioned description of the  "collective human intelligence" as an unfurling flower never before seen in the universe (as far as we know). He then moves on to possit a theory as to why humanity has never been contacted by other civilisations.

"Surely some people-like animals have evolved elsewhere. Surely we are not, in this crowded reality of countless other similar planets, the only thinking beings to have turned up. Most unlikely! So why isn't life out there contacting us? Why aren't the intergalactic phones ringing?

Here is one sobering possibility for our isolation: maybe life has often evolved to intelligence on other planets with biospheres and every time that intelligence, when it became able to alter its environment, did so with catastrophic consequences. Maybe we have had many predecessors in the Cosmos but all have brought about their own downfall.

That's why they are not communicating with Earth. They have extincted themselves. They have come and gone. And now it's our turn."

Yes. He said "Extincted". I shall leave that there for you to ponder as we move on.

So Bobs theory is that there might very well have been earlier alien civilisations in the universe, but that they all fell to the same problems of biosphere destruction, and we're next.

However, luckily Bob has a solution. Global Democracy. Bob wants a world parliament, based on the premise of one person, one vote.

"In his Gettysburg address of 1859, Abraham Lincoln proclaimed: 'We here highly resolve... that government of the people, by the people, and for the people, shall not perish from the Earth.'

153 years later, let us here in Hobart, and around the world, highly resolve that through global democracy we shall save the Earth from perishing.

For those who oppose global democracy the challenge is clear: how else would you manage human affairs in this new century of global community, global communications and shared global destiny?

Recently, when I got back to bed at Liffey after ruminating under the stars for hours on this question, Paul enquired, 'did you see a comet?' 'Yes', I replied, 'and it is called 'Global Democracy'.

A molten rock from space destroyed most life on the planet those sixty-five million years ago. Let us have the comet of global democracy save life on Earth this time."

Leaving aside the fact that Bob has just compared his idea of a world saving global democracy with the event that killed nearly everything on the planet, let's see how Bob thinks this World Government would work:

So let us resolve

that there should be established

for the prevalence and happiness of humankind

a representative assembly

a global parliament

for the people of the Earth

based on the principle of

one person one vote one value;

and to enable this outcome

that it should be a bicameral parliament

with its house of review

having equal representation

elected from every nation.

Right, so it's a westminster system for the world.

Look, read the whole thing, you may agree with Bob and you may not. Personally I think it puts the Greens back in the "nice to have in the senate balancing out the nationals" category rather than any serious contender for government. But that's just me.

 

Blog Catagories: 

March 27, 2012 11:58 AM

The ALP did NOT lose in Queensland Because Wikileaks

Look, I understand that for a lot of people, Wikileaks and Julian Assange are very important. Wikileaks has opened up a number of different cans of worms, and is an expression of openness taken to the extreme (all communications should be open, etc, etc). Assange himself is the personification of the wikileaks ideals.

However.

Contrary to articles like this, the Labor Party did NOT collapse in Queensland because they failed to speak out on the continuing attempts to extradite Assange to Sweden, or the ongoing campaign to starve Wikileaks of funding and resources.

The reason that the ALP died in Queensland has nothing to do with Assange and everything to do with being an old, out of touch government that despite some very good work during the floods and cyclone disasters, couldn't connect with the voters in any meaningful sense.

The voters were ready to give the ALP a kicking it would never forget for a whole range of reasons and I have to tell you, failure to comment on Assange and Wikileaks would have been right down the bottom of the list.

Honestly? The Queensland Labor Party could have launched a rescue team, brought Assange home and set him up with unlimited government resources and the actual voting difference it would have made would have been bupkiss. 

Blog Catagories: 

March 27, 2012 12:10 AM

March 26, 2012

James Purser's hackergotchi

James Purser

New Episode of Purser Explores The World is out - Printing Your New Life

Just as 3D printing is changing the way we look at manufacturing, it's changing the way medicine approaches different problems.

In this episode I talk to Scott Summit from Bespoke Innovations about the work his company does  with artificial limbs and I have a look at some of the other ways that 3D Printing is changing the way the medical world turns.

Audio:

MP3

OGG

Torrents:

MP3

OGG

Blog Catagories: 

March 26, 2012 12:25 PM

March 21, 2012

Sridhar Dhanapalan's hackergotchi

Sridhar Dhanapalan

Twitter Weekly Updates for 2012-03-21

  • Great work Channel 11 for butchering Team America to the point where it made no sense #

March 21, 2012 06:15 AM

March 20, 2012

Simon

Simon "Horms" Horman

Perdition 1.19-rc5 Released

[perdition]

I have released version 1.19-rc5 of Perdition. The key changes are:

  • ldap: fix segmentation fault in dbserver_get2()
  • Manage-sieve: Fix handling of plain login which would segmentation fault in some cases
  • Manage-sieve: Fix handling of long authentication hashes
  • Enhance --bind_address option parsing to handle IPv6 addresses
  • Fix 8/4byte integer type miss-matches which may lead to undefined behaviour

The code and related libraries are available as tarballs here. More information is available in the announcement email. More information about perdition here.

March 20, 2012 12:25 PM

Sonia Hamilton

Ruby, Lisp, Python

Up late tonight reading about Emacs Lisp, I came across Tour de Babel by Steve Yegge comparing different languages (C, C++, Java, etc), and why he likes Lisp and Ruby so much. I’m stuck in stodgy Python land at the moment, this is balm for the soul:

Anyway, Ruby stole everything good from Perl; … for the most part, Ruby took Perl’s string processing and Unix integration as-is, meaning the syntax is identical, and so right there, before anything else happens, you already have the Best of Perl. And that’s a great start, especially if you don’t take the Rest of Perl.

But then Matz took the best of list processing from Lisp, and the best of OO from Smalltalk and other languages, and the best of iterators from CLU, and pretty much the best of everything from everyone. And he somehow made it all work together so well that you don’t even notice that it has all that stuff.

March 20, 2012 10:59 AM

James Purser's hackergotchi

James Purser

#Facepalmer and #grubbyjournalism

Well, you can't say that Australian politics is dull.

First up we have Clive "Face" Palmer accusing the Greens and Greenpeace of being front organisations for the CIA to ruin the Australian coal industry. Then we have Peter Slipper, the surprisingly independent Independent Speaker of the House of Representatives using twitter to take the wind out of an attack article that is (was) going to be printed tomorrow.

To be honest, Clive Palmers foray into tin foil hat territory, while fun, isn't as interesting as Peter Slipper's use of social media to defend himself against an attack.

From the moment he was selected as Speaker, Peter Slipper has been determined to make his mark, both in the House (I think he's ejected more people from the House in his first couple of months than Harry Jenkins did in the last year) and without.

He's always been an active tweeter and his knowledge of the platform and the tools available today allowed him to tackle a potentially damaging attack head on. Using twitter and tools like Hootsuite, he's released the full chain of email correspondance between his office and the journalist involved. This means that not only does the journalist lose any sort of exclusivity, but any claims contained within the article (if it every see's the light of day) can be easily cross checked with what Slippers office actually said.

I'm going to say Speaker - 1, Journalist - 0 on this one.

Blog Catagories: 

March 20, 2012 10:24 AM

March 18, 2012

Sonia Hamilton

Gnu Screen – split screens

One of the features I’ve always wished Gnu screen had was the ability to split a screen horizontally, so you can for example run a grep or mc in the top half of the terminal, and some commands in the bottom half.

Well it turns out that you can split screens in Screen, here’s how to you do it:

  • C-a S to split
  • C-a X to unsplit (and remove the current region)
  • C-a Q to make the current region the only region

Also, you can bind some keys to move between regions; add these settings to your ~/.screenrc:

bind j focus down
bind k focus up
bind t focus top
bind b focus bottom

Then you can do things like C-a j to move down a region, C-a k to move up a region.

March 18, 2012 11:11 PM

GNU Screen Alternative – Terminator?

I’ve been using GNU Screen for years, and I always wished it had a “broadcast” functionality like MultiXterm. Anyway, this morning I came across Terminator – it splits screens, has broadcasts, etc (probably old news for some people…).

By the way, you can split screens in GNU Screen.

March 18, 2012 11:09 PM

March 17, 2012

Mark Greenaway

For a long time, I've been interested in martial arts but been held back by inflexibility and lack of fitness. I've tried various things, such as lots of stretching and going to physiotherapists. Those helped a little.

But in the past few weeks, I've been working close to where I live and that's given me the opportunity to try something else - being much more generally active. I walk or cycle to and from work every day, and try to make it to a couple of martial arts classes a week. My work and study is quite sedentary, so I find the hour or so of walking each day is really making a huge difference - strengthening my weak leg and stretching it out as I walk. And I'm finding my general fitness is slowly improving as well. I think incorporating physical activity into my everyday life is something I'm much more likely to stick with than a gym routine or the occasional yoga class.

March 17, 2012 10:39 PM

March 14, 2012

Sridhar Dhanapalan's hackergotchi

Sridhar Dhanapalan

Twitter Weekly Updates for 2012-03-14

  • A slash is not a backslash! How difficult can it be??? #

March 14, 2012 06:15 AM

March 13, 2012

James Purser's hackergotchi

James Purser

Revue Update Update and a Rant

So yesterday I had a bit of whinge about the fact that I couldn't update my Logitech Revue because for some bizarre reason, they had geo locked the update.

Well last night I figured rather than wait around until Logitech or Google or whoever was responsible got to fixing the issue, I would utilise one of the many vpn services which allows me to pretend I'm actually a USanian for the purposes of accessing various web sites. 

I connected using a free trial account with the openvpn guys and lo and behold the update worked (in fact half a dozen apps that had until now refused to update, updated).

So now I have a nice shiny new Google Play Store on my Revue but unless I either setup my own vpn setup or pay for one of the commercial ones, I'm still restricted as to what content we get to view.

This is nuts.

In order for me to do the right thing and pay for content I wish to consume I have to do the following:

  • Purchase the services of a commercial VPN provider (who will allow me to pretend I'm from either the US or UK)
  • Acquire a US Credit Card
  • Acquire a US address for both said Credit Card and access to say Amazon or Google Movies/Music
  • Then pay for the service itself

The next time someone bitches to me about "piracy" I'm going to point them at that process and then I'm going to tell them that the shocking thing isn't that people pirate, it's that people actually do the above. They WANT to reward the content producers for their work, they WANT to access services in a way that means they aren't breaking laws.

At some point, something is going to have to break. "Traditional" content producers, the ones who are locked into this geographical market madness are going to be replaced by the new online producers. The TWiTs and Revision3's of the world, the ones who view the internet as a single market and plan accordingly are going to grow and increasingly threaten the position of the main stream.

So there ya have it. Until such time, people are either going to download shows from the intarwebs or find some way to actually pay people, who really do not seem all that fussed about taking your money.

Blog Catagories: 

March 13, 2012 10:45 PM

March 11, 2012

James Purser's hackergotchi

James Purser

Not happy Google/Logitech

For those of you playing at home I have a GoogleTV based Logitech Revue. It is a thing of beauty, being snappy, well integrated and with added App goodness.

However, over the past few days I have been less than pleased with it.

Why? I hear you ask?

Mainly it relates to the recent move by Google to bring all their Market type stuff into one brand: "Google Play". This meant of course, that all Android Market apps needed to be updated to reflect the new branding and the new, integrated services.

So the first cab off the rank was my nexus s. It's running Ice Cream Sandwich and updated to Google Play without an issue.

Great I thought, then I noticed that the revue was reporting that it had updates waiting. I decided to kick off the update when I went to bed (I run the mythtv output through the revue so figured it would better to start when no one was watching). Having done that, I fully expected it to be up to date when I woke up the next morning.

Except it wasn't. It was still trying to run the update.

Sigh.

At first it was thought that someone had closed down the update path prematurely, but after much digging around by frustrated revue owners it was discovered that only those outside the US had the problem. Those within the US had upgraded and were happily accessing all areas (movies and music especially, the bastards).

I've checked, and for whatever reason if I access the update URL via a US IP address, I can access it without a problem. If I do it from my australian IP address, I get a cannot be found page.

Double U Tee Eff

That's my rage for the day.

Blog Catagories: 

March 11, 2012 11:37 PM

Scott Sinclair

Using WSE3 services with Python

Like many companies, we use a number of Web Services at work. These are mainly used for our client side applications to talk back to things like SQL and other services, without going direct to them (and thus having a "security layer" of sorts). Having the ability to use these in some scripts/processes that you design can often be useful, as you have to play by the business logic.

In our case, our web services are .NET Web services using WSE3, to add on WS-Addressing and WS-Security features to them. These tie in easily to C# or other .NET languages, just by adding them into your Application. However, in a SysAdmin/DevOps role, you most likely aren't wanting to use a language like C#. You most likely want something like Python, Ruby or node.js; or you may be wanting to integrate these into something that you want to run on Linux or Solaris.

That was my thought. I wanted something in Python, to be able to run it from a few of our Linux boxes. On having a look around the internet, it seems that there is actually not much documentation on getting WSE3 (with WS-Addressing and WS-Security) web services to work in Python. So this article changes that.

In this article I will provide an example script which will show you how Python can talk to WSE3 scripts. It should hopefully point you in the right direction, that you need to go to achieve your goal.

What you need

Before we start, you will need to have available the following python libraries:

It will also help to have a small bit of knowledge about how SOAP works, but this is not required.

Our final script

We will start out, by showing the full script and then explaining each bit of how it works.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/python

import logging
import random
import string

from suds import MethodNotFound
from suds.client import Client
from suds.wsse import Security, UsernameToken
from suds.sax.element import Element
from suds.sax.attribute import Attribute
from suds.xsd.sxbasic import Import

WEBSERVICE_URL = 'http://www.example.com/Webservice/Webservice.asmx'
NS_WSA = ('wsa', 'http://schemas.xmlsoap.org/ws/2004/08/addressing')
MUST_UNDERSTAND = Attribute('SOAP-ENV:mustUnderstand', 'true')

def main():
    logging.basicConfig(level=logging.INFO)
    logging.getLogger('suds.client').setLevel(logging.DEBUG)

    client = Client('%s?wsdl' % WEBSERVICE_URL)

    add_security(client, 'DOMAIN\User', 'Password')
    add_addressing(client, WEBSERVICE_URL)
    method = get_method(client, 'method')

    print method()

def add_security(client, user, passwd):
    sec = Security()
    token = UsernameToken(user, passwd)
    token.setnonce()
    token.setcreated()
    sec.tokens.append(token)
    client.set_options(wsse=sec)

def add_addressing(client, webservice_url):
    headers = []

    addr = Element('Address', ns=NS_WSA).setText('http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous')

    headers.append(Element('Element').addPrefix(p='SOAP-ENC', u='http://www.w3.org/2003/05/soap-encoding'))
    headers.append(Element('ReplyTo', ns=NS_WSA).insert(addr).append(MUST_UNDERSTAND))
    headers.append(Element('To', ns=NS_WSA).setText(webservice_url).append(MUST_UNDERSTAND))
    headers.append(addr)
    headers.append(Element('MessageID', ns=NS_WSA).setText('urn:uuid:%s' % generate_messageid()))

    client.set_options(soapheaders=headers)

def get_method(client, method):
    try:
        m = getattr(client.service, method)
        action = client.wsdl.services[0].ports[0].methods[method].soap.action
        action = action.replace('"', '')
    except MethodNotFound:
        return None

    action_header = Element('Action', ns=NS_WSA).setText(action)
    client.options.soapheaders.append(action_header)

    return m

def generate_messageid():
    fmt = 'xxxxxxxx-xxxxx'
    resp = ''

    for c in fmt:
        if c == '-':
            resp += c
        else:
            resp += string.hexdigits[random.randrange(16)]

    return resp

if __name__ == '__main__':
    main()

How the script works in detail

Now that we have seen the full script, we will go thru it, and explain what it does.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import logging
import random
import string

from suds import MethodNotFound
from suds.client import Client
from suds.wsse import Security, UsernameToken
from suds.sax.element import Element
from suds.sax.attribute import Attribute
from suds.xsd.sxbasic import Import

First we start by including some libraries we are going to use. We use the random library for generating a random message ID for our SOAP message. The includes from suds.* are for the SOAP library we will be using.

We have also included the logging library, which will enable us to be able to see some debug messages should we wish to.

1
2
3
WEBSERVICE_URL = 'http://www.example.com/Webservice/Webservice.asmx'
NS_WSA = ('wsa', 'http://schemas.xmlsoap.org/ws/2004/08/addressing')
MUST_UNDERSTAND = Attribute('SOAP-ENV:mustUnderstand', 'true')

Next, we define our webservice url (WEBSERVICE_URL). This should be the full path to the endpoint. This should not be the URL to it's WSDL.

We also define some attributes for our XML Elements that we will needed further down in our script. NS_WSA is the namespace we are defining for WS-Addressing. The MUST_UNDERSTAND variable is used to make Elements which the Web Service must understand and process.

1
2
3
def main():
    logging.basicConfig(level=logging.INFO)
    logging.getLogger('suds.client').setLevel(logging.DEBUG)

This is our main() function, that will be called when we start the script. The first two lines, will provide our debug output for running the script. These can be commented out afterwards should you want to.

1
client = Client('%s?wsdl' % WEBSERVICE_URL)

We next create an instance of the suds.client.Client object, which will be used for connecting and inspecting our web service.

1
2
3
4
5
add_security(client, 'DOMAIN\User', 'Password')
add_addressing(client, WEBSERVICE_URL)
method = get_method(client, 'method')

print method()

The last bit of our main() function, will be where we call our other functions to add in support for WS-Addressing and WS-Security. Then the last bit will be finalising the method we are going to call, and calling the method and printing out the results.

You would change/set the DOMAINUser and Password, as well as the method here, so it runs with the right credentials and the correct method of the web service.

1
2
3
4
5
6
7
def add_security(client, user, passwd):
    sec = Security()
    token = UsernameToken(user, passwd)
    token.setnonce()
    token.setcreated()
    sec.tokens.append(token)
    client.set_options(wsse=sec)

This is our add_security() function which will take care of implementing WS-Security into our request. Luckily for us, WS-Security support is available in Suds already, so we just need to add it to our client object.

The token we add is our username and password (username is prefixed with the Domain when it is sent to the function). We also set a "Nonce" and the created date and time. These together help to prevent replay attacks with the SOAP request.

Finally we add our token to our security object, and add our security object, into our client object.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
def add_addressing(client, webservice_url):
    headers = []

    addr = Element('Address', ns=NS_WSA).setText('http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous')

    headers.append(Element('Element').addPrefix(p='SOAP-ENC', u='http://www.w3.org/2003/05/soap-encoding'))
    headers.append(Element('ReplyTo', ns=NS_WSA).insert(addr).append(MUST_UNDERSTAND))
    headers.append(Element('To', ns=NS_WSA).setText(webservice_url).append(MUST_UNDERSTAND))
    headers.append(addr)
    headers.append(Element('MessageID', ns=NS_WSA).setText('urn:uuid:%s' % generate_messageid()))

    client.set_options(soapheaders=headers)

The next function we call in our script, is the add_addressing() function. This function adds most required headers for WS-Addressing. There is one that is added the get_method() function, but we will cover that shortly.

First we start by defining an "Address" Element, which is a static reference to the WS-Addressing specification. Note we also set the namespace to the NS_WSA variable we created befoer. After that, we create a generic Element tag, which is used to define the SOAP Encoding we are using.

Next are the two most important elements we will add to the header. The ReplyTo Element is added, with reference to the Address element, and the mustUnderstand attribute. The ReplyTo element defines the endpoint for the reply to the web service. The To Element is where we define the address of the web service we are calling.

We finish up by adding the Address element into the headers, and defining a unique MessageID for the message we are able to send. We then add these headers into our client object.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
def get_method(client, method):
    try:
        m = getattr(client.service, method)
        action = client.wsdl.services[0].ports[0].methods[method].soap.action
        action = action.replace('"', '')
    except MethodNotFound:
        return None

    action_header = Element('Action', ns=NS_WSA).setText(action)
    client.options.soapheaders.append(action_header)

    return m

This function, get_method(), is used to be able to find the action path of the method we want to call, and add this int our SOAP headers.

We first look up to see whether the method we have been given, is a valid method that exists when the WSDL file is introspected. If it is, we store this in m, for returning back later.

Before finishing up however, we look in the WSDL definition for the service, and get the SOAP action attribute for the given method. We remove and bad characters and add this into our SOAP Headers as the Action element. This tells WS-Addressing the function we want to call to do our work.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
def generate_messageid():
    fmt = 'xxxxxxxx-xxxxx'
    resp = ''

    for c in fmt:
        if c == '-':
            resp += c
        else:
            resp += string.hexdigits[random.randrange(16)]

    return resp

The generate_messageid() function is used by add_addressing(), to generate a Unique and random message ID. This function simple look over each character in our defined format (fmt), and generates a unique hex character to be returned. Literal dashes (-) in the format string are ignored.

1
2
if __name__ == '__main__':
    main()

To finish off, this is stock standard python. If this script is invoked from the command line, the built-in variable name will be set to main. We simply say here, that if it is invoked from the command line, run our main() function.

Now, if you have updated some of the variables where needed in the above, you will now be able to run the script, and it should print our the resulting dataset from your web service. If you get any errors, have a look and see if you can work out what may be causing it. Do check that it's something as simple as maybe the wrong username or password tho.

Where to from here?

Now that you have the script, you will most likely want to use what you have learnt here, to form this into a library of functions, so you can use it in your application. And get the values from somewhere else, than what is hardcoded in the script.

You will also want to have a play around with calling method's with parameters and also seeing what happens when you start to need to use more complex data types that the web service method defines. But you should be able to handle this, as Suds includes this introspection in it's API support.

Should you have any questions, feel free to contact me, and i'll see what I can do!

I should also thank the below articles/posts on websites for helping, as without them, I may have had no clue to some bits of this.

March 11, 2012 03:02 PM

March 10, 2012

Michael Knight

Upgrading the root file system on a Linode to ext4

The ext4 file system has been around for a while now, so I figured I'd migrate my Linode's ext3 partition to it for some of the reasons listed here.

The major downsides would be that I wouldn't be able to use some nice tools that Linode provide, such as their automatic partition resizing and automatic backup solution, and their rescue distribution, Finnix, doesn't support it. (Edit: Their rescue distribution does now support ext4.)

Obviously you'd want to make sure you have a full backup before proceeding with this. I didn't, but I'm an idiot.

First you need to make sure you're using a recent kernel — probably 2.6.30 or higher. This is because some applications had made bad assumptions. I'm using the latest 2.6 Paravirt that Linode provides, which is 2.6.35.4-x86-_64-linode16. My system is Ubuntu 10.10 64-bit.
  1. From the Linode Platform Manager, restart in rescue mode.
  2. Run the following commands to update Finnix with a recent e2fsprogs that supports ext4:
    1. apt-get update
    2. apt-get install debian-archive-keyring e2fsprogs
  3. Perform the actual ext4 conversion:
    1. tune2fs -O extents,uninit_bg,dir_index /dev/xvda (It will no longer be ext3 compatible after running this.)
    2. e2fsck -fDC0 /dev/xvda
  4. Shutdown and boot up through the Linode Platform Manager
  5. The system should automatically mount the partition as ext4.
Even though the system mounted the partition successfully I figured I'd change the /etc/fstab to reflect the new file system.

Links

March 10, 2012 11:03 PM

Sridhar Dhanapalan's hackergotchi

Sridhar Dhanapalan

OLPC Australia Education Newsletter, Edition 9

Edition 9 of the OLPC Australia Education Newsletter is now available.

In this edition, we provide a few classroom ideas for mathematics, profile the Jigsaw activity, de-mystify the Home views in Sugar and hear about the OLPC journey of Girraween Primary School.

To subscribe to receive future updates, send an e-​​mail to education-​newsletter+subscribe@​laptop.​org.​au.

March 10, 2012 02:11 AM

March 09, 2012

Mark Greenaway

There's a blog post brewing in my brain about leading an active lifestyle. But it's still brewing, and it would be much more in line with my current goals if I got off my butt to get to a martial arts class or finish the cleaning I've got to do than blogging about it.

March 09, 2012 10:40 PM

March 06, 2012

Ian Wienand

Investigating the Python bound method

You work with Python for a while and you'll become familiar with printing a method and getting

<bound method Foo.function of <__main__.Foo instance at 0xb736960c>>

I think there is room for one more explanation on the internet, since I've never seen it diagrammed out (maybe for good reason!).

An illustration of Python bound methods

In the above diagram on the left, we have the fairly simple conceptual model of a class with a function. One naturally tends to think of the function as a part of the class and your instance calls into that function. This is conceptually correct, but a little abstracted from what's actually happening.

The right attempts to illustrate the underlying process in some more depth. The first step, on the top right, is building something like the following:

class Foo():

      def function(self):
      	  print "hi!"

As this illustrates, the above code results in two things happening; firstly a function object for function is created and secondly the __dict__ attribute of the class is given a key function that points to this function object.

Now the thing about this function object is that it implements the descriptor protocol. In short, if an object implements a __get__ function; then when that object is accessed as an attribute of an object the __get__ function is called. You can read up on the descriptor protocol, but the important part to remember is that it passes in the context from which it is called; that is the object that is calling the function.

So, for example, when we then do the following:

f = Foo()

f.function()

what happens is that we get the attribute function of f and then call it. f above doesn't actually know anything about function as such — what it does know is its class inheritance and so Python goes searching the parent's class __dict__ to try and find the function attribute. It finds this, and as per the descriptor protocol when the attribute is accessed it calls the __get__ function of the underlying function object.

What happens now is that the function's __get__ method returns essentially a wrapper object that stores the information to bind the function to the object. This wrapper object is of type types.MethodType and you can see it stores some important attributes in the object — im_func which is the function to call, and im_self which is the object who called it. Passing the object through to im_self is how function gets it's first self argument (the calling object).

So when you print the value of f.function() you see it report itself as a bound method. So hopefully this illustrates that a bound method is a just a special object that knows how to call an underlying function with context about the object that's calling it.

To try and make this a little more concrete, consider the following program:

import types

class Foo():

    def function(self):
        print "hi!"

f = Foo()

# this is a function object
print Foo.__dict__['function']

# this is a method as returned by
#   Foo.__dict__['function'].__get__()
print f.function

# we can check that this is an instance of MethodType
print type(f.function) == types.MethodType

# the im_func field of the MethodType is the underlying function
print f.function.im_func
print Foo.__dict__['function']

# these are the same object
print f.function.im_self
print f

Running this gives output something like

$ python ./foo.py
<function function at 0xb73540d4>
<bound method Foo.function of <__main__.Foo instance at 0xb736960c>>
True
<function function at 0xb73540d4>
<function function at 0xb73540d4>
<__main__.Foo instance at 0xb72c060c>
<__main__.Foo instance at 0xb72c060c>

To pull it apart; we can see that Foo.__dict__['function'] is a function object, but then f.function is a bound method. The bound method's im_func is the underlying function object, and the im_self is the object f: thus im_func(im_self) is calling function with the correct object as the first argument self.

So the main point is to kind of shift thinking about a function as some particular intrinsic part of a class, but rather as a separate object abstracted from the class that gets bound into an instance as required. The class is in some ways a template and namespacing tool to allow you to find the right function objects; it doesn't actually implement the functions as such.

There is plenty more information if you search for "descriptor protocol" and Python binding rules and lots of advanced tricks you can play. But hopefully this is a useful introduction to get an initial handle on what's going on!

March 06, 2012 12:46 PM

Robert Thomson

What isn't Puppet?

What isn’t Puppet?

  1. Puppet is not an orchestration system.
    * Puppet is not well suited to VM orchestration.
    * Puppet is not well suited to application release management/complex upgrades.
  2. Puppet is not a user management system.
  3. Puppet is not a good configuration database.

Of course you can do all of these with Puppet.. but it’s just not the best solution for them. Sometimes you should put down the hammer, and go look for a wrench.

March 06, 2012 06:45 AM

March 05, 2012

Sonia Hamilton

Backup multiple MySQL databases into separate files – Windows

Years ago I wrote a post on how to Backup multiple MySQL databases into separate files (Linux). I get a lot of questions about how to do the same on Windows; here’s a script submitted by one of my readers:

:: MySQl DB user
set dbuser=xxxx

:: MySQl DB users password
set dbpass=xxxx

:: Switch to the MySQL data directory and collect the folder names
pushd "C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.5\data"

:: Loop through the folders and use the fnames for the sql filenames, collects all databases automatically this way

echo "hello"

echo "Pass each name to mysqldump.exe and output an individual .sql file for each"

FOR /D %%F IN (*) DO (
"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqldump.exe" --user=%dbuser% --password=%dbpass% --databases %%F > "C:\SQLBackup\%%F.%backupdate%.sql"
)

March 05, 2012 09:19 PM

March 04, 2012

Scott Sinclair

Fall 2011 TV Scorecard

Just thought I would give an update on the shows I said I would be watching mid-last year, and how they are going so far.

Let me know how you think these shows did, and if you think differently to how things are going below.

Boss:   I predicted this one wouldn't last, and I've been proven wrong. Another 10 episodes for Season 2 of the show have already been ordered. This is a bit weird, as each episode only managed to pull in about half a million viewers on average.

Charlie's Angels:   As I said in the original article, remakes don't always go well. Charlie's Angels managed to prove that, and was cancelled after only 4 episodes.

Grimm:   Of the two Fairy Tale based TV Shows to air during this Fall TV season, Grimm seems to be doing okay. However, some weeks, the other fairy tale based show, Once Upon a Time, is pulling in almost double the number of viewers. However, this is one of ABC network's best new shows for this season.

Homeland:   As to be expected, Showtime once again pulled a terrific storyline out of this show, and it ended up being one of the best rating Showtime shows. The story lends itself to a Season 2, but will Showtime?

How to Be a Gentleman:   "Probably won't last". And it didn't.

I Hate My Teenage Daughter:   It is rating well, but had a very long hiatus (December to March). I get the feeling this one will say around this year, but if it comes back, it could be questionable.

Last Man Standing:   Last Man Standing has rated very well, and I'm sure this will be something that we see for at least the next 2 seasons.

Man Up:   While the viewer numbers were okay, the target market was giving it a very low rating. This show was probably killed before it's time. But it's gone now, and it won't be coming back.

New Girl:   Massive Hit. Will be around for next season.

Once Upon a Time:   This is the show that has been beating Grimm in the ratings, and I think we are going to see it stay that way. Season 2 while unconfirmed, is a definite to happen.

Person of Interest:   This is personally, one of my favourite shows of the 2011-2012 Fall Season. In the US, ther ehas not been an epsideo which has pulled in less than 11 Million viewers, with the average in the 13 Million mark. This show isn't going to die, unless they change the storyline.

The Playboy Club:   This may have been the most hyped show of the Fall Season, but it was the first show to fall. Only 3 episodes were shown before the plug was pulled, and that was probably 3 too many.

Prime Suspect:   It's a UK Drama, that was converted for the US Market. and it failed. The show got off on a slow start, which made it hard for any audience to adapt to it, especially in the face of Shows that were on at the same slot. At least all the episodes got to be aired of this show.

Terra Nova:   Terra Nova finished it's 13 episode run a few months ago, but yet there is no clue on whether there will be a Season 2. While it did have fairly decent ratings, there is some thoughts that it maybe wasn't as good as what could have been. If we see this next season, it could be a miracle. Update Strike that, it's been canned.

Unforgettable:   Hey guess what, it has a love storyline! And it's with the two lead actors. So obvious that was going to be the case. But on the show itself, it seems to be doing okay on the ratings. Averaging about 10 million viewers, it should easily have a second season, but no word yet.

March 04, 2012 03:01 PM

Andrew Cowie's hackergotchi

Andrew Cowie

Using inotify to trigger builds

Having switched from an Eclipse (which nicely takes care of building your project for you) to working in gVim (which does nothing of the sort), it’s a bit tedious to have to keep switching from the editor’s window to a terminal in the right directory to whack Up then Enter to run make again.

I know about inotify, a capability in the Linux kernel to watch files for changes, but I hadn’t realized there was a way to use it from the command line. Turns out there is! Erik de Castro Lopo pointed me to a program called inotifywatch that he was using in a little shell script to build his Haskell code. Erik had it set up to run make if one of the files he’d listed on the script’s command line changed.

Saving isn’t what you think it is

I wanted to see if I could expand the scope in a few ways. For one thing, if you had inotifywatch running on a defined list of files and you created a new source file, it wouldn’t trigger a build because it wasn’t being watched by inotify. So I had a poke at Erik’s script.

Testing showed that the script was working, but not quite for the reason that we thought. It was watching for the ‘modify’ event, but actually catching a non-zero exit code. That’s strange; I was expecting a normal 0 not error 1. Turns out 1 is the exit code in situations when the file you were watching is deleted. Huh? All that I did was save a file!

Of course, that’s not what many programs do when saving. To avoid the risk of destroying your original file in the event of having an I/O error when overwriting it, most editors do NOT modify your file in place; they write a new copy and then atomically rename it over the original. Other programs move your original to a backup name and write a new file. Either way, you’ve usually got a new inode. Most of the time.

And that makes the exact event(s) to listen for tricky to pin down. At first glance the ‘modify’ one seemed a reasonable choice, but as we’ve just seen that turns out to not be much use, and meanwhile you end up triggering due to changes made to transient garbage like Vim’s swap files — certainly what you don’t want to trigger a build. Given that a new file is being made, I then tried watching for the ‘create’ event, but it’s overblown with noise too. Finally, you want touching a file to result in a rebuild and that doesn’t involve a ‘create’ event.

It turns out that saving (however done) and touching a file have in common that at some point in the sequence your file (or its backup) will be opened and then closed for writing. inotify has a ‘close_write’ event (complimenting ‘close_nowrite’) so that’s the one to watch for.

If you want to experiment with figuring all this yourself, try doing:

$ inotifywait -m .

and then use your editor and build tools as usual. It’s pretty interesting. The inotifywait(1) program is part of the 'inotify-tools' package on Debian-based Linux systems.

Resurrection, Tron style

Triggering a build automatically is brilliant, but only half the equation; inevitably you want to run the program after building it. It gets harder; if the thing you’re hacking on is a service then, having run it, you’ve got to kill it off and restart it to find out if your code change fixed the problem. How many times have you been frustrated that your bugfix hasn’t taken only to realize you’ve forgotten to restart the thing you’re testing? Running the server manually in yet another terminal window and then killing it and restarting it — over and over — is quite a pain. So why not have that triggered as a result of the inotify driven build as well?

Managing concurrent tasks is harder than it should be. Bash has “job control“, of course, and we’re well used to using it in interactive terminals:

$ ./program
^Z
$

$ bg
[1] 13796
$ jobs
[1] Running    ./program
$

$ kill %1
[1] Terminated ./program
$

It’s one thing to run something and then abort it, but it’s another thing entirely to have a script that runs it and then kills it off in reaction to a subsequent event. Job control is lovely when you’re interactive but for various reasons is problematic to use in a shell script (though, if you really want to, see set -m). You can keep it simple, however: assuming for a moment you have just one program that needs running to test whatever-it-is-you’re-working-on, you can simply capture the process id and use that:

    #!/bin/sh

    ./program &
    PID="$!"

Then you can later, in response to whatever stimuli, do:

    kill $PID

Said stimulus is, of course, our blocking call to inotifywait, returning because a file has been saved.

GOTO 10

Do a build. If it succeeds, run the specified program in the background then block waiting for an inotify ‘close_write’ event. When that happens, kill the program and loop back to the beginning. Easy, right? Sure. that’s why it took me all day.

I called it inotifymake. Usage is simple; throw it in ~/bin then:

$ cd ~/src/project/branch/
$ inotifymake ./program

make does its thing, building program as its result
program runs
waiting…

change detected!

kill program make does its thing, build failed :(
waiting…

change detected!

make does its thing, rebuilding program as a result
program runs
waiting…

the nice part being that the server or whatever isn’t running in the middle when the build is borked; http://localhost:8000/ isn’t answering. Yeah.

So yes, that was a lot of effort for not a lot of script, but this is something I’ve wanted for a long time, and seems pretty good so far. I’m sure it could be improved; frankly if it needed to be any more rigorous I’d rewrite it as a proper C program, but in the mean time, this will do. Feedback welcome if you’ve got any ideas; branch is there if you want it.

AfC

March 04, 2012 02:53 PM

Mark Greenaway

It occurred to me some time after the Aphex Twin show that we would have had no way of knowing if he was even there.

March 04, 2012 02:35 AM