On administration
Contest winners are supposed to be random, pulled from a hat so to speak. The process of doing that is a little less obvious when that hat is a MySQL database with 500,000 people in it. You can't just stick your hand in and grab the first peice of paper you feel. Wait.... actually you can. So I needed to select a random group of people from this MySQL table. It's super easy to... continue »
siteWatcher is an easy way to check if your Websites and MySQL databases are up and running. It runs on a schedule you set and simply checks your websites for content you specify and notifies you by email if that content is not found. You can also use it to check connectivity to MySQL databases. To setup siteWatcher all you need to do is download the PHP file, put it on your server... continue »
Everyone wants to display friendly error pages for visitors to thier website. This is easy to do using a variety of methods, but are the common methods always the best decision? There are an abundance of pages that discuss how to make custom 404 error pages. While this practice is an excellent way to help direct misguided visitors to the correct area of your website, it can have some... continue »
If you've ever had to create a bunch of zone files for a bunch of domains you know it can be a pain. Should you ever find yourself in that dark hole again use this. It is a quick and simple DNS Zone File creator for BIND. It takes an array of domain names, creates zone files and adds the zones to your master BIND configuration. All you need to do is put the domains in the array and restart... continue »
The more traffic your Website gets, the more important efficient handling of that traffic becomes. First you want to be sure that your visitors get a fast response, but you also want to make sure that bogus traffic doesn't suck all your bandwidth. Here is a simple way to keep bogus traffic off your Website. Bogus Traffic? O yea... those pesky offline browsers (or site stealers, who... continue »
If you have a MySQL powered website it is critical that the MySQL Server is running. This little diddy will check to see that the MySQL Server is running and restart it if it's not.You will need to add an entry to your crontab that runs on a interval you are comfortable with. This example runs every minute although you can set it to run as often as you like. The command is very low on system... continue »
This is the 'hands-on' way of changing the root password for your MySQL server. Get to a command prompt on the MySQL server and enter the following commands: mysql -u root mysql > UPDATE user SET password=password('secret') WHERE user='root'; > flush privileges; This should reset the password for you and then you can log in and get some real work done. continue »
Even a seasoned developer can forget the standard response codes for the Apache Server. This list will refresh your memory. If you are looking to customize your 404 pages check this out Successful Client Requests: 200 OK 201 Created 202 Accepted 203 Non-Authorative Information 204 No Content 205 Reset Content 206 Partial Content Client Request Redirected: ... continue »
It's always a good idea to have all the traffic for your site go to www.yourdomain.com. Through the magic of Apache mod_rewrite, you can keep your URLs clean and tidy. Often times people will just type your domain name (i.e. "yourdomain.com") into their browser to get to your website. This can cause some interesting and undesired issues, especially if you plan to do any detailed log... continue »
All of the conversion functions that I found seemed really bloated. Here is a nice clean way to convert seconds to a more user friendly hour:minute:seconds format. This example takes the current Unix time and converts it to the desired format. Of course you can use this for just about any application that requires you to convert seconds to a more readable format. $seconds = time(); $time =... continue »
At some point you will find yourself locked out of your Webmin console and in need to change the password for your user. Here's how:First, SSH/Telnet to the box in question. You will need to know where Webmin is installed and the path to the script we will be using. > whereis webmin should print something like: webmin: /etc/webmin Then enter: > locate... continue »