Launching balloons

February 16, 2009 by geoffoc

It’s been a while since i’ve posted something here. Most of my recent blogs have been within the team space at ASRI and are therefore private until it’s ready for public release.   Anyway, there are two pieces of news I can happily report :

  1. I’ve been appointed as the new High Altitude Balloon (HAB) manager for ASRI.  This is a fantastic opportunity to do some decent hardware and software hacking – if only work provided opportunities like this :-(
  2. My first project proposal as part of the HAB program has been given approval to proceed.  This project expects to deliver a number of flights with one of the goals being the creation of  an ongoing capability for ASRI members, schools, universities and the general public – much the same as what ASRI currently does with its unique Small Sounding Rocket Program (SSRP).

These balloon flights typically get above most of the atmosphere to a height around 30km.  The current flight computing hardware i’m designing isn’t Linux based :-(    It is being developed on Linux.   Will Linux be flown?   If the experiment complexity dictates it then yes, of course.   The current hardware is most likely going to be based on the parallax propellor microcontroller which  provides 8 processors (COGS).

Anyway, that is my update for the moment.   More to follow.

web 2.0 != cloud computing != evil

December 1, 2008 by geoffoc

Ok, a bit of a pointless rant here.  I see many people suggesting that somehow web 2.0 technology is the same as cloud computing.  Big shock coming, it isn’t.   I also see people inferring that cloud computing somehow forces you to hand over all your data leaving you with an empty desktop and that horrible feeling associated with forgetting to get dressed before you go into the office – another shock coming, it doesn’t have to.

The twenty cent summary is that ‘cloud computing’ is the (as close to real time) provisioning of computing resources when you need them.   You can think of this as having software made available to you or infrastructure made available to you  (or other combinations) – when you want it and to solve the problems you have.

Sure, web 2.0 and cloud computing together can provide some extremely compelling applications and you’re likely to see quite a few of those being developed.

Do you have to move all your data into the ‘cloud’, well that depends on the applications that reside in the cloud, or the applications you as a developer develop (if you are one).  It is certainly possible to use infrastructure as a service in a stateless manner – that is, you pass whatever data you need to the on demand infrastructure / application to process and return you the results – without any data being saved permanently in the cloud.   This is not an appropriate design pattern for all applications, some may need to work on large datasets or have certain required performance characteristics.  Each design has tradeoffs and data protection issues – are they all the same – no, of course not.

The cloud is not evil, it is not trying to eat your children.  Don’t believe all the hype either- cloud computing and web 2.0 wont free elvis from the aliens or make britney a good singer.  Web 2.0 and Cloud Computing are part of an emerging tool set that will see wonderful (and complete crap) applications developed.  They are not the solution to every problem, but they are certainly the solution to many problems, some we as yet don’t even realize we have.

VLC – 1, MythTV Internal Player – 0

November 30, 2008 by geoffoc

Don’t freak, I love my MythTV, however the Internal player for handling videos and dvds tends to suck a little at times.

I watch a few google videos (more like this or this, than this , but hey, you watch what you want :-) ) – anyway, the MythTV internal player more often than not doesn’t like playing these files, with either the video jumping, audio twitching, missing or some odd combination thereof.   Anyway, I’d finally had enough and decided i’d switch from the internal player to using vlc.

Surprisingly it’s pretty easy.

In mythtv, navigate the menus to “Video Settings” -> “Player Settings” and change the player from ‘Internal’ to vlc file://%s vlc:quit .  The vlc:quit adds ‘quit’ to the playlist which means when the video ends you’re not left with vlc sitting there looking at you.

Rather than passing parms to vlc via the command line, I modified the ~/.vlc/vlcrc and set options like :

fullscreen=1
width=1920
height=1080
osd=0
control=lirc    #note
intf=dummy
key-quit=Esc

Then of course I had to modify my ~/.lircrc to allow my remote and vlc to have a happy relationship.  Of course your remote is likely different to mine, but the concept looks like this:

In this context, button is the button pressed on the remote and config is the vlc action to take (as detailed in the ~/.vlc/vlcrc )


#Stop playback and exit
begin
prog = vlc
button = stop
config = key-quit
end

# Pause playback
begin
prog = vlc
button = playpause
repeat = 3
config = key-play-pause
end

# Seek back 10 seconds
begin
prog = vlc
button = rew
repeat = 3
config = key-jump-short
end

End result, all my videos work without issue.  My nearly 4 yr old son can happily get mythtv to work with this configuration, so dont let anyone tell you mythtv is hard to use :-)

