matthias's blog

The many circles of quoting hell

When it comes to shell programming quotes and escaped quotes and escaped escapes seem to offer a limitless pit of fun. At times it seems nearly insurmountable and depending on whether you are running interactively or from a script.

Recently I had the opportunity to assist in some bash shell scripting. The issue was largely based on trying to get smbclient to run via some options that were being passed and parsed into a script.

Raw CUPS configuration challenge!

So, I recently had the pleasure of setting up a printer on Windows Vista laptop. In the past I've always made the choice to go the 'Generic Postscript' driver route. This generally works, but does not allow the Windows client to adjust any of the printer settings such as color, quality, etc. With this in mind and the price of print cartridges I decided I should re-investigate the setup of the printer driver.

1 != 1 ... it's a type thing

I found myself scripting a nagios check the other day. That in itself isn't unusual, but in this case I was writing a script to run via NRPE on a windows host using WSH/VB. The script was intended to received 3 parameters: a string, a warning number and a critical number. It would then list all the processes on the windows host and see if they matched the string. If so it would count them and compare that count to the critical and warning values.

gentoo on apache with mod_suexec

In my last post I eluded to some difficulties in getting mod_suexec to build for apache on my gentoo host. It used to work for a long time and then it failed around the time that the gentoo team moved and changed some of the build flags from /etc/apache2/apache2-builtin-mods to /etc/make.conf.

I've been lazy and haven't file a bug report, but since I have a work around and it doesn't change that often, the pain factor has not reached critical mass.

The magic of /etc/conf.d/apache2 and it's failings

I'm still running a Gentoo despite of the recent political stuff they've undergone. It simply works well for me and why fix and switch everything to Ubuntu.

At any rate, there is a web server that lives on the Gentoo box, that I occasionally add things to. I'm a big fan of splitting each virtual host into it's own file for cleanliness and after making changes I tend to run apache2 -t to verify the syntax is correct in all of the config files.

scripting against windows

So, I've been running UNIX and Linux for a long time. I've also run Windows for a long time. I do have a preference and one of my chief issue with Windows (and the reason I feel it's tedious) is that it is difficult to script against. That is not really a problem when you are running a handful of servers, but when the number goes to dozens, clicking simply doesn't cut it for me.

quick to sleep, but slow to wake (resume)

So I finally took the plunge and upgraded to Hardy Heron and am generally pleased. The one thing I noticed which I did not care for was the behaviour of suspend and resume. It worked great under Gutsy Gibbon but after my upgrade it was slow to return from suspend.

The laptop went to sleep in about the same amount of time, but when resuming, it would sit at a black screen with a single underscore in the top left corner for about a minute before going back to X.

device mapper, logical volumes, mount points and raw device paths

The other day I was needing to dig into I/O performance on a Linux box and in the past iostat has served me well, so I tried the good old

iostat -x

but wasn't quite sure what to look at.

Now the box I was working on was enjoying the benefits of RAID and LVM and so the output I saw looked as follows:

avg-cpu: %user %nice %system %iowait %steal %idle
0.01 0.00 0.01 0.00 0.00 99.98

howto move mbox files to an IMAP server

So I found myself in a conversation the other day about some things from a previous life. I knew I had some details about it somewhere in old email archives and started grepping for it. I found a lot of stuff but not the right stuff. Since it wasn't critical, I left it sit, but thought that it sure would be nice to have all of my old email on my mail server, where I can then use the search functionality of my email client. That's where it got to be interesting ...


Subscribe to RSS - matthias's blog