Solaris Jumpstart Installations In An All-Debian Environment

Time to bring the Solaris workstations into our new infrastructure, to discover all the hidden Debian-specific parts in my Puppet manifests, and then fix them to be platform-neutral. First off, I need to be able to ensure a common base installation on my Solaris systems, and to have that base be as hands-off as possible. Alongside this, I need to leverage our existing Debian infrastructure since the only extra Suns I have are very old and slow, and I have nowhere to house them (I will not Jumpstart from a Sparc 20 with a 10 megabit interface when I have a new file server with gigabit ethernet).
Continue reading “Solaris Jumpstart Installations In An All-Debian Environment”

Why Not Just Send It As Text?

This ad-laden page at about.com talks about why you might want to send emails as plain text by default (bandwidth, misbehaving HTML support in email clients, etc.). Never mind any ugly stationery you might have to look at.

So I receive an email memo informing me that since some group of people had trouble printing an earlier email memo (one I don’t think I ever received oh, wait — they sent the original as an email with no body text and an attached JPG from a scan of the original memo? I finally found it in my Spam folder), that copies of the original memo were attached to this email in both Word and PDF formats.

This second email totaled up at 77,711 bytes. Broken down into:

  1. A 24,576 byte MS Word document
  2. A 25,230 byte PDF file
  3. A 1,980 byte HTML version of the main body text (thank you, MS Office HTML export).
  4. A 178 byte text version of the main body text.
  5. The balance of the space taken up with encoding the binary attachments, the headers, and the quoted-printable conversion of the body text.

All this to send a memo that had a grand total of 724 bytes of actual text in it. An approximately 1:107 signal to noise ratio. I know. Disk space is cheap, as is on-campus bandwidth. And the second email is still an improvement over the 121,571 bytes from the original email with the absent text and the JPG attachment. But it’s the principle of the thing.

And I bet everyone could have printed the original memo perfectly well if they had just sent it as text.

AutoHotkey and Palm Desktop

I’m coming to the realization that my email inbox is not a task management system, it’s an inbox. I don’t need to abuse it as a list of things I need to do, I just need to grab the necessary details from the email and create a regular task in my Treo’s Tasks application. But since I use Thunderbird and Palm Desktop instead of MS Outlook, there’s not a particularly seamless way to tie pop up a new task or a new appointment from my email. Honestly, I had gotten so used to not having Palm Desktop at all (previously, my m515 cradle was at home instead of at work) that I’d built a bad habit of just scribbling in the tasks manually.

But for all of the Treo’s advantages, it just doesn’t feel quite as easy to enter information with the keyboard as it was with Graffiti 1 on the m515. I know it should be faster, and maybe it is. But it doesn’t flow like handwriting does. What would be great would be to use my office system’s full-size keyboard to enter a task into Palm Desktop, and then HotSync it to the Treo. But now we’re back to the pain of keeping Palm Desktop open, switching to it from Thunderbird, selecting the Calendar or Tasks pane, and then adding a new entry. Not convenient.

Enter AutoHotKey. This is basically a macro-typing tool for Windows. Its scripting language is flexible enough to start applications, check if an application is already running, and insert characters into the keyboard buffer. Now I have something I can work with. To wit, my “New Task” and “New Appointment” hotkeys, bound to Windows-T and Windows-N respectively, so that they parallel Menu-T and Menu-N in DateBk6:

;
; Create new appointment in Palm Desktop 4.1.4 with Win+N
;
#n::
IfWinExist Palm Desktop
{
	WinActivate
}
else
{
	Run C:\\Program Files\\Palm\\Palm.exe
	WinWait, Palm Desktop, , 10
}
if ErrorLevel
{
	MsgBox Palm Desktop did not start within 10 seconds.
	return
}
else
{
	WinActivate
	Send !vc{Enter} ; View / Calendar
	Sleep 100
	Send ^n ; New Event
	return
}

;
; Create new task in Palm Desktop 4.1.4 with Win+T
;
#t::
IfWinExist Palm Desktop
{
	WinActivate
}
else
{
	Run C:\\Program Files\\Palm\\Palm.exe
	WinWait, Palm Desktop, , 10
}
if ErrorLevel
{
	MsgBox Palm Desktop did not start within 10 seconds.
	return
}
else
{
	WinActivate
	Send !vt ; View / Tasks
	Sleep 100
	Send ^n ; New Task
	return
}

