September 09, 2004
Useful software: libxosd

I had built an early version of libxosd for my Solaris SPARC systems a year or two ago, since it provides a very tidy way to have a ubiquitous onscreen clock with a wide variety of window managers. libxosd went, when I was distracted, through a substantial rewrite, culminating in a 2.2.x series release. And I'm running Solaris 10 (with smf(5)) on a dual Opteron now, as I've mentioned before.

I generally try to build OSS software with the Sun Workshop/Forte compiler suite first, but for libxosd, I recommend going directly to GCC. There are too many mistakes in the autoconf/libtool pairing to bother fixing—none of these appear to be libxosd issues. (I mean, couldn't -Wall not be passed to cc by now?)

Recommended.

Posted by Stephen at 11:43 PM
June 24, 2004
A menu of many buffers

I'm often manipulating over 100 files when I'm making modifications to various software components. Generally, the buffers menu in Vim (X11/Motif) handles this okay, unless all of the files are named with the same letters. In a recent batch of changes, 90 of my files were named "Makefile", "prototype_com", or "pkginfo.tmpl"; this results in the buffers menu being larger than the vertical height of the screen.

I tried a few of the publically available scripts, and found BufExplorer to be all I needed and more: since it turns the list into an additional buffer, with various viewing and sorting options, it's easy to search and select the correct buffer to modify. And your fingers need never leave the keyboard.

Recommended.

Posted by Stephen at 12:05 PM
June 21, 2004
Second stream of consciousness

I figured I should mention that I'm going to make most of my Solaris-specific comments on my blog at blogs.sun.com. We'll see if I can keep the topics meaningful and interesting on both, without halving my posting rate on each.

Posted by Stephen at 11:52 AM
June 03, 2004
Ion-2 and VNC

I use ion as my window manager, but have recently switched my home desktop from a G4 Cube to a PC running Solaris. I'm a regular full-screen VNC user, and getting vncviewer and ion to cooperate is pretty key. Fullscreen mode can be achieved using vncviewer and ion (from blastwave, or build them yourself) with only a few modifications to the X resources for vncviewer. These aren't at all tricky, but require enough experimenting that writing them down will save someone somewhere five minutes some day.

Although the fullscreen transition will mostly work, ion will be confused about the keyboard focus, so we need to tell vncviewer to take additional responsibility. Add the following to your $HOME/.Xdefaults file:

vncviewer.grabKeyboard: true
vncviewer.fullScreen: true

For the latter case, you could instead use the -fullscreen option to vncviewer or the on-screen menu. That's it: you're immersed in a virtual reality... which for me is mostly the same as my normal reality.

Update (9 June): Five minutes saved already; see Comments.

Posted by Stephen at 05:56 PM
May 07, 2004
sun.com survey on default secure install

Here's an interesting survey: Sun wants to know how secure the default install for Solaris 10 should be. If you listened to the NetTalk on Wednesday, then you might be able to guess that your input here probably means more work for my team and me.

(I suppose I should really split work blogging from home blogging. Oh, well: work's particularly fun right now.)

Posted by Stephen at 12:55 AM
May 04, 2004
Stephen on NetTalk panel at sun.com

Stephen's one of the so-called "rocket scientists" in the Solaris 10 Technical Discussion being offered as a NetTalk tomorrow. (It's at 1pm PDT.) You can register for the live session (or for details about hearing a replay later).

(You would think folks would rather hear from computer scientists or software engineers or operating systems designers than rocket scientists on this kind of topic, but perhaps not...)

Posted by Stephen at 10:16 PM
April 09, 2004
Sounds again

hercules-pocket.gifI've been using a dual Opteron as my primary desktop lately, but Solaris doesn't support the sound device included on its motherboard. After asking around about the likelihood of support arriving, I was told that one possible path was to use a USB Audio device instead.

So I drove off to Fry's to look around and found, as is always true when I look at PC peripherals, that there is a wide variety of such devices, ranging from a cheap plastic version with only a few features to US$100+ options from Philips and Creative.

I ended up selecting from the midrange, and bought the Hercules Gamesurround MUSE Pocket, which is a little chrome number with a big volume dial (which Solaris supports) that doubles as a mute button (which it doesn't) and 5:1 surround sound (which I can't test). (Generally the Gamesurround gets middling reviews, but as a USB Audio pod when no sound support is available, I like it.)

Recommended.

References:
Posted by Stephen at 11:38 AM
January 27, 2004
The joy of :bufdo

If you use vim, then you may have discovered that its documentation, while extensive, is nearly impenetrable. One operation I often have to do is

$ for x in [list of files]; do
> sed -e '[some substitution]' < $x > $x.bak
> mv $x.bak $x
> done
since most Unix-based editors don't offer multi-file replace. It turns out that, sometime between 5.3 and 6.x, vim has added the :bufdo command, so this operation is much simpler as
  • you needn't leave the editor, and
  • you needn't maintain a list of files, provided you've opened them all in the editor.
I'm posting to share this small tip, since when I canvassed a few folks at the office, no one seemed to have heard of :bufdo. (See "impenetrable documentation", above.)
Posted by Stephen at 11:41 AM
December 07, 2003
software:dockables page updated

I've reformatted the software:dockables page to bring it in line with the site's general format; it's still one of the more active entry pages for blueslugs.com (along with the grammar entry in Ben's ABC collection).

