Planet Linux Australia
Celebrating Australians & Kiwis in the Linux and Free/Open-Source community...

September 02, 2014

Follow up

I have a mental illness. From consuming weed for those years. I have major depression & anxiety. I also get paranoid about germs/what people think of me/my health. I think sometimes I make things worse for myself. The best thing that has ever happened is meeting my lovely Becci. She definitely has taken my unwell self and made me well. I had long quit the weed. But recovering from heavy usage takes the brain a while. Years in fact. I have been in and out of work. Fired for having a mental illness (CBA) and more recently as in last year my mother doused herself in gasoline and set herself alight. I haven’t walked easy street. But I try to keep my head up and wits about me. I have a family to care for an my grandparents who helped raise me quite a bit. Well a lot.

A bit about “jlg”

I’m 29, Male from Sunny Brisbane (sunny at the moment). I was born in Adelaide, SA, Australia in a hospital called Modbury hospital. It’s still there. I have one son. I also have a daughter who by law I am not legally allowed to see as I am not on the birth certificate but I’m 99.99 percent sure I’m her father. Her name for the record is Annabel. I’m unsure of spelling. Our son (mine and Bec’s) is being raised with so much love and care and I only wish the same for my daughter. I should mention I’m no street thug or criminal. I actually have no criminal record. I survive on $500AUD a fortnight currently as of right this moment. Which is not much for a overweight male. I don’t really have any vices per say but I don’t use computers so frequently at my age of 29 I have short sighted vision. I should mention I don’t have diabetes.

My story is a common one I think? Man meets woman (Steve Cullen) my bio dad. Has sex, finds out has baby and does runner. I have to this day never met my bio dad. I have seen a photo when I was younger. He was some bald dude. I don’t think much of  him and I actually don’t speak much of him. My mother was awesome and she still is, albeit after her last suicide attempt. I will get to this later. I should mention I was a heavy smoker of cannabis from 2003 to 2007.  I attended a place called HUMBUG. Ironically it was a friend I made called Daniel who got me into marijuna. He would write code, I’d hack computers. We kind of worked as a team. Because the trust was set by us consuming so much (I will call it weed). I’m not proud of my drug usage but little did I know my Mum was a heavy user of other “drugs”. She was also in the army. For roughly 6 years she taught Army service men and women about english/maths etc. As she was a UniSA educated teacher. I on the other hand am self taught. From a young age I was somewhat unwillingly writing phish attacks but for chat websites. I would call these fake logins via HTML. I did this all roughly during High School. I admit freely that the school network was a joke. That doesn’t mean I abused it. I just made sure I couldn’t use their computers by inputting ASCII characters alt+256 the invisible char into the login screen I was using. It was Novell and it would not log in if you entered this char quickly without teacher looking then you’d get moved say to a girl you liked and flirt with her…. :-o)

For the sake of keeping things realistic and true I was actually very frigid. I dated some real nice girls I just couldn’t even get any courage to do anything more than sitting near them. That obviously changed in my final few years. I have always been anti-authority because I actually had 0 parent supervision for most of my teens. I would sit infront of my IBM Aptiva listening to god awful rap music I won’t mention online. I would sit reading RFCs, reading how to write HTML then thinking outside the box and doing what’s now called XSS (aka cross site scripting). Yahoo was one I did, obviously I have never been the type of guy to go hey here’s my handle and here I am LEA track me down. I prefer doing these things without an identity I always have, always will. I am a free lance individual. Whilst I sympathize with various well known hacktivists. I do not go out of my way to engage them.

I think this is enough for now…I will update soon. It’s 10.37pm I know not that late but all this writing has exhausted me. More later.

[life] Day 216: Kindergarten, startup stuff, tennis and baking

I wanted to do a run this morning, but the flesh was weak, so it didn't happen.

I was a bit late getting away to pick up Zoe from Sarah's place, and the traffic was pretty bad again. I got to Kindergarten a bit later than I'd have liked.

I had a meeting with an accountant to discuss some stuff at 9:30am, which I managed to comfortably make. I even got the 30 minute consult for free, which was pretty awesome. I'm pretty close to shelving this particular startup idea, because I can structure it in a way that I'd like, but I can possibly pivot slightly and still solve the overall problem I'm trying to solve. I have some more research to do before I can make a final decision.

After I got home, I procrastinated for a bit and went and had a cup of tea with my neighbour, before finishing off the assessment for the unit of my real estate course that I've been making slow progress on. It finally went into the mail today, so I'm happy about that.

I drove to Kindergarten to take Zoe to tennis class. After tennis class, she wanted Megan to come back for a play date, and Laura had some errands to run, so that worked out well. I had some baking to do for the Father's Day thing at Kindergarten tomorrow, and Megan was keen to help. Zoe was more interested in playing dress ups. Ultimately all they wanted to do was lick the spatulas anyway.

I made my favourite red velvet cheesecake brownie, and tried milling some whole wheat down into flour. The texture was a bit gritty like cornmeal, but it seemed to turn out okay. I've been having problems with it not setting properly in the middle the last few times I've made it, and this time was no different, so I'll have to try making another batch in the morning.

Anshu dropped in after work, and then Laura got back to pick up Megan just before Sarah arrived to pick up Zoe. An easy afternoon.

Matching Ceph Volumes To Nova Instances

Assumptions:

Introduction:

If you have a variety of Ceph pools on different hardware, you may want to be able to find out which Ceph pools each instance is on for either performance or billing purposes.

Here's how I go about it...

Obtain the Volume ID

If your OpenStack service is configured to boot instances from volumes, then you can get the volume ID from the os-extended-volumes:volumes_attached field:

$ nova show Tutorial0 | grep volumes
| os-extended-volumes:volumes_attached | [{"id": "96321d31-27f7-47e5-b2a8-fcd1c0c30767"}]

Query the Ceph Cluster

I've not found an elegant way to go about this yet, so log into one of your Ceph servers and query the Ceph pools...

Grab a list of your Ceph pools:

 # ceph osd lspools
 10 poola,11 poolb,

Then query each pool to locate your volume:

# rbd -p poola ls | grep 96321d31-27f7-47e5-b2a8-fcd1c0c30767
# rbd -p poolb ls | grep 96321d31-27f7-47e5-b2a8-fcd1c0c30767
volume-96321d31-27f7-47e5-b2a8-fcd1c0c30767

Viola! The volume for your instance Tutorial0 is in the Ceph pool, poolb.

September 01, 2014

[life] Day 215: Kindergarten, tinkering, massage and some shopping

Zoe was yelling out for me at 1:30am because her polar bear had fallen out of bed. She then proceeded to have a massive sleep in until 7:30am, so the morning was a little bit rushed.

That said, she took it upon herself to make breakfast while I was in the shower, which was pretty impressive.

Being the first day of Spring and a nice day at that, I wanted to get back into the habit of biking to Kindergarten, so despite it being a bit late, even though we did a very good job of getting ready in a hurry, we biked to Kindergarten. Zoe was singing all the way there, it was very cute.

I got home and spent the day getting Puppet to manage my BeagleBone Black, since I'd had to reinstall it as it had semi-died over the weekend.

I'd moved my massage from Wednesday to today, since there's a Father's Day thing on at Kindergarten on Wednesday, so I had a massage, and then went directly to pick up Zoe.

We went out to Westfield Carindale after pick up, to try and get some digital cameras donated to the Kindergarten to replace the ones they've got, which have died. I wasn't successful on the spot. Then we dropped past the pet shop to get some more kitty litter for Smudge, and then got home.

We'd barely gotten home and then Sarah arrived to pick Zoe up.

[life] Day 212: A trip to the pool

This is what I get for not blogging on the day of, I can't clearly remember what we did on Friday now...

I had the plumber out in the morning, and then some cleaners to give a quote. I can't remember what we did after that.

After lunch we biked to Colmslie Pool and swam for a bit, I remember that much, and then I had some friends join Anshu and us for dinner, but the rest is coming up blank.

brendanscott

AGs is seeking public submissions on Online Copyright Infringement.

Some thoughts are:

The cover letter to the inquiry cites a PWC report prepared for the Australian Copyright Council.  The letter fails to note that gains are offset by the role of intellectual property in transfer pricing by multinationals.  There is strong evidence to suggest that intellectual property regimes have the effect of substantially reducing Australian taxation revenue through the use of transfer pricing mechanisms.

Page 3 of the discussion paper states that  the High Court in Roadshow said “that there were no reasonable steps that could have been taken by iiNet to reduce its subscribers’ infringements.”  The discussion paper goes on to enquire about what reasonable steps a network operator could take to reduce subscribers’ infringements. The whole of the debate about copyright infringement on the internet is infected by this sort of double speak.

The discussion paper does not specifically ask about a three strikes regime.  However, it invites discussion of a three strikes regime by raising it in the cover matter then inviting proposals as to what might be a “reasonable step.  Where noted my responses on a particular question relate to a three strikes regime.

Question 1:

Compelling an innocent person to assist a third party is to deprive that person of their liberty.  The only reasonable steps that come to mind are for network operators to respond to subpoenas validly issued to them – at least that is determined on a case by case basis under the supervision of a court.

Question 2:

Innocent third parties should not be required to assist in the enforcement of someone else’s rights. Any assistance that an innocent third party is required to give should be at the rights holder’s cost.  To do otherwise is to effectively require (in the case of a network) all customers to subsidise the private rights of the “rights’ holders'” enforcement. This is an inefficient an inequitable equivalent to a taxation scheme for public services.  The Government may as well compulsorily acquire the rights in question and equitably spread the cost through a levy.

Question 3:

No.  The existing section 36/101 was specifically inserted to provide exactly the clarity proposed here.  Rights holders were satisfied at the time.

Question 4:

Presumably reasonable is an objective test.

Question 5:

This response assumes the proposed implementation of a “three strikes” regime.

There is a Federal Magistrates court which is able to hear copyright infringement cases.  Defendants should have the right to have the case against them heard in a judicial forum. Under a three strikes regime an individual is required to justify their actions based on an accusation of infringement.  In the absence of a justification they suffer a sanction.  Our legal system should not be driven by mere accusations.  Defendants also have the right to know that the case against them is particular to them and not a cookie cutter accusation.

Question 6:

The court should have regard to what aims a block is intended to achieve, whether a block will be effective in achieving those aims and what impact a block will have on innocent third parties which may be affected by it.  For example, when Megaupload was taken down many innocent people lost their data with no warning.  This is more likely to be the case in the future as computing resources are increasingly shared in load balanced cloud storage implementations. These third parties are not represented in court and have no opportunity to put their case before a block is implemented.

A practice should be established whereby the court requires an undertaking from any person seeking a block to indemnify any innocent third party affected by the block against any damage suffered by them.  Alternatively, the Government could establish a victims compensation scheme that can run alongside such a block.  These third parties will be collateral damage from such a scheme.  Indeed, if the test for a site is only a “dominant purpose” test then collateral damage necessarily a consequence of the block.   An indemnity will serve the purpose of guiding incentives to reduce damage to innocent third parties.

Question 7

If the Government implements proposals which extend the applicability of auhtorisation infringements to smaller and smaller entities (eg a cafe providing wifi) then the safe harbour provisions need to be sufficiently simple and certain as to allow those entities to rely on them. At the moment they are compex and convoluted. If a cafe is forced to pay hundreds or thousands of dollars for legal advice about their wifi service, they will simply not provide it.

Question 8

Before the impact of measures can be measured [sic] a baseline first needs to be established for the purpose the Copyright Act is intended to serve.   In particular, the purpose of the Copyright Act is not to reduce infringement.  Rather, its titular purpose is to promote the creation of works and other subject matter.  This receives no mention in the discussion paper.  Historically, the Copyright Act has been promoted as necessary to maintain distribution networks (pre 1980s), as a means of providing creators with an income (last 2 centuries, but repeatedly contradicted empirically – most recently in the Don’t Give Up Your Day Job report),  as a natural right of authors (00s – contrary to judicial pronouncements on the issue) and now, apparently, as a means of stimulating the economy.  An Act which has so mutable a purpose ought to be considered with a jaundiced eye.

The reference to the PWC document suggests that the Hargreaves report would be a good starting point for further policy making.

Question 9

The retail price of downloadable copies of copyright works in Australia (exclusive of GST) should not exceed the price in their country of origin by more than 5% when sold directly.  The 5% figure is intended to allow for some additional costs of selling into Australia.

Implement the Productivity Commission’s recommendations on parallel importation.

Question 10, 11

The next two paragraphs of the response to this question deals primarily with a possible three strikes regime although the final observations are of a general character.

“Three strikes” regulation will effectively shift the burden of enforcement further away from rights holders to people who are the least equipped to implement it.  What will parents who receive warning letters do?  Will they implement a sophisticated filtering system on their home router?  Will they send their children off to a reeducation camp run by the rights’ holders? More likely they will blanket ban the internet access.  How will cafes manage their risk? More likely they will not provide wifi access.  This has already been the death knell of community wifi networks in the US.  The collateral damage from these proposals is difficult to quantify but there is every reason to believe it will be widespread.  This damage is routinely ignored in policy making.

Will rights’ holders use such a system against everyone? That is unlikely.  Rather, it will be used against some individuals unlucky enough to be first on the list. Those individuals will be used as examples for others.  This will be a law which will be enforced in an arbitrary and discriminatory fashion.  As such it will undermine respect for the law more generally.

The comments on the proposals above assume that they are acted on bona fide.  Once network operators are conditioned to a Pavlovian response to requests the system will be abused – the Get Up! organisation already believes it has been the subject of misuse: https://www.getup.org.au/campaigns/great-barrier-reef–3/adani-video/someone-wants-to-silence-us-dont-let-them

Evasion technologies have previously been a niche interest.  The size of the market limited their growth.  These provisions will sheet home to all citizens the need to implement evasion technologies, thereby greatly increasing the market and therefore the economic incentive for their evolution.  The long run effect of implementing proposals which effect this form of general surveillance of the population is to weaken national security.

By insulating rights holders from the costs of enforcement the proposals disconnect rights holders from the very externalities that enforcement creates.  If there were ever a recipe for poor policy, such a disconnection would be a key element of it.

 

 



August 31, 2014

Links August 2014

Matt Palmer wrote a good overview of DNSSEC [1].

Sociological Images has an interesting article making the case for phasing out the US $0.01 coin [2]. The Australian $0.01 and $0.02 coins were worth much more when they were phased out.

Multiplicity is a board game that’s designed to address some of the failings of SimCity type games [3]. I haven’t played it yet but the page describing it is interesting.

Carlos Buento’s article about the Mirrortocracy has some interesting insights into the flawed hiring culture of Silicon Valley [4].

Adam Bryant wrote an interesting article for NY Times about Google’s experiments with big data and hiring [5]. Among other things it seems that grades and test results have no correlation with job performance.

Jennifer Chesters from the University of Canberra wrote an insightful article about the results of Australian private schools [6]. Her research indicates that kids who go to private schools are more likely to complete year 12 and university but they don’t end up earning more.

