The Road to Elysium

March 26, 2010

Rapidshare Linux Script

Filed under: Linux — jorge @ 07:44

Update: Seems this procedure isn’t working anymore, as Rapidshare has switched some things around. Have a look at Rapidshare Linux Script Revisited for updated information.

A friend tipped me about Rapidshare, and has been working great ever since I bought a premium account. Thing is though, most addons/download clients are specifically for Windows, and I use Fedora Linux. I searched quite a while before I found an option that makes downloading through a Rapidshare Premium Account damn simple; namely making a script. And it’s really easy!

What we first need to do is to grab and save your Rapidshare cookie. This is luckily something you only need to do once. Execute the following command to do so:

wget --save-cookies /home/jorge/.cookies/rapidshare --post-data "login=USERNAME&password=PASSWORD" -O - https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi > /dev/null

..replacing USERNAME and PASSWORD with your Rapidshare account details, and /home/jorge with whatever suits you.

Once that is done, we proceed with the script itself. Now, most pages will recommend using wget for this, but I personally prefer aria2. This is because aria2 supports multiple files download and it also splits each file in multiple parts for faster downloading. Moreover you can resume the download any time you want just by typing the same command again.

Either way I will paste two scripts, one with wget and the other one with aria2, and you can then make your pick.

wget

#!/bin/bash
LIST="/home/jorge/Downloads/.url"
cd ~/Downloads
for url in `cat $LIST`
do
    wget -c --load-cookies /home/jorge/.cookies/rapidshare $url
done

Save this file as wrsd.sh and make it executable by doing a:

$ chmod +x wrsd.sh

aria2

#!/bin/bash
cd ~/Downloads
aria2c -j 5 -c --load-cookies=/home/jorge/.cookies/rapidshare -i /home/jorge/Downloads/.url

Save this as arsd.sh and make it executable just like above. Now the file containing the various URLs to download is in my case located in the file ~/Downloads/.url. One URL in each line should do the trick. Open the file, paste a few URLs, save and close it, and run either wrsd.sh or arsd.sh, depending on if you want to use wget or aria2.

Enjoy!

March 17, 2010

Embedding subtitles srt into avi files with mencoder

Filed under: Snippets — jorge @ 09:59

Easier than you might think:

$ mencoder -sub movie_subtitle.srt -ovc xvid -xvidencopts bitrate=-700000 -oac copy -o new.movie.name.avi movie.avi

Firefox 3.6 and Java on Linux

Filed under: Linux — jorge @ 08:19

Finding that you’re lacking Java in Firefox 3.6 on Linux? The steps to install it are easy, but you have to do things a bit differently than you have in previous Firefox-versions.

First head over to the Download-section at http://www.java.com. Select to download the file named Linux RPM (self-extracting file) (if you’re using an RPM-based distribution like Fedora). Once it’s downloaded, and assuming it has been downloaded to the folder Downloads, do the following:

$ su -
# chmod +x /home/jorge/Downloads/jre-6u18-linux-i586-rpm.bin
# /home/jorge/Downloads/jre-6u18-linux-i586-rpm.bin

After agreeing to the license terms, just type Yes and press enter. Now making the plugin work with Firefox. I mentioned earlier that you have to do things a bit differently. Whereas we used the file libjavaplugin.so before, now we have to use the next generation Java plugin, namely libnpjp2.so. So execute the following command to make things work:

# ln -s /usr/java/latest/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins/

Restart your browser, and you should have Java. Verify it at http://java.com/en/download/installed.jsp?detect=jre&try=1.

Enjoy!

March 6, 2010

Firefox 3.6 on Fedora 12

Filed under: Linux — jorge @ 16:19

Easy peasy:

# yum --enablerepo=rawhide install firefox

And that should upgrade Firefox fo the newest available in the repositories.

Powered by WordPress