Sunday, May 29, 2011

My monit recipes

Monit is one of my favorite tools. While it is a nice monitoring tool
for politely behaved services, it is also a quick work-around for
those services which don't play well in the normal boot sequence. For
me, these include the Statusnet daemons and Openfire. I have no good
startup script for the Statusnet daemons (xmppdaemon and queuedaemon)
and Openfire absolutely refuses to be part of the normal boot
sequence, though manually running "/etc/init.d/openfire start" always
works. In any case, the following monit recipies work for me:

 # xmppdaemon
 check process xmppdaemon with pidfile /var/run/xmppdaemon.generic.pid
 group statusnet
 start program = "/var/www/sn/scripts/startdaemons.sh"
 stop program = "/var/www/sn/scripts/stopdaemons.sh"
 if 5 restarts within 5 cycles then timeout
 
 # queuedaemon
 check process queuedaemon with pidfile /var/run/queuedaemon.generic.pid
 group statusnet
 start program = "/var/www/sn/scripts/startdaemons.sh"
 stop program = "/var/www/sn/scripts/stopdaemons.sh"
 if 5 restarts within 5 cycles then timeout
 
 # openfire
 check process openfire with pidfile /var/run/openfire.pid
 group openfire
 start program = "/etc/init.d/openfire start"
 stop program = "/etc/init.d/openfire stop"
 if failed host localhost port 9090
 protocol HTTP request "/login.jsp" then restart
 if 5 restarts within 5 cycles then timeout

The only shortcoming I see with the tool is that alerts are limited to
email only. I'd love to have the ability to post alerts via StatusNet
or IM/IRC. Guess I need to brush up on my C (or borrow someone else's
code). I know of a very cheesy system call that will post alerts to
Statusnet.

Tuesday, May 24, 2011

Getting rid of the Ubuntu splash screen on a LTSP thin client

One of the problems with running Ubuntu thin clients is that, when things go wrong, the splash screen gets in the way. To turn off the splash screen for a specific thin client, do the following:

1) Acquire root on the LTSP server

2) cd to the directory which holds the boot config file

cd /var/lib/tftpboot/ltsp/i386/pxelinux.cfg

3) There should be a file called “default” there. Copy that file to one that starts with 01, followed by the MAC address of the target thin client (change the colons to dashes).

cp default 01–00–0c-29-e1-a2–55

4) Open the new file with your favorite editor. The contents should look something like the following:

default ltsp label ltsp kernel vmlinuz append ro initrd=initrd.img quiet splash nbdport=2000

5) From that last line, remove the words “quiet splash” and save the file.

6) Your thin client should now boot without the splash screen (no need to restart the server), allowing you to see where in the boot sequence it’s crashing.

Above is adapted from the 28 Aug 2008 entry in the bootpolish blog

Saturday, May 21, 2011

Adding HDMI Audio to Ubuntu on the Acer Revo

Finally got around to attempting to get audio working through HDMI on
the little Acer Revo that I'd acquired a few months back. Turns out
it wasn't all that difficult, under Ubuntu 10.4.2.

The HDMI video worked when I plugged it in. It took a little while to
figure out that HDMI video wouldn't work unless I unplugged the SVGA
cable (this isn't mentioned in any online docs that I could find).

Audio took just a little more work than did video. First, I had to
update the nVidia driver and reboot. For some reason, version 173
doesn't support HDMI audio.

Next I added the following line to /etc/modprobe.d/alsa-base.conf
(this assumes that you have alsa-base installed):

  options snd-hda-intel model=auto

After that, I ran the following (as root) and rebooted after it was done:

  update-initramfs -k all -u

From there, I just needed to bring up the PulseAudio Volume Control
window, select the "Configuration" tab, and choose "Digital Stereo
(HDMI) Output" under the "Internal Audio" chooser. That's it.

There's a few minor problems with the new install. First, I can't
tell you what version of the proprietary driver. It's listed as
"(version current)", with the parens.

Second, where my monitor used to detect the video signal as 1920x1080
(using version 173 of the driver), it now detects the video signal as
"1080p". For some reason, this change causes the top and bottom of
the display to be off the screen (i.e., the Gnome panels are off the
screen). They're not visible unless I tell the Revo to use a 1440x900
resolution. I haven't yet decided which is the greater inconvenience:
having to switch headsets when listening to videos or the computer, or
having to employ a slightly less dense display resolution. For now, I
like not having to switch headsets. I'm still researching the video
resolution issue.

Lastly, and I'm not sure that it's actually a problem, I need to use
the monitor's control, vice the computer's, to control the audio
volume. It's going to take a little getting used to, reaching for the
remote control, vice the knob on my keyboard.

My thanks to Christopher Youde, who posted the howto as a bug on the
Ubuntu Laundpad bug page.

Wednesday, May 11, 2011

WikiPublisher side effects

It took a little wedging, but have WikiPublisher server up and running on home PmWiki (on top of Ubuntu 10.4 LTS). Have noted a couple side effects/oddities:

  • anything using the HTML strikethrough tag becomes invisible in the output PDF
  • PDF documents attached to a wiki page become included in the output PDF, while linked documents become footnotes

The latter one is probably a feature, though I don't know that I can determine "why".  In any case, I'm enjoying myself, working through the "How to Produce a Book" howto.  Anyone know of any other pitfalls/gotchas?

 

Saturday, May 7, 2011

The Little Things II

There are a couple nice work-arounds to counter the two previously-noted side effects, produced by de-selecting raise_on_click. Older Unix users will probably find them familiar and like them more than veteran Windows users. One is "focus follows mouse" and the other is the ability to use a combintation of keyboard and mouse to move a window. 

By clicking on System -> Preferences -> Windows, you're presented with the following screen. By selecting the first two check boxes and adjusting the slider, you can tweak the "focus follows mouse" function. You can also put that darned "Windows" key (or the Alt key) to work, allowing you to hold down the key, in conjunction with a left-click, to move a window.

A lot of people have asked about disabling the "raise on click" feature. If you're one of them, I hope this and the previous post make your life just a bit easier.

Screenshot-window_preferences