Jamie Bennett Speaks

Thoughts from Jamie Bennett

Archive for the ‘Uncategorized’ Category

Automatically download torrents with rsstorrent and rtorrent

with 2 comments

Have you ever wanted to automatically download torrents when they become available, not just when you manage to remember them? Have you ever wanted to have your torrents sat waiting for you when you come home from work? Do you want someone to give you a step by step rundown on how to do this? If the answer is yes to these questions, this how-to is for you.

Prerequisites: or what you need first

For this how-to you need the following software.

See the individual packages web sites for instructions on how to install them.

Setting up rtorrent

rtorrent has an excellent feature that enables you to drop .torrent files into a specified directory and it will automatically start downloading. To enable this you first need to edit the .rtorrent.rc found in your home directory,

You need to change the line that reads something like

#schedule = watch_directory,5,5,load_start=

to

schedule = watch_directory,5,5,load_start=/home/jamie/downloads/torrents_files

Obviously change the load_start directory to the one that you want to use.

rtorrent should then be run in the background all the time. It will watch the directory and any .torrent files you drop in there will be automatically downloaded. I use the screen command to have rtorrent always running. Start it with:

screen rtorrent

Type [ctrl]-a [ctrl]-d to detach the screen and go back to the command prompt. rtorrent will still be running.

Next step, setup rsstorrent.

Setting up rsstorrent

rsstorrent is a simple python script to download and check rss files that contains torrent information. It will figure out if a new torrent has been added to the feed since the last time it checked and if so, it will download the .torrent file into a directory of your choosing. Obviously when used in conjunction with rtorrent, these two are pretty powerful.

You can put the rsstorrent.py file anywhere that you have access to. I put it in my home directory at:

/home/jamie/scripts/

Edit the script with your favorite editor and change only the top few variables:

# List of url feed to be parsed.
FEEDS = [
"http://feedmytorrents.com/rss/97-lost/",
]
DOWNLOAD_DIR = "/home/jamie/downloads/torrents/"
TIMESTAMP = "/home/jamie/downloads/rsstorrent.stamp"
VERBOSE = False

FEEDS is a list of rss feed urls that contain the torrent information. From the example above I have used the popular http://www.feedmytorrents.com site to get a random feed, this one is for the tv series Lost.

A little side note here. Please do not download any illegal torrent files or any files you do not have permission to own. OK, with that out of the way, add as many feed urls as you like, in the format shown above, to the FEEDS list. You will also want to change the DOWNLOAD_DIR and TIMESTAMP variables. Change DOWNLOAD_DIR to the same directory that you used when setting up rtorrent and the TIMESTAMP path can be anywhere that rsstorrent is allowed to save it timestamp information.

Once you have this setup, your ready to go. If you just want to test it out, change the VERBOSE variable to True and run rsstorrent:

python /home/jamie/scripts/rsstorrent.py

If all went according to plan you should see ... nothing downloaded. Why? Well on first run, rsstorrent has no timestamp information so it has to use the current time as a starting point. Rest assured, if you only get the "No new torrents to download" message, everything should be working right.

If you run rsstorrent again later, it will use the timestamp file to determine if any new .torrent files need to be downloaded.

Automating the process

To completely automate the process, rsstorrent can be called from cron. Edit the /etc/crontab file and add an entry for rsstorrent, something like this.

30 */6 * * * jamie cd /home/jamie/scripts && python ./rsstorrent.py

This line means that cron will call rsstorrent every 6 hours.

Conclusion

So there you have it. cron calls rsstorrent periodically to determine if any new .torrent files are available. If they are, the files are downloaded to a directory that rtorrent 'watches'. If rtorrent see's any new .torrent files in this directory, it downloads the torrent automatically.

Now all you need to do is sit back and see your legal torrents download without lifting a finger.

Written by Jamie Bennett

March 11th, 2009 at 4:16 pm

Posted in Uncategorized

Questionable Karma?

without comments

A little lightheartedness.

I just looked at my Maemo profile today and was greeted with this …


A ‘devilish’ Maemo user?

