Eddie On Everything

Tips & tricks on things that interest me

Entries Tagged ‘linux’

Linux .forward file not working? Make sure you have the permissions set correctly

I checked in to one of my Linux accounts today and saw that I had about 2 GB of unread emails. Dating back to 2008, these emails were almost entirely the output of different cron jobs that I have set up & running on that account.  They were error notifications & various STDOUT messages.  Nothing [...]

Managing Server Load when unzipping many large files

So, I have about 500 zipped up files that I needed to unzip.  Each of these files is about 100M when decompressed.  I ran into a big problem when unzipping the files all at once – when I did a simple “unzip \*zip", the server load eventually skyrocketed.  The load got so high, in fact, [...]

Caution: filename not matched error when unzipping multiple files workaround

I was unzipping a boatload of zip files today, and I casually entered “unzip *zip” into my Linux command line. No way, said my system. Instead of unzipping the files, I got a bunch of warnings that read: “caution: filename not matched,” followed by a filename.  At the end of the listing, unzip told me [...]

How to Scan a Computer for Open Ports

There are a bunch of GUI utilities for conducting port scans, but I prefer to work from a command line shell.  In the past, I’ve used a custom script for scanning a machine for open ports from the command line, but I recently needed to get a little more information from a scan than my [...]

The Zen of Taco Bell Programming – Using Unix Tools to Prevent Reinventing the Wheel

Saw this great article by Ted Dziuba that parallels my programming philosophy. ( In case you’re interested, here’s a reddit thread on the article. ) In short, the article states that much of what you want to accomplish with any project is possible with the standard, tried-and-true Unix tools. When you shun these tools in [...]

How To Keep An SSH Connection Alive in Linux

By default, many Linux configurations automatically close SSH sessions after a certain amount of inactivity. You can easily change this setting on your system by editing the sshd configuration file. Of course, before doing so, you should consider the security implications of keeping SSH sessions active. Setting your server to keep connections alive may present [...]

Fix the Synergy Copy-and-Paste Clipboard Problem on XP

I use Synergy to use a single keyboard and mouse to control multiple computers. (Or, I should say, I used to use Synergy – more on that later.) It’s really great software. If you’ve never used it, and you have multiple computers on your desktop, I highly recommend that you check it out. For a [...]

Rotating Backup Directories using cp -al (hardlinks) to Save Disk Space

The copy command “cp -al” found on all versions of Unix/Linux creates what’s called a “hard link” to a file. The nice thing about this command is that it doesn’t create an actual copy of the file on disk – instead, it creates a “link” or pointer to the file data on the disk. Basically [...]

Using rsync & ssh to Backup Files Between Linux Machines (Perl)

This script performs a network backup using unix’s rsync command over ssh. It performs an incremental backup, which means that it only updates new files and files that have changed since the last backup, thus minimizing network traffic. This script runs on the source machine (SOURCE) and connects to the backup machine (BACKUP). (SOURCE->BACKUP). It [...]

“Argument list too long” from rm command. A Perl Script to Get Around the Problem

You’ve seen the problem – many Unix commands don’t like very long argument lists.  For instance, my Linux machine complains when I try to “rm” 10,000 files at once: [eddie@yoakam test]$ rm * -bash: /bin/rm: Argument list too long Here’s a simple script that will delete all of the files in a given directory, even [...]

How to Easily Install a Perl Module In Ubuntu Linux

Wow, I think I just found the best tip EVER. I had to install a perl module (WWW::Mechanize) and was stuck in a serious dispute with CPAN over dependencies.  Wow, what a mess. Fortunately I found this post by David Yin about how to use Debian’s totally awesome apt-get command to install the module. Steps: [...]

Linux Question: When does updatedb.mlocat / cron.daily run?

Uggh. My Ubuntu server’s updatedb.mlocate process is loud as heck and runs *forever*. I haven’t noticed a performance decrease, as the job is set to run at a fairly low priority. But since I sit near the server, it’s annoying to listen to the hard drive churn for hours and hours. All I wanted to [...]

Linux / WHM / Cpanel : Resource temporarily unavailable

Getting this Linux error message? Resource temporarily unavailable It’s because your system is limiting the number of files / processes / CPU that your particular user ID can use. If you use WHM/Cpanel, enabling the “Shell fork bomb protection” can make the “Resource temporarily unavailable” message appear more often. Don’t disable the shell fork bomb [...]

Uploading Large Files to a LAMP setup – upload_max_filesize, post_max_size, and max_allowed_packet

So you’re trying to upload a large file via PHP and you’re getting an error, eh? It’s probably because of PHP’s default configuration, which limits uploads to 2 Megs, or because of MySQL’s default 1.5 Meg limitation. Here’s how you change these defaults. First, find your php.ini file. If you don’t know where it is, [...]


Buy me a ginger ale