Showing posts with label download. Show all posts
Showing posts with label download. Show all posts

Monday, 15 June 2009


How to read 20 magazines for free.


You will need Firefox and an addon called User agent Switcher and configure it with an iPhone setting :

Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A102 Safari/419 (United States)

You can then visit http://zinio.com/iphone/ and read 20 magazines each month for free.

It gets better though, it is very simple to download these pages onto your computer using Linux, aren't you glad you dumped windows ;)

We now need the URL to the image so "copy image location" from the right click menu then using this command:

curl -O -A "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3" INSERTURL

Replace INSERTURL with the copied link you got to page 1, then delete back to the underscore and append [1-300].jpg this is a range option to grab pages 1 to 300 and can be adjusted, so the final command will look like this:

curl -O -A "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3" http://imgs.zinio.com/iphone/issues/416078746/[1-300].jpg

The files will need to be renamed, as sadly they won't sort correctly if you are going to do the next step of combining them into a single pdf. We need the jpgs numbering from 001.jpg so they order correctly. this can be achieved in a variety of ways, using Thunar rename to insert the necessary 0's in two stages is one simple way, insert 00 at position 10 for number 1-9, and insert 0 into postion 10 for pages 10-99. it can also be scripted in a couple of steps with :

for i in `seq 1 9`; do mv *_$i.jpg 00$i.jpg ;done

for i in `seq 10 99`; do mv *_$i.jpg 0$i.jpg ;done

This could of course be scripted into one single command using a bash script.

Then we can simply issue the command:

convert *.jpg magazine.pdf

Thats it, you now have a local copy of the magazine in a handy PDF format relatively simply, it lokos more complex than it really is once you get your head around it.

Tuesday, 26 August 2008

rTorrent, light and fast bittorrent client.

I use two torrent clients almost every day, Transmission on my own box with a gnome desktop, and for a long time now rTorrent in a shell via SSH to a spare machine I have use of on a separate connection. Setting up rTorrent on an Ubuntu machine is what I am going to discuss here.

First step is to install the program, open a terminal and enter:

sudo apt-get install rtorrent

Or use Synaptic and search for 'rtorrent', install it. A basic config file is located /usr/share/doc/rtorrent/examples for you to tweak to your own liking, at its simplest you may want to change the download folder in it and the 'watch' folder. The watch folder is a place that rTorrent will monitor for *.torrent files coming into so it can automatically start, and when the download has completed and achieved a ratio you are happy with, you can just delete the torrent file from this folder to remove it from rTorrent. Dead simple stuff :]

cp /usr/share/doc/rtorrent/examples/rtorrent.rc ~/.rtorrent.rc

then edit this file with your prefered text editor, mine is usually nano, use gedit if you prefer a GUI editor:.

cd ~/
nano .rtorrent.rc

Now we can make the most basic of changes, first up is the download folder, look for the line:

# Default directory to save the downloaded torrents.

change the line after it to the folder you want to be your download folder and remove the # so you have something like this:

# Default directory to save the downloaded torrents.
directory = ~/torrents

This makes my download folder /torrents/ in my home, the default without editting is simply your home folder which you may be happy with.

Next lets tell it what folder to watch for torrent files. I have defined mine to be this same ~/torrents/ folder, you may prefer to leave it as your home folder. Either way find these lines just slightly down from the previous:

# Watch a directory for new torrents, and stop those that have been
# deleted.
schedule = watch_directory,5,5,load_start=~/torrents/*.torrent
schedule = untied_directory,5,5,stop_untied=

Yours will look very slightly different as I have shown how I changed mine to watch the ~/torrents/ folder. You should now save the file and close the editor, ctrl+o to save in nano if you used my prefered editor from above and don't know it, press enter to save wit hthe same name, then ctrl+x to close it.

You should now be free to start rTorrent with the command:

rtorrent

Not very impressive at first look is it, but download a torrent file to the watch folder and see rtorrent leap into action all by itself. You can adjust the upload and download speeds using the keys

a/s/dIncrease the upload throttle by 1/5/50 KB.
z/x/cDecrease the upload throttle by 1/5/50 KB.
A/S/DIncrease the download throttle by 1/5/50 KB.
Z/X/CDecrease the download throttle by 1/5/50 KB.


There are other keys to pause and resume torrents and many other facilities that you may require, for that I would point you at the User Guide page at http://libtorrent.rakshasa.no/wiki/RTorrentUserGuide


As I use this remotely I also run it inside a screen so I can safely detach from it and break the connection leaving it running on the remote machine, to do this enter in a terminal:

screen

then you will just see another command prompt on a clear terminal at which point enter:

rtorrent

rTorrent will start as normal but if you use the keys ctrl+a then d it will detach, that is it will drop you back at your original shell, leaving rtorrent running in the backgroun still. You can attach to it again with:

screen -r

You can then see rTorrent again to check your downloads or ratios. Check 'man screen' for more help on using screen, there are a *lot* of things you can do with it, and that might be a worthwhile post for me some time soon.