Facebook Link Sharing Details 
Friday, January 14, 2011, 06:00 AM
Posted by Administrator
I have added meta data to my web pages to enable descriptions and a logo to be displayed in Facebook when one of my URL's is shared.
view entry ( 2692 views )   |  permalink
New Short URL 
Monday, December 13, 2010, 04:08 AM
Posted by Administrator
I have registered a new short URL.
This blog is now viewable via the short url:

http://ro6.co/b

view entry ( 3040 views )   |  permalink
Script to reconnect my TPG service after the modem drops out  
Saturday, December 11, 2010, 01:00 AM
Posted by Administrator
My ADSL modem would drop out and hang the RED interface of my Smoothwall Gateway. The smoothwall networking requires a restart to reconnect my TPG service.

I wrote the following script that is adapted from the scripts found at these URLs:
https://www.glassnetworks.net/forum/index.php?topic=15.0
http://www.cyberciti.biz/tips/simple-li ... ripts.html

I added a command to restart the web proxy as it would also stop running.

#!/bin/bash
HOSTS="123.123.123.123"

COUNT=5

for myHost in $HOSTS
do
count=$(ping -c $COUNT $myHost | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')
echo $count
if [ "$count" == "" -o "$count" == "0" ]
then

# 100% failed
echo "Host : $myHost is down (ping failed) at $(date)"

# Now try to restart interface
echo "Restarting the RED Network Interface"
ATTEMPTS=1

while [ "$count" == "" -o "$count" == "0" ]
do
# Drop out after 4 attempts
if [ $ATTEMPTS -gt 4 ]
then
echo "TPG modem check failed to restart the networking"
exit;
fi

# Restart networking
/etc/rc.d/rc.netaddress.down NOTGREEN
sleep 3
/etc/rc.d/rc.netaddress.up NOTGREEN

# Increment attempts
ATTEMPTS=$[$ATTEMPTS+1]

# Check that the network came up
count=$(ping -c $COUNT $myHost | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')

done

# Restart the WebProxy too
/usr/bin/smoothcom squidrestart

fi

done

# Close
echo "TPG modem check is now terminating"

I included this script to run every few minutes from crontab.

# Check that the RED interface modem is up
*/3 * * * * root /usr/local/bin/TPGModemCheck >/dev/null

view entry ( 3032 views )   |  permalink

<<First <Back | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |