Archive for November, 2007

Script to check if Googlebot IP is blocked on apf

November 24, 2007

#!/bin/bash

hostname=`/bin/hostname`
MAIL_BODY=/tmp/googleblock.txt

#Give the email address(es) to which the script will have to send the alerts
MAIL_TO=some_addr@some_domain.com

send_mail()
{
cat $MAIL_BODY|mail -s ” Googlebot IP blocked on $hostname” $MAIL_TO
rm -f $MAIL_BODY
}

for i in `cat /etc/apf/deny_hosts.rules | grep -v “#” `
do
host $i | grep googlebot
if [ $? -eq 0 ]
then
echo $i >> $MAIL_BODY
fi
done

if [ -f $MAIL_BODY ]
then
echo “Check the reverse DNS as well before unblocking this IP” >> $MAIL_BODY
send_mail
fi

Advertisements

Mounting proc filesystem: Bad file descriptor

November 5, 2007

Ballu called me as he got this error:

Mounting proc filesystem Bad file descriptor
No such partition found …

Something modifed /dev/null to a regular file. To fix, login into repair mode, remount root filesystem as read-write, and restore /dev/null:

# mount -n -o remount,rw /
# rm -f /dev/null
# mknod -m 0666 /dev/null c 1 3

It worked.

Protected: Mongrel-:m:O:.n.

November 5, 2007

This content is password protected. To view it please enter your password below:

Protected: C-trace

November 5, 2007

This content is password protected. To view it please enter your password below: