20081029 Wednesday October 29, 2008

Virtual Box 2.0.4

I have taken the opportunity to upgrade to Virtual Box 2.0.4. The upgrade for Ubuntu 8 goes fine, although EZ-Web is barfing on the upgrade; I have forgotten some password I need. (Hmm, I wonder if I should try the command line, or closing the postgres service first.)

I have amended my proxy set up script. I had not read the documentation carefully enough and tried to set up the proxied ports while the VM was running. This is bad. The new script now displays the parameters set,


case $2 in
make)   echo $0 make proxy
        ./VBoxManage.exe setextradata "Ubuntu 8" \
                "VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/Protocol" TCP
        ./VBoxManage.exe setextradata "Ubuntu 8" \
                "VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/GuestPort" ${port}
        ./VBoxManage.exe setextradata "Ubuntu 8" \
                "VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/HostPort" ${port}
         ;;
show|list|display) echo $0 list parameters for $key
        for property in Protocol GuestPort HostPort
        do
           ./VBoxManage.exe getextradata "Ubuntu 8" \
                "VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/${property}"
        done
        ;;
rm|remove) echo $0 remove proxy
        ./VBoxManage.exe setextradata "Ubuntu 8" \
                "VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/Protocol"
        ./VBoxManage.exe setextradata "Ubuntu 8" \
                "VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/GuestPort"
        ./VBoxManage.exe setextradata "Ubuntu 8" \
                "VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/HostPort"
        ;;
esac

I set the key variable earlier in the program. As you can see I have used two idioms now, i.e. iteration and sequence and I am sure a horrendous function could make the code much more economic. However it would have a non real name like act or do which is a clue to a design error. I wonder what it would look like in Python. Mind you, another reason this code is so repetitive is that the shell interpreter doesn't do associative arrays. Boo!

The program now takes two arguments one to define the service and one to define the action. This is why the example above uses $2 as the case argument. The previous version of the code was published earlier this month here on this blog.

tags:

              

(2008-10-29 04:01:10.0) Permalink

Comments:

Post a Comment:

Comments are closed for this entry.
Innovate on OpenSolaris
   in London

  Subscribe to this blog XML

  Now referenced at is.gd,
    http://is.gd/1BW3h

  AddThis Feed Button

  

  See my delicious tag cloud, or
  follow it using a feed reader.

  Also my sun mediacaster page

  Link to my FOAF file

News
Recent & Interesting
All about my site
Recently at del.icio.us
links
Article Index
archives

  2009

  2008

  2007

  2006

  2005

  2004

Blogosphere

Locations of visitors to this page >
referers