Posted by anuj on Dec 30, 2009 in
Linux
wget is a very good utility to download large files or iso images.
When downloading large file or DVD iso, you can use wget -c ‘url to iso file’ which you can resume download from where you left last time.
Sometimes there are scuh links which keep a lot of garbege, and using wget -c ‘url to iso file’ causes a new thread a new download instead of resuming.
In such a case you can use wget -c ‘url to iso’ -O my-dvd.iso
Using -O file name downloads file with file name and always can be resumed.
Anuj
Posted by anuj on Oct 12, 2008 in
Linux
Here we will be connecting two linux machines, of which ISP is blocking ports.
On the machine behind the blocked ports:
Download hamachi for linux.
https://secure.logmein.com/products/hamachi/list.asp
I have hamachi-0.9.9.9-20-lnx.tar.gz
Posted by anuj on Oct 12, 2008 in
Linux
Following steps will give you sify client on linux, working with an automatic connectivity, you need to be root.
- Create a directory where we will be keeping sifyconnect related files or scripts.
mkdir /usr/src/sify
- Change directory
cd /usr/src/sify
- Download sifyclient from http://thegoan.com/supersify/
wget http://thegoan.com/supersify/supersify.zip
- unzip downloaded sify client.
unzip supersify.zip
- I modified the provided ss.sh script just as for my needs, there may be some other method. Just added ‘cd /usr/src/sify’ line as first line to ss.sh.
cd /usr/src/sify
java -jar supersify.jar $*
if [ $? -eq 1 ]
then read
fi
- Created a second script to login without providing password every time#!/bin/bash
#
#Change USERNAME, PASSWORD and ETH according to your system and user/pass
#Change ETH with the ethernet card connecting to sify ISP
#mail me: anuj.unix@gmail.com
#Ends.
USERNAME=my_sify_username
PASSWORD=my_sify_password
ETH=eth1
#Get the mac address here
MAC_SIFY=`ifconfig $ETH |grep HWaddr|cut -d ” ” -f 11`
if [ "$#" -ne 1 ];then
echo “To connect: `basename $0` -c ”
echo “To disconnect: `basename $0` -d ”
exit
fi
#Change directory where we unzipped the supersify.zip
cd /usr/src/sify
#To connect sify
if [ "$1" = "-c" ];then
/bin/sh ss.sh -u “$USERNAME” -p “$PASSWORD” -m $MAC_SIFY
#To disconnect sify
else if [ "$1" = "-d" ];then
echo “Logging out from sify”
/bin/sh ss.sh -l
else
echo “To connect: `basename $0` -c ”
echo “To disconnect: `basename $0` -d ”
exit
fi
fi
- chmod the script
chmod 700 /usr/bin/sifyconnect
- To check the internet connectivity create one more script, f.e. /usr/bin/sifychk#!/bin/bash
#
#to check the internet connection
ping -c 4 google.com
if [ "$?" -ne 0 ];then
/usr/bin/sifyconnect -c
else
exit
fi
- chmod 755 /usr/bin/sifychk
- Add an entry in cron to automatically try to connect in case you are disconnected. Following crontab entry will check the internet connectivity every minute and connect automatically in case of disconnection. Obviously network cable and ISP should be reachable.crontab -e
* * * * * /usr/bin/sifychk >/dev/null 2>&1
That’s it.
Anuj Singh.