04 4 / 2011

While I’m loving my new notebook (Hp Envy 14), it doesn’t play completely nice with Linux yet. Like there is an led on the envy’s touchpad, on which you can double tap to toggle touchpad on/off. That functionality isn’t supported out of the box and requires patches to both the kernel and the synaptics touchpad driver.

Synaptics driver patch (for 1.4.0)

Kernel patch (for the LED support - 2.6.38)

If you’r using arch linux, there’s an older version of the driver in the AUR. Here’s the v1.4.0 version I compiled after applying the patch (for x86_64) - xf86-input-synaptics-1.4.0-1-x86_64.pkg.tar.xz

After install, you may want to increase the MaxDoubleTapTime to around 300 in the synaptics config file as the default value is set too low. Next up, to get the suspend working properly (it’s the radeon driver thats causing it to fail).

17 1 / 2011

Peter Norvig’s article. So true and a must read.

Permalink 1 note

15 1 / 2011

CloudApp is one great way to share your files elegantly. And the features they provide even with their free accounts are great

  • Create unlimited bookmarks
  • Upload 10 files a day (max file size 25MB)
  • Update: keep your files forever

The only problem is it’s Mac OS centric, but the CloudApp team provides developers a nice api so that other platforms don’t get left out.

Here is one such attempt of bringing CloudApp to Linux - py-cloudapp. As the name suggests, it’s a multi-threaded python application which allows you to drag-drop-upload files into CloudApp and auto clipboard copy links into the clipboard.

Drop targetTray icon

Here are a few main features

  • Add/Delete/View files on CloudApp.
  • Auto Clipboard copy support.
  • Notification Support - libnotify support (linux)

Just make sure you install the following dependencies from your distro’s repositories.

  • Py-Qt
  • Python (>2.5)

Try it out guys, let me know of any bugs and suggestions on the github page. For the next version, I have things like better notifications and screenshots lined up.

Github page Download

Tags:

5 notes

20 12 / 2010

Yet another post to overcome yet another urllib2 quirk. Using the default urllib2 module shipped with python, one can only make HTTP GET and POST requests. The code that decides which method to use is something like this (in urllib2.Request)

def get_method(self):
    if self.has_data():
        return 'POST'
    else:
        return 'GET'

Thankfully you can make DELETE (and also HEAD and PUT requests as I’m told) by sub classing from urllib2.Request and overriding get_method method.

class RequestWithMethod(urllib2.Request):
    """Workaround for using DELETE with urllib2"""
    def __init__(self, url, method, data=None, headers={},\
        origin_req_host=None, unverifiable=False):
        self._method = method
        urllib2.Request.__init__(self, url, data, headers,\
                 origin_req_host, unverifiable)

    def get_method(self):
        if self._method:
            return self._method
        else:
            return urllib2.Request.get_method(self) 

The usage of our shiny new inherited class to make a DELETE request goes as follows

req = RequestWithMethod(url, 'DELETE')
urllib2.urlopen(req)

Hope this post saves you hours of googling and experimenting.

Update: Thanks to commenter Gherron for pointing out a bug and improving the code.