HOW-TOs

Bash Extended Globbing

Wildcards in bash are referred to as pathname expansion. Pathname expansion is also sometimes referred to as globbing. Pathname expansion "expands" the "*", "?", and "[...]" syntaxes when you type them as part of a command, for example: $ ls *.jpg # List all JPEG files $ ls ?.jpg # List J

Bash Parameter Expansion

If you use bash you already know what Parameter Expansion is, although you may have used it without knowing its name. Anytime you use a dollar sign followed by a variable name you're doing what bash calls Parameter expansion, eg echo $a or a=$b. But parameter expansion has numerous other forms which allow you to expand a parameter and modify the value or substitute other values in the expansion process.

Change Volume From a Bash Script

If you use ALSA for sound on your system the functions contained in the script presented here can be used to get and set the volume on your system. You might use this if you had a monitoring script running and wanted to raise the volume when you signal an alarm and then lower it again to the previous volume.

Monitoring Processes with Kill

If you have a process ID but aren't sure whether it's valid, you can use the most unlikely of candidates to test it: the kill command. If you don't see any reference to this on the kill(1) man page, check the info pages. The man/info page states that signal 0 is special and that the exit code from kill tells whether a signal could be sent to the specified process (or processes).

Grep: RRTFM

If you've been a Linix/UNIX user for a long time you surely know what RTFM means (Read The *bleep* Manual). I'd like to offer up a new, related acronym, RRTFM, for Re-Read The *bleep* Manual.

Custom checks and notifications for Nagios

A while back, I wrote an article for Linux Journal's web edition entitled “Howto be a good (and lazy) System Administrator.” A couple astute readers, after reading the article, asked if I was familiar with the Nagios monitoring system, and I am. I've been using Nagios for a few years now.

OpenOffice.org: Knowing when to use Impress

With Labour Day past, we back in the season of slide shows -- million of them daily in both academia and business. For over a decade now, slide shows have become an accepted prop for public speaking, regardless of whether they are useful or well-designed, and the trend shows no sign of slowing. You can, of course, just acquiesce and accept that as soon as you click to the first slide, most of your audience will sigh deeply and sit back low in their chairs. But, if you really want to make slide shows work for you, you'll think before opening up the Impress wizard.

Reading Native Excel Files in Perl

In my last article for Linux Journal's web edition, I discussed a web-based program that queried an SQL database and output a native Excel file. That article was based on a program I wrote for a customer some time ago.

OpenOffice.org Impress: Using Master Slides

The Master view in Impress is the equivalent of page styles in Writer. It's the view where you can set elements of design that appear throughout your presentation, such as the slide background and foreground colors, any reoccurring elements, and the fonts. By creating the master slides you need before you add content, you can automate your work and free yourself to focus on content.

Rebooting the Magic Way

If you have ever had a hard drive fail on a remote server you may remember the feeling you had after trying to issue the following commands:

Use Nagios to Check Your Zypper

If you use Nagios to monitor your system and run openSUSE on a remote server the bash script presented here will check for online updates and is designed to be run by Nagios so that the result will appear on the Nagios service-detail page.

Monitoring Processes with Kill

If you have a process ID but aren't sure whether it's valid, you can use the most unlikely of candidates to test it: the kill command. If you don't see any reference to this on the kill(1) man page, check the info pages. The man/info page states that signal 0 is special and that the exit code from kill tells whether a signal could be sent to the specified process (or processes).

Converting troff to HTML

Ok, more specifically, troff using the mm macros to HTML. This is another from my "rusty scripts" collection which was written for a specific task long ago. In this case, we were converting some internal documentation from troff using the mm macros into HTML.

Generating Native Excel Files in Perl

Over the years, I've probably created thousands of reports for customers and co-workers. Usually, I have a web-based program that generates reports in either html or comma-separated format. The html format is a lot prettier and usually gives the user what they want.