Archive for June, 2008

RapidShare BASH Download Script

Saturday, June 28th, 2008

Since my BashDL project is kinda on hold till I finish kickstart bash, I’m posting the script I’m currently using to download from rapidshare. I fixed a small bug since rapidshare changed some of the site’s inner workings. The script can currently be found until improved here:
RapidShare Basic Download Script

It’s possible there are still bugs present, in which case you just respond here with what the problem is. If you are going to attach output, check /tmp/ for files looking like LINKS???????.rs, PAGE???????.rs and WGET??????.rs.

IMPORTANT!
Make sure you remove your rapidshare password and user from ALL files you send me. I don’t need to know.
You can do this by using ‘sed’ (replace 000000 by your user name / password).
See the manual for information on how to use sed. A example can be found here:

sed -i s/000000/=LOGIN=/ [filename]
sed -i s/000000/=PASSWORD=/ [filename]

If you run into any trouble loading a file with links in it, make sure it has unix line endings. You can use the tool dos2unix to convert a file before using it.

Rapidshare Perl Upload API

Thursday, June 26th, 2008

Not many people know about it, but the file hosting service rapidshare.com provides a perl script to upload files to their servers. They distribute it here: http://images.rapidshare.com/software/rsapi.pl.

If you have ever used it, or are trying it out right now, you’ll notice it is but-ugly. The script isn’t meant to be actually used (AFAIK) but is more of a prove of concept where other programmers can base themselves up to write their own applications to upload to rapidshare. I adjusted the script a little to use myself. Nothing changed in the internals, but I added a progress meter and upload speed.

A small example of the output now is:

[  1%]    896000 of  71061919 bytes sent at [Current/Global:  73.80 /  63.05 (KB/s)]
[  1%]   1024000 of  71061919 bytes sent at [Current/Global:  58.13 /  62.30 (KB/s)]
[  1%]   1152000 of  71061919 bytes sent at [Current/Global:  63.66 /  62.46 (KB/s)]
[  1%]   1280000 of  71061919 bytes sent at [Current/Global:  58.37 /  61.98 (KB/s)]

Upload Speed statistics may be a bit of. it’s more of an indication anyway…

The source of my ‘hardly’-improved version can be found here:
Rapidshare Perl API (Improved) (Zip File).

Google Code Hosting

Thursday, June 19th, 2008

A couple of days ago, I finally made up my mind about choosing sourceforge.net or google code. It became google code. It seems to me the site is a lot more responsive than the sourceforge one, and that is really all that matters for now. I don’t need complicated tools (although the webhosting sf.net provides would come in handy…).

After making a initial mistake of adding a wiki page right from the start, I could no longer reset the attached svn repository (this is only possible when you are still at r1), so I had to make a little detour by the Google-code-group. You can find the finished product here: http://code.google.com/p/kickstart-bash/. Happy issue filing!

WordPress with not-so-decent subdomain hosting.

Wednesday, June 11th, 2008

Like I posted some time ago, I had some problems resolving the rewrite engine when trying to access my kickstart page (http://vstone.eu/kickstart) and separating it from http://kickstart.vstone.org. I proposed a solution but that only worked half the time. It was a work around at the time, but it gave me some problems in the end. Since the check for the referer was in there, I couldn’t access my wordpress/wp-admin page anymore when using the link on the main page. This gave me a nice 404.

So, I decided to be smart about it, reset the .htaccess file in my root folder to the default one for wordpress and adjust a separate .htaccess file in the kickstart subfolder. It looks like this:

<IfModule mod_rewrite.c>
RewriteEngine On

# BEGIN WordPress
RewriteBase /kickstart/
RewriteCond %{HTTP_HOST} !^kickstart.vstone.org$ [NC]
RewriteRule . /index.php [L]
# END WordPress
</IfModule>

By setting the RewriteBase to /kickstart/, I’m already sure this rewrite condition will never match ‘http://kickstart.vstone.org/’. This could only give me problems when I have sth like http://kickstart.vstone.org/kickstart/. So, I also make sure that the HTTP_HOST never is kickstart.vstone.org.

After that, I can be pretty sure I can rewrite it to the index file used for wordpress.

Can’t stay away from OO

Wednesday, June 11th, 2008

Since the beginning of this week, I’ve been altering my code base for the Kickstart BASH script a lot. After a while, I decided it looked horrible, lacked documentation and was unmaintainable (and certainly not expandable). I also have the bad habit of forgetting what a certain function does, so proper documentation is a must.

So I started with getting back too my good old classes and objects. Starting off with the Output to HTML / Text or a File, I’m converting everything to fit nicely in classes and mainly use objects. And started documenting them all. You never know my code might prove useful to somebody else. You can expect to have a link show up to the phpdocs pretty soon.

Next up is converting my kinda ugly template system to Classes. Probably Options will prove useful here too. And I’ll be able to re-use them from my Output.