Stac, Stace, ace - blog space
Stacey Marshall's Weblog
Main | Next page »
20090430 Thursday April 30, 2009
Cloud space

Has it really been five years since the creation of blogs.sun.com? And six years since the integration of Dtrace? Clearly I'm having fun as the time seems to have flown by.

I'm currently eager to get on and use my cloud space. Like others I'm too thinking of using it for backups of important information that I'd really rather not lose. But I'm also looking forward to using it as a repository for some data that I currently hold on my Treo and that I access mostly on the Desktop by transferring the memory card; which I hope I don't lose. I'm waiting with bated breath for the Palm Pre to be made available in the UK for the same reason. No dates mentioned as yet :-(


Apr 30 2009, 01:02:48 PM GMT+00:00 | Technorati tags: | Permalink Comments [0] del.icio.us technorati digg

20090220 Friday February 20, 2009
BIND training with the ISC
The ISC (Internet Systems Consortium) have scheduled further training course on BIND. The next one is in March at the ISC's headquarters in Redwood City, CA. I'm looking forward to attending, last I heard there was still a couple of places open if your interested.

Feb 20 2009, 02:15:28 PM GMT+00:00 | Technorati tags: | Permalink del.icio.us technorati digg

20081215 Monday December 15, 2008
Unified Differences (udiff) with in-line line numbers.

In my day-to-day role as a software engineer I share with my peers unified-differences derived from the diff(1) command. For example:


$ diff -u old new
  --- old	Wed Oct 29 14:36:47 2008
+++ new	Wed Oct 29 14:36:56 2008
@@ -1,9 +1,15 @@
 I
 really
-should
+ought
 provide
 better
 examples.
 
-Or at least use some of my daughters poetry
+Mary
+had
+a
+little 
+lamb,
+
+Or perhaps use some of my daughters poetry.

$

Where differences occur a line listing the original line number followed by the new line numbers are displayed which is followed by the changes. Lines removed from "new" are marked with a "-" at the beginning while lines added to "new" are marked with a "+". In the example its quite easy to see that line three has been removed and replaced. However it is sometimes not so obvious, the line numbers get a little confusing in ensuing conversation.

So I put together a little nawk script to display the line numbers in-line as well:

$ diff -u old new | udiffn
--- old	Wed Oct 29 14:36:47 2008
+++ new	Wed Oct 29 14:36:56 2008
 Old  New @@ -1,9 +1,15 @@
   1    1  I
   2    2  really
   3      -should
        3 +ought
   4    4  provide
   5    5  better
   6    6  examples.
   7    7  
   8      -Or at least use some of my daughters poetry
        8 +Mary
        9 +had
       10 +a
       11 +little 
       12 +lamb,
       13 +
       14 +Or perhaps use some of my daughters poetry.
   9   15  

Ideally diff(1) would have an option to provide this output but in the mean time this little tool will suffice:

$ cat ~/tools/sh/udiffn
#!/bin/nawk -f
# Add line numbers to unified diff output: diff -u old new | udiffn
/^No differences encountered/ ||		# No exit as intended as a pipe
/^$/ ||						# Blank lines
/^(\-\-\-|\+\+\+)/ {print; next;}		# diff Headers
/^@@ [-+][0-9]*,[0-9]* [+-][0-9]*,[0-9]* @@/ {	# Start of difference block
  i=split(substr($2,2), o, ",");		# old start line in o[1]
  j=split(substr($3,2), n, ",");		# new start line in n[1]
  l=length(n[1])+1;				# Numeric field length
  if (l <= 4 ) l = 4;
  printf("%*s %*s %s\n", l, "Old", l, "New", $0);
  next;
}

/^ /	{printf("%*s %*d %s\n", l, o[1]++, l, n[1]++, $0); next;}
/^\+/	{printf("%*s %*d %s\n", l, " ", l, n[1]++, $0); next;}
/^\-/	{printf("%*d %*s %s\n", l, o[1]++, l, " ", $0); next;}

/^Index: / {print; next}			# patch/wx header
/^diff -r/ {print; next}			# Mercurial header
# Everything else is unexpected.
{print "Er!",NR,$0;}

Dec 15 2008, 05:16:30 PM GMT+00:00 | Technorati tags: | Permalink del.icio.us technorati digg

20081114 Friday November 14, 2008
XP has Point to Focus

I've just found out that it is possible to select Point-to-focus, my preferred focus policy, on Windows XP. I found the option in Tweak UI which can be down loaded from the MS Power Toys for Windows XP page. To enable Point-to-Focus run Tweak UI, navigate down the right pane to Mouse -> X-Mouse and select "Activation follows mouse (X-Mouse)". As of yet I have not found an option to stop raising the window on click!

I came across Tweak UI utility as having purchased a new 1TB disc I wanted to move the common "Shared" folders to it. I tried dragging the folder as suggested but this didn't seem to have the desired effect. Some goolge time later I found Tweak UI which also has an option to change those settings. Looks like there are some other useful tools in there too, such as CmdHere and DeskMan.


Nov 14 2008, 10:34:03 AM GMT+00:00 | Technorati tags: | Permalink del.icio.us technorati digg

20081113 Thursday November 13, 2008
Music Man
Music Man Poster

BATS latest production of The Music Man is now underway at the Haymarket Theatre in Basingstoke and running through to Saturday 22nd.

Both of my girls, Emily and Alice, are in the show performing together on alternating nights. I'm looking forward to seeing it on Friday as I've heard that this is another excellent performance by BATS.

The show features the signature song ‘Seventy-Six Trombones’. The story sees 'Professor' Harold Hill, a con man, whose scam is to convince parents he can teach their musically disinclined children to play instruments. He takes pre-orders for musical instruments and promises to form a band, when he promptly skips town and moves onto the next before he is found out. Harold arrives at River City, Iowa, where he meets their townspeople and therein the fun starts.


Nov 13 2008, 05:28:48 PM GMT+00:00 | Technorati tags: | Permalink del.icio.us technorati digg

20081107 Friday November 07, 2008
ut-where update

A minor update to ut-where to add a '-V' option which causes ut-where to provide some additional verbosity in a zenity window. I can't see one wanting to use the option ongoing but its nice at first to help understand whats happening, for example when your screen does not automatically change because the utsettings are not set as you might expect them to be. Or because XRandR is not supported.


Nov 07 2008, 06:23:16 PM GMT+00:00 | Technorati tags: | Permalink Comments [1] del.icio.us technorati digg

20081105 Wednesday November 05, 2008
location, location, and size matters.

My Sun Ray TM session can now automatically switch desktop size when moving between different clients.

For example:
Having logged on originally at my desk, Sun Ray 2FS with a 1920x1200 monitor

I pull my card and move to a break area with a Sun Ray 150 with a much smaller screen

The whole desktop is displayed, no panning required :-D

Sun Ray Server Software 4.1 includes a new standalone Xserver, Xnewt, based on Xorg 7.2 community source. Xnewt introduces the XRandR extension to Sun Ray which amongst other features enables the session to switch Video Resolution and resize the desktop dynamically. No more panning around when using on a smaller display, or unused space when moving to a larger display.

Using the example above, moving from the Sun Ray 2FS with a 1920x1200 monitor to a Sun Ray 150 xrandr reports:

$ /usr/X11/bin/xrandr -q
 SZ:    Pixels          Physical       Refresh
 0    640 x 480    ( 180mm x 135mm )
 1    800 x 600    ( 225mm x 169mm )
 2   1024 x 768    ( 289mm x 216mm )
 3   1152 x 900    ( 325mm x 254mm )
 4   1280 x 1024   ( 361mm x 289mm )
 5   1400 x 1050   ( 395mm x 296mm )
 6   1440 x 900    ( 406mm x 254mm )
 7   1600 x 1024   ( 451mm x 289mm )
 8   1600 x 1200   ( 451mm x 339mm )
 9   1680 x 1050   ( 474mm x 296mm )
 10  1920 x 1080   ( 542mm x 305mm )
*11  1920 x 1200   ( 542mm x 339mm )
Current rotation - normal
Current reflection - none
Rotations possible - normal 
Reflections possible - none

While by comparison the Sun Ray setting, as reported by utset is somewhat smaller:

$ /opt/SUNWut/bin/utset | grep '^Display Timing 1:'
Display Timing 1: 1024x768@60
$

Therefore I can dynamically change the desktop using xrandr command and shrink my desktop accordingly:

$ /usr/X11/bin/xrandr -s 1024x768

The one caveat at this time is that for xrandr to grow the desktop Xorg must have allocated sufficient memory for it. Obviously with the example above it would have done. But had I logged in on the Sun Ray 150 first there may have been a problem. Therefore you may need to set your preferred default resolution to the largest available value to allow for that growth. This is accomplished using utxconfig:

$ /opt/SUNWut/bin/utxconfig -r 1920x1200

So what of automatic switching?

Taking Chris' Sun Ray location idea a little further I re-wrote his script, ut-where, so that it automatically switches the display depending on the device setting. This modified script has a couple of other new features including

I'm still toying with the idea of saving other preferences to the location file such as the preferred resolution and or pidgin status... Full options listed below.

$ ut-where -h
usage: ut-where [-vxX][[-i]|[-d]|[-s]|[-t]|[-l]|[-c]|[-a [description]]]

  -a	Add location, prompts for description if none supplied.
    	Colon characters in description are substituted by space character.
  -l	Display contents of location file.
  -i	Initialise; starts utaction monitors for connect/disconnect
    	Will also start IM client if none active for user.
    	Kills current "utaction ut-where" scripts
  -c	Update pidgin with current description:
    	This option is intended to be used by "utaction -c"
    	If description is unknown then a description dialogue is
    	requested using zenity.
    	If description contains "conference" then status is
    	set to "unavailable".
  -d	Update IM tool with away message (unless away status already set).
    	This option is intended to be used by "utaction -d"
  -t	Display current description.
  -v	Verbose mode
  -x	Debug
  -X	Debug functions

Without any options the appliance name and description are displayed.
$

Thus to start IM client and utaction monitors simply use ut-which -i.

One final note. I have found some devices have there default resolution set much lower than expected, i.e. 640x480. Therefore you may need to change those. The best way to do that is to use utsettings (press <shift>-<props> keys together) and change the resolution under the "Display" category.

Happy switching.


Nov 05 2008, 12:06:41 PM GMT+00:00 | Technorati tags: | Permalink Comments [1] del.icio.us technorati digg

20081029 Wednesday October 29, 2008
Window raise on frame only

When interacting with a window interface I prefer point-to-focus rather then click-to-focus. This can easily be achieved by enabling "Select Windows when the mouse moves over them" from "Window Preferences" (from Gnome Preferences).

But I also prefer my windows to stay put and not atomically raise to the top when I click in them, for example when using middle-click to paste into the obscured window...

To stop that annoying behavior run 'gconf-editor' and enable the Sun Extension 'window_raise_on_frame_only', /apps/metacity/general/sun_extensions/window_raise_on_frame_only (use ctrl-F and search for it). The associated note for which states "If enabled, in sloppy focus mode [point-to-focus], the window will be raised to top of stack when clicked on window frame only. Windows will not raise when clicked inside them." Sloppy in deed, how dare you ;-)