Posted by Stephen at 08:08 PM
November 27, 2003
Fixing a common/combined Apache log

I was trying another web server statistics package, awstats, based on a testimonial in Alan's blog. Unfortunately, awstats expects a log file to be in the `combined' log format, and blueslugs.com has many entries in the default `common' format (prior to a switch for superior logging). A search showed no obvious small script for this, so I hope that providing massage_log.pl will save someone a few minutes or, at least, a few thousand log entries.

Posted by Stephen at 02:04 PM
November 22, 2003
Caching minidns

I've started using analog to build reports from the blueslugs.com server logs. One of the tools on the site is minidns, which is a small Perl script that runs through the logs, replacing any IPv4 address matches with their DNS-resolved names (if defined). I've improved this slightly, by adding caching inside the application (on the grounds that your site is likely visited by the same communities over time) and, via Storable, to a state file (on the grounds that you probably run the analyzer over your logs rather regularly). [Get cachedns.pl.]

Is it worth it? Read on.

Here are some simple timed runs with the original (minidns.pl) and with cachedns.pl.
$ time perl minidns.pl < ./al.1000 > /dev/null

real    1m56.431s
user    0m0.030s
sys     0m0.030s
al.1000 is the first 1000 lines of an Apache server log. Our name service cache, nscd(1), and the DNS server we're calling (and the perl(1) text) are now reasonably warmed up for subsequent callers.
154 $ time perl minidns.pl < ./al.1000 > /dev/null

real    0m11.210s
user    0m0.030s
sys     0m0.020s
155 $ time perl minidns.pl < ./al.1000 > /dev/null

real    0m12.943s
user    0m0.050s
sys     0m0.010s
So 1000 calls take a little over 10 seconds. Let's run the caching version:
$ time perl cachedns.pl -c dns.cache < ./al.1000 > /dev/null

real    0m8.579s
user    0m0.090s
sys     0m0.020s
So the internal caching is maybe making a little difference. But let's rerun with the now-populated cache file.
$ time perl cachedns.pl -c dns.cache < ./al.1000 > /dev/null

real    0m0.096s
user    0m0.070s
sys     0m0.010s
Since the first part of the log file is processed every night, our cache file means that we're likely only going to perform a DNS lookup for new visitors to the site. (There are many sophisticated DNS resolvers-for-weblogs around, that use C++ or Python or threading or whatever. I just felt that a simple, understandable Perl version, with a boost, was enough for this little site.)
Posted by Stephen at 12:59 PM
June 12, 2003
Thumbs up: Chicken of the VNC

I've used pretty much every VNC client available for Mac OS X over the past year. My preferred client now is Chicken of the VNC, even though the pun makes me cringe. Recommended.

Posted by Stephen at 10:24 PM
March 25, 2003
An icon for GNOME

I recently started using Sun's version of GNOME 2.0 as my primary desktop environment, and decided that I needed an icon to launch my favourite mail application, mutt. I'm not much of an artist or a GIMP expert, but I was able to combine the GNOME terminal icon with the mutt in the Mutt banner:

mutt-terminal.png

Feel free to use it, if it's useful to you.

Posted by Stephen at 03:24 PM