June 17, 2006

Indexing Script

Check how many pages you have indexed in the major search engines; Yahoo, Google and MSN.

Index Checking script

Use at your own risk, you are responsible for the results.

I have been added to the functionality of this script. Besides being able to setup a cron job to email you the results daily, I have hacked together the ability to dump the daily results into a MySQL database. With a database of results, you can then use that data to graph your results.

Filed under Web, PHP by admin.
Permalink • Print •  • 1 comment

Good for researching who is linking to you.

Yahoo Site Explorer

Filed under Web by admin.
Permalink • Print •  • Comment

Here’s a simple shell script for copying a file to all the accounts on the same server.  Of course, this can be modified to do just about anything.

#!/bin/sh
accounts=”usernam1 usernam2 usernam3 usernam4″
for account in $accounts
do
cp htaccess.txt /home/$account/public_html/.htaccess
done

In this example accounts is an array of usernames which gets assigned to the variable $account while looping through the accounts array.  This script copies a file called htaccess.txt to .htaccess in each users account.  Fast.

Filed under Web by admin.
Permalink • Print •  • Comment

http://www.devshed.com/c/a/MySQL/

Backing-up-and-restoring-your-MySQL-Database/1/

Some good information there about MySQL database, moving them, compressing, etc. The most challenging thing about the information available online is understanding whether people are talking about username/passwords that are specifc to the database or the server. I will attempt to be clear on this subject.

Here’s the link that helped me the most: http://www.webhostingtalk.com/archive/thread/520657-1.html

Backing up the database on the local server. The local server being the one you are transferring the database from and the remote server being the one you want to transfer and restore the database to.

mysqldump -u user_mysqluser -p mysqlpassword –databases database_name > backup.sql

user_mysqluser and mysqlpassword are the username and password specific to the local server’s MySQL datbase … and not the server’s login details.

One error message I received was “stdin: is not a tty error message” - turns out to just be a warning and the backup to the local server worked fine.

Now I want to copy the backup.sql to the remote server. The examples from the first link above didn’t do it for me. This link was the most helpful for copying to the remote machine, http://www.webhostingtalk.com/archive/thread/520657-1.html .

You want to use the scp command - a secure version of the RCP command (”Remote Copy”). The sytax from your local server to your remote server should looks like this:

scp -C /root/backup.sql root@111.111.111.111:/root

This assumes the remote server’s I.P. address is 111.111.111.111 - replace with your remote server’s I.P.

Now login into the shell of the remote server (which means this is no longer the remote server - but we will still refer to it that way). Now remember I mentioned that understanding which username / password to use is tricky. Pay attention.

Here’s the command to restore - or create for that matter - the same database that was on the local server. Important, the username and password to use are not your MySQL username / password. You want to use the server login username / password.

mysql -u user -p database_name < backup.sql

With this command, you will be prompted for your server password.

I did all of this on two Linux servers.

Filed under Web by admin.
Permalink • Print •  • Comment