Previously I have unset /apps/metacity/general/raise_on_click which also worked for me. Though it does contain the following description underneath it:

"Setting this option to false can lead to buggy behavior, so users are strongly discouraged from changing it from the default of true. Many actions (e.g. clicking in the client area, moving or resizing the window) normally raise the window as a side-effect. Set this option to false to decouple raising from other user actions. Even when this option is false, windows can still be raised by an alt-left-click anywhere on the window, a normal click on the window decorations, or by special messages from pagers, such as activation requests from tasklist applets. This option is currently disabled in click-to-focus mode. Note that the list of ways to raise windows when raise_on_click is false does not include programmatic requests from applications to raise windows; such requests will be ignored regardless of the reason for the request. If you are an application developer and have a user complaining that your application does not work with this setting disabled, tell them it is _their_ fault for breaking their window manager and that they need to change this option back to true or live with the bug they requested. See also http://bugzilla.gnome.org/show_bug.cgi?id=445447#c6."

I do wonder if the above warning does also apply to window_raise_on_frame_only?


Oct 29 2008, 01:50:35 PM GMT+00:00 | Technorati tags: | Permalink Comments [1] del.icio.us technorati digg

20080113 Sunday January 13, 2008
test
ublog test

Jan 13 2008, 04:39:00 AM GMT+00:00 | Technorati tags: | Permalink del.icio.us technorati digg

