HOW-TOs

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:

Sync Firefox from the Command Line

There are lots of solutions for syncing Firefox, and I must confess I haven't used any of them. As I've read the descriptions, I've always gotten the sense that they wouldn't do what I wanted, the way I wanted it, when I wanted it. Necessity being the mother of invention, I wrote my own shell script to do what I needed.

Web Content Filtering with OpenDNS

Once in a while, you come across a gem that you just want to share with others. I recently stumbled upon OpenDNS, and I've had such a good experience with it, I thought I'd write a bit about it. For the record, I have no affiliation with OpenDNS, except that I'm a happy user of this free service.