Filing 29 GB of Project Materials

I keep around a lot of project and class materials, both paper and electronic. As far as paper goes:

  • 1 lateral file drawer of B.S. and M.S. class materials
  • 1 lateral file drawer of regular work materials
  • 2 lateral file drawers emptied within the last few months. These mostly contained student tests, projects, and records from when I used to teach engineering graphics. I boxed up the projects and tossed the rest.

The volume of the above may not rank compared to the faculty here, but it’s a lot for me. As far as electronic storage goes: it’s down to 28.6GB in 135,336 files and 7,032 folders spanning 12 years or so. These are CAD drawings, solid models, finite element analyses, lecture notes from other classes I’ve taught, lab inventories, image processing code and the images themselves, etc., etc. I never had a good filing system for either. And that’s what I’m talking about now.
Continue reading “Filing 29 GB of Project Materials”

Watching Remote System Status with Nagios and NRPE

I know I’m late to the game with this part of my setup, but nonetheless, I’m happy with the results. The short form of it is that Debian’s nagios-nrpe-server package lets my central Nagios server keep track of my clients’ disk space, load averages, etc. Granted, I already had most of that visible through Ganglia, too, but Ganglia’s more of a grapher and collector, and not a notifier. I used to keep track of that stuff with Spong, but when I switched over to Nagios, that functionality went missing. Now, if one of the graduate students (let’s call him “new guy”) fills up 288 GB of /tmp and tells his advisor “the program crashed for some reason”, I won’t be finding the bloody remains days later when another student asks me why their program won’t run at all.

nrpe-output.png

Puppet and other configuration excerpts follow.

classes/nagios-nrpe-server.pp:

class nagios-nrpe-server {
    # nagios-nrpe-server for remote monitoring
    package {
        [ "nagios-nrpe-server", "nagios-plugins" ]:
            ensure => installed;
    }
    file {
        "/etc/nagios":
            ensure => directory,
            owner  => root,
            group  => root,
            mode   => 0755;
        "/etc/nagios/nrpe_local.cfg":
            source => "puppet:///files/apps/nagios-nrpe-server/nrpe_local.cfg";
    }
    service {
        "nagios-nrpe-server":
            ensure    => running,
            pattern   => "/usr/sbin/nrpe",
            subscribe => File["/etc/nagios/nrpe_local.cfg"],
            require   => Package["nagios-nrpe-server"];
    }
}

files/apps/nagios-nrpe-server/nrpe_local.cfg:

allowed_hosts=127.0.0.1,NAGIOSIP
command[check_disk_root]=/usr/lib/nagios/plugins/check_disk -w 20 -c 10 -p /
command[check_disk_boot]=/usr/lib/nagios/plugins/check_disk -w 20 -c 10 -p /boot
command[check_disk_tmp]=/usr/lib/nagios/plugins/check_disk -w 20 -c 10 -p /tmp
command[check_disk_var]=/usr/lib/nagios/plugins/check_disk -w 20 -c 10 -p /var
command[check_disk_amanda]=/usr/lib/nagios/plugins/check_disk -w 20 -c 10 -p /opt/amanda
command[check_disk_home]=/usr/lib/nagios/plugins/check_disk -w 20 -c 10 -p /home

excerpt from /etc/nagios2/conf.d/hosts.cfg:

define service{
        use                     generic-service
        host_name               ch226-21, ch226-22, ch226-23, ch226-24, ch226-25, ch226-26, ch226-27, ch226-28, ch226-29, ch226-30, ch226-31, ch226-32
        service_description     Disk Usage - /
        check_command           check_nrpe_1arg!check_disk_root
        contact_groups  admins
}
define service{
        use                     generic-service
        host_name               ch226-21, ch226-22, ch226-23, ch226-24, ch226-25, ch226-26, ch226-27, ch226-28, ch226-29, ch226-30, ch226-31, ch226-32
        service_description     Disk Usage - /tmp
        check_command           check_nrpe_1arg!check_disk_tmp
        contact_groups  admins
}

Solution to a Vexing update-alternatives Problem

So I’ve got Debian packages made from lots of large proprietary software titles, but one of them (Hyperworks) had been throwing errors on several of the systems I tried to install it on, normally something like:

