HOW-TOs

Creating Secure Tunnels With ssh

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.

Creating Queries in OpenOffice.org Base

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.

Using ps to Monitor Processes

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.

More on Using the Bash Complete Command

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.

Protect Your PostScript Files from Being Converted to PDF

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.

Monitoring E-Mail with Nagios

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.

The Bash declare Statement

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.

Start and Control konsole with DCOP

I like to open a lot of tabs in my terminal (konsole) window: a few standard shells, a couple of su shells, and some ssh connections to other systems that I access regularly. KDE can remember some of these settings via its session capability, but it doesn't always remember everything I want, and sometimes it remembers things I wish it would forget. So, to get my standard tabs, I use DCOP to start what I want when I want it.

Running Complex Commands with sudo

If you use sudo to run commands as root, you've probably run into “permission denied” problems when only part of a pipeline or part of a command is running with root permissions. This fails with “permission denied” because the file is writable only by root:

Troubleshooting Network Problems

Back when I worked in the Network Operations department at one of my previous jobs, we used to chuckle when a customer would call us reporting that “the Internet is down.” Now, I realize that there are otherwise intelligent computer users out there who don't understand why that might cause a technician to chuckle, and I'm not trying to make fun of them.

Slice and Dice PDF

Using poppler-tools and psutils, you can extract a range of pages from a larger PDF file. For example, if you want to extract pages 11–14 of the PDF file afile.pdf, you could use the following command:

Stop Telling sudo Your Password

If you get tired of typing your password for sudo, but you don't want (or don't have permissions) to put NOPASSWD in your sudoers file, you can use the following procedure to update the sudo password timestamp and avoid typing your password. Step 1) Create $HOME/bin/sudo-hack.sh: