Posts

Showing posts from June, 2015

Grab Packt With Groovy

Automatically claim Packt's free e-books with a Groovy program. Introduction Packt Publishing has launched a new programme called " free learning offer "; each day they put an e-book for free on their website to download: one only needs to login to Packt's website and click on the "claim your free book" link. Following Grab Packt with Racket, here is the Groovy version, to automatically add the e-book to your Packt account for later downloads. The Code The code is in public domain. You can get it directly from is.gd/isbviw or from my github gist . For this to work you need to replace YOUR-EMAIL-ADDRESS (line 26) and YOUR-PASSWORD (line 27) with reasonable values. If you wish to run this from shell/cron remember to add #! /usr/bin/env groovy to the top of the file. The script is completely self-contained as @Grab annotation on line 4 fetches the dependencies it requires. /** * @author Bahman Movaqar */ @Grab('org.jsoup:jsoup:1.8.2') i...

Grab Packt With Racket

Automatically claim Packt's free e-books with a Racket program. Introduction Packt Publishing has launched a new programme called " free learning offer "; each day they put an e-book for free on their website to download: one needs to login to Packt's website and click on the "claim your free book" link. A nice fellow, wrote some Javascript code (nodejs) to be able to automatically claim a book, for example by calling the code from a cron job. He named the code "grab_packt" and has made it available on github . To me it is not fair to have only a Javascript version! So I decided to give it a go with different languages. This time I'll present the version written with Racket . The Code The code is in public domain. You can get it directly from is.gd/iRF96N or from my github gist . For this to work you need to replace YOUR-EMAIL-ADDRESS (line 24) and YOUR-PASSWORD (line 25) with reasonable values. If you wish to run this from shell/cron ...

aria2: An Ultra Fast Download Manager On Linux

Image
Introducing one of the fastest download managers in the universe: aria2. Introduction aria2 is a brutally fast and very feature rich download manager available for Linux platform. It can handle almost any kind of download you can ever imagine (FTP, HTTP, BitTorrent, SFTP, ...). You can install it by simply running sudo apt-get install aria2 at the command line or by using Ubuntu Software Center (if you're on Ubuntu). How To Use First add the following line at the bottom of your .bashrc (or .bash_profile depending on your distro). alias aria2c='aria2c -c -x5 -s10 -m0' This practically replaces the original aria2c command with a pre-configured one that tries to resume the download in case of a disconnect or failure for each download establishes up to 5 simultaneous connection to the server downloads a file using 10 connections/segments retries indefinitely in case of failure to connect to the server Remember to close the terminal and open a new one, for this ch...