Skip to content

Instantly share code, notes, and snippets.

View UniIsland's full-sized avatar

Huang, Tao UniIsland

View GitHub Profile
@bobisme
bobisme / gist:1078482
Created July 12, 2011 17:29
Build/install custom linux kernel headers in ubuntu.

Linux Headers

  • Install tools to build:
sudo apt-get update
sudo apt-get install kernel-package fakeroot wget bzip2
  • Linux-2.6.39.1-linode34 is same as regular 2.6.39
def humanize secs
[[60, :seconds], [60, :minutes], [24, :hours], [1000, :days]].map{ |count, name|
if secs > 0
secs, n = secs.divmod(count)
"#{n.to_i} #{name}"
end
}.compact.reverse.join(' ')
end
@huyng
huyng / reflect.py
Created February 7, 2011 17:57
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):