Written by Jamie Bennett

March 10th, 2009 at 11:00 am

Posted in Uncategorized

Homecamp

without comments

The date for the second homecamp has been announced, Saturday 25th April 2009, 10am until 6pm, at Bash Creations, 65-71 Scrutton Street, London, EC2A 4PJ.

So what is homecamp I hear you ask, well …

[googlemaps http://maps.google.co.uk/maps?f=q&source=s_q&hl=en&geocode=&q=65+-+71+Scrutton+Street,+London,+EC2A+4PJ&sll=51.509912,-0.129361&sspn=0.100214,0.30899&ie=UTF8&t=h&s=AARTsJqPd-ErkdBxBCv5KvS11XqkYfWsRA&ll=51.524833,-0.081217&spn=0.004673,0.00912&z=16&iwloc=cent&output=embed&w=425&h=350]

From the homecamp website:

“Home Camp is an unconference about using technology to monitor and automate the home for greener resource use and to save costs. This is about low energy devices and servers, reducing your electricity bills, monitoring your mouse traps, home automation, monitoring your water usage, using solar power. This is a hack day.”

For more information, the homecamp blog can be found here and a link to the first event is here.

The second homecamp promises to be great, don’t miss it!

Written by Jamie Bennett

March 4th, 2009 at 2:51 pm

Posted in Uncategorized

Recent Reading

without comments

I not a prolific reader by any stretch of the imagination, in fact the opposite is true, but one of my new years resolutions was to make a conscious effort to read more. Here is a short list of the books I’ve read in January and February. I’m starting to pick up the pace now and I’m really enjoying reading again.

  1. Agile Project Management with Scrum (Microsoft Professional) by Ken Schwaber
    Good book on SCRUM and Agile principles. The pace of the book seemed just right and there’s enough substance there to make you want to go back and skim read it again.
  2. Test Driven Development: By Example – by Kent Beck
    Not a bad book but not great. Tries to introduce the reader to the methods involved with Test Driven Development (TTD) by using very simple examples. Unfortunately if you have any experience with this methodology already (which is where I’m coming from), at least the first half of the book is useless and the second half doesn’t introduce much. Good for a introduction, nothing more.
  3. Eat That Frog!: Get More of the Important Things Done, Today! by Brian Tracy
    I like to read these organizational, somewhat motivational books to see if I can glean any useful information from them. Unfortunately this had very little.
  4. Painless Project Management with FogBugz by Mike Gunderloy
    We use Fogbugz at work, which, despite the steep fee you have to pay for it, is actually not a bad piece of software. This book is the definitive guide to everything you need to know about the tool and puts a project management spin on it. Good read if you use Fogbugz.
  5. Predictably Irrational: The Hidden Forces That Shape Our Decisions by Dan Ariely
    Not bad. Over-hyped and of dubious use but worth a read.
  6. Freakonomics: A Rogue Economist Explores the Hidden Side of Everything by Steven D. Levitt (Author), Stephen J. Dubner
    This surprisingly covers a lot of ground (the exact same examples in some cases) that Predictably Irrational does although this seems to do it better. A good read and some thought provoking material.
  7. Hot, Flat and Crowded: Why the World Needs a Green Revolution – and How We Can Renew Our Global Future by Thomas L. Friedman
    Best of the bunch of books I’ve read this year. If you can look past the constant use of buzz words by Thomas L. Friedman and dig deeper into the meaning behind what he is saying, the subject material is fascinating.

Written by Jamie Bennett

March 2nd, 2009 at 9:24 am

Posted in Uncategorized

BathCamp #2 – Arduino

without comments

BathCamp number 2 is happening in only two days. This time the topics are on the subjects of Arduino and the excellent Current Cost units (which can be seen in action on this very site here).

Ben Tomlinson, Creative Director of London agency Ico Design will be hosting the Arduino talk and Dale Lane will be talking about Current Cost.

This promises to be a great night, see you there.

Written by Jamie Bennett

March 2nd, 2009 at 8:07 am

Posted in Uncategorized

OMAP 3 Maemo Power Management

without comments

There is a good, but short, article about the state of power management on the next generation Maemo devices at lwn.net (subscription required or free but you have to wait until Thursday).

In the article, Nokia’s Peter De Schrijver talks about the 4 modes of power management that will be available in the next platform, “on”, “inactive”, “retention” and “off”. These modes will govern how the device draws power and careful optimizations will ultimately dictate how long the battery life of these new devices will last.

Its good to see that careful attention is being shown to this often neglected area. For example, the very functional Android based G1 mobile phone is hampered by its ridiculously short battery life. It doesn’t matter that the phone has some killer apps, or that its running Linux under the hood, if the battery runs down in less than a day. Lets hope that Nokia can tame the OMAP 3 architecture into lasting at least as long as its predecessors.

It looks like this code for the power management optimizations will be ready soon, quoting the lwn.net article, Peter De Schrijver said,

The “retention” state works. Basic “off” mode works on most development boards; drivers are being adapted for “off” mode now and will be ready at the end of February.

Written by Jamie Bennett

February 18th, 2009 at 1:36 pm

Posted in Uncategorized

Fremantle pre-alpha 2 SDK released

without comments

The second version of the Fremantle alpha SDK has just been released, see the announcement and go get it now.

Written by Jamie Bennett

January 29th, 2009 at 9:12 am

Posted in Uncategorized

Qt goes LGPL

without comments

So Nokia today have announced that they are to add the LGPL license to Qt. What does this mean for Qt and specifically Maemo? Well …

Open source code repositories

Qt will now be available in a publicly-accessible Git repository, meaning changes can easily be tracked and patches can be created more readily. For the first time developers can see exactly the direction Qt is taking and for any developer investing time and often money in their software and toolkit of choice, this is a big plus.

More commercial software

The switch to the LGPL means proprietary software can be created with the Qt toolkit. The commercial licensing that Qt previously had (you can distribute your software for free under the GPL but closed source projects require a license fee) meant that Qt hasn’t become as widespread as maybe it should of. I know of several projects that chose to use the less restrictive licensing of the GTK toolkit for this very reason. Lets hope the new license encourages more software, free or otherwise.

Often open source developers frown upon closed source projects but lets not forget the model that the iphone has. It has free and commercial software side by side. Often the commercial software is of a nominal fee, 99 cents or 59 pence here in the UK and I for one would gladly pay small amounts of money to see good software on my Maemo device.

Cross platform software

Qt is truly cross-platform, running on Windows, Mac, Linux and even Symbian. Developers that would usually target one platform can now use a toolkit that, with a tweak or two, can happily run on many. This can only open the flood gates for a slew new applications on the Maemo platform. Maybe this new software wasn’t originally targeted for Maemo, but when companies and individuals realize that they can offer their software to Maemo users with very little effort on their part, maybe we will see things that otherwise would never of worked on our tablets materialize.

A Standard

Qt can now become a standard. There really is no excuse not to consider Qt when developing cross platform software. From the companies that need to make money with their software products to the individuals who do it for fun and everyone in between, all can use the same powerful, cross-platform toolkit.

Today, Nokia could of just changed the playing field for developers.

Written by Jamie Bennett

January 14th, 2009 at 10:21 am

Posted in Uncategorized

BathCamp

without comments

According to the BathCamp blog, monthly meets are scheduled to start up from February (the 4th to be precise). A summary of what is planned can be found on the BathCamp ning.com site.

I’m particularly looking forward to the Arduino talk at the beginning of March by Ben Tomlinson, Creative Director of London agency Ico Design.

For those people that do not know what BathCamp is, check out the introduction from the BathCamp website.

Written by Jamie Bennett

January 14th, 2009 at 9:10 am

Posted in Uncategorized

Lauchpad Goes Open Source

without comments

Mark Shuttleworth’s pledge to release the popular hosting service software launchpad as open source has finally got a firm date, 21/07/09, just scraping in on the ‘one year from now’ statement..

Well done Canonical.

Written by Jamie Bennett

January 9th, 2009 at 7:16 pm

Posted in Uncategorized