Kiwix is an offline Wikipedia reader for Android, needs 9.5G of storage space for the database [7].

Melanie Poole wrote an informative article for Mamamia about the evil World Congress of Families and their connections to the Australian government [8].

The BBC has a great interactive web site about how big space is [9].

The Raspberry Pi Spy has an interesting article about automating Minecraft with Python [10].

Wired has an interesting article about the Bittorrent Sync platform for distributing encrypted data [11]. It’s apparently like Dropbox but encrypted and decentralised. Also it supports applications on top of it which can offer social networking functions among other things.

ABC news has an interesting article about the failure to diagnose girls with Autism [12].

The AbbottsLies.com.au site catalogs the lies of Tony Abbott [13]. There’s a lot of work in keeping up with that.

Racialicious.com has an interesting article about “Moff’s Law” about discussion of media in which someone says “why do you have to analyze it” [14].

Paul Rosenberg wrote an insightful article about conservative racism in the US, it’s a must-read [15].

Salon has an interesting and amusing article about a photography project where 100 people were tased by their loved ones [16]. Watch the videos.

Twitter posts: 2014-08-25 to 2014-08-31

Big announcement about upcoming announcements...

The Papers Committee weekend went extremely well and without bloodshed according to Steve, although there was some very strong discussion from time to time! The upshot is that we have a fantastic program now, with excellent presentations all across the board.

We have already begun contacting Miniconf organisers to let them know who has been successful and who hasn’t, and over the next couple of weeks we will be sending emails out to everyone who submitted a presentation to let them know how they fared.

If you have been accepted to run a Miniconf then your contact will be Simon Lyall (miniconfs@lca2015.linux.org.au) and if you have been accepted as a speaker then your contact will be Lisa Sands (speakers@lca2015.linux.org.au). We will be asking for a photo of you and your twitter name, as we will be running a Speaker Feature about a different presenter each day - don’t worry - you will be notified on your day!

We want to give great thanks to everyone who submitted papers - you are all still winners in our eyes, and we hope that even if you weren’t selected this time that won’t put you off attending the conference and having a great time. Please note that due to the large volume of submissions, we are unable to provide feedback on why any particular submission was unsuccessful.

Our earlybird registration will be opening soon, so watch this space!

August 30, 2014

Outsourcing your webapp maintenance to Debian

Modern web applications are much more complicated than the simple Perl CGI scripts or PHP pages of the past. They usually start with a framework and include lots of external components both on the front-end and on the back-end.

Here's an example from the Node.js back-end of a real application:

$ npm list | wc -l
256

What if one of these 256 external components has a security vulnerability? How would you know and what would you do if of your direct dependencies had a hard-coded dependency on the vulnerable version? It's a real problem and of course one way to avoid this is to write everything yourself. But that's neither realistic nor desirable.

However, it's not a new problem. It was solved years ago by Linux distributions for C and C++ applications. For some reason though, this learning has not propagated to the web where the standard approach seems to be to "statically link everything".

What if we could build on the work done by Debian maintainers and the security team?

Case study - the Libravatar project

As a way of discussing a different approach to the problem of dependency management in web applications, let me describe the decisions made by the Libravatar project.

Description

Libravatar is a federated and free software alternative to the Gravatar profile photo hosting site.

From a developer point of view, it's a fairly simple stack:

The service is split between the master node, where you create an account and upload your avatar, and a few mirrors, which serve the photos to third-party sites.

Like with Gravatar, sites wanting to display images don't have to worry about a complicated protocol. In a nutshell, all that a site needs to do is hash the user's email and add that hash to a base URL. Where the federation kicks in is that every email domain is able to specify a different base URL via an SRV record in DNS.

For example, francois@debian.org hashes to 7cc352a2907216992f0f16d2af50b070 and so the full URL is:

http://cdn.libravatar.org/avatar/7cc352a2907216992f0f16d2af50b070

whereas francois@fmarier.org hashes to 0110e86fdb31486c22dd381326d99de9 and the full URL is:

http://fmarier.org/avatar/0110e86fdb31486c22dd381326d99de9

due to the presence of an SRV record on fmarier.org.

Ground rules

The main rules that the project follows is to:

  1. only use Python libraries that are in Debian
  2. use the versions present in the latest stable release (including backports)

Deployment using packages

In addition to these rules around dependencies, we decided to treat the application as if it were going to be uploaded to Debian:

  • It includes an "upstream" Makefile which minifies CSS and JavaScript, gzips them, and compiles PO files (i.e. a "build" step).
  • The Makefile includes a test target which runs the unit tests and some lint checks (pylint, pyflakes and pep8).
  • Debian packages are produced to encode the dependencies in the standard way as well as to run various setup commands in maintainer scripts and install cron jobs.
  • The project runs its own package repository using reprepro to easily distribute these custom packages.
  • In order to update the repository and the packages installed on servers that we control, we use fabric, which is basically a fancy way to run commands over ssh.
  • Mirrors can simply add our repository to their apt sources.list and upgrade Libravatar packages at the same time as their system packages.

Results

Overall, this approach has been quite successful and Libravatar has been a very low-maintenance service to run.

The ground rules have however limited our choice of libraries. For example, to talk to our queuing system, we had to use the raw Python bindings to the C Gearman library instead of being able to use a nice pythonic library which wasn't in Debian squeeze at the time.

There is of course always the possibility of packaging a missing library for Debian and maintaining a backport of it until the next Debian release. This wouldn't be a lot of work considering the fact that responsible bundling of a library would normally force you to follow its releases closely and keep any dependencies up to date, so you may as well share the result of that effort. But in the end, it turns out that there is a lot of Python stuff already in Debian and we haven't had to package anything new yet.

Another thing that was somewhat scary, due to the number of packages that were going to get bumped to a new major version, was the upgrade from squeeze to wheezy. It turned out however that it was surprisingly easy to upgrade to wheezy's version of Django, Apache and Postgres. It may be a problem next time, but all that means is that you have to set a day aside every 2 years to bring everything up to date.

Problems

The main problem we ran into is that we optimized for sysadmins and unfortunately made it harder for new developers to setup their environment. That's not very good from the point of view of welcoming new contributors as there is quite a bit of friction in preparing and testing your first patch. That's why we're looking at encoding our setup instructions into a Vagrant script so that new contributors can get started quickly.

Another problem we faced is that because we use the Debian version of jQuery and minify our own JavaScript files in the build step of the Makefile, we were affected by the removal from that package of the minified version of jQuery. In our setup, there is no way to minify JavaScript files that are provided by other packages and so the only way to fix this would be to fork the package in our repository or (preferably) to work with the Debian maintainer and get it fixed globally in Debian.

One thing worth noting is that while the Django project is very good at issuing backwards-compatible fixes for security issues, sometimes there is no way around disabling broken features. In practice, this means that we cannot run unattended-upgrades on our main server in case something breaks. Instead, we make use of apticron to automatically receive email reminders for any outstanding package updates.

On that topic, it can occasionally take a while for security updates to be released in Debian, but this usually falls into one of two cases:

  1. You either notice because you're already tracking releases pretty well and therefore could help Debian with backporting of fixes and/or testing;
  2. or you don't notice because it has slipped through the cracks or there simply are too many potential things to keep track of, in which case the fact that it eventually gets fixed without your intervention is a huge improvement.

Finally, relying too much on Debian packaging does prevent Fedora users (a project that also makes use of Libravatar) from easily contributing mirrors. Though if we had a concrete offer, we would certainly look into creating the appropriate RPMs.

Is it realistic?

It turns out that I'm not the only one who thought about this approach, which has been named "debops". The same day that my talk was announced on the DebConf website, someone emailed me saying that he had instituted the exact same rules at his company, which operates a large Django-based web application in the US and Russia. It was pretty impressive to read about a real business coming to the same conclusions and using the same approach (i.e. system libraries, deployment packages) as Libravatar.

Regardless of this though, I think there is a class of applications that are particularly well-suited for the approach we've just described. If a web application is not your full-time job and you want to minimize the amount of work required to keep it running, then it's a good investment to restrict your options and leverage the work of the Debian community to simplify your maintenance burden.

The second criterion I would look at is framework maturity. Given the 2-3 year release cycle of stable distributions, this approach is more likely to work with a mature framework like Django. After all, you probably wouldn't compile Apache from source, but until recently building Node.js from source was the preferred option as it was changing so quickly.

While it goes against conventional wisdom, relying on system libraries is a sustainable approach you should at least consider in your next project. After all, there is a real cost in bundling and keeping up with external dependencies.

This blog post is based on a talk I gave at DebConf 14: slides, video.

Australian Singing Competition

The Finals concert of the 2014 Australian Singing Competition was an amazing experience, and it was the first time I listened to opera singers live.

Congratulations to the winner, Isabella Moore from New Zealand!

Isabella Moore

Chromium tabs crashing and not rendering correctly?

If you’ve noticed your chrome/chromium on Linux having problems since you upgraded to somewhere around version 35/36, you’re not alone. Thankfully, it’s relatively easy to workaround. It will hit people who keep their browser open for a long time, or who have lots of tabs (or if you’re like me, and do both).

To tell if you’re suffering from this particular problem, crack open your ~/.xsession-errors file (or wherever your system logs stdout/stderr from programs running under X), and look for lines that look like this:

[22161:22185:0830/124533:ERROR:shared_memory_posix.cc(231)]
Creating shared memory in /dev/shm/.org.chromium.Chromium.gFTQSy
failed: Too many open files

And

[22161:22185:0830/124601:ERROR:host_shared_bitmap_manager.cc(122)]
Cannot create shared memory buffer

If you see those errors, congratulations! The rest of this blog post will be of use to you.

There’s probably a myriad of bugs open about this problem, but the one I found was #367037: Shared memory-related tab crash. It turns out there’s a file handle leak in the chromium codebase somewhere, relating to shared memory handling. There’s no fix available, but the workaround is quite simple: increase the number of files that processes are allowed to have open.

System-wide, you can do this by creating a file /etc/security/limits.d/local-nofile.conf, containing this line:

* - nofile 65535

You could also edit /etc/security/limits.conf to contain the same line, if you were so inclined. Note that this will only take effect next time you login, or perhaps even only when you restart X (or, at worst, your entire machine).

This doesn’t help you if you’ve got Chromium already open and you’d like to stop it from crashing Right Now (perhaps restarting your machine would be a terrible hardship, causing you to lose your hard-won uptime record), then you can use a magical tool called prlimit.

The prlimit syscall is available if you’re running a Linux 2.6.36 or later kernel, and running at least glibc 2.13. You’ll have a prlimit command line program if you’ve got util-linux 2.21 or later. If not, you can use the example source code in the prlimit(2) manpage, changing RLIMIT_CPU to RLIMIT_NOFILE, and then running it like this:

prlimit <PID> 65535 65535

The <PID> argument is taken from the first number in the log messages from .xsession-errors – in the example above, it’s 22161.

And now, you can go back to using your tabs as ersatz bookmarks, like I do.

August 29, 2014

SM1000 Part 4 – Killing a PCB and PTT Working

Last Sunday the ADC1 net on the first SM1000 prototype went open circuit all of a sudden. After messing about for a few hours I lifted the uC pin for that net and soldered a fine wire to the other end of the net. That lasted a few days then fell off. I then broke the uC pin trying to put it all back together. So then I tried to use some Chip Quick I had laying about from the Mesh Potato days to remove the uC. I royally screwed that up, breaking several pads.

It’s been 7 years since my last surface mount assembly project and it shows!

However when the uC came off the reason for the open circuit became apparent. The photo below was taken through the microscope I use for surface mount assembly:

At the top is the bottom part of a square pad that is part of the ADC1 net. The track is broken just before the lower left corner of the pad. Many of the pads under the uC were in various stages of decomposition, e.g. solder mask and tinning gone, down to bare copper. Turns out I used too much flux and it wasn’t cleaned out from under the chip when I washed the PCB. For the past few weeks it was busy eating away the PCB.

Oh well, one step back! So this week I built another SM1000, and today I brought it to life. After fixing a few small assembly bugs I debugged the “switches and leds” driver and sm1000_main.c, which means I now have PTT operation working. So it’s normally in receive mode, but press PTT and it swaps to tx mode. The sync, PTT, and error LEDs work too. Cool.

Here is a picture of prototype number 2:

The three trimmers along the bottom set the internal mic amp, and line levels to the “mic” and “speaker” ports of the radio. The pot on the RHS is the internal speaker volume control. The two switches upper RHS are PTT and power. On the left is a RJ45 for the audio connections to the radio and under the PCB (not visible) are a bunch of 3.5mm sockets that provide alternate audio connections to the radio.

What next? Well the speaker audio is a bit distorted at high volume so I might look into that and see if the LM386 is behaving as specified. Then hook it up to a real radio and test it over the air. That will shake down the interfaces some more and see if it’s affected by strong nearby RF. Oh, and I need to test USB and a few other minor interfaces.

I’m very happy with progress and we are on track to release the SM1000 in beta form commercially in late 2014.

Lidar landing with APM:Plane

Over the last couple of days I have been testing the Lidar based auto-landing code that will be in the upcoming 3.1.1 release of APM:Plane. I'm delighted to say that it has gone very well!

Testing has been done on two planes - one is a Meridian sports plane with a OS46 Nitro motor. That is a tricycle undercarriage, so has very easy ground steering. The tests today were with the larger VQ Porter 2.7m tail-dragger with a DLE-35 petrol motor. That has a lot of equipment on board for the CanberraUAV OBC entry, so it weighs 14kg at takeoff making it a much more difficult plane to land well.

The Lidar is a SF/02 from LightWare, a really nice laser rangefinder that works nicely with Pixhawk. It has a 40m range, which is great for landing, allowing the plane plenty of time to lock onto the glide slope in the landing approach.

APM:Plane has supported these Lidars and other rangefinders for a while, but until now has not been able to use them for landing. Instead they were just being logged to the microSD card, but not actively used. After some very useful discussions with Paul Riseborough we now have the Lidar properly integrated into the landing code.

The test flights today were an auto-takeoff (with automatic ground steering), a quick auto-circuit then an automatic landing. The first landing went long as I'd forgotten to drop THR_MIN down to zero (I normally have it at 20% to ensure the engine stays at a reasonable level during auto flight). After fixing that we got a series of good auto flights.

The flight was flown with a 4 second flare time, which is probably a bit long as it allowed the plane to lose too much speed on the final part of the flare. That is why it bounces a bit as it starts losing height. I'll try with a bit shorter flare time tomorrow.

Here is the video of one of the Meridian flights yesterday. Sorry for missing part of the flight, the video was shot with a cell phone by a friend at the field.

Here is another video of the Porter flying today, but taken from the north of the runway

I'd like to thank Charles Wannop from Flying Finish Productions for the video of the Porter today with help from Darrell Burkey.

The Next Adventure