zfs … Ok i’m jealous

November 25, 2008 by geoffoc

If you’ve ever built large filesystems on linux with hundreds of disks using ext3 and LVM you will appreciate the very nice way zfs works on opensolaris.   Having had a play with zfs – I am jealous.

If you would like to see more on zfs, the following 3 videos are an excellent presentation and demonstration of zfs.  Thanks to Bill and Jeff and Sun for making this available.

ZFS : The last word in filesystems Pt 1

ZFS : The last word in filesystems Pt 2

ZFS : The last word in filesystems Pt 3

Getting the output from a sub-process

October 25, 2008 by geoffoc

A few times recently i’ve needed to capture the output from an OS specific command in Java.   It’s not terribly difficult, but this little example may save you some time.

package test;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    private final static String COMMAND = "/usr/bin/uptime";

    public static void main(String[] args) throws Exception {

       Process process = Runtime.getRuntime().exec(COMMAND);
       BufferedReader stdout =
            new BufferedReader(new InputStreamReader(process.getInputStream()));
       String line = "";
       while ((line=stdout.readLine())!=null) {
          System.out.println(line);
       }
       process.waitFor();  // unlikely we'd ever wait as we've got EOF on stdout
       System.out.println("Exit code = "+process.exitValue());
    }
}

And here is the output as you would expect :

 08:30:47 up 12 days, 23:53,  1 user,  load average: 1.87, 1.99, 2.07
Exit code = 0

openembedded now using git

October 24, 2008 by geoffoc

Ok, so this news is a little old, but nonetheless I am happy to see monotone go.   It made my experience with openembedded less than pleasant.  It was a slow, buggy and outright irritating experience.  Let’s just say – I will happily purge monotone from my systems and never look back.

Thank you Openembedded community, i’m now looking forward to coming back :-)

It’s sad when…..

October 4, 2008 by geoffoc

For your morning commute you have to walk, catch a bus followed by a train and still more walking to get into the office and it takes about an hour and twenty minutes, costs you $10.10 and then you discover that you can ride into work in One Hour and three minutes, costs you nothing but a little sweat and you have a healthier lifestyle.

Maybe it’s not sad, but perhaps a happy discovery.  People get out of your cars, ignore the pathetic public transport and simply ride to work – the planet will thank you later :-)

new toy in the house

August 30, 2008 by geoffoc

Ok,  it was time to replace my lovely Sony KRHV32M31 CRT with a new LCD.   The Sony is a beautiful CRT, but shall we say – it needs to lose a few kilos as it weighs a ton :-) .  Anyway, after lugging the beast upstairs (something I don’t care to repeat for a long time to come especially considering how sick i’ve been) the hole it left behind was filled nicely with a Philips 42PFL7403 .

Normally installation of this TV (just as a TV) is piece of cake.  Plug in the antenna, turn it on and answer the questions you get asked and it’s all done – really even my mum could have done it (Hi Mum :-) ).

Of course there’s a fair bit of Linux in my house so a reconfiguation of my  mythtv box was going to be required.   Previously the Sony CRT required handcrafted X modelines and was connected via a VGA to RGBHV cable.  I’d like to get those hours of my life back.   In this case I decided on using a DVI to HDMI adapter with an ancillary stereo audio cable tied to one of the Philips HDMI inputs.

After a couple of hours (yes I went and had lunch in that couple of hours as well) myth was alive and happily delivering 1080p content onto this really nice piece of equipment – don’t trust me, go read the reviews yourself and then have good look at it in the shops.

So what happened in those couple of hours (apart from lunch).  I just put in a standard ubuntu X config file, connected it to the TV, restarted X and had a look to see what happened.   The wonders of EDID saw the LCD automatically detected and I could start the mythfrontend in 1080p mode.   The GUI was off centered and required adjusting within the mythtv frontend settings.   This did however expose this bug which left an annoying white line at the top of the screen (boo!!).  Anyway, the simple solution was to put the XFCE panel into autohide mode which solved the problem.

Now, sometimes it’s a little hard to find true HD content being broadcast when you want it to show off the LCD in all it’s glory so I reserved a really nice piece of HD content called Big Buck Bunny which is available under a Creative Commons Attribution 3.0 licence.   The end result – happy family :-)