20071005 Friday October 05, 2007
Solaris x86 for the beginner: Videos

Today I came across the OpenSolaris Project: Starter Kit which includes links to OpenSolaris Screencasts (videos).

In particular I like the reference to the backup tool "g4u" to backup my Windows partition(s). It would be neat if I could use the same trick to backup the Solaris partition too.


Oct 05 2007, 02:30:43 PM GMT+00:00 | Technorati tags: | Permalink del.icio.us technorati digg

20070927 Thursday September 27, 2007
I'm it!
Peter tagged me! I'm like the school boy who, while lining up in the playground to play one game, is suddenly rushed upon and touched in a fleeting moment to the cheer of "tag" as the ascendant races off. I liked playing tag, though I always preferred "Stuck in the mud" (apparently known as Freeze Tag in some places).

So, five things you may not already know about me....

  1. Thinking that I may have had a very minor dairy intolerance I gave up eating dairy produce in my early twenties. Obviously this means no Milk, Cheese or Chocolate. But that's only the half of it. Wey solids and powder are found in an amazing host of foods like biscuits, cakes and crackers. And all those really nice things like cakes (did I say that already), custard, pastries, and a whole lot more.... I'm not sure the diet had much effect on my Asthma, but I sure did put on the pounds once I came off of it (I have subsequently lost that weight, with help from the Hackers Diet) and my bicycles. I was certainly glad to no longer be having water on my morning cereal.

  2. This may not be so surprising to those paying close attention to my blog... OK, so its a surprise to you all! I used to be cleaner at Express Dairies. It helped me save up for the road "racing" bicycle that I still ride to this day. My section included a small hall with a free milk dispenser which was always in a real slimy and smelly state come the evening (people, be considerate with your unwanted beverages). I still remember with joy the first time I used the floor polishing machine. It whizzed around taking me with it and wrapping me around with the power cord. Took a few times to tame it, but it was always fun.

  3. Somewhat like Clingan at school I was interested in long distance running. I used to take part in the cross country race each year and for sports day entered the 1500m and 5km race. Though I never took it seriously, I just seemed to have a lot of stamina. These days I really don't enjoy running and much prefer to be on my bike where my stamina still sees me through..

  4. I was in a Secondary School (high-school) production of "My Fair Lady". I was in the chorus and several non-speaking parts including a chimney sweep and ballroom dancer. I enjoyed every moment of it, especially learning the waltz (shame I don't remember it now). I dare say it's those memories why I encourage my girls to take up the thespian joys that they have. Mind, they can sing unlike myself.

  5. On the theme of Musicals, my favorites all time is the film "The Slipper and the Rose", staring Richard Chamberlain and Gemma Craven. It is in my opinion the best adaptation of the Cinderella Story. My favorite bit is when the fairy god mother, played by Annette Crosbie, exclaims "I know, I'll borrow time!" (or something to that effect) which for me explained why the magic had to be withdrawn at midnight. So why don't the slippers disappear? Well that magic clearly wasn't borrowed ;-)

