Dave James Miller

Developer. Computer Geek. INTJ.



Linux Toolkit


Some useful scripts for maintaining Linux servers.

Find newly created/modified files in Linux

Find files created today or recently modified... Read More

Check MX Records


Checks the MX record settings for each domain on a cPanel server match those in an external DNS serv…

Read More

Installing PHP 5.4 on Debian 6 (Squeeze)

Debian 7 (Wheezy) is due to come out soon, but I didn’t want to wait to upgrade to PHP 5.4, nor to install the release candidate. I tried using the Wheezy repository, but got dependency errors. Fortunately Dotdeb provides packages for… Read More

List the number of open HTTP connections per IP in Linux

This was useful when fighting a DDoS attack on one of our web servers. Read More

Installing Dnsmasq for wildcard local domains on Debian

I use this to point all subdomains of a domain to my local development server. Read More

Automatic updates for Debian

Originally I was using apticron to email me whenever new security updates were available and then manually applying them, but with 3 Debian servers and frequent updates this was getting annoying. So I decided to automate it. Read More

Installing PHP 5.2 FastCGI on a cPanel server (alongside PHP 5.3+)

This is based on my instructions for Debian and a bit from this forum post. It requires root access and you must be comfortable using the command line. Read More

Bulk (batch) rename files in Linux

rename -v s/OLD/NEW/ FILENAMES Read More

Extract images from a .ico file (e.g. favicon.ico) on Linux

icotool -x -o . favicon.ico Read More

Script to delete and re-create a Linux test user account

I use this script to repeatedly delete and re-create a Linux (Debian/Ubuntu) user account for testing my dotfiles installation script. Read More

Sites Manager


Script to manage virtual hosts in Apache and Exim on my Debian servers.

Installing PHP FastCGI with suEXEC on Debian

Most of the time I’m happy with mod_php. It’s certainly the most efficient way to run PHP. But there is one major downside – all scripts are run as the Apache user (www-data). We can get around this by using… Read More

Installing Ruby on Rails 3.1 + Ruby 1.9 on a cPanel 11.30 server

cPanel 11.30 doesn’t support Ruby 1.9 or Ruby on Rails 3.0/3.1, only Ruby 1.8 and Rails 2.3. They are working on supporting Rails 3 in cPanel 11.34, but that could be 12 months away still, so for now we have to install… Read More

Automatically mounting a Samba share at boot on Debian

First you’ll need somewhere safe to put the username & password. We’ll store them in /etc/sambapasswords, and make that only readable by root. Read More

Connecting PHP to Microsoft SQL Server on Linux

Here is how to get PHP 5.2 on Linux (specifically Debian/Ubuntu) talking to a Microsoft SQL Server database Read More

Installing PHP 5.2 FastCGI on Debian 6 (Squeeze)

Debian Squeeze comes with PHP 5.3. This is good, because PHP 5.2 is no longer maintained, but causes problems for old applications that can’t support it (e.g. ViArt 3, because it uses Zend Encoder). Rather than permanently downgrade PHP for the whole server,… Read More



Config files and scripts for Bash, Vim, Git and other Linux software.

Download MySQL database from cPanel to development server (shell script)

This is a tiny script I used to download my live site database onto my development server when I used a web host that used cPanel, but didn’t give me access to mysqldump over SSH (because they have Jailshell enabled). Read More

Setting up Wake-on-LAN (with a Debian server)

Today I set up Wake-on-LAN (WOL) on all the PCs at work. It was pretty easy actually. Read More

Mounting Samba/CIFS on Linux as a regular (non-root) user

smbmount //server/filestore /path/to/mountpoint/ -o user=dave,pass=XXX,dir_mode=0700,file_mode=0600 Read More

How I set up my Debian web server

Recently I moved my websites to a virtual private server (VPS) from Memset. Rather than pay an extra £7.50/month for cPanel, I decided to configure it myself. This is my notes about what I did. It’s not designed to be a… Read More

Debian vs Ubuntu

For a while now I’ve been using Ubuntu as my Linux distro of choice. On Monday I have to reinstall one of the Ubuntu servers at work, so I thought I’d have a look at Debian this weekend, to see if it would be… Read More

SUID Shell Scripts

I was trying to work out why my SetUID (chmod ug+s) script wouldn’t work properly, until I came across a page that explains why this is disabled. I’ve changed it to require that sudo ./myscript be used instead. Read More

Devil’s Pie

A very useful tool for Linux users: Devil’s Pie. Read More

Page 1 of 212

© 2017 Dave James Miller — Powered by WordPress

Theme by Anders NorenUp ↑