Setting up hyperworks8 (8.1+0.2) ...
update-alternatives: slave link name /usr/bin/amfbuilder duplicated
dpkg: error processing hyperworks8 (--configure): subprocess post-installation script returned error exit status 2
Errors were encountered while processing:
hyperworks8
E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried lots of quick fixes:

  • purge, clean, and reinstall — no good.
  • purge, clean, clear out /etc/alternatives and /usr/bin of any detritus from earlier package versions — no luck there, either
  • edit /var/lib/dpkg/info/hyperworks8.postinst to remove the amfbuilder line — that just moved the error onto another program included in the package

Finally, I found a /var/lib/dpkg/alternatives/hw file and removed it. It contained nothing but my Hyperworks-related settings, so that was safe. Afterwards, no more errors.

Lowe’s and Staples

A student working in one of our labs noticed that a piece of equipment had dead batteries, and asked me to get replacements. Nothing special, just 6 regular D-cells. The next day or so, I head to Lowe’s, and use my university card to pick them up for around $9.50, tax-exempt, for 8 batteries. I bring the receipt back to the office, and mark it up so that the cost is assigned to the right account, and am asked:

“Did you check at Staples?”

Um, no. I get everyday electrical stuff at Lowe’s. Power strips; surge suppressors; extension cords; heavy cabling, plugs, and receptacles for hooking up high-power heaters or parts of server racks; etc. There’s an industrial electronics place in town that’s good for heavier-duty batteries, but these batteries will probably last for years regardless. Staples is more for when we need a cheap network switch right now.

“Staples has a state contract, and if an item is on their contract site, we have to document that we can find it cheaper elsewhere.”

Ok. So I finally went to Staples today. Not that they can actually price check the batteries without charging and then voiding my university card:

Vendor List Price Discounted Price Battery Quantity Cost per battery
Lowe’s ~ $9.50 N/A 8 $1.19
Staples ~ $7.50 ~ $7.47 4 $1.87

The mind boggles. Office-supply stores don’t sell batteries for cheap, even if you have a contract with them. Why doesn’t the state board that wrote the contract know this?

To greylisting: the cause of, and solution to, all of life’s problems.

New mail server went in this afternoon. I did forget to email the few non-administrative users we have on it ahead of time. My fault. But among other things, the new server has postgrey installed for greylisting. In the first six hours, we greylisted 136 emails, and 30 got resent. So that’s roughly 100 spam messages that I won’t have to deal with (I expect I see the most spam on the server, between my own email address and all the stuff that tries to hit the various mailman lists). In the next seven hours, 147 were greylisted, and 4 got resent.

Eventually, I’ll get dspam working alongside it, since 3 of the delayed emails today were actually spam, but this is an enormous first step, and the return on the minimal amount of configuration required is huge.

Update on emails delivered versus greylisted:

Date Delivered without Delay Greylisted Greylisted, but Re-sent
2007/09/11 222 136 30
2007/09/12 859 336 7
2007/09/13 888 270 9
2007/09/14 845 363 13

Stupid Software!

  1. Stupid Winamp. I update it on my laptop last weekend, and suddenly none of the MS Office products work any more.
  2. Stupid MS Ofice. After I get back to the office, I try to repair it by pointing it at the setup files it’s been looking for all weekend, but it doesn’t like those setup files.
  3. Stupid Windows. After I uninstall Office, it wants me to reboot. When I do, Windows blue screens right after I log in.
  4. Stupid Windows installation CDs. For some reason, you think the USB Zip drive with no disk inserted in it would make a lovely drive C:. Realizing that it has no disk inserted in it, you happily install Windows to my hard disk like I’d expect, which you then label drive E:.
  5. Stupid Windows management tools. I move the Zip drive to Z: like it had been before, but you won’t let me change the drive letter on the boot drive from E: to C:. So I unplug the Zip drive and reinstall Windows.
  6. Stupid OS X. When mounting a 8.86 TB Samba volume with 7.70 TB free, you think it’s an 800 GB volume with nothing free. Mount the same volume via Netatalk, and you’re fine.
  7. Stupid GNU tar. If I blindly chmod a bunch of files that my users might have the wrong permissions on, you think I’ve done something to the file contents, even if the permissions before and after are identical. I’ve not gotten a good backup of this one student’s 80GB of data yet, as far as you’re concerned.