Fill that hole RFE

February 26, 2009

Fill
that hole
is a web site set up by the CTC for reporting pot holes
and road defects so that they can be reported back to the relevant
authority. You don’t have to be a cyclist to use it and all road
users benefit from it’s actions.





I Just put this suggestion on the
http://www.fillthathole.org.uk
site:





You should look at getting a
twitter feed that can report holes when a certain tag is used.


A phone with a camera, GPS and
network link could be used to report holes accurately with supporting
evidence from the side of the road.


Also apps for the various smart
phones to do the same would be good. I would love to be able to use
my Nokia E71 to snap a photo of a hole and then just upload it. The
phone has GPS so it really should not involve any extra work.


The next level of having the camera
watch the road and automatically recognise holes look them up in the
database of known defects and report new one. Possibly over
engineering the solution a bit there;-)


[Open]Solaris logfiles and ZFS root

February 21, 2009

This week I had reason to want to see how often the script
that controls the access hours of Sun Ray
users actually did work
so I went off to look in the messages files only to discover that
there were only four and they only went back to January 11.


: pearson FSS 22 $; ls -l mess*
-rw-r–r– 1 root root 12396 Feb 8 23:58 messages
-rw-r–r– 1 root root 134777 Feb 8 02:59 messages.0
-rw-r–r– 1 root root 53690 Feb 1 02:06 messages.1
-rw-r–r– 1 root root 163116 Jan 25 02:01 messages.2
-rw-r–r– 1 root root 83470 Jan 18 00:21 messages.3
: pearson FSS 23 $; head -1 messages.3
Jan 11 05:29:14 pearson pcplusmp: [ID 444295 kern.info] pcplusmp: ide (ata) instance #1 vector 0xf ioapic 0×2 intin 0xf is bound to cpu 1
: pearson FSS 24 $;


I am certain that the choice of only four log files was not a
concious decision I have made but it did make me ponder whether
logfile management should be revisted in the light of ZFS root. Since
clearly if you have snapshots firing logs could go back a lot futher:


: pearson FSS 40 $; head -1 $(ls -t /.zfs/snapshot/*/var/adm/message*| tail -1)
Dec 14 03:15:14 pearson time-slider-cleanup: [ID 702911 daemon.notice] No more daily snapshots left
: pearson FSS 41 $;


It did not take long for this shell function to burst into life:


function search_log
{
typeset path
if [[ ${2#/} == $2 ]]
then
path=${PWD}/$2
else
path=$2
fi
cat $path /.zfs/snapshot/*$path | egrep $1 | sort -M | uniq
}


Not a generalized solution but one that works when you root
filesystem contains all your logs and if you remember to escape any
globbing on the command line will search all the log files:


: pearson FSS 46 $; search_log block /var/adm/messages\* | wc
51 688 4759
: pearson FSS 47 $;


There are two ways to view this. Either it it great that the logs are
kept and so I have all this historical data or it is a pain as
getting red of log files becomes more of a chore, indeed this is
encouraging me to move all the logfiles into their own file systems
so that the management of those logfiles is more granular.


At the very least it seems to me that
OpenSolaris should sort out where it’s log files are going and end
the messages going in /var/adm and move them to /var/log which then
should be it’s own file system.


VirtualBox pause and resume

February 17, 2009

I have a VirtualBox
running ubuntu
that is acting as a print server for my HP
Officejet J6410 and although that works well it chews a significant
amount of CPU resource which given that the printer is not in use
most of the time seems a bit of a waste, especially when the Sun Ray
server can have 4 active sessions running on it. So now I am running
this simple script:


#!/bin/ksh93 -p
logger -p daemon.notice -t ${0##*/}[$$] |&
exec >&p 2>&1
while :
do
echo resuming vbox
su – vbox -c "VBoxManage -nologo controlvm ubunto resume"
ssh print-server sudo ntpdate 3.uk.pool.ntp.org
while ping printer 2 > /dev/null 2>&1
do
sleep 60
done
echo pausing vbox
su – vbox -c "VBoxManage -nologo controlvm ubunto pause"
until ping printer 2 > /dev/null 2>&1
do
sleep 1
done
done


After the usual magic to redirect it’s output to syslog this just
loops forever pinging the printer. If the printer is alive the
VrtualBox is resumed and if the printer is not alive the VirtualBox
is paused. So as soon as the printer is turned on the virtual box is
ready and then within 60 seconds of the printer being turned off the
virtualbox is paused.





So that the clock on the VirtualBox is
kept correct (the guest additions are, I am told, supposed to do this
for free but in practice they do not for me) after resuming there is
the ssh onto the virtual machine to set it’s clock*, so I have a work
around in place for VirtualBox which is itself a work around for a
defect
in Solaris
and that work around is also working around another
issue
with Solaris.





Life on the bleeding edge is always
fun!







