HOWTOs

To add a bit of color to your man pages install the most pager. For most DEB based distros:

  $ sudo apt-get install most

For most RPM based distros:

  $ yum install most

Failing these, get the source here.

To kick off the upcoming 4th of July celebrations we present the following bash script for your enjoyment.

In order to avoid this common mistake I often have my shell scripts prompt me for a yes or no answer before they proceed. The function described here is for doing that: asking a question and validating the answer.

As a consultant, I am often faced with an unfamiliar Linux system (usually RHEL). I always find it useful to understand which files that shipped with rpm packages have been modified, since it's usually a good indicator of what customizations have been performed on the system. To determine the modified files, I simply run:

On Debian based systems, or any that use Synaptic for package management, you can use Synaptic to help you setup multiple systems with the same software. On the first system select all the packages you want and then under the File menu use Save Markings or Save Markings as to save your selections to a file.

To see the interrupts occurring on your system, run the command:

If you manage remote servers or if you have more than one computer you most likely have used the ssh command. A simple description of ssh is that it's a secure version of telnet, but that's like saying a Porsche is a just a better version of a Volkswagen bug.

The following methods can be used for resetting the root password if the root password is unknown.

Do you know what this sequence of characters "/-\|/-\|" is for? A text based spinner. Still confused, read on.

Queries are the database equivalent of filters in a spreadsheet. Just as a filter can limit and reorganize the information displayed in a spreadsheet, so a query limits and reorganizes the information in a database. Either can be an efficient way of finding the information you want, especially when you're dealing with thousands of records.

In a previous tech tip, we saw how to use kill to monitor processes. Another option is to use ps. With both methods, you can check $? for success/failure. However, note that kill -0 may return failure even if the process actually exists. This happens when the current user has no permission to the process in question, for example: kill -0 1.

In the video last week I showed how to use the bash complete command for simple use cases. Today I'll show you some of the additional ways that you can use the command for more complex scenarios.

If you've ever used fillable PDF forms, you've probably noticed that you can't save a copy of the form once it has been filled in. Being sneaky, you probably might try to print the form to a file (PostScript) and then use ps2pdf to convert it to a PDF. But, this doesn't work either, because ghostscript gives you an error saying the file can't be redistilled. This article shows you how to protect your own PostScript using the same technique.

The trap statement in bash causes your script to execute one or more commands when a signal is received. One of the useful things you can use this for is to clean up temporary files when your script exits.

Have you ever felt like you were being ignored? Have you ever felt like you were talking but no one was listening? Well, that's how it feels when your e-mail system is broken and you don't know it.

Although rarely used, the bash declare statement does have a couple useful options. It can mark a variable as read only and also mark it as being a number only.

SOCKS is built in to OpenSSH, so it's a trivial matter to set up a local SOCKS proxy with the -D flag. For example:

When looking at log files or other files that are compressed and rotated automatically, it's useful to be able to deal with them in a uniform fashion. The following bash function does that:

Introduction

Responding to growing demand for a professional level backup and recovery solution, Zmanda, a leading vendor for open source backup solutions, has introduced an Ubuntu server version of their Zmanda Recovery Manager (ZRM) for MySQL.

Syndicate content

Newsletter

Each week Linux Journal editors will tell you what's hot in the world of Linux. You will receive late breaking news, technical tips and tricks, and links to in-depth stories featured on www.linuxjournal.com.
Sign up for our Email Newsletter

Tech Tip Videos

From the Magazine

July 2009, #183

News Flash: Linux Kernel 3.0 to include an on-the-go Expresso machine interface! Ok, maybe not, but Linux is definitely going mobile, from phones to e-readers. Find out more inside about Android, the Kindle 2, the Western Digital MyBook II, The Bug, and Indamixx (a portable recording studio). And if you've gone mobile and you been wanting more Emacs in your life then check out Conkeror.


To compliment the mobile we've got the stationary: parsing command line options with getopt, checking your Ruby code with metric_fu, and building a secure Squid proxy. How is this stationary you ask? What can we say? It's not. We just wanted to see if anybody actually read this part of the page :) .


All this and more, and all you have to do is get your hot sweaty hands on the latest copy of Linux Journal.





Read this issue