drupal5, images and private file systems – a match made in ….

July 22, 2008 by geoffoc

Ok,  It wasn’t a lot of pain, but it was a tad annoying nonetheless.

The story begins with using Drupal 5 for a private website (Note: I actually think these later releases of Drupal are pretty good – it’s pretty easy to create themes and the feature set is pretty rich).  Since the data that was being uploaded needed access controls I set Adminster/File System/Download Method to private.   Sounds Good so far.

Since I wanted to have some nodes containing uploaded image data, which I wanted to have ACLs protecting I installed the ACL/Content_Access modules and the Image module.  I set the ACLs on the nodes as appropriate for me – nothing for Anonymous and view for Authenticated users.

Bugger – didn’t work.  According to the logs I was getting 403’s via the module performing the private downloads.  This wasn’t good.  So after a great deal of Ineffective Googling (now known as IG) I decided to read the code.

After scratching my head for a little while I started to make sense of the code.  The problem was that in addition to the ACL settings on the Image nodes I also needed to have view_original_file and view_uploaded_files permissions set for my Authenticated Role.  Once I set that everything started working as I expected and sanity was restored.

Hopefully this little blog entry will end some drupal induced suffering for someone else.

openssh crypto cipher performance

July 1, 2008 by geoffoc

It was mentioned to me that when transferring files on an internal network that by selecting a different cryptographic cipher you could improve the file transfer performance.  So, since I had a few spare minutes and elected not to scratch my bum I whipped up the following little script to test the theory.

I elected to scp a random ~700Mb file I affectionately called disc1.iso  (it was actually just random data, but you get the idea) to my localhost.  That is, I transferred the file from system A to system A.   I’m not interested in getting the highest possible speed with this test, i’m more interested in the relative performance of the ciphers.   Doing this creates a ‘relatively’ stable environment to conduct the comparisons.

I added my ssh key to allow myself to talk to myself – sort of like this blog really with the number of readers I have :-)   Then I did the following (a man ssh shows the valid ciphers for protocol 2)

for c in 3des-cbc aes128-cbc aes192-cbc aes256-cbc aes128-ctr aes192-ctr aes256-ctr \
         arcfour128 arcfour256 arcfour blowfish-cbc cast128-cbc ; \
         do for j in `seq 1 1`  ; \
          do /usr/bin/time -a -o results.txt -f "$c,$j,%E,%U,%S" scp -c $c disc1.iso localhost:tmp/ ;\
          done  ; \
         done &

This creates a results file which in my case looks like this :

3des-cbc,1,1:12.67,35.41,3.53
aes128-cbc,1,0:56.18,9.52,4.09
aes192-cbc,1,0:54.58,9.86,4.16
aes256-cbc,1,0:55.73,11.46,3.89
aes128-ctr,1,0:59.78,13.43,4.14
aes192-ctr,1,1:04.33,14.67,4.19
aes256-ctr,1,1:01.07,15.31,4.08
arcfour128,1,0:57.75,7.10,4.50
arcfour256,1,1:18.06,7.80,4.56
arcfour,1,0:59.32,7.05,4.60
blowfish-cbc,1,1:01.19,11.62,4.46
cast128-cbc,1,1:26.57,22.31,4.14

Now, according to the man page aes128-cbc is the default cipher for Protocol version 2 so if I use this as the baseline then the relative performance becomes  :

Cipher Relative Performance
3des-cbc 0.77
aes128-cbc 1.00
aes192-cbc 1.03
aes256-cbc 1.01
aes128-ctr 0.94
aes192-ctr 0.87
aes256-ctr 0.92
arcfour128 0.97
arcfour256 0.72
arcfour 0.95
blowfish-cbc 0.92
cast128-cbc 0.65

Based on those numbers I really wouldn’t bother trying to select a different cipher for the file transfer.

Note 1: This was performed on a run of the mill core 2 duo system running Ubuntu Hardy, you will possibly find that certain architectures have better results with certain ciphers possibly due to the instruction set being a better fit for a certain algorithm or in the case of higher end servers the availability and use of cryptographic hardware.

Note 2:  The seq 1 1 allows you to run the test multiple times, just change it to seq 1 10 to run each test 10 times.  I just did it once for the purposes of putting it in the blog.