*) I would normally use the address of
my server to sync with but thanks to the issues
with build 108
I currently don’t have a working ntp server on the
system.


Build 108

February 15, 2009

I’ve managed to upgrade my home server
to build 108 which is an important mile-stone for me as it has the
fix for:


6763600: nautilus becomes unusable on a system with 39000 snapshots.


Which was rendering nautilus close to unusable for any users who
moved out of their lofs automounted home directories. In partilcular
any attempt to use it to manage the photo directories was painful.


However all was not smooth as again I
hit this bug:


6795892: Sun
Ray X servers (both Xsun and Xorg) suffer network problems in snv_106


but since I was expecting this I tried
the workaround from bug 6799655
which is the same as the one for 6763600:





In /etc/sock2path
change the following lines:



2 2 0 tcp
2 2 6 tcp
26 2 0 tcp
26 2 6 tcp
2 1 0 udp
2 1 17 udp
26 1 0 udp
26 1 17 udp


to:



2 2 0 /dev/tcp
2 2 6 /dev/tcp
26 2 0 /dev/tcp6
26 2 6 /dev/tcp6
2 1 0 /dev/udp
2 1 17 /dev/udp
26 1 0 /dev/udp6
26 1 17 /dev/udp6


While this got the Sun Rays up it also stopped named from working,
spewing errors like this:


Feb 15 15:10:39 pearson named[15558]: [ID 873579 daemon.error] 71/Protocol error
Feb 15 15:10:39 pearson named[15558]: [ID 873579 daemon.error] socket.c:4315: unexpected error:


So have had to revert to some internal to Sun binaries that work
around this while the underlying bug is fixed. It is slighly worring
as I’m left wondering what other victims are out there. One I have
already found is ntp, which is a known bug:


6796948:
NTP completely broken by I_SETSIG semantics change in snv_106


I suspect that the system will have to
revert to build 105 soon.


Mobile internet on OpenSolaris

February 13, 2009

I have a new mobile phone which is less steam driven than the one
it replaces and, hopefully, will not power itself off and reset to
factory defaults every few days. Being modern it can act as a USB
modem device and therefore allows me to have my OpenSolaris Laptop
work with it.


Following the instructions from James
Leggs blog
and some from an Email I had been sent (James’
instructions were the same as the email) it all worked just fine
except: The phone is a Nokia E71 and by default the USB setting was
menu->connectivity->usb was set with “USB mode” to mass
storage and “Ask on connection” to Yes. It seems that that was
enough for OpenSolaris to see it as a disk drive and then not plumb
up the serial devices. Changing the “USB mode” to “PC Suite”
resolved this.


The only addition I have made was to add these scripts into
/etc/ppp to disable nwam and fix resolv.conf when the link comes up
and reverse that when it is taken down.


cjg@brompton:~$ cat /etc/ppp/ip-up
#!/bin/ksh -p
/usr/sbin/svcadm disable -t svc:/network/physical:nwam
mv /etc/resolv.conf /etc/resolv.conf.preppp
cp /etc/ppp/resolv.conf /etc/resolv.conf
chmod 644 /etc/resolv.conf
cjg@brompton:~$


and


cjg@brompton:~$ cat /etc/ppp/ip-down
#!/bin/ksh -p
test -f /etc/resolv.conf.preppp && mv /etc/resolv.conf.preppp /etc/resolv.conf
/usr/sbin/svcadm enable nwam
cjg@brompton:~$


Not rocket science and when nwam knows about ppp they will surely go
but until then quite satisfactory.





Finally create a launcher that will
start this at the click of a button. I have cheated here and simply
have it starting in a terminal so I can stoop it by quitting the
terminal:


cjg@brompton:~/Desktop$ cat 3G\ network.desktop
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=true
Icon[en_GB]=/usr/share/icons/gnome/24×24/actions/call-start.png
Name[en_GB]=3G network
Exec=\spfexec pppd call vodafone\n
Name=3G network
Icon=/usr/share/icons/gnome/24×24/actions/call-start.png
cjg@brompton:~/Desktop$


New Home printer VirtualBox & Ubuntu to the rescue

February 8, 2009

I’ve got a new printer for home, an HP OfficeJet J6410, but the
bad news is on Solaris the hpijs server for ghostscript fails and
while I have made some progress debugging this it will clearly take
some time to get to the root cause. As part of the debugging I ran up
a Ubuntu linux in VirtualBox to see if the problem was a generic
ghostscript/CUPS problem.


Since Ubuntu had no problem printing for the short term I have
given the Ubuntu system a virtual network interface so that I can
configure the Sun Ray server to print via the Ubuntu print-server,
which if I use the cups-lpd server, will do the formatting for the
remote hosts. The remote hosts therefore just have to send
PostScript to the print-server and only it needs to be able run the
hpijs server.


