Category Archives: Code

Various bits of code. Could be Linux Bash Scripts or wordpress PHP plugins, or anything else in between.

Link Lint (Broken HTTP links) using Parallel processing

This script is designed to check many different websites for broken links at once and uses a multi-process approach to speed up checking times. #!/bin/bash # This script was created by Michael Kubler # On the 26th of May, 2010 … Continue reading

Posted in Code | Leave a comment

Bash Prompt

For those that are regular Terminal, SSH, and/or Putty users, there will come a time when you want to change the Bash prompt. Here is the new PS1 (Shell Prompt) which you can add into ~/.bashrc if [ "$color_prompt" = … Continue reading

Posted in Code | Leave a comment

Create Site Script

This is one of the most comprehensive bash scripts I’ve ever written. Over 760 lines of code, but it allows an Ubuntu System Admin to create a new Website, Mailman mailing list, FTP account and/orĀ  WordPress Blog by typing an … Continue reading

Posted in Code, Downloads, OMFG | Leave a comment

MySQL Backup Script with User Permisions

This is a usefull script that performs a standard MySQL database dump but includes the functionality to backup users and user permisions in addition to the datain the database. #!/bin/bash # Copyright (c) 2005 nixCraft project # This script is … Continue reading

Posted in Code, Need to know | Leave a comment

WordPress Hello Dolly -> Rick Roll

For a little bit of fun a number of months ago I edited the default hello dolly wordpress plugin and changed it to a rick roll. Personally, I’m not of the Hello Dolly generation and it didn’t interest me at … Continue reading

Posted in Code | Leave a comment

SugarCRM Soap v2 Modules and Link Fields lister

Here at ANAT we use SugarCRM. A reasonably good, open source and free Customer Relations Management System which is used to keep the membership database information, send out monthly digest emails to subscribers, do document control, and much more. Unfortunately … Continue reading

Posted in Code | 3 Comments

Fun with sudoer

As part of our ongoing push to make our servers more secure the tech department decided to lock down the sudo command on our servers by restricting which users could use it and enabling e-mail alerts for unauthorised access. For … Continue reading

Posted in Code, Gripes, OMFG, WTF | Leave a comment

Empty directory cleanup

This script will remove all empty subdirectories within the directory supplied as a command line parameter. i.e. ./CleanupDirs.sh /docs/stuff will remove any empty subdirectories of /docs/stuff. #!/bin/bash   # This script was created by Dale Caon # On the 15th … Continue reading

Posted in Code | Leave a comment

MySQL Backup and Rsync Script

As part of running a Web server, in this case a LAMP (Linux Apache, MySQL, PHP) server, you need to ensure you have a good backup system. As per the Tao of backup, you need something that allows you to … Continue reading

Posted in Code | 1 Comment

Usefull Aliases

Here is a list of useful aliases used by the ANAT Tech department. Please feel free to use these as appropriate : alias aRestart=’sudo apache2ctl -k restart’ alias acs=’apt-cache search’ alias agg=’sudo apt-get upgrade’ alias agi=’sudo apt-get install’ alias agr=’sudo … Continue reading

Posted in Code | 2 Comments