So, Jonathan, your it!

Stace


Sep 27 2007, 12:53:53 PM GMT+00:00 | Technorati tags: | Permalink del.icio.us technorati digg

20070918 Tuesday September 18, 2007
Running BIND server 'named' as a different user on Solaris 10

The named process is started by root and thus inherits roots privileges, as were traditionally needed, to access the DNS communication channel (port 53). BIND administrators know the named command accepts a -u username option which causes the process to switch user attributes after opening privileged interfaces. The idea being that should the service be compromised the effective user is not all powerful.

In the Solaris 10 Operating Environment the process privilege model, privileges(5), allows for a more fine-grained control. Coupled with the Service Management Facility, smf(5), services may inherit less privileges and alternative user process and group identities at start-up. Therefore under the Solaris 10 OE named may be configured at start to run with an alternative user identity making the -u option superfluous.

To have the BIND server named start with an alternative user identity and group under the Solaris 10 OE complete the following steps:

1. Add the user to the solaris.smf.manage.bind role

# usermod -A solaris.smf.manage.bind dnsadmin
# tail -1 /etc/user_attr
dnsadmin::::type=normal;auths=solaris.smf.manage.bind
#

Without this role the server, named, will be unable to manage it's SMF FMRI and named will automatically be restarted by SMF after an rndc stop or halt command. As indicated by the syslog message "error: smf_disable_instance() failed for svc:/network/dns/server:default : insufficient privileges for action"

2. Modify the service properties

# svccfg
svc:> select svc:/network/dns/server:default
svc:/network/dns/server:default> setprop start/user = dnsadmin
svc:/network/dns/server:default> setprop start/group = dnsadmin
svc:/network/dns/server:default> exit
# svcadm refresh svc:/network/dns/server:default
# svcadm restart svc:/network/dns/server:default

3. Specify an alternative location for the pid-file

As only root has write access to create the default pid-file; /var/run/named.pid named must be configured to use an alternative path. For Example:

# mkdir /var/named/tmp
# chown dnsadmin /var/named/tmp # head /etc/named.conf
options {
directory "/var/named";
pid-file "/var/named/tmp/named.pid";
};

zone "0.0.127.in-addr.arpa" in {
type master;
file "db.127.0.0";
};
#

Updated 25 Feb 2009 with instructions on how to add user to authority.



20070910 Monday September 10, 2007
BIND 9.3.4-P1 available with Solaris 10

An upgrade to BIND 9.3.4-P1 is available for Solaris 10 Operating Environment by installing patch 119783-05 for SPARC or 119784-05 for x86 architectures.

