Category Archives: Other Code

Copy Files to Many USB Drives Quickly and Easily 1

I was recently tasked with copying speaker’s presentations, files and handouts onto 100s of USB Drives (key drives) for a conference that work is hosting down in Washington, D.C. My first thought was that it was going to be a pain to have to copy/paste the files to each drive. I thought about creating a [...]

How to Install SNMP on Tomato Router Firmware and Graph Traffic with Cacti 5

You’ve flashed your old WRT54G or other vanilla router with the Tomato firmware. This itself turns your router into a lean, mean routing machine with QOS, SSH and more, but let’s say we want to take it a bit further. What it we want to get some more stats out of it?
In order to do [...]

Easy Search and Replace in Multiple Files on Linux Command Line 8

I recently came across a typo that existed in a bunch of html files on my web server. I thought it should be easy enough to change, but since it was in a number of files, editing it by hand would be time consuming. Fortunately, there is an easy, one liner command to replace the [...]

Password Protected Folder Gives 404 Not Found in Wordpress Installation Sub-folder. 15

Came across this little maddening issue again today after fixing it a few months back. I created a directory that is password protected using a .htaccess file. However, when trying to access this folder or anything under this directory, a File Not Found 404 error from Wordpress is displayed before it even prompts you for [...]

Simple Redirect Subdomain to a Directory 1

If you are running Apache for your web server, and mod_rewrite is installed (this is a pretty typicaly module on all installations) this is actually pretty easy.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^subdomain\.yourdomain\.com
RewriteRule ^(.*)$ http://www\.yourdomain\.com/subdomain/$1 [L]

Add this code to your apache configuration file – the easiest location is in the .htaccess file in your root web directory. This [...]