Sunday, 23. March 2008 Week 12
Wednesday, 5. March 2008 Week 10
Thursday, 21. February 2008 Week 8
Friday, 15. February 2008 Week 7
Thursday, 14. February 2008 Week 7

Python Webserver in 1 or 15 lines

Python Webserver in 1 line:

python -c "import SimpleHTTPServer; SimpleHTTPServer.test()"

Python Webserver in 15 lines:

import BaseHTTPServer



class WebRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):

    def do_GET(self):

        if self.path == '/foo':

            self.send_response(200)

            self.do_something()

        else: 

            self.send_error(404)

            

    def do_something(self):

        print 'hello world'

        

server = BaseHTTPServer.HTTPServer(('',80), WebRequestHandler)

server.serve_forever()

via

Monday, 11. February 2008 Week 7
Monday, 4. February 2008 Week 6
Thursday, 24. January 2008 Week 4
Saturday, 19. January 2008 Week 3

How to brick your Mac

  1. Install Mac OS X 10.4
  2. Install rEFIt
  3. Install Linux
  4. After some time decide to upgrade to Mac OS X 10.5 and at the same time make the partition bigger (e.g. by merging with a FAT32 partition which was originally intended to contain some Windows)
  5. Use the GNU Parted utility to delete the Mac OS X and FAT 32 partitions and create a new bigger partition for Mac OS X 10.5.
  6. Restart your Mac.
  7. Cheer that now you can no longer boot from the harddisk or a CD/DVD nor from anything else!

And now, how to un-brick it again:

  1. Call Apple support
  2. Find out that you are lucky and have some warranty left (6 days in my case!!!).
  3. Bring your Mac to an Authorized Service Provider.
  4. Get it back with a new harddisk :-)