Eddie On Everything

Tips & tricks on things that interest me

Entries Tagged ‘ubuntu’

Problem with upstart job on Ubuntu: stop: unknown job: plexmediaserver

I spent way too long tearing my hair out over this. I’m setting up a new 14.04 server (trusty). I installed Plex Media Server, which is a horribly written piece of software with absolutely brilliant features. Seeing as how it’s about the best out there in terms of features, I’m taking the, “eh, whatever, it [...]

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 [...]

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 [...]

  

Tips graciously accepted