I’m running the VirtualBox headless and gdm turned off, infact
everything except CUPS, xinetd and sshd turned off. I’ve not written
an SMF service to start the VirtualBox yet in the hope that this is
infact a very short lived situation as the Solaris print service will
be up and running soon. Anyway I now have working printing on Solaris


Now back to what I know about ghostscript and the hpijs service.
If you know more (which would not be hard) then let me know.


The problem is that ghostscript called from foomatic-gswrapper
fails with a range check error:


: pearson FSS 51 $; truss -faeo /tmp/tr.$$ /usr/lib/lp/bin/foomatic-gswrapper>
truss -faeo /tmp/tr.$$ /usr/lib/lp/bin/foomatic-gswrapper -D -dBATCH -dPARANOIDSAFER -dQUIET -dNOPAUSE -sDEVICE=ijs -sIjsServer=hpijs -dIjsUseOutputFD -sOutputFile=-
foomatic-gswrapper: gs ‘-D’ ‘-dBATCH’ ‘-dPARANOIDSAFER’ ‘-dQUIET’ ‘-dNOPAUSE’ ‘-sDEVICE=ijs’ ‘-sIjsServer=hpijs’ ‘-dIjsUseOutputFD’ ‘-sOutputFile=/dev/fd/3′ 3>&1 1>&2
unable to set Quality=0, ColorMode=2, MediaType=0, err=4
following will be used Quality=0, ColorMode=2, MediaType=0
unable to set paper size=17, err=4
Unrecoverable error: rangecheck in setscreen
Operand stack:
-0.0 0 –nostringval–
: pearson FSS 52 $;


The errors, unable to set Quality and unable to set paper size appear
to home from the hpijp server that returns NO_PRINTER_SELECTED (4) if
these routines are called prior to the printer context is set up.


Quite how and why the printer context
is not getting set up is the question. I’ve now rebuilt both
ghostscript and the hpijs service from source and worked out how to
get foomatic to use the new ones and I still have the issue but at
least I should now be able to do diagnosis in my own time while the
printer is usable by everyone on the local network.


Building ghostscript was simple:


$ ./configure –prefix=/opt/cjgsw


Then make and make install.


Building hpijs was less simple and I am
not entirely sure I have it built correctly in fact I stronly
suspect it is not built correctly. At least I have my binaries
behaving the same way as the Solaris binaries, ie the failure mode is
the same. My configure line was:


 $ ./configure LIBS=”-lsocket -lnsl” –prefix=/opt/cjgsw –disable-pp-build –ena
ble-static –disable-shared


All the –enable-static and –disable-shared are required or the
linker gets upset during the build I think the next stop would be an
update to gcc….


You can’t put it back in the box.

February 7, 2009

It seems the clever Lawyers at LBC have not really paid attention
to how the web works. Specifically “The
Net interprets censorship as damage and routes around it.
“.
This post is part of that routing.


The Bad
Science
blog from Dr Ben Goldacre took justified issue with a rant from Jennie Barnett about the
“dangers” of the MMR vacine and in doing so included the audio
clip of her ravings. Now rather than being pleased that increased
publicity would result so that more people would listen to her radio
show in the future they decided that Ben was in breach of copyright
and set
the Lawyers
on him. I can understand them not wanting her ravings
heard but the better way would be to stop her talking about things
she knows nothing about but that would make for a much shorter show.


So you can no longer listen to the
clip unless you look here,
or here,
or listen to it and read a transcript here.
And what ever you do don’t type “Jeni Barnett censorship” into
google!


40″ Sun Ray Display

February 4, 2009

I managed to buy 2 Sun Ray 2’s off Ebay and one of them was is now
in place in the living room driving our 40” TV.



Combine
this with a KeySonic wireless mini keyboard and the DTU does not only
act as a photo frame. The Sun Ray unit is attached to the underside
of the shelf as the top unit in the pile is a Virgin cable TV
recorder which does not like having anything on top blocking the air
flow. Thanks to the Sun Ray 2 being so light 5 strips of sticky back
velcro do the trick so well that it really is going nowhere to the
point that I could not remove it to plug the USB keyboard adapter
directly in the back of the unit. The keyboard adapter has a button
you have to press once plugged in to pair it with the keyboard. Alas
with the Sun Ray in this configuration the button faces upwards. So
there is a short USB cable hidden back there.


Networking is provided via Ethenet over mains.


The keyboard has impressive range and a really nice touch pad that
pretends to have a scroll wheel down one side. However I’ve not yet
got the keyboard map for it right but it only arrived an hour ago so
there is time.


Blog Comments broken

February 1, 2009

The spam detection on the blog comments on this blog seems to have done a google and is marking all comments as spam which requires me to approve them all, even my own!


Unless the comments are obviously spam, really offensive or duplicates. I will approve them even if I disagree.