0

using wget

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

Share/Save/Bookmark

 
0

bypass port blocking of ISP using hamachi

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

  • Uncompress tar file with
    tar zxvf hamachi-0.9.9.9-20-lnx.tar.gz -C /usr/src/
  • Change directory
    cd /usr/src/hamachi-0.9.9.9-20-lnx/
  • Install hamachi
    make install
  • Run tuncfg command
    tuncfg
  • Generate crypto identity
    hamachi-init
  • Start hamachi daemon
    hamachi start
  • Put hamachi daemon online
    hamachi login
  • Create hamachi network
    /usr/bin/hamachi create myHamNetwork password
  • Now become online in created network
    /usr/bin/hamachi go-online myHamNetwork

    Follow these steps on the machine from which you want to connect to the blocked machine:

  • Download hamachi for linux.https://secure.logmein.com/products/hamachi/list.aspI have hamachi-0.9.9.9-20-lnx.tar.gz
  • Uncompress tar file with
    tar zxvf hamachi-0.9.9.9-20-lnx.tar.gz -C /usr/src/
  • Change directory
    cd /usr/src/hamachi-0.9.9.9-20-lnx/
  • Install hamachi
    make install
  • Run tuncfg command
    tuncfg
  • Generate crypto identity
    hamachi-init
  • Start hamachi daemon
    hamachi start
  • Put hamachi daemon online
    hamachi login
  • Join the hamachi network
    hamachi join myHamNetwork
  • You will be prompted for the password of myHamNetwork, in earlier steps we defined password as ‘password’ on machine behind blocked ports.
  • Check the list of hamachi network with
    hamachi list
    * [myHamNetwork]
    * 5.66.11.169                                 118.94.50.194:32774
    Here we can see 5.66.11.169 is th
  • Now become online in created network
    /usr/bin/hamachi go-online myHamNetwork
  • a
  • hamachi-init

Share/Save/Bookmark

 
0

Configure sifyconnect on linux- Auto Connectivity

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.

  1. Create a directory where we will be keeping sifyconnect related files or scripts.
    mkdir /usr/src/sify
  2. Change directory
    cd /usr/src/sify
  3. Download sifyclient from http://thegoan.com/supersify/
    wget http://thegoan.com/supersify/supersify.zip
  4. unzip downloaded sify client.
    unzip supersify.zip
  5. 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

  6. 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

  7. chmod the script
    chmod 700 /usr/bin/sifyconnect
  8. 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

  9. chmod 755 /usr/bin/sifychk
  10. 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.

Share/Save/Bookmark

Copyright © 2010 Anuj Singh All rights reserved. Theme by Laptop Geek.


Warning: stristr() [function.stristr]: Empty delimiter in /home/a/anujhere/public_html/wp-content/plugins/wassup/wassup.php on line 2093