Bullit | Home | Ignore Double Slashes in URLs in Restlet Applications

Filed under Quick Tips on October 27, 2008 by Chris Dary

Instant Web Sharing via Python

This is a neat trick I saw from 'mrlawlsome' on reddit and didn't want to pass up.

Ever been on an internal network and wanted to share a file or two quickly? This little *nix script will let you do so in a snap. (And it works on Mac OS X, too!)

From the command line, just type:

python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"
While running, this python script will run a simple web server with your current working directory as the root. Just browse to http://[youripaddress]:8000 to see it in action!

This script is probably most useful as an alias. Just add the following into your .bashrc file:
alias webshare='python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"'
You can now just use 'webshare' whenever you want to allow access to some files on your machine. Pretty slick!

Post a Comment Digg Del.icio.us

Trackback Pings (TrackBack URL for this entry)

http://www.arc90.com/cgi-bin/mt4/mt-tb.cgi/198.

Post a Comment:

Bullit | Main | Ignore Double Slashes in URLs in Restlet Applications