Over my past few years at Automattic, I’ve worked on a bunch of different teams and projects – VideoPress, the WordPress iOS app, various Social projects, and most recently, o2. I even took a few months to work on WordPress core, helping build the auto-update functionality that we now see rolling out security updates within hours of their release.

The few months I spent working on WordPress core made me realise something – there’s a lot more I have to contribute. So, with the WordPress 4.0 RC out the door, I’m super excited to be moving to my next project – working on WordPress core full time!

Automattic naturally puts a lot of people-hours into WordPress, with over 30 of us contributing to WordPress 3.9. I’m looking forward to being a bigger part of that, and giving more back to WordPress community!

Test processes as servers

Since its very early days subunit has had a single model – you run a process, it outputs test results. This works great, except when it doesn’t.

On the up side, you have a one way pipeline – there’s no interactivity needed, which makes it very very easy to write a subunit backend that e.g. testr can use.

On the downside, there’s no interactivity, which means that anytime you want to do something with those tests, a new process is needed – and thats sometimes quite expensive – particularly in test suites with 10’s of thousands of tests.Now, for use in the development edit-execute loop, this is arguably ok, because one needs to load the new tests into memory anyway; but wouldn’t it be nice if tools like testr that run tests for you didn’t have to decide upfront exactly how they were going to run. If instead they could get things running straight away and then give progressively larger and larger units of work to be run, without forcing a new process (and thus new discovery directory walking and importing) ? Secondly, testr has an inconsistent interface – if testr is letting a user debug things to testr through to child workers in a chain, it needs to use something structured (e.g. subunit) and route stdin to the actual worker, but the final testr needs to unwrap everything – this is needlessly complex. Lastly, for some languages at least, its possibly to dynamically pick up new code at runtime – so a simple inotify loop and we could avoid new-process (and more importantly complete-enumeration) *entirely*, leading to very fast edit-test cycles.

So, in this blog post I’m really running this idea up the flagpole, and trying to sketch out the interface – and hopefully get feedback on it.

Taking subunit.run as an example process to do this to:

  1. There should be an option to change from one-shot to server mode
  2. In server mode, it will listen for commands somewhere (lets say stdin)
  3. On startup it might eager load the available tests
  4. One command would be list-tests – which would enumerate all the tests to its output channel (which is stdout today – so lets stay with that for now)
  5. Another would be run-tests, which would take a set of test ids, and then filter-and-run just those ids from the available tests, output, as it does today, going to stdout. Passing somewhat large sets of test ids in may be desirable, because some test runners perform fixture optimisations (e.g. bringing up DB servers or web servers) and test-at-a-time is pretty much worst case for that sort of environment.
  6. Another would be be std-in a command providing a packet of stdin – used for interacting with debuggers

So that seems pretty approachable to me – we don’t even need an async loop in there, as long as we’re willing to patch select etc (for the stdin handling in some environments like Twisted). If we don’t want to monkey patch like that, we’ll need to make stdin a socketpair, and have an event loop running to shepard bytes from the real stdin to the one we let the rest of Python have.

What about that nirvana above? If we assume inotify support, then list_tests (and run_tests) can just consult a changed-file list and reload those modules before continuing. Reloading them just-in-time would be likely to create havoc – I think reloading only when synchronised with test completion makes a great deal of sense.

Would such a test server make sense in other languages?  What about e.g. testtools.run vs subunit.run – such a server wouldn’t want to use subunit, but perhaps a regular CLI UI would be nice…



August 28, 2014

Raspberry Pi versus Cray X-MP supercomputer

It's often said that today we have in the phone in our pocket computers more powerful than the supercomputers of the past. Let's see if that is true.

The Raspberry Pi contains a Broadcom BCM2835 system on chip. The CPU within that system is a single ARM6 clocked at 700MHz. Located under the system on chip is 512MB of RAM -- this arrangement is called "package-on-package". As well as the RPi the BCM2835 SoC was also used in some phones, these days they are the cheapest of smartphones.

The Whetstone benchmark was widely used in the 1980s to measure the performance of supercomputers. It gives a result in millions of floating point operations per second. Running Whetstone on the Raspberry Pi gives 380 MFLOPS. See Appendix 1 for the details.

Let's see what supercomputer comes closest to 380 MFLOPS. That would be the Cray X-MP/EA/164 supercomputer from 1988. That is a classic supercomputer: the X-MP was a 1982 revision of the 1975 Cray 1. So good was the revision work by Steve Chen that it's performance rivalled the company's own later Cray 2. The Cray X-MP was the workhorse supercomputer for most of the 1980s, the EA series was the last version of the X-MP and its major feature was to allow a selectable word size -- either 24-bit or 32-bit -- which allowed the X-MP to run programs designed for the Cray 1 (24-bit), Cray X-MP (24-bit) or Cray Y-MP (32-bit).

Let's do some comparisons of the shipped hardware.

 

Basic specifications. Raspberry Pi versus Cray X-MP/EA/164
Item Cray X-MP/EA/164 Raspberry Pi Model B+
Price US$8m (1988) A$38
Price, adjusted for inflation US$16m A$38
Number of CPUs 1 1
Word size 24 or 32 32
RAM 64MB 512MB
Cooling Air cooled, heatsinks, fans Air cooled, no heatsink, no fan

 

Neither unit comes with a power supply. The Cray does come with housing, famously including a free bench seat. The RPi requires third-party housing, typically for A$10; bench seats are not available as an option.

The Cray had the option of solid-state storage. A Secure Digital card is needed to contain the RPi's boot image and, usually, its operating system and data.

 

I/O systems. Raspberry Pi versus Cray X-MP/EA/164
Item Cray Raspberry Pi
SSD size 512MB Third party, minimum of 4096MB
Price US$6m (1988) A$20
Price, adjusted for inflation US$12m A$20

 

Of course the Cray X-MP also had rotating disk. Each disk unit could contain 1.2GB and had a peak transfer rate of 10MBps. This was achieved by using a large number of platters to compensate for the low density of the recorded data, giving the typical "top loading washing machine" look of disks of that era. The disk was attached to a I/O channel. The channel could connect many disks, collectively called a "string" of disks. The Cray X-MP had two to four I/O channels, each capable of 13MBps.

In comparison the Raspberry Pi's SDHC connector attaches one SDHC card at a speed of 25MBps. The performance of the SD cards themselves varies hugely, ranging from 2MBps to 30MBps.

Analysis

What is clear from the number is that the floating point performance of the Cray X-MP/EA has fared better with the passage of time than the other aspects of the system. That's because floating point performance was the major design goal of that era of supercomputers. Ignoring the floating point performance, the Raspberry Pi handily beats out every computer in the Cray X-MP range.

Would Cray have been surprised by these results? I doubt it. Seymour Cray left CDC when they decided to build a larger supercomputer. He viewed this as showing CDC as not "getting it": larger computers have longer wires, more electronics to drive the wires, more heat from the electronics, more design issues such as crosstalk and more latency. Cray's main design insight was that computers needed to be as small as possible. There's not much smaller you can make a computer than a system-on-chip.

So why aren't today's supercomputers systems-on-chip? The answer has two parts. Firstly, the chip would be too small to remove the heat from. This is why "chip packaging" has moved to near the centre of chip design. Secondly, chip design, verification, and tooling (called "tape out") is astonishingly expensive for advanced chips. It's simply not affordable. You can afford a small variation on a proven design, but that is about the extent of the financial risk which designers care to take. A failed tape out was one of the causes of the downfall of the network processor design of Procket Networks.

Appendix 1. Whetstone benchmark

The whets.c benchmark was downloaded from Roy Longbottom's PC Benchmark Collection.

Compiling this for the RPi is simple enough. Since benchmark geeks care about the details, here they are.

$ diff -d -U 0 whets.c.orig whets.c
@@ -886 +886 @@
-#ifdef UNIX
+#ifdef linux
$ gcc --version | head -1
gcc (Debian 4.6.3-14+rpi1) 4.6.3

$ gcc -O3 -lm -s -o whets whets.c

Here's the run. This is using a Raspbian updated to 2014-08-23 on a Raspberry Pi Model B+ with the "turbo" overclocking to 1000MHz (this runs the RPi between 700MHz and 1000MHz depending upon demand and the SoC temperature). The Model B+ has 512MB of RAM. The machine was in multiuser text mode. There was no swap used before and after the run.

$ uname -a
Linux raspberry 3.12.22+ #691 PREEMPT Wed Jun 18 18:29:58 BST 2014 armv6l GNU/Linux

$ cat /etc/debian_version 
7.6

$ ./whets
##########################################
Single Precision C/C++ Whetstone Benchmark

Calibrate
       0.04 Seconds          1   Passes (x 100)
       0.19 Seconds          5   Passes (x 100)
       0.74 Seconds         25   Passes (x 100)
       3.25 Seconds        125   Passes (x 100)

Use 3849  passes (x 100)

          Single Precision C/C++ Whetstone Benchmark

Loop content                  Result              MFLOPS      MOPS   Seconds

N1 floating point     -1.12475013732910156       138.651              0.533
N2 floating point     -1.12274742126464844       143.298              3.610
N3 if then else        1.00000000000000000                 971.638    0.410
N4 fixed point        12.00000000000000000                   0.000    0.000
N5 sin,cos etc.        0.49911010265350342                   7.876   40.660
N6 floating point      0.99999982118606567       122.487             16.950
N7 assignments         3.00000000000000000                 592.747    1.200
N8 exp,sqrt etc.       0.75110864639282227                   3.869   37.010

MWIPS                                            383.470            100.373

It is worthwhile making the point that this took maybe ten minutes. Cray Research had multiple staff working on making benchmark numbers such as Whetstone as high as possible.

Terry is getting In-Terry-gence.

I had hoped to use a quad core ARM machine running ROS to spruce up Terry the robot. Performing tasks like robotic pick and place, controlling Tiny Tim and autonomous "docking". Unfortunately I found that trying to use a Kinect from an ARM based Linux machine can make for some interesting times. So I thought I'd dig at the ultra low end Intel chipset "SBC". The below is a J1900 Atom machine which can have up to 8Gb of RAM and sports the features that one expects from a contemporary desktop machine, Gb net, USB3, SATA3, and even a PCI-e expansion.





A big draw to this is the "DC" version, which takes a normal laptop style power connector instead of the much larger ATX connectors. This makes it much simpler to hookup to a battery pack for mobile use. The board runs nicely from a laptop extension battery, even if the on button is a but funky looking. On the left is a nice battery pack which is running the whole PC.



An interesting feature of this motherboard is no LED at all. I had sort of gotten used to Intel boards having blinks and power LEDs and the like.

There should be enough CPU grunt to handle the Kinect and start looking at doing DSLAM and thus autonomous navigation.

[life] Day 211: A trip to the museum with Megan and a swim assessment

Today was a nice full day. It was go go go from the moment my feet hit the floor, though

I had a magnificent 9 hours of uninterrupted sleep courtesy of a sleeping pill, some pseudoephedrine and a decongestant spray.

I started off with a great yoga class, and then headed over to Sarah's to pick up Zoe. The traffic was phenomenally bad on the way there, and I got there quite late, so I offered to drop Sarah at work on the way back to my place, since I had no particular schedule.

After I'd dropped Sarah off, I was pondering what to do today, as the weather looked a bit dubious. I asked Zoe if she wanted to go to the museum. She was keen for that, and asked if Megan could come too, so I called up Jason on the way home to see she wanted to come with us, and directly picked her up on the way home.

We briefly stopped at home to grab my Dad Bag and some snacks, and headed to the bus stop. We managed to walk (well, make a run for) straight onto the bus and headed into the museum.