BIND 9.3.4 provided a number of new features over BIND 8 which was supplied with the Solaris 8 and 9 Operating Environments. Additionally BIND 9.3.4 provides a number of compatibility features not available in BIND 9.2.4 (the FCS version of BIND in Solaris 10 OE). For details of all the changes refer to the migration notes.

Summary of Differences between BIND 9.3 from BIND 9.2

BIND 9.3 has a number of new features over 9.2 including:

  • DNSSEC is now Delegation Signer (DS) based, RFC4033, RFC4034 and RFC4035. This collection of RFCs is otherwise known as DNSSEC-bis.

  • DNSSEC Look-aside Validation (DLV) (experimental), RFC4431

  • check-names is now implemented.

  • rrset-order is more complete.

  • IPv4/IPv6 transition support, "dual-stack-servers".

  • IXFR deltas can now be generated when loading master files, "ixfr-from-differences".

  • It is now possible to specify the size of a journal, "max-journal-size".

  • It is now possible to define a named set of master servers to be used in masters clause, "masters".

  • The advertised EDNS UDP size can now be set, "edns-udp-size".

  • New Name Server SMF properties. With the introduction of BIND 9.3.4 new Name Server smf(1) properties have been introduced to provide an SMF compliant method for setting BIND 9.3.4 command line options. Changing the "start method" property of the BIND 9 service is no longer recommended.

For further information refer to the migration notes as above.


20070823 Thursday August 23, 2007
Live Upgrade over VPN

My friend and Colleague Isamu just asked me how I live-upgrade my home machines. Here's how:

Tunnel the NFS TCP port over ssh

Thanks to Chris Gerhard for this tip.

  $ ssh -fNCL 6049:enospc:2049  enoexec

where 'enospc' is the name of the nfs server that exports the install images and 'enoexec' is the name of a host that can access the nfs server which has AllowTcpForwarding set to "yes" in its /etc/ssh/sshd_config file.

Using nfs URLs mount the file system

   # mount nfs://localhost:6049/export/install /mnt

Remove Current lu packaging and add new packages, i.e.:

   # yes y | pkgrm SUNWluu SUNWlur SUNWlucfg
   ....
   # ls /mnt/i86pc/os/nv/
   69 68 70
   # luv=70
   # cd /mnt/i86pc/os/nv/$luv/Solaris_11/Product
   # yes y | pkgadd -d . SUNWlucfg SUNWlur SUNWluu
   ....
   # cd /

Upgrade

Firstly, get name of my current lu partitions using lustatus:

   # lustatus
   ....

Rename the one I'm replacing so that I know which version it is for now.

   # lurename -n snv_$luv -e ‹old BE›

Next use lumake to update older image with changes made in newer image, thanks to Brent Paulson for this tip. Obviously you can miss this step if you just created the image. This takes some time, it sends an email when its complete. Alternatively use lustatus to see when its done.

   # lumake -n snv_$luv -t now -m mail-address@domain

Finally, do the upgrade.

   # luupgrade -u -n ‹new BE› -s /mnt/i86pc/os/nv/$luv

Activate the new environment

Use luactivate and 'init 6' to reboot solairs, the reboot command will not suffice.

   # luactivate snv_$luv
   ....
   # umount /mnt
   # init 6 

Stace



20070201 Thursday February 01, 2007
Fun Family Camping in the Netherlands

My Brother phoned me earlier asking where it was that I went on Vacation last year, the place that was on a fun park, with a pool and zoo? Where it was really good for young families?

Well, it was one of two places: one has a Safari park on site and the other claimed to have the longest water slide within its multi fun-pool complex in Europe. We went to both places with Eurocamp, which is very easy to get to from the South of England in the car.

Hilvarenbeek Beekse Berg.

Also known as Speelland where we have been twice.

Situated on a Safari park and children's amusement park. Has small swimming pool and large lake with boats and several petting zoos, a very large site that is lovely to cycle about. In the evening we cycled up to a little known vieing point and watched the Zebras and Giraffes. It's also affiliated with a fun-pool in town (not far away).

Dunrell - Wassenaar

Dunrell is also situated on an amusement park. We likened it to Thorpe park here. This park would perhaps suit older children as it has some additional activities (High ropes, toboggan and age limit rides). But it also has lots for the younger members of the family, including a playground with the equipment playgrounds had when we were kids. Like the Witches Hat, Two storey high slides,large swings, Helter-skelter; all of which we no longer seem to have in the UK these days :-(. But every day you just have to go to the fun pool which is nice and warm and has so many fun slides... It might just be the best in Europe. I believe our fees covered entry for 2 hours in the pool (at 11am) when we were there.

Both places are not far from Efteling (though Speelland is nearest) which the girls loved.

Check it out... Stace