Wednesday, June 18, 2008

Rapidshare premium download with Wget

#!/bin/bash
# Original author: Mark Sullivan

#########################################################
# I had to modify the script, actually stripped it down,#  
# gotten rid of some unnecessary stuffs. Now it works   #
# perfect on Debian/Ubuntu. -- babil, 18th june'2008.   #
#########################################################
 

RED='\e[1;31m'
CYAN='\e[1;36m'
NC='\e[0m' # No Color
cookie=cookie.txt

if [ -z $3 ] ; then 
 echo
 echo "[*] $0   " 
 echo
 exit 1  
else
 user=$1
 pass=$2
 url=$3
fi


echo -e "${RED}REALURL:${CYAN} $url${NC}"
fileName=`basename $url`
echo -e "${RED}FILENAME: ${CYAN}$fileName${NC}"

## LOGIN and save cookie ##
wget --save-cookies=$cookie -q --post-data="login=$user&password=$pass" https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi -O /dev/null
wget --load-cookies=$cookie $url -O $fileName

## CLEAN UP ##
rm $cookie


Wednesday, June 11, 2008

Vim freezes with Ctrl+S

lol ... now this is a very strange and funny problem. Most of us are used to ctrl+s for saving files, but on vim it just freezes everything. Specially if you are on a ssh session, have just added 100 lines of code to your cool new application, ctrl+s can effectively ruin all the fun all of a sudden. Well the solution to this problem was not very complicated, try pressing ctrl+q ;)

Well, found the solution to this problem somewhere here :: http://vimdoc.sourceforge.net/cgi-bin/vimfaq2html3.pl#32.1. And this is what it says ::

Many terminal emulators and real terminal drivers use the CTRL-S key to
stop the data from arriving so that you can stop a fast scrolling display
to look at it (also allowed older terminals to slow down the computer so
that it did not get buffer overflows).  You can start the output again by
pressing the CTRL-Q key.

When you press the CTRL-S key, the terminal driver will stop sending the
output data. As a result of this, it will look like Vim is hung. If you
press the CTRL-Q key, then everything will be back to normal.

You can turn of the terminal driver flow control using the 'stty' command:

$ stty -ixon -xoff

or, you can change the keys used for the terminal flow control, using the
following commands:

$ stty stop 
$ stty start