Skip to main content

Posts

Showing posts from November, 2008

Hacks: Replace yum's downloader with Axel

/!\ This is an ugly hack, use it at your own risk,
I am not responsible for any breakage

P/S, your sysadmin might not gonna like this

Disclaimer aside, I really love Python.

So, I'm behind such a bad network which keep timing out, and downloading stuff using yum in this network is a real PITA. And so, I had enough of it and decided to hack around.

Axel is a CLI download accelerator thats lightweight and pretty fast. I've been using it quite frequently to get a bit more speed for my downloads. I think, why not just replace this urllib2 grabber with axel, so, I did. (I am such an evil guy)

After a few hours looking through yum code to find what to modify, I ended up with this



# file: /usr/lib/python2.5/site-packages/urlgrabber/customgrabber.py

import grabber
import os

class AxelGrabber(grabber.URLGrabber):
def urlgrab(self, url, filename=None, **kwargs):
"""grab the file at and make a local copy at
If filename is none, the basename of the url is used.

FOSS.my 2008 Ended!

Everything has its end :). and FOSS.my 2008, ended a great SUCCESS!!.



It's been a fun roller coaster ride being a FOSS.my 2008 crew. All the rushing, stress, tears and blood to get things prepared before the event, and all the running all over APIIT during the event to keep everything ok, the lack of sleep and rest, losing the chance to hear most of the talks, etc, paid off when seeing everything went smoothly without any major noticable problems.

To be frank, I was quite scared during preparation day (Friday) considering soo many things not yet done such as tags, posters, signages, failure handling plans, etc. But all well ends well, we somehow managed to get most of them done in 24hours and prepared for the big day.

Can you believe that this came out of nowhere in 1 hour??!!.




I think I've been wearing quite a number of hats throughout the whole FOSS.my. From being the publication guy for the posters and tags, to being a bit of tech support for some machines, to getting the sli…