Wednesday, December 16, 2009

rapidshare download in linux

using wget:
---------------------------------------------------------------------------
wget \
--save-cookies ~/.cookies/rapidshare \
--post-data "login=USERNAME&password=PASSWORD" \
--no-check-certificate \
-O - \
https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi \
> /dev/null
---------------------------------------------------------------------------
--save-cookies defines the location the cookie will be stored
--post-data provides the login form with your account's data
--no-check-certificate don't validate the server's certificate
-O downloads the html page to get the cookie and then it deletes it by redirecting it to /dev/null

Of course you must replace USERNAME and PASSWORD with your account details.

create a bash script file (save as rapiddownloader.sh):
--------------------------------------------------------------
#!/bin/bash
for url in `cat $1`
do
wget -c --load-cookies ~/.cookies/rapidshare $url
done

--------------------------------------------------------------
then:
chmod +x rapiddownloader.sh

command:
./downloader.sh urls

here urls is a text file containing urls of file in rapidshare

using aria2:
aria2c --http-user=USERNAME --http-passwd=PASSWORD -i urls -j 2 -s 4

list open ports and unix sockets

To do this I use netstat command to list all open ports: $ sudo netstat -tuplen to list open ports and unix sockets: $ sudo netstat -...