import sys, BaseHTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler HandlerClass=SimpleHTTPRequestHandler ServerClass=BaseHTTPServer.HTTPServer protocol = "HTTP/1.0" host = "192.168.0.185" port = 8888 server_address = (host, port) HandlerClass.protocol_version = protocol httpd = ServerClass(server_address, HandlerClass) sa = httpd.socket.getsockname() print "Serving HTTP on", sa[0], "port", sa[1], "…" httpd.serve_forever()import sys, BaseHTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler HandlerClass=SimpleHTTPRequestHandler ServerClass=BaseHTTPServer.HTTPServer protocol = "HTTP/1.0" […]
Python
If you want to switch off your monitor from your command line in linux, there is an easy way: sleep 1 && xset -display :0.0 dpms force offsleep 1 && xset -display :0.0 dpms force off What if you want to run this command remotely? Here is my take on this question: – use Python […]
I needed a case for the RaspberryPi. The good thing about the RPi being a business card-sized computer is that it fits nicely in a plastic box from old business cards. If you look on Ebay, you can buy 20 of them for £5 including delivery. The boxes make fantastic custom RPi cases! I didn’t […]
This is how the final product looks like on my desk. I now need to write a python script which will translate various button combinations into actions. Stay tuned…
An IKEA mirror gradually becomes a control panel…
This is a short video of a project I completed last month: a music box for my goddaughter. This music box was put together using a Lego storage box, a raspberrypi B+ and a speaker, along with a few MP3s of original music box sounds and lullabies. Python and a few bash scripts took care […]