The Museum and the Sciencecentre are synonymous to Zoe, despite the latter requiring admission (we've got an annual membership). In trying to use my membership to get a discounted Sciencecentre ticket for Megan, I managed to score a free family pass instead, which I was pretty happy about.

We got into the Sciencecentre, which was pretty busy with a school excursion, and girls started checking it out. The problem was they both wanted to call the shots on what they did and didn't like not getting their way. Once I instituted some turn-taking, everything went much more smoothly, and they had a great time.

We had some lunch in the cafe and then spent some more time in the museum itself before heading for the bus. We narrowly missed the bus 30 minutes earlier than I was aiming for, so I asked the girls if they wanted to take the CityCat instead. Megan was very keen for that, so we walked over to Southbank and caught the CityCat instead.

I was half expecting Zoe to want to be carried back from the CityCat stop, but she was good with walking back. Again, some turn taking as to who was the "leader" walking back helped keep the peace.

I had to get over to Chandler for Zoe's new potential swim school to assess her for level placement, so I dropped Megan off on the way, and we got to the pool just in time.

Zoe did me very proud and did a fantastic job of swimming, and was placed in the second-highest level of their learn to swim program. We also ran into her friend from Kindergarten, Vaeda, who was killing time while her brother had a swim class. So Zoe and Vaeda ended up splashing around in the splash pool for a while after her assessment.

Once I'd managed to extract Zoe from the splash pool, and got her changed, we headed straight back to Sarah's place to drop her off. So we pretty much spent the entire day out of the house. Zoe and Megan had a good day together, and I managed to figure out pretty quickly how to keep the peace.

When testing goes bad

I've recently started working on a large, mature code base (some 65,000 lines of Python code). It has 1048 unit tests implemented in the standard unittest.TestCase fashion using the mox framework for mocking support (I'm not surprised you've not heard of it).

Recently I fixed a bug which was causing a user interface panel to display when it shouldn't have been. The fix basically amounts to a couple of lines of code added to the panel in question:

+    def can_access(self, context):
+        # extend basic permission-based check with a check to see whether 
+        # the Aggregates extension is even enabled in nova 
+        if not nova.extension_supported('Aggregates', context['request']):
+            return False
+        return super(Aggregates, self).can_access(context)

When I ran the unit test suite I discovered to my horror that 498 of the 1048 tests now failed. The reason for this is that the can_access() method here is called as a side-effect of those 498 tests and the nova.extension_supported (which is a REST call under the hood) needed to be mocked correctly to support it being called.

I quickly discovered that given the size of the test suite, and the testing tools used, each of those 498 tests must be fixed by hand, one at a time (if I'm lucky, some of them can be knocked off two at a time).

The main cause is mox's mocking of callables like the one above which enforces the order that those callables are invoked. It also enforces that the calls are made at all (uncalled mocks are treated as test failures).

This means there is no possibility to provide a blanket mock for the "nova.extension_supported". Tests with existing calls to that API need careful attention to ensure the ordering is correct. Tests which don't result in the side- effect call to the above method will raise an error, so even adding a mock setup in a TestCase.setUp() doesn't work in most cases.

It doesn't help that the codebase is so large, and has been developed by so many people over years. Mocking isn't consistently implemented; even the basic structure of tests in TestCases is inconsistent.

It's worth noting that the ordering check that mox provides is never used as far as I can tell in this codebase. I haven't sighted an example of multiple calls to the same mocked API without the additional use of the mox InAnyOrder() modifier. mox does not provide a mechanism to turn the ordering check off completely.

The pretend library (my go-to for stubbing) splits out the mocking step and the verification of calls so the ordering will only be enforced if you deem it absolutely necessary.

The choice to use unittest-style TestCase classes makes managing fixtures much more difficult (it becomes a nightmare of classes and mixins and setUp() super() calls or alternatively a nightmare of mixin classes and multiple explicit setup calls in test bodies). This is exacerbated by the test suite in question introducing its own mock-generating decorator which will generate a mock, but again leaves the implementation of the mocking to the test cases. py.test's fixtures are a far superior mechanism for managing mocking fixtures, allowing simpler, central creation of mocks and overriding of them through fixture dependencies.

The result is that I spent some time working through some of the test suite and discovered that in an afternoon I could fix about 10% of the failing tests. I have decided that spending a week fixing the tests for my 5 line bug fix is just not worth it, and I've withdrawn the patch.

August 27, 2014

[life] Day 210: Running and a picnic, with a play date and some rain

I had a rotten night's sleep last night. Zoe woke up briefly around midnight wanting a cuddle, and then I woke up again at around 3am and couldn't get back to sleep. I surprised I'm not more trashed, really.

It was a nice day today, so I made a picnic lunch, and we headed out to Minnippi Parklands to do a run with Zoe in the jogging stroller. It was around 10am by the time we arrived, and I had grand plans of running 10 km. I ran out of steam after about 3.5 km, conveniently at the "Rocket Park" at Carindale, which Zoe's been to a few times before.

So we stopped there for a bit of a breather, and then I ran back again for another 3 km or so, in a slightly different route, before I again ran out of puff, and walked the rest of the way back.

We then proceeded to have our picnic lunch and a bit of a play, before I dropped her off at Megan's house for a play while I chaired the PAG meeting at Kindergarten.

After that, and extracting Zoe, which is never a quick task, we headed home to get ready for swim class. It started to rain and look a bit thundery, and as we arrived at swim class we were informed that lessons were canceled, so we turned around and headed back home.

Zoe watched a bit of TV and then Sarah arrived to pick her up. I'm going to knock myself out with a variety of drugs tonight and hope I get a good night's sleep with minimum of cold symptoms.

August 26, 2014

Central Sydney WordPress Meetup: E-mail marketing

Andrew Beeston from Clicky! speaks about email marketing at Central Sydney WordPress meetup:

[life] Day 209: Startup stuff, Kindergarten, tennis and a play date

Last night was not a good night for sleep. I woke up around 12:30am for some reason, and then Zoe woke up around 2:30am (why is it always 2:30am?), but I managed to get her to go back to bed in her own bed. I was not feeling very chipper this morning.

Today was photo day at Kindergarten, so I spent some extra time braiding Zoe's hair (at her request) before we headed to Kindergarten.

When I got home, I got stuck into my real estate license assessment and made a lot of progress on the current unit today. I also mixed in some research on another idea I'm running with at the moment, which I'm very excited about.

I biked to Kindergarten to pick Zoe up, and managed to get her all sorted out in time for her tennis class, and she did the full class without any interruptions.

After tennis, we went to Megan's house for a bit. As we were leaving, her neighbour asked if we could help video one of her daughters doing the ALS ice bucket challenge thing, so we got a bit waylaid doing that, before we got home.

I managed to get Zoe down to bed a bit early tonight. My cold is really kicking my butt today. I hope we both sleep well tonight.

About your breakfast

We know that eating well (good nutritional balance) and at the right times is good for your mental as well as your physical health.

There’s some new research out on breakfast. The article I spotted (Breakfast no longer ‘most important meal of the day’ | SBS) goes a bit popular and funny on it, so I’ll phrase it independently in an attempt to get the real information out.

One of the researchers makes the point that skipping breakfast is not the same as deferring. So consider the reason, are you going to eat properly a bit later, or are you not eating at all?

When you do have breakfast, note that really most cereals contain an atrocious amount of sugar (and other carbs) that you can’t realistically burn off even with a hard day’s work. And from my own personal observation, there’s often way too much salt in there also. Check out Kellogg’s Cornflakes for a neat example of way-too-much-salt.

Basically, the research comes back to the fact that just eating is not the point, it’s what you eat that actually really does matter.

What do you have for breakfast, and at what point/time in your day?

August 25, 2014

APM:Rover 2.46 released

The ardupilot development team is proud to announce the release of version 2.46 of APM:Rover. This is a major release with a lot of new features and bug fixes.



This release is based on a lot of development and testing that happened prior to the AVC competition where APM based vehicles performed very well.



Full changes list for this release:

  • added support for higher baudrates on telemetry ports, to make it easier to use high rate telemetry to companion boards. Rates of up to 1.5MBit are now supported to companion boards.
  • new Rangefinder code with support for a wider range of rangefinder types including a range of Lidars (thanks to Allyson Kreft)
  • added logging of power status on Pixhawk
  • added PIVOT_TURN_ANGLE parameter for pivot based turns on skid steering rovers
  • lots of improvements to the EKF support for Rover, thanks to Paul Riseborough and testing from Tom Coyle. Using the EKF can greatly improve navigation accuracy for fast rovers. Enable with AHRS_EKF_USE=1.
  • improved support for dual GPS on Pixhawk. Using a 2nd GPS can greatly improve performance when in an area with an obstructed view of the sky
  • support for up to 14 RC channels on Pihxawk
  • added BRAKING_PERCENT and BRAKING_SPEEDERR parameters for better breaking support when cornering
  • added support for FrSky telemetry via SERIAL2_PROTOCOL parameter (thanks to Matthias Badaire)
  • added support for Linux based autopilots, initially with the PXF BeagleBoneBlack cape and the Erle robotics board. Support for more boards is expected in future releases. Thanks to Victor, Sid and Anuj for their great work on the Linux port.
  • added StorageManager library, which expands available FRAM storage on Pixhawk to 16 kByte. This allows for 724 waypoints on Pixhawk.
  • improved reporting of magnetometer and barometer errors to the GCS
  • fixed a bug in automatic flow control detection for serial ports in Pixhawk
  • fixed use of FMU servo pins as digital inputs on Pixhawk
  • imported latest updates for VRBrain boards (thanks to Emile Castelnuovo and Luca Micheletti)
  • updates to the Piksi GPS support (thanks to Niels Joubert)
  • improved gyro estimate in DCM (thanks to Jon Challinger)
  • improved position projection in DCM in wind (thanks to Przemek Lekston)
  • several updates to AP_NavEKF for more robust handling of errors (thanks to Paul Riseborough)
  • lots of small code cleanups thanks to Daniel Frenzel
  • initial support for NavIO board from Mikhail Avkhimenia
  • fixed logging of RCOU for up to 12 channels (thanks to Emile Castelnuovo)
  • code cleanups from Silvia Nunezrivero
  • improved parameter download speed on radio links with no flow control



Many thanks to everyone who contributed to this release, especially Tom Coyle and Linus Penzlien for their excellent testing and feedback.



Happy driving!

APM:Plane 3.1.0 released

The ardupilot development team is proud to announce the release of version 3.1.0 of APM:Plane. This is a major release with a lot of new features and bug fixes.



The biggest change in this release is the addition of automatic terrain following. Terrain following allows the autopilot to guide the aircraft over varying terrain at a constant height above the ground using an on-board terrain database. Uses include safer RTL, more accurate and easier photo mapping and much easier mission planning in hilly areas.



There have also been a lot of updates to auto takeoff, especially for tail dragger aircraft. It is now much easier to get the steering right for a tail dragger on takeoff.



Another big change is the support of Linux based autopilots, starting with the PXF cape for the BeagleBoneBlack and the Erle robotics autopilot.



Full list of changes in this release

  • added terrain following support. See http://plane.ardupilot.com/wiki/common- ... following/
  • added support for higher baudrates on telemetry ports, to make it easier to use high rate telemetry to companion boards. Rates of up to 1.5MBit are now supported to companion boards.
  • added new takeoff code, including new parameters TKOFF_TDRAG_ELEV, TKOFF_TDRAG_SPD1, TKOFF_ROTATE_SPD, TKOFF_THR_SLEW and TKOFF_THR_MAX. This gives fine grained control of auto takeoff for tail dragger aircraft.
  • overhauled glide slope code to fix glide slope handling in many situations. This makes transitions between different altitudes much smoother.
  • prevent early waypoint completion for straight ahead waypoints. This makes for more accurate servo release at specific locations, for applications such as dropping water bottles.
  • added MAV_CMD_DO_INVERTED_FLIGHT command in missions, to change from normal to inverted flight in AUTO (thanks to Philip Rowse for testing of this feature).
  • new Rangefinder code with support for a wider range of rangefinder types including a range of Lidars (thanks to Allyson Kreft)
  • added support for FrSky telemetry via SERIAL2_PROTOCOL parameter (thanks to Matthias Badaire)

    added new STAB_PITCH_DOWN parameter to improve low throttle behaviour in FBWA mode, making a stall less likely in FBWA mode (thanks to Jack Pittar for the idea).
  • added GLIDE_SLOPE_MIN parameter for better handling of small altitude deviations in AUTO. This makes for more accurate altitude tracking in AUTO.
  • added support for Linux based autopilots, initially with the PXF BeagleBoneBlack cape and the Erle robotics board. Support for more boards is expected in future releases. Thanks to Victor, Sid and Anuj for their great work on the Linux port. See http://diydrones.com/profiles/blogs/fir ... t-on-linux for details.
  • prevent cross-tracking on some waypoint types, such as when initially entering AUTO or when the user commands a change of target waypoint.
  • fixed servo demo on startup (thanks to Klrill-ka)
  • added AFS (Advanced Failsafe) support on 32 bit boards by default. See http://plane.ardupilot.com/wiki/advance ... iguration/
  • added support for monitoring voltage of a 2nd battery via BATTERY2 MAVLink message
  • added airspeed sensor support in HIL
  • fixed HIL on APM2. HIL should now work again on all boards.
  • added StorageManager library, which expands available FRAM storage on Pixhawk to 16 kByte. This allows for 724 waypoints, 50 rally points and 84 fence points on Pixhawk.
  • improved steering on landing, so the plane is actively steered right through the landing.
  • improved reporting of magnetometer and barometer errors to the GCS
  • added FBWA_TDRAG_CHAN parameter, for easier FBWA takeoffs of tail draggers, and better testing of steering tuning for auto takeoff.
  • fixed failsafe pass through with no RC input (thanks to Klrill-ka)
  • fixed a bug in automatic flow control detection for serial ports in Pixhawk
  • fixed use of FMU servo pins as digital inputs on Pixhawk
  • imported latest updates for VRBrain boards (thanks to Emile Castelnuovo and Luca Micheletti)
  • updates to the Piksi GPS support (thanks to Niels Joubert)
  • improved gyro estimate in DCM (thanks to Jon Challinger)
  • improved position projection in DCM in wind (thanks to Przemek Lekston)
  • several updates to AP_NavEKF for more robust handling of errors (thanks to Paul Riseborough)
  • improved simulation of rangefinders in SITL
  • lots of small code cleanups thanks to Daniel Frenzel
  • initial support for NavIO board from Mikhail Avkhimenia
  • fixed logging of RCOU for up to 12 channels (thanks to Emile Castelnuovo)
  • code cleanups from Silvia Nunezrivero
  • improved parameter download speed on radio links with no flow control

Many thanks to everyone who contributed to this release, especially our beta testers Marco, Paul, Philip and Iam.



Happy flying!

[life] Day 208: Kindergarten, running, insurance assessments, home improvements, BJJ and a babyccino

Today was a pretty busy day. I started off with a run, and managed to do 6 km this morning. I feel like I'm coming down with yet another cold, so I'm happy that I managed to get out and run at all, let alone last 6 km.

Next up, I had to get the car assessed after a minor rear-end collision it suffered on Saturday night (nobody was hurt, I wasn't at fault). I was really impressed with NRMA Insurance's claim processing, it was all very smooth. I've since learned that they even have a smartphone app for ensuring that one gets all the pertinent information after an accident.

I dropped into Bunnings on the way home to pick up a sliding rubbish bin. I've been wanting one of these ever since I moved into my place, and finally got around to doing it. I also grabbed some LED bulbs from Beacon.

After I got home, I spent the morning installing and reinstalling the rubbish bin (I suck at getting these things right first go) and swapping light bulbs around. Overall, it was a very satisfying morning scratching a few itches around the house that had been bugging me for a while.

I biked over to Kindergarten for pick up again, and we biked back home and didn't have a lot of time before we had to head out for Zoe's second freebie Brazilian Jiu-Jitsu class. This class was excellent, there were 8 kids in total, and 2 other girls. Zoe got to do some "rolling" with a partner. It was so cute to watch. They just had to try and block each other from touching their knees, and if they failed, they had to drop to the floor and hop back up again. For each of Zoe's partners they were very civilized and took turns at failing to block.

Zoe was pretty tired after the class. It was definitely the most strenuous class she's had to date, and she briefly fell asleep in the car on the way home. We had to make a stop at the Garage to grab some mushrooms for the mushroom soup we were making for dinner.

Zoe helped me make the mushroom soup, and after dinner to popped out for a babyccino. It's been a while since we've had a post-dinner one, and it was nice to do it again. We also managed to get through the entire afternoon without and TV, which I thought was excellent.

My Media Server

Over the years, I’ve experimented with a bunch of different methods for media servers, and I think I’ve finally arrived at something that works well for me. Here are the details:

The Server

An old Dell Zino HD I had lying around, running Windows 7. Pretty much any server will be sufficient, this is just the one I had available. Dell doesn’t sell micro-PCs anymore, so just choose your favourite brand that sells something small and with low power requirements. The main things you need from it are a reasonable processor (fast enough to handle transcoding a few video streams in at least realtime), and lots of HD space. I don’t bother with RAID, because I won’t be sad about losing videos that I can easily re-download (the internet is my backup service).

Downloading

I make no excuses, nor apologies for downloading movies and TV shows in a manner that some may describe as involving “copyright violation”.

If you’re in a similar position, there are plenty of BitTorrent sites that allow you register and add videos to a personal RSS feed. Most BitTorrent clients can then subscribe to that feed, and automatically download anything added to it. Some sites even allow you to subscribe to collections, so you can subscribe to a TV show at the start of the season, and automatically get new episodes as soon as they arrive.

For your BitTorrent client, there are two features you need: the ability to subscribe to an RSS feed, and the ability to automatically run a command when the download finishes. I’ve found qBittorrent to be a good option for this.

Sorting

Once a file is downloaded, you need to sort them. By using a standard file layout, you have a much easier time of loading them into your media server later. For automatically sorting your files when they download, nothing compares to the amazing FileBot, which will automatically grab info about the download from TheMovieDB or TheTVDB, and pass it onto your media server. It’s entirely scriptable, but you don’t need to worry about that, because there’s already a great script to do all this for you, called Advanced Media Server (AMC). The initial setup for this was a bit annoying, so here’s the command I use (you can tweak the file locations for your own server, and you’ll need to fix the %n if you use something other than qBittorent):

"C:/Program Files/FileBot/filebot" -script fn:amc --output "C:/Media/Other" --log-file C:/Media/amc.log --action hardlink --conflict override -non-strict --def "seriesFormat=C:/Media/TV/{n}/{'S'+s}/{fn}" "movieFormat=C:/Media/Movies/{n} {y}/{fn}" excludeList=C:/Media/amc-input.txt plex=localhost "ut_dir=C:/Media/Downloads/%n" "ut_kind=multi" "ut_title=%n"

Media Server

Plex is the answer to this question. It looks great, it’ll automatically download extra information about your media, and it has really nice mobile apps for remote control. Extra features include offline syncing to your mobile device, so you can take your media when you’re flying, and Chromecast support so you can watch everything on your TV.

The Filebot command above will automatically tell Plex that a new file has arrived, which is great for if you choose to have your media stored on a NAS (Plex may not be able to automatically watch a directory on a NAS for when new files are added).

Backup

Having a local server is great for keeping a local backup of things that do matter – your photos and documents, for example. I use CrashPlan to sync my most important things to my server, so I have a copy immediately available if my laptop dies. I also use CrashPlan’s remote backup service to keep an offsite backup of everything.

Conclusion

While I’ve enjoyed figuring out how to get this all working smoothly, I’d love to be able to pay a monthly fee for an Rdio or Spotify style service, where I get the latest movies and TV shows as soon as they’re available. If you’re wondering what your next startup should be, get onto that.

August 24, 2014

Guitar

Does anyone still blog? It seems nearly everyone has moved onto Twitter/Facebook. I miss being able to express thoughts in more than 160 characters.



I went to a picnic recently, and some people were passing a steel string guitar around. I'm not a good acoustic player, but it was fun so I had a bash. Someone played Under The Bridge, and took liberties with the chord voicings. So I was inspired to pick up my guitar and work through the official transcription, which I own. While the basic form of the song is pretty simple, as you can hear, the clever part is the choice of chord voicings and fills. I'll be practicing that one for a while.



I've also started over working through the Berklee method books, starting at Volume 2. I learned by playing by ear and memorising, so sight reading is still something I'm getting used to, and sometimes I'm not disciplined enough to do it properly. But I'm getting better at that. I'll be so happy when I start to get good at position playing.

Physiotherapy

I'm at Elevate in Sydney CBD. For a long time, I've struggled with flexibility issues, and I began to think something must be wrong. It turned out something is wrong-I have a minor skeletal deformity in my left hip joint, and my muscles have developed in a strangely imbalanced way to compensate. Except it isn't working, I have severely reduced range of motion and had chronic pain in my left hip joint.

My Physio thinks he can correct the problem, but it's going to take a while. So I'll be off training for at least six weeks, and more likely two months or more. But it will be worth it if my joint pain goes away and I can move like the other people my judo class.

Posted via LiveJournal app for iPhone.

 
"Curiously enough, the only thing that went through the mind of the bowl of petunias as it fell was 'Oh no, not again.'" - Hitchhiker's Guide to the Galaxy.

One for the stats nerds

At USyd, we did all our stats in R. Now I'm working at the Department of Health, and we do most of our stats in SAS. SAS is pretty different to R, and so I've needed to work hard to try to learn it.



This is a rite of passage that most trainee biostatisticians go through, and so people have shoved various books into my hands to help me get up to speed. I'll omit the names of many of the books to protect the guilty, but the most useful book someone pressed innto my hands was The Little SAS Book, which I read cover to cover in two sittings.



The Little SAS Book is more technical than the others, hence more suitable for programmers, and actually gives you an inkling of what the designers of the language were thinking. That's helped me begin to think in the language, which is something none of the other books have helped me to do.



The best comparison I can come up with for now is that SAS is like German, whereas R is like Japanese. SAS has lots of compound statements, each of which does a lot, while R has many small statements which each do a little bit. So would you like to be able to speak German or Japanese? The correct answer is, of course, both, each at the appropriate time :)

Gainfully employed

A while ago, I applied for a job as a biostatistician in public health. I made it to the interview stage, and that seemed to go quite well. They said they'd contact me in seven to ten days. I didn't hear anything for a while, but eventually I bumped into one of my referees who said he'd spoken with my interviewers, and they sounded "very positive". I poked my other referee, and he said they'd spoken to him too. So that was sounding pretty good.



On the advice of my girlfriend, I asked them how things were going, and they said they were waiting for a criminal record check to complete. Owing to my misspent youth, there's no criminal record to check, so now I was feeling very positive indeed. To cut a long story short, today they offered me a position, and I accepted.



So all's well that ends well!

British Medical Journal publishes paper on the risks of head banging

Head and neck injury risks in heavy metal



This is the funniest thing I've seen in ages. I particularly like the mitigation options: many injuries could be prevented if AC/DC would stop playing Back In Black live, and instead play Moon River ;)
 
Sometimes I feel like I'm not so much in control of my body as sending it memoes. And it responds with things like "Tough job, hip rotation. Can you come back Monday?".

True Temperament

I've been playing a few more jazz chords and moveable chord forms of late, and my ear's been getting a little better. Unfortunately, this means I've become more sensitive to how out of tune the notes in some of those chords sound as you move up the neck.



To some extent, this problem is inherent in the guitar's construction. There are some very determined people at a company called True Temperament who've decided to do something about this by making custom necks with strange looking curved frets. The FAQ on that site also goes into some depth about tuning methods and why the problem is unsolvable on a standard guitar.



So I'm going to have to live with it, or pick up a saxophone or something :)

Judo

Judo is going well. I've been working on the fundamentals a lot recently, especially breakfalling. I'm finally getting to the point where I'm losing my fear of being thrown - the people in my club are nice and aren't there to hurt people, and I've learnt that by just going with the throw rather than resisting you can breakfall more cleanly. That way, you're very unlikely to get hurt. And if you pay attention while you're being thrown, you tend to learn more about how the throw works, so when it comes your turn, you'll do it better.



Being a lightweight, I've got to fight differently to the heavier judoka, so in the next little while I'm going to focus on improving my speed and perfecting my technique for the basic throws and sweeps. If you're stronger you can just apply more force to get bad throwing techniques to work, but this isn't an option for me. I think ultimately it's a good thing, because I'll have to learn the throws properly.



Always more things to work on. Practice, practice, practice.
 
Having spent the last few weeks being sick, now that I'm beginning to get better I'm finding I'm pretty hyper.
 
Just getting over this illness, whatever it is. I just want to eat and sleep.
 
I'm using a surprising amount of maths in my current job. Recently, we've been trying out measures of diversity. Today, I'm taking a look at Shannon entropy.

The tyranny of distance

At the moment, I'm commuting between two and two and a half hours each way to and from work. That's between twenty and twenty five hours a week. And it's costing me more than $65 a week to do all that travelling. This doesn't make any sense. So looking forward to moving.
 
I've been sick for a few weeks. I thought it was a bad cold, but my mum thinks it's something more serious. She suggests it might be sinusitis. We're not doctors, so it's off to visit a GP tomorrow to find out what's wrong.

An open letter to Peter Ryan regarding police treatment of cyclists

Hon Peter Ryan,



I am writing because I am concerned at the number of recent incidents where a driver has collided with a cyclist, and the case hasn't been followed up by the police. Such incidents and the publicity surrounding them does nothing to encourage road users to obey the law when they realise that they will most likely get away with not doing so.



A week ago in Ballarat, a 13 year old boy was hit by a car, and the police said the boy had the right of way[1]. Despite this, the article linked states that the police will not charge the driver. This, despite her having broken Australian Road Rule 67 to 72, 84 or 86 depending on circumstances at the stated intersection, or perhaps 140 to 144 if travelling in the same direction. She was likely negligent in allowing the collision to happen in the first place, which, by my understanding, is a criminal offence, especially since there was serious injury involved. If she used the usual excuse that "she didn't see him", then that's an admission of guilt in failing to obey ARR 297 - driver having proper control of vehicle.



Also recently, there was a highly publicised case where Shane Warne had an altercation with a bicycle rider. In that case, the fact that Warne hit the cyclist from behind (ARR 126) after overtaking unsafely (ARR 144) is undisputed[2]. The fact that details were not exchanged following the collision is also undisputed (ARR 287). It is also well established that Warne was stopped unnecessarily in a bike lane (ARR 125; 153)[3]. And yet the police will not investigate[4].



Going back a number of years, I also have not had good experiences getting the police to follow up on cases. In my most recent case (11/10/2005; I do not know the case number sorry, all I know was that I was attended to by Angove & Auchterlonie from Boroondara police), the driver also failed to obey ARR 287 (as well as a slew of other offences, such as ARR 46 and 148 - changing lanes without indicating sufficiently and without due care). The police refused to prosecute the driver, and also would not hand over the driver's details or insurer details, based on some misguided privacy policy, asking me instead to fork out for a freedom of information request. Given that I was a broke student at the time, this was not a feasible thing to do and I never did receive compensation from the driver for damage to my bicycle, clothes, and large out of pocket expenses for travel to medical care for several years that the TAC didn't cover. The police also displayed a lack of knowledge of the law, initially thinking that I had broken ARR 141.



I can't imagine why the police aren't investigating these cases, because in each case, clear evidence is at hand, and not disputed. The identities of all parties are known. It should be an open and shut case. Without the police making charges, the rider in each case will have a much harder time claiming from the driver's insurance (if the boy was not admitted overnight, his TAC excess will be an enormous burden to his family). The driver in each case will not be discouraged from driving in a similar fashion next time. And other drivers also know that they will most likely get away with any offences they commit if a bicycle is involved. This is a perverse reversal of the situation that we should have, in which drivers should be encouraged to take due diligence around cyclists. It almost seems that the police always assume a cyclist is at fault unless proven otherwise in Australia, whereas most other countries with an established bicycling culture assume that the driver is at fault unless proven otherwise as they hold the burden of driving the more deadly vehicle and so should be required to take due care.



If the laws weren't adequate enough to prosecute to the driver in the above cases, has your department been contacted to update the laws, and what is being done? Keep in mind that cyclists have no protection other than by the law, and as the more vulnerable road user, the laws should focus on their safety and ensuring that transgressions are dealt with effectively.



Can you please encourage the police in each of these cases to follow them up to the full extent that the law currently allows.





Sincerely,





[1]

http://www.theage.com.au/victoria/teen-cyclist-struck-by-car-20120110-1ps85.html



[2]

http://theage.drive.com.au/motor-news/warnes-tirade-triggers-bike-rego-call-20120118-1q5k0.html



[3]

http://www.cyclingtipsblog.com/2012/01/cyclist-versus-warnie-the-cyclists-story/



[4]

http://www.heraldsun.com.au/news/more-news/warne-blasts-cyclists-on-twittershane-warne-clashes-with-cyclist-on-way-home-from-training-session/story-fn7x8me2-1226246735306

Breaking windows

Another letter in The Age today. Unedited text below:





Ian Porter (Without car manufacturing, we are on the road to ruin, The Age, 13 Jan) believes that the government needs to keep throwing money at the car industry in order to support other industry in Australia. I'm surprised as an industry analyst, he hasn't heard of the broken window fallacy.



Throwing good money after a bad unsustainable industry that can't adapt is just a waste. It's exactly identical to sending soldiers to dig holes only to fill them back up again just to keep them employed and off the streets. The money could be better spent on doing useful things that will remain useful into the future. Yes, paying people to break windows and then paying the glazier to repair them will keep people employed, but couldn't the glazier be better employed building things that then keep other people employed into the future?



Why don't we do something useful with the money instead? Like built modern intra- and inter-city rail infrastructure? This won't become stranded assets when cheap oil becomes unavailable. We won't be left with vast tracts of useless motorways - we will continue to be able to use the rail infrastructure well past these boom times.

Police a bit rich

Hrrrfm. The Age didn't publish my letter:





I find it a bit rich that the police union are upset that information

alongside a photograph was distributed about one of their members, without

his consent. I understand that truth is not not considered a defence to

libel in Australia, so it was perhaps unwise to distribute such a photo.

But it is common police practice to photograph protesters without our

consent, and to store these photos with profiles in national databases

without a right of appeal or review. I probably find myself on some

watchlist now just for attending some of last night's Occupy Melbourne

general assembly.



Maybe there would be no need for a photograph to be distributed if police

correctly wore their own name badges (and if the name badges weren't

deliberately too small to read). Or if there was some accountability, as

opposed to the protectionism that police have demonstrated in the past

with the likes of their disgusting behaviour at the APEC protests.

on the hardships of living with minimal amounts of RAM (4GB or so)

I just got 200MB/s read/write rate from my swap device on my laptop. Fast laptop eh? OK, so I'm cheating by using the compcache/zram module from the staging tree.



When I bought my 2 laptops, I was upgrading from 256MB to 4GB. I thought that would be enough to last me for years. The video card on that first laptop came with more memory than the system memory of the machine I was upgrading from. Alas, I forgot to factor in opera and firefox (we're now in the era when Emacs is officially lightweight). And being laptops with the particular chipsets they have, 4GB is it, I'm afraid.



And the fact that Linux's VMM, for me, has never really handled the case of a machine running with a working set not all that much smaller than physical RAM. If I add up resident process sizes plus cache plus buffer plus slab plus anything else I can find, I always come up about 25% short of what's actually in the machine. Ever since those 256MB days (whereas about half the ram went "missing" on the 128MB machine prior to then). And even when your working set, including any reasonable allowance for what ought to be cachable, falls far short of RAM, it still manages to swap excessively, killing interactive performance (yes, I've tried /proc/sys/vm/swappiness). When I come in in the morning, it's paged everything out to make backups through the night marginally faster (not that I cared about that - I was asleep). Then it pages everything back in again at 3MB/s, despite the disk being capable of 80MB/s. Pity it's not smart enough to realise that I need the entire contiguous block of swapped pages back in, so it might as well dump the whole wasted cache, and read swap back in contiguously at 80MB/s rather than seeking everywhere and getting nowhere.



What I really wanted, was compressed RAM. Reading from disk with lots of seeks is a heck of a lot slower than decompressing pages in RAM. I vaguely recall such an idea exists if you're running inside VMWare or the like. But this is a desktop. I want to display to my physical screen without having to virtualise my X11 display.



But the zram module might be what I want. Pretty easy to set up (in the early days, it required a backing swap device and was kinda fiddly). Here's the hack I've got in rc.local along with a reminder sent to myself that I've still got this configured, at reboot:

echo 'rc.local setting zramfs to 3G in size - with a 32% compression ratio (zram_stats), that means we take up 980M for the ramfs swap' | mail -s 'zram' tconnors
echo $((3*1024*1024*1024)) > /sys/block/zram0/disksize
mkswap /dev/zram0
swapon -p 5 /dev/zram0


It seems to present as a block device of default 25% of RAM size (but I've chosen 3GB above), and as you write to that device, compressed versions of the page end up in physical memory. Eventually you'd run out of physical memory, and hopefully you have a second swap device (of lower priority) configured where it can page out for real. In my case, I'm using the debian swapspace utility. Be warned, if you plan to hibernate your laptop, not to forget to have a real swap partition handy :)



zram_stats tells me I'm currently swapping 570MB compressed down to 170MB, for a compression ratio of 28%. That 170MB has to be subtracted from the memory the machine has, so it appears to really only have 3.8 or so GB. No huge drawback. At that compression ratio, if I were to swap another 3GB out, physical ram stolen by zram would only be 1GB. My machine would be appearing to have 3GB of physical ram, 3GB of blindingly fast swap, and a dynamic amount (via swapspace) of slow disk based swap. I'd be swapping more because I had 1GB less than I originally had. But at least I'd be swapping so quickly I ought not notice it ('course, I haven't bench marked this). And I'd be able to have 2GB more in my working set before paging really starts to become unbearable.



So, with an uptime of 4 hours, I haven't even swapped to disk yet (I know this, because swapspace hasn't allocated any swapfiles yet). The machine hasn't yet thrashed half to death yet. That must be a recent record for me.





Yes, the module is in the staging tree. It's already deadlocked on me once, getting things stuck in the D state. And the machine has deadlocked with unexplained reasons a couple of other times recently (with X having had the screensaver going at the time, so no traces, and no idea whether it's general kernel 3.0 flakiness or zram in particular; I had forgotten until tonight that I even had previously configured zram back in the 2.6.32 days).



What I really *really* want, since I lack the ability to add more ram to the machines, is a volatile-ram ESata device, used purely as a swap device, reinitialised each boot (ie, having a battery backup is just pointless complexity and expense, and SSD is slow, fragile and prone to bad behaviour when you can't use TRIM, for the amount of writes involved in a swap device). There is the Gigabyte i-Ram and GC-RAMDISK and similar devices, but they're kinda pricey, even without the RAM included in the price. Why is SSD so much cheaper than plain old simple RAM these days? I thought the complexity involved would very much make it go the other way around.



What I really *really* **really** want, is for software to be less bloaty crap.

We do things differently, here

Another slightly edited letter published in The Age today. Maybe I should become a media mogul. Original here:



I've just come back from a tour of Europe. Wind farms are everywhere. Near tourist attractions, and along roads where it is particularly windy. Anywhere appropriate, and especially near townships and individual houses, because that's where the consumers of electricity are. No one seems to have a problem with them. People there don't suffer from increased rates of cancer or bogus self-imagined inflictions. They don't ban building windmills within 2km of towns. They don't ban the building along a windy stretch of road because tourists happen to drive along there.



They also don't develop in green wedges, allow cattle to graze in their national parks, or try to make it easier to log old growth forest and make it harder to protect such lands.



Europeans seem to have no problem accepting that, despite their per-capita emissions being way below ours, that something has to change. It's a pity we are not lead by leaders. The best I can manage out of my local member, Ted Baillieu, is a form letter in reply to my concerns, uttering vague niceties about planning and the economy, and attacking the opposition.

Failed and now discarded Victorian cycling strategy

I've always been a crazy cat man who sends letters to the editor and his local parliamentary representitatives. Except that I have no cat. Anyway, a shortened version of this letter was published in The Age today.





Dear Sir/Madam (CCed my State local member, and The Age letters),



The auditor general's report into the Victorian government cycling strategy said "the Department of Transport and VicRoads had not ... addressed conflicts and delays where cyclists crossed busy roads, and where cyclists and pedestrians shared paths." ("No way to spin it, the wheels are off", The Age, Aug 18). It's not just busy crossings that cause unnecessary delays to people not in the precious car.



A trip along Southbank is usually hampered by 2 traffic light controlled crossings where up to 100 pedestrians and riders are waiting at the lights with an average waiting time of around 5 minutes between them. That's 10 minutes per return trip wasted. We wait for just an occasional car (each with just one person in them) and empty tram to pass. The cars are frequent enough to make running ("jaywalking") across the road a little unsafe, but not frequent enough that the road is anywhere near capacity and that adding more frequent red lights for the car traffic is going to harm the flow into and out of the city at all. And it will help the 100 waiting pedestrians.



In the land where cycling is taken seriously, Holland, they want cyclists to have to wait no more than 15 seconds. And they're experimenting with microwave sensors to extend the green cycle to let cyclists cross safely. Here, the Southbank story is repeated across the city. Outside Swinburne University, a pedestrian light regularly sees several dozens of students wait several minutes at lunchtime to cross while a small handful of cars (each with just one person in them) cross just frequently enough to make a quick dash across the road down from the lights, impossible. The vehicle sensor loops at Camberwell Junction have, for years, been tuned to not even be sensitive enough to detect cyclists, so you can wait at 11pm for 2 cycles of the lights to completely bypass turning green on the road you're travelling on, while no cars cross the other legs of the junction at all before you give up and cross illegally (completely safely, because there's no traffic at all at that time of night and you can see for miles).



Given that you can't continue to keep encouraging people to get in their cars because it's been conclusively proven over the last 40 years that you can't build your way out of car congestion, perhaps it time to promote other forms of travel?

New Media

The Age published an article about http://theconversation.edu.au/, a new media outlet run by the former chief in editor of The Age. Not only have I seen intelligent articles on it, their editors and authors understand Creative Commons licenses.

Mary Poppins

Small country towns and petrol. I should have learned by now. I was running short of where I expected to run low[1], but the maps told me there was a little town up the road with fuel, so I stopped there. It's Sunday. In a small town. That's OK, I've got 36km of fuel left according to the onboard computer, and a guy reckons a town 20km back there had fuel. I didn't see it, and it was a very small town, so I decide to push my luck and head over the mountains, where I know a town 63km away (Mansfield) has fuel. I've stopped before when the computer reckoned there was 7km left, and I really had 1.5L of fuel left, which should be good for 30km. So 36+30km should get me there with 3km to spare! Except that mountains take juice. So I absolutely babied it over. Then thought I was lost because of a GPS stuffup (problem exists between touchscreen and bike seat). I never went above 80km/h hour (and associated with the want not to have to roll on the throttle, is the want to not put on too much brake to waste too much energy. Not braking and mountains aren't really a clever mix). And it should have been a really fun road. I still hadn't reached the top of the mountain when the computer said there was 0km left. I couldn't listen to music, because I had to listen to the telltale signs of the engine missing or other signs that I should immediately turn off the ignition lest the fuel pump bearings burn up. Anyway, 20km later, no signs of trouble, and I roll into the fuel station. 1.5L left still.



I've got a Mary Poppins fuel tank.



Anyhoo, that blew the cobwebs away. 2 days ought to be enough holiday between jobs, right? Wish me luck tomorrow! I've reccied where it is that I'm working, so now I've just got to find out what I'm actually doing. Oh, and find a house.



[1] At Caltex in the main street of Wagga Wagga, I got the worst quality fuel I've ever got (5.8L/100km, for premium grade, despite traveling most of the time at the speed limit, and riding pretty conservatively (compared to the rest of my trip in NSW!). The previous fuel was 5.1L/100km, and the next fuel was 5.4L/100km despite only having the lower grade available)

The wrong politic

It seems that Senator Carr didn't like the frank and fearless advice his public servants were offering him, and the Chief Scientist's position became untenable. Sure, you're not meant to offer that frank and fearless advice through the media, but what's the point of a having a chief scientist or indeed any publicly paid scientist if they're only allowed to tow the party line, and not allowed to tell the public what they need to know? We see this time and again. CSIRO researchers have been completely barred from making any public comments without going through the central media office. What's the use of public funding if the public research isn't allowed to be told?



Tony Rabbit wanted to remove the Chief Scientist's office because it was too political (I did read this in the SMH a few months ago, but can't find the cite). Senator Carr wanted to remove the officer because she was the wrong politic and was telling too much truth.

Why I don't donate to natural disasters in Australia anymore

I donated towards the Black Saturday fires, and then the donation policy of Red Cross became "we'll forward donations to people with insurance and people with holiday homes that got burned down". I wanted my money to go to people who can't afford to pay for insurance, and certainly to people who can't afford holiday and investment homes. Insurance will cover those who can afford it. The rest truly deserve a break. The Qld flood donations are going to people who simply won't need it.



And as to who would pay for it, and whether Australia should postpone bringing ourselves back into budget surplus: If we didn't dump the mining rent resources tax, we'd be fine. Not only would the annual amount generated by the tax neatly match the amount that needs to be spent repairing Qld, but if it was framed ideally (ie, applied to all mining companies) it would come from companies that were largely responsible for the worsening of these severe storms. I.e., they wouldn't be able to externalise their costs onto the rest of society so much anymore - those that actually consume more would end up paying for the damage it does, which would then partly fund the mitigation costs we all endure. Actually, it should come partly from farmers too. What did you expect would happen when you clear the land of its natural ability to regulate water flow?



The guy who texted into JJJ talkback that we should just drop the National Broadband scheme instead, on the basis that it would be obsolete by the time it was built, made me laugh. Yes sure, if we don't build something, then the next thing we can't build would be even better!

Wrong technological fixes to problems vol. #8123

Arizona state apparently spent $1B to attempt to automate the detection of people crossing a 53 mile section of the Mexican border.



If we expect the lifetime of such a project to be 15 years before the infrastructure completely falls apart and needs to be renewed, then in that same 15 year period, we can employ 33333/15=2222 staff at what seem to be typical US wage rates (neglecting inflation. But since the US economy is a basket case, I might be justified in doing that). In that 53 mile space, we could space 2222 guards every 40 metres in a line, or a bit more sparse if you wanted a grid of guards to detect tunneling.



<hint of sarcasm="maybe">

I'm sure most government spending is useful, and I'm sure the expense of the project could be entirely justified. I'm sure the article is just ill-informed.

</hint of sarcasm>

Vale Purrple

I'm not having much luck selecting cats for longevity rather than character. Still, I'd rather character than longevity.







Purrple has been living with mum since Phred died, because cats always deserve fellow playthings, and I wasn't about to get another cat. The signs of her (presumably) cancer started showing in October, but the tests the vet did didn't reveal anything (he wasn't searching for cancer though). On Monday this week, she started showing other signs - that of kidney failure. In the end, she went the same way Phred did.



I didn't get to see her in the end - the curse of long distance part time veterinaries. He made the call, it could either be sew her back up, give her drugs, and transport her back to us, or put her down.



And it's only just hit me. I had to type that up.

Reqium for a species

Yikes. I'm reading Clive Hamilton's "Requiem for a species. Why we resist the truth about Climate Change". (all tyops are mine)





To date, governments have shunned geoengineering for fear of being accused of wanting to avoid their responsibilities with science fiction solutions. The topic is not mentioned in the Stern report and receives only one page in Australia's Garnaut report. As a sign of its continuing political sensitivity, when in April 2009 it was reported that President Obama's new science adviser John Holdren had said that geoengineering is being vigorously discussed as an emergency option in the White House, he immediately felt the need to issue a "clarification" claiming that he was only expressing his personal views. Holdren is one of the sharpest minds in the business and would not be entertaining what is now known as 'Plan B'— engineering the planet to head off catastrophic warming — unless he was fairly sure Plan A would fail.





It is far easier, on the face of it (and certainly, politically), to perform geoengineering than to slow down the generation of CO2. So cheap that one country can afford it, instead of it being such a huge (political) task that not even all of the worlds countries acting cooperatively will be able to pull it off. So great, lets go servo the eco-system. Control Systems are easy, right? They never break into unwanted oscillations while you're still learning their response function.





The implications are sobering. In August 1883 the painter Edvard Munch witnessed an unusual blood-red sunset over Oslo. He was shaken by it, writing that he 'felt a great, unending scream piercing through nature'. The incident inspired him to create his famous work, The Scream. The sunset he saw that evening followed the eruption of Krakatoa off the coast of Java. The explosion, one of the most violent in recorded history, sent a massive plume of ash into the stratosphere, causing the Earth to cool by more than one degree and disrupting weather patterns for several years. More vivid sunsets would be one of the consequences of using sulphate aerosols to engineer the climate; but a more disturbing effect of enhanced dimming would be the permanent whitening of daytime skies. A washed-out sky would become the norm. If the nations of the world resort to climate engineering as an expedient response to global heating, and in doing so relieve pressure to cut carbon emissions, then as the concentration of carbon dioxide in the atmosphere continued to rise so would the latent warming that must be suppressed. It would then become impossible to stop sulphur injections into the stratosphere, even for a year or two, without an immediate jump in temperature. It's estimated that, if we did stop, the backup of greenhouse gases could see warming rebound at a rate 10-20 times faster than in the recent past, a phenomenon referred to, apparently without irony, as the "termination problem". Once we start manipulating the atmosphere we could be trapped, forever dependent on a program of sulphur injections into the stratosphere. In that case, human beings would never see a blue sky again.





Please read his book. The book goes down many paths -- human pyschology, politics, science. It's bloody depressing, but people need to understand why we not going down a better route.

Health and Safety

It has always frustrated me that the medical profession and unions and the like are always pushing the health and safety barrow so much without critical thought.



Putting up safety fencing to the point that no one pays attention anymore, because they assume the safety fencing will always be everywhere (I am reminded here of work. You have to pay a lot more attention now lest your attention lapses when you go near a fence with a hole in it because the engineering simply makes it impossible to make everything safe). (I could rant how the unions have forced legislation on how brightly lit my office has to be, to the point where it hurts my eyes if I don't wear sunglasses, but I'm going offtopic here)



Putting sensors in cars that are so safe that you don't need to pay attention anymore, so that most people drive like they're driving a Volvo (I fear and loath the research into automatically driven cars − unless those cars all limit themselves to 40km/h or they legislate against cyclists and kangaroos from roads, the research will be a failure, safety wise). Rear view cameras being mandated in cars simply because a few people in 4wds are too stupid to look backwards before running over their spawn? How is that going to protect against a child that is lying underneath the car?



But when it comes to mandatory helmet legislation, it seems the medical profession are just blind and dogmatic, and lack any critical thinking skills.



The head of Montreal’s trauma unit, Dr Raziz, really needs to come out to Australia and have a look in the trauma unit of Melbourne's hospitals some time. There he'll see that helmets do very little against cars that hit helmeted cyclists; after all, the standards only test to impact speeds of 19.5km/h - a fall of 1.5metres without any additional velocity components of heavy blunt metal. Helmets do nothing when a cyclist is ejected over the handlebars face first into the tarmac, because their handlebars got caught in the wheel-well of an excessively high 4wd. Cars are driven recklessly by drivers who have never gotten used to, nor tolerated cyclists because most cyclists had been driven off the road 20 years ago precisely because of the legislation that people like him were trying to push. When you only look at one small part of the picture, you only see a very small part of the picture. Get out there and look at the big picture. Getting more people cycling is the solution.



Something that makes people feel safer, but is not actually safer (bicycle helmets) just leads to risk compensation. Forcing people to wear helmets is anything but safe. The choice to wear helmets should be your choice, and your choice only (or your parents, if you are of an age that it is deemed that you can't legally decide for yourself).



A far more effective piece of legislation to introduce would be to ban vehicles from having a bonnet of height more than that of your typical sedan. The aggressivity ratings of 4WDs is unacceptably large, so they have poor crash compatibility with other road users. If only the legislation worked to minimise risky practices rather than forcing passive safety and adopting other practices that lead to risk compensation.

Conga line of suckholes

I've got a higher respect for ex-leader of the ALP, Mark Latham than I currently do have for Prime Minister Julia Gillard and Attorney-General Robert McClelland.



Conga line of suckholes indeed.

Google Maps Fun

Google maps is fun. Google maps API is even more fun!



Just so many cool things to do. My first Google maps hack lets you draw routes on the map (or sat image) and print out the distance associated with it. I've got some other cool things coming up, but I thought I'd get that one out now.



Oh, it is currently centered on work's new building, but zoomed out to see most of the city.

Python Generators

Didn't understand the coolness of python generators today. I wanted to generate a list of

files in a directory. Previously I had to write a class and do __iter__ tricks. Now I can

simply do this:



def file_walk(path):
    for dn, ignore, files in os.walk(path):
        for fn in files:
            yield dn + os.sep + fn

Python decorators

I love Python because it is so easy to write unreadable code in.



I wanted to handle sub-commands and didn't want to go to all the hassle of

maintaining a dispatch dictionary. So I decided I could be really seedy and

do:



globals()[args[0]](args[1:])



However this sucks if someone picks function that wasn't intended as a subcommand.



Python decorators to the rescue! My main problem with the dispatch dictionary was

having to update commands in two places. So with decorators I can do this:



commands = {}



def command(fn):

commands[fn.func_name] = fn



@command

def foo(args): pass



and then



commands[args[0](args[1:])



and I don't have to be so seedy. Of course I'm sure people still won't understand

what I'm doing, but thats ok ;)

Hoary Hedgehog

Today I decided to join the droves trying out hoary. I would love to say it was simple seamless experience, but it wasn't.



Not that it was particularly painful find you, just a couple of little annoyances.



Firstly SATA didn't quite work for me. My BIOS has somethign called "combination mode", which seems to make the SATA disks appear like normal ATA disks as well as SATA disks. Which confused the hell out of the kernel. By setting it to "Normal" mode in the BIOS this problem went away.



The other problem was buggy media. The CD seemed a bit scratchy but after retrying about 5 times it finally worked.



Anyway seemed to work and let me get at a terminal. I haven't got rid of the GNOME stuff and installed ratpoison yet, but this will mainly be a remote

login box anyway, so I don't care too much about the GUI.

Switching ALSA audio outputs

While its all well and good mixing audio output, so you can hear both the CD you are listening too, and

the audio stream from a VLC stream, it can get kind of confusing listening to two things at once.



So I to write a simple shell script which would mute the currently active output

stream, and unmute the other, which I could then easily bind this to a key in ratpoison.



I thought it would be easy, which it was, but the result is fairly gross. Surely someone can show me a better way

to do this:



#!/bin/sh

if [ `amixer cget iface=MIXER,name="PCM Playback Switch" | tail -1 | cut -d\, -f2` "==" off ]; then 
    amixer cset iface=MIXER,name="PCM Playback Switch" 1 > /dev/null; 
    amixer cset iface=MIXER,name="CD Playback Switch" 0 > /dev/null; 
else 
    amixer cset iface=MIXER,name="PCM Playback Switch" 0 > /dev/null; 
    amixer cset iface=MIXER,name="CD Playback Switch" 1 > /dev/null; 
fi
 
Yay, I got my paper into LCA 2005. Hooray!



In other news I picked up my big day out tickets today. Hooray!



Finally, I leave you with a great (very nerdy) quote from Ted Ts:



The way the kernel will deal with C++ language being a complete
disaster (where something as simple as "a = b + c + d +e" could
involve a dozen or more memory allocations, implicit type conversions,
and overloaded operators) is to not use it.  Think about the words of
wisdom from the movie Wargames: "The only way to win is not to play
the game".
 
So instead of going to SLUG last night, Jamie and I went and played pool at the Clare Hotel. Anyway, long story short, it turns out we aren't the only

ones who play the penis game in Sydney.

have cable!

of course i dont have a computer yet. i have a nice new powerbook on order which should show up soon.



so anyway this post is coming courtesy of my palm pilot connecting to cable via new dlink 624+ wireless router.
 
This is a cool (though for very nerdy reasons), piece of art.

Meme meme wonderful meme

So I was explaining to Suzy exactly what a meme was the other day, but now I have a more thorough example to show. It seems that the "23rd post, 5th line" meme, is a mutation, of another "grab nearest book, 23rd page, 5th line" (or more likely the mutation went the other way around.) The point of the story is look at how that meme managed to adapt to the livejournal environment to ensure its continued replication. (Or so the meme freaks would have you believe ;)



Anyway, the meme lives on and I will give it to you in book format, from the "PCI System Architecture; 4th Ed." (yes, I am that lame...)



"and the return of the bus to the idle state. It defined how a device must respond"



So there you go, benchmark still hasn't finished and Angel still isn't on TV yet.

Screwing over business

So I am waiting for benchmarks to run, so I will actually update

this thing.



These latest wage rises are really quite silly for two main reasons:



1/ It really doesn't help the low income worked by much (which

is what the ACTU has been saying).

2/ It screws over small and medium businesses, which will end

up putting people out of work because they can't afford the

wage rise.



This article in the Australian explains it better than I will, but the short version is, for the $19 wage rise businesses will end up paying more than $19 per employee due to on-costs. And of the $19 families will see less than $4 once you take out the tax and the loss of other benefits.



This is really dumb, basically everyone loses, well, except that is for us. By not having to pay as many benefits out, and by raking in extra payroll tax from business, the government will be able to afford to gice middle-income earners a tax break, and get themselves reelected, or am I being too cynical?

The Free Trade Agreement

I'm sure you all realise that one person's crusade is another person's "whatever", but can I urge you all to read of the problems with the FTA.



This bill was all about being able to sell wheat and stuff to the US, but in return we have to agree to the United State's draconian copyright and digital rights management laws. This will make it illegal for certain software to be developed in Australia, with the chance of programmers being branded criminals and through in gaol.



Of course with all the other problems in the world I'm sure

this will go largely unnoticed :(.
 
I don't know what is more annoying not being able to eat or not being able to shave.



On the not eating side of things, does anyone have any suggestiosn for liquid meals?
 
So to explain my last post, whilst playing rugby on the

weekend, one of the oppositions' elbows came into contact with the side of my head. Normally this is pretty by the by, elbow swings, jaw moves, keep playing. In this case however I was lying on the ground and hence jaw couldn't really move, and the force behind the elbow was the entire weight of the player assisted by gravity. So jaw has nowhere and breaks under the force.



Of course I don't actually remember any of this happening, I was knocked unconcious, hell I didn't even feel the pain in my jaw until hours later.



Luckily it is an undisplaced fracture, which basically means I have a crack, but the jaw didn't move anywhere, so I don't need to be wired up or anything. I wish I could scan in the xrays they are pretty cool.



So now I'm out of rugby for at least 6 weeks while the bone heals.



Also of note is how damn cool the OPG (no idea what it stands for) xray machine, you stand still and it zips around your head taking incremental xrays to give a flat project of your mouth, really classy.



I should also note how cool drugs are. Codeine and paracetomal really hit the spot. I'm not sure how good any of the code I write whilst on it will be but oh well.
 
Broken jaws are painful.

Blog blog blog... over here

So I've jumped ship as it were and am now mostly blogging on my own site, so point your browser to http://benno.id.au/blog/ (or

your aggregator to http://benno.id.au/blog/feed/)

NSW geocoding

So my maps stuff now lets you look up addresses in NSW.

Posting from the air!

I'm currently flying somewhere over the black sea, en route to London. Singapore airlines is really cool and have the interweb on board. Rock!

GIMP and colour depth

So I'm playing with a new embedded board, which has a nice 16-bit 640x480 colour LCD. So to make

a nice splash-screen I fired up the GIMP did a nice gradient effect and some text. This looked

really nice on my 32-bit colour display, but once you move to a 16-bit display the gradient is

no longer nice and smooth.



So all I want to do is convert my 24-bit colour RGB image to a 16-bit colour RGB image, and get the

GIMP to do dithering. This is something that should be relatively straight forward. Alas I couldn't

find any way to do, and neither could anyone else in the lab.



I ended up using convert, which worked pretty well:



convert -treedepth 5 -colors 65535 -dither logo24.bmp logo.bmp



But it still amazes me that GIMP can't do this. If anyone knows how to do it please let me know!



Here is the image if you want to give it a try.

OMG! You would not believe the picture of a shark I saw today!





In fact this whole shark site is pretty hilarious. Don't even ask why I was googling for sharks.

More GoogleMaps fun.

I've updated my google maps interface again.



There is a new tool "Handy Places" which gets a bunch of different map views from a backend database and gives you easy access to them. Of course I still need allow people to add their own bookmarks here, but that should be doable soon.



Length finder has some rudimentry UI for saving stuff, but this doesn't actually work yet :). Otherwise I still think its the best length finder available for google maps at the moment.



Current Place has been updated to correctly give you an idea of the size of the earth you are currently looking at. The coolest thing is seeing how the map gets distorted as you get closer to the poles.

Round-up of options for disabling Mac OS X Lion's feature of auto-restoring windows

As part of the "Back to the Mac" theme in OS X Lion (10.7) by Apple, they have taken what they have learnt from user interfaces and experience on iOS devices such as the iPhone and iPad, and tried to bring some of those concepts home to the full fledged Mac experience.





There are many changes in relation to this but one of those most noticeable, and sometimes annoying, features -- is that applications will now often restore the documents and windows you had open when you last closed them. Not only that, your entire desktop will re-open to every application and document you were last using.





While this is sometimes useful, it can also be very annoying. For myself, the most common application this bugs me with is Preview. I am quite used to building up a pile of documents in preview, only to quit it to clear them out so that next time I start them, the build-up is gone. This is also happening with Google Chrome and TextEdit.





Fortunately, there are some solutions at hand! There are two main options;





Close all windows in an application once-off



If you use the option key when selecting the application menu, you will note most applications gain a "and Close all windows" suffix on the quit item. This will quit the application and not remember the open windows.



Additionally you can simple use Apple-Option-Q as a single keyboard shortcut to close an application including all of it's windows.





Disable the feature entirely



You can wholesale disable the feature, so that no application will re-open windows and so that your desktop won't re-open applications. This is a fairly simple toggle.







  1. Select the Apple menu, then move halfway down to "System Preferences" and select it.


  2. Select the "Show All" button from the top menu bar


  3. Select the very first icon under the "Personal" category, "General"


  4. Look towards the bottom and select the option "Restore windows when quitting and re-opening apps"








Disable the behaviour on a per application basis.



It can be done manually with "defaults write" in many cases, however a free application RestoreMeNot has been developed and released which automates this behavior.



It's a free download and allows you to exclude specific applications from this behavior, in my case Preview was first cab off the rank.

Watch out for hostname changes when using replication!

Cross-post from my blog at sun



For one reason or another, many times we find ourselves changing the hostname of a machine. It's been repurposed or moved - or perhaps the original installer didn't know what name it should have. To achieve this on most modern Linux distributions there are 2 key files you need to update.





  1. /etc/hostname needs to be updated with correct hostname to be set on boot, and


  2. /etc/hosts needs to be updated for DNS lookups of the local hostname. This is more important than you might think and will break many applications if not updated.






Some people also take the third step of updating the hostname on the fly with the 'hostname' tool, which if you do that means the gotcha I'm about to describe take you completely unaware in some weeks or months.



If you are using MySQL replication, there are two key options which depend on the hostname. These are the 'log-bin' and 'relay-log' for the binary log and binary log replication log paths respectively. The problem is not only do the logs themselves depend on the hostname, so does the index which tells you where to find them. So if you restart the server, it will look for a new index file and won't find it - causing errors such as:



090825 17:17:15 [ERROR] Failed to open the relay log './mellie-relay-bin.000002' (relay_log_pos 339)

090825 17:17:15 [ERROR] Could not find target log during relay log initialization




There are several possible solutions to this, one involves combining the old and new files (which you can find documented here - but that's a more pro-active approach. The second is to completely restart the replication process - which in my opinion, is cleaner. So I will detail that approach.



First we need to stop the slave process, just to make sure.



mysql> STOP SLAVE;




Then we can get the slave status, to see what position the master is currently. You can see what that looks like here. The important values to note are the following two:



mysql> SHOW SLAVE STATUS\G

*************************** 1. row ***************************

Master_Host: localhost

Master_User: root

Master_Port: 3306

Relay_Master_Log_File: gbichot-bin.005

Exec_Master_Log_Pos: 79





These values tell us what the current position in the master's binary logs the slave has executed up to as well as the basic master details. The reason this is important is we are going to tell the slave to completely forget about it's current replication information and fetch the data fresh.



While normally you could just change the master log file and position, since it can't open the relay log at all - the slave replication does not start and we must completely reset and specify all of the details again. The above information contains everything you need except the password for the replication user. You can find that by reading either the 'master.info' file or by prior knowledge.



ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log




To reset that, we run RESET SLAVE like so:



mysql> RESET SLAVE;




Then we run we need to construct a CHANGE MASTER statement with the above information.



In our case the statement is

mysql> RESET SLAVE;

mysql> CHANGE MASTER TO MASTER_HOST="localhost", MASTER_USER="root", MASTER_PASSWORD="test", MASTER_LOG_FILE="gbichot-bin.005", MASTER_LOG_POS=79;


... but be sure to use your own values from the SLAVE STATUS and make sure the log and position are from Relay_Master_Log_File and Exec_Master_Log_Pos - there are other values that look similar so don't confuse them. Once this is done we can start the slave, and check the status to make sure it is replicating correctly.



mysql> START SLAVE;

*wait a few moments*

mysql> SHOW SLAVE STATUS\G




When the slave status is displayed, make sure that both the IO and SQL threads are running and there are no errors.





mysql> SHOW SLAVE STATUS\G

*************************** 1. row ***************************

Slave_IO_Running: Yes

Slave_SQL_Running: Yes

Seconds_Behind_Master: 8




Also keep an eye on the Seconds_Behind_Master value and make sure that it is reducing to 0.





That's this weeks situation. If you do change your hostname, it pays to reboot your machine to make sure everything has worked and that issues will not pop up down the track when your machine is unexpectedly rebooted by a crash or some other circumstance. You don't need unexpected changes causing problems!



This applies to any situation where you might change a configuration file, but making it's effects current are done separately. This is very common in MySQL, where you might want to change a dynamic variable and also edit the my.cnf file. If you make a syntax error, you won't know until your server reboots. So it helps to be very careful and preferably do the actual MySQL or server reboot.

Checking ldirectord is alive

This week's blog post is not strictly to do with MySQL, but a little more to do with highly available clusters using heartbeat and ldirectord



While many people use heartbeat with MySQL, ldirectord usage is less common in these scenarios and more often using in clustered web and mail servers. It is however sometimes used with a selection of MySQL slave servers.



ldirectord is a tool that manages IPVS in the kernel. Essentially you give it a list of servers that act as a "cluster" for a service, for example, 2 web servers. It will then setup the linux load balancer IPVS to direct to these 2 machines. However, what it does is keeps monitoring the servers, and if one of them goes away, it removes them from the cluster pool.



The problem I have run into a number of times, is that ldirectord gets stuck and stops monitoring services. However when it does this, then services stop getting updated, and if a service goes down, it won't be removed from the cluster. On top of that, I have had it get stuck on START UP, after a failover, in this case not many of the services had a chance to come up yet, and you are stuck with a cluster often with 0 nodes available to service some requests - which causes downtime.



So last night, Shane Short and myself wrote a patch to ldirectord and a nagios plugin, in order to make sure that ldirectord is doing it's job and hasn't got stuck. It works by hooking into ldirectord's '_check_real' function, which is called whenever a server is checked. It will then adjust the timestamp on a 'pulse' file, which we later check with our nagios script.



Here is the patch to ldirectord: http://lathiat.net/files/ldirectord.patch



So now, in the default configuration we will end up with a file at /var/run/ldirector.ldirectord.pulse (this file is actually in the same location as your ldirectord PID file, so if you have moved that, it will be with it) which has it's timestamp updated with each service check.



Now, we make a plugin for nagios, which I have here:



http://lathiat.net/files/check_ldirectord_pulse



And you can configure this plugin into Nagios or Nagios NRPE as normal. You can test it is working by running the plugin manually, you should have a result like this;





OK: ldirectord pulse is regular (4 seconds since last beat)





The default timeout is 120 seconds (2 minutes) for a warning, and 300 seconds (5 minutes) for a critical alert.



Hope this helps some people using ldirectord! Personally this has caused downtime for ourselves a few times when ldirectord got stuck. I would love to hear any feedback or if you are successfully (or unsuccesfully) using this, you can contact me here:

http://lathiat.net/contact

At Linux.conf.au 2009 and starting on Planet MySQL

Greetings Planet MySQL readers,



I am new to Planet MySQL.. so I thought I should introduce myself.



I am Trent Lloyd (some may know me online as 'lathiat'), based in Perth, Western Australia and presently working for Sun Microsystems as a MySQL Support Engineer providing support to Sun's MySQL customers. I have been with Sun for 12 months, and previous to that was working for MySQL AB before it was acquired for 8 months. My background before that is in the ISP industry working for HostAway in a combination System/Network administration and support role.



I have also given a number of papers, often related to either Avahi or IPv6 at a few conferences.. mainly Linux.conf.au - you can view them on my web-site www.lathiat.net.



I have an open-source/free-software community background.. I co-authored Avahi (a mDNS/DNS-SD/Link-Local IP stack for Linux and other *nixes) with Lennart Poeterring and dabbled my hand in the likes of the Ubuntu MOTU and GNOME communities.



Working in the MySQL Support Team, and having a very large customer base to source problems from, we run into many problems and gotcha's on our customer systems which people don't hit every day but are very difficult to track down when you do. I hope that by sharing some of these experiences





With that introduction out of the way, I have just landed in Hobart, Tasmania, Australia to attend linux.conf.au (which was a very last minute arrangement). I have attended this conference every year since 2003 (thats 7 of them!), it's always great and I am glad I am able to attend again.



I am sitting at the "Open Source Databases" mini-conference which has a strong MySQL presence. There are quite a few Sun folk here, which is fantastic - unfortunately a few others were unable to make it but it should be great never the less.



I will be bringing you more Linux.conf.au updates throughout the week and MySQL tips into the future!

Linkin Park - No More Sorrow

I just noticed that as of a few days ago (22nd August) - Avahi is now 3 years old.



Heres my original release announcement:

http://lists.freedesktop.org/archives/avahi/2005-August/000227.html



That's a crazy amount of time, since then I presented at Linux.conf.au 2006 and GUADEC 2007 (Birmingham) as well as some presentations at GNOME mini-confs and the like.



Fun and games... also for anyone following this blog, I regularly twitter as lathiat

http://twitter.com/lathiat



Feel free to follow me, but it tends to be more personal stuff rather than Tech/Open-Source related

Matchbox 20 - Push

Dear World,



Please remind me why I bought a mac?



Love,

Trent



[i was typing away the other day and *blip* my backlight stopped working, permanently, seriously, wtf.]

Traveling to sydney...

Howdy all,



I will be traveling to Sydney on Sunday the 20th and 21st - if you're in sydney and want to catch up for a beer or something let me know.



Only timeslot will be Sunday (20th) afternoon as I fly out Monday night (21st)



- lathiat

Pete Murray - Oppurtunity

As most of you reading this are likely aware, I work as a Support Engineer for MySQL AB - which was recently acquired by Sun Microsystems.



If you have been living under some variety of rock-like object, you can see the press release here:

http://www.mysql.com/news-and-events/sun/







As part of that, as of this month I now work for Sun Microsystems Australia.





Trent Lloyd

MySQL Support Engineer

Sun Microsystems





However I am really doing the same job I was before.. so far the acquisition seems to have gone fairly positively. I was a little concerned about some of the employment/IP restrictions that our new fangled contracts bring but in the end I was able to sort out enough to satisfy me.



I am still working from Home, and there are no plans (at least for me) to move around within Sun - I plan to continue my role as MySQL Support Engineer.



I really hope this acquisition is beneficial for MySQL in the long run.. there are potential ups and downs but so far for me the experience has been very positive and the Sun team have been very welcoming.



The MySQL Users Conference is upon us this week, which means there will likely to be some interesting announcements from various MySQL-related companies as tends to be the case around major conferences (there are already some talk of a new product from "Kickfire" that sounds interesting, albeit sketchy at this stage)



In more personal news, they sold the house I am renting so I have to move. For more amusement Aleesha is over-seas until after I have to move so I have to move before she gets back, oh well. I applied for a house today and the Property Manager seemed very enthusiastic so I guess thats a good sign.



It's a very nice 3x2 townhouse:

http://gallery.mac.com/lathiat#100525&bgcolor=black&view=grid



It's also only a couple hundred meters from the local telephone exchange, so ADSL2+ speeds should be fairly flat (24/1 M) which will be nice :)



To follow me closer, check out my twitter: twitter.com/lathiat

Britney Spears - Piece of me

Howdy all,



I know there are some followers of my blog.. and I know I don't update it very much (sorry!)



However I update my twitter quite regularly, so check out http://twitter.com/lathiat (you can subscribe as an RSS if you want)



Trent

Matchbox 20: The Burn

Back home in Perth from Linux.conf.au... couple surprises when I got in.



First up, I made Qantas Silver Frequent flyer. This is mainly a yay for the priority check-in - and I get 1 free Qantas club invitation.



Had I thought about it when I started travelling, and taken Qantas the whole time I probably would have been gold by now but I took 2 big european trips on emirates.. and a whole stack of Virgin Blue domestic. Oh well.



Secondly, I left my air conditioner on.. It's a crappy old wall unit and it has apparently continually frozen and unfrozen up over the week and theres a nice trail of water down the wall onto my mattress which is very damp and has several water stain marks. Obviously been through the cycle a few times. It also managed to eat a bit into the plasterboard under it. -woops-. When I got in it was frozen solid out the filter and nearly out the plastic grating.



Note to self: check this in future.



And last but not least, its too damn hot in Perth.

Poker

While I'm in Melbourne for linux.conf.au (which finished yesterday), I thought I'd head down to the Crown Poker Room to get some action.



Unfortunately I missed the Aussie Millions by a couple of weeks, but I did run into one of the final tablist while there. He made alot of money.



I set myself a limit of $300.. so first I tackled the Sunday $100 ($85+$15) NLHE tournament. I didn't fair so well.. I got up in chips early (doubled up).. had a really unfortunate hand..



I was dealt [Kd] exposed, next card was [Ac] and my redealt card was [6s]. I elected to fold and out flopped [Kh][Kc][3d] - I was not happy! I definitely would have been in with [Kd][As] and my trips would have more than likely got me a healthy stack. D'oh.



I endeed up going out just before level 4 with my [Kh][As] vs [Jh][10s]. The flop was a blank and a [10c] came on the river sealing my fate.



From then I moved onto the $2/$3 NLHE. I bought in for $100 and about an hour later was up to $254 and cashed out when my seat in a $50 Sit'n'Go came up.



I didn't do too well in the Sit'n'Go either.. busted out in 6th place calling all-in with my [As][10s] against my offenders [Ah][Ac]. The aces held up.



Then I nearly left.. but decided to head back to the $2/$3 NLHE cash game again for $100. Only about 30 minutes in I was up to $306. At this point although I felt guilty leaving the table a couple hands after winning an $80 or so pot; but I knew it was starting to go to my head and I'd loste up and likely lose it all and probably more back. So I left, $210 up for the day.



Not a bad effort! Tournaments bad.. cash games good.. probably a bit lucky but the tables were quite soft, very often folding to reraises or calling down with bugger all.



Woo!

MacBook even more broken than I thought... Asus EeePC is good...

So having taken my MacBook to the apple store on Tuesday, they replaced the logic board and subsequently found out that not only was the logic board toast, so is the hard drive.



How the hell did I manage that?



So anyway, being 10AM Tuesday morning, and a talk to give at 1:30PM - I cruised down to Myer (by way of a $6 taxi, didn't realise how close it was) and bought an Asus EeePC.



I then rewrote the talk in <2 hours and did it. It was a bit of a rush job but it worked OK.



I'm fairly impressed by the EeePC.. it's got 4G flash, 512MB ram, Webcam.. and comes with a pre-installed and customized Xandros-based OS. It has all the good utils.. Pidgin, Firefox, Skype, Openoffice, etc... although I hope to install Ubuntu on it later.



It did manage to compile a kernel in <hour earlier.. so its not *that* slow.. altho the kernel was a little minimalistic with the features needed for it.

MacBook broken

I've really hit a wall with my MacBook.



it has stopped booting after a kernel panic, which was caused by unplugging a Sony Ericsson phone that was just charging.



I can't even boot a cd or into firewire target mode.



This is the 3rd trip now I have had something go wrong with it, dammit. I think life is telling me to go back to a PC and ubuntu!



I guess its

kindof poetic my MacBook running macosx broke at Linux.conf.au.



Posted from my iPod touch.

Feel Like Home (feat. Styles Of Beyond) - Fort Minor

Well, I made it through my first day in Melbourne for linux.conf.au 2008



Due to horrible travel planning, I arrived in Melbourne at 6am but was unable to check-in to Trinity College until 1PM. Thus I had to wast a couple hours then met some of the organisers and helped shuffle boxes of conference bags out of one room, into cars to then be unpacked down at the venue.



Following that I spent some time folding up t-shirts and finally I was able to register and check in at the college.



Having taken the midnight flight over, I hadn't slept and so I carked it from 4PM to 8PM. This is going to really throw my sleeping out! But oh well..



Following on from my lazing, I located the Trinity common area, with semi-working wireless (some rogue client is handing out DHCP leases that are useless, so you have to refresh 30 times)



So far I have ran into lots of people I know from work and past LCAs.. I'll certainly miss some but they include.. Stuart Young, Stuart Smith, Colin Charles, Giuseppe Maxia, James Iseppi, Arjen Lentz, Joel Stanley, Leon Brooks, Donna Benjamin, Daniel Stone, Grant Diffey, Michael Kedzierski(sp?), Ryan Verner, Tim Ansell.. there are a few people who escape me at the moment!



As wireless is only available in the common area, my 2GB of 3G data with three is certainly proving helpful :)



Until tomorrow... (or well, today)

Veronicas - Hook Me Up

Heading off shortly to Linux.conf.au 2008 in Melbourne, Victoria.



I've got the red-eye, so I'll be landing in at 6AM Melbourne time - for any other LCAers i'll be staying at the Trinity college.



I'm giving a talk at the MySQL Mini-conf @ 1:30PM on Tuesday - it will be about my experiences as a MySQL Support Engineer and the common sorts of problems that people run into and how to avoid them!



Should be a good week for the conference, and maybe I can lose^H^H^H^Hwin a few dollars at the Crown with my handy dandy poker skills :)



Anyone up for a game? Unfortunately I've misplaced my small, portable and travel-friendly chipset - I really must find that.

Anika-Robert Picardo-Extreme Bob-More Parodies, Travesties & Anomalies

Thanks to work, I spent this week in Cupertino, CA. Having never been anywhere in the USA before, it was somewhat exciting to be staying literally up the road from the Apple Campus.





Me @ 1 Infinite Loop



I was also able to goto Google in Mountain View, to attend the Silicon Valley MySQL Users Group at the Visitors Center. Unfortunately I didn't come accross any large google logos to take my photo with, but I did find building number 42







I also spotted the offices of Symantec, Trend Micro, Packeteer, Solid, Microsoft, Borland and MySQL (Surprise!) along the way. Certainly "exciting" for someone thats never been to the bay area.



I had hoped to make it up to San Francisco, and do a little site-seeing of the Golden Gate Bridge and some other stuff, but was too tired to do it this afternoon, and I am attending BarCampBlock today in Palo Alto from early until I fly out tonight - so unfortunately I am going to miss out this trip. Hopefully work will send me back this way again sometime next year.

GUADEC 2007

So, thanks to GUADEC 2007 kindly accepting my talk & paying for my travel expenses, and I had a good time.



I think my Avahi talk went well... we had a good 15+ minute talk about future possibilities, which is what I was hoping.

Lennart's Pulseaudio talk was also very good, it has advanced quite some since his talk @ LCA so it's good to see progress.



I got to meet Sjoerd, and generally the entire Collabora team which was pretty cool - I've fixed some bugs in Avahi so they can progress with the Salut support for OLPC which is good.



I have uploaded my photo collection to flickr, so you can check them out here.



Heres some of my favourites..



I managed to crash the in-flight entertainment system, apparently it uses svgalib..





I love these power transformers that point out all sides, as much as I'm sure they are safe, it just irk's me slightly ;)





Primitive mapping technology...





Walkabout - the Australian Bar - Dude in a kangaroo suit





Me with an iFailPhone





Dress code... no football tops.... exceed england.





www.wtfisthisgame.com





All in all, it was a good trip :)