...making Linux just a little more fun!
Amit Saha [amitsaha.in at gmail.com]
Hello all,
Perhaps this is too simple to be a 2c-tip, but still a tip.
The following script (either run by hand) or in a script starts up a HTTP server and makes available all the files and directories from which it is started, so as to make them available over the network:
python -m SimpleHTTPServer &
By default, it starts off the server on '8000' but that can be changed using:
python -m SimpleHTTPServer 9090, which starts the server on 9090, and can be accessed via the browser or any HTTP client using:
firefox http://127.0.0.1:8000/
More on the Python module at http://docs.python.org/library/simplehttpserver.html
Thanks, Amit
-- http://amitksaha.blogspot.com http://amitsaha.in.googlepages.com/ *Bangalore Open Java Users Group*:http:www.bojug.in "Recursion is the basic iteration mechanism in Scheme" --- http://c2.com/cgi/wiki?TailRecursion
Thomas Adam [thomas.adam22 at gmail.com]
2009/4/2 Amit Saha <amitsaha.in@gmail.com>:
> Hello all, > > Perhaps this is too simple to be a 2c-tip, but still a tip. > > The following script (either run by hand) or in a script starts up a > HTTP server and makes available all the files and directories from > which it is started, so as to make them available over the network:
So this is exactly the same as WEBrick in Ruby then.
-- Thomas Adam
Amit Saha [amitsaha.in at gmail.com]
On Thu, Apr 2, 2009 at 7:24 PM, Thomas Adam <thomas.adam22@gmail.com> wrote:
> 2009/4/2 Amit Saha <amitsaha.in@gmail.com>: >> Hello all, >> >> Perhaps this is too simple to be a 2c-tip, but still a tip. >> >> The following script (either run by hand) or in a script starts up a >> HTTP server and makes available all the files and directories from >> which it is started, so as to make them available over the network: > > So this is exactly the same as WEBrick in Ruby then.
Looks like it.
-Amit
-- http://amitksaha.blogspot.com http://amitsaha.in.googlepages.com/ *Bangalore Open Java Users Group*:http:www.bojug.in "Recursion is the basic iteration mechanism in Scheme" --- http://c2.com/cgi/wiki?TailRecursion
Mulyadi Santosa [mulyadi.santosa at gmail.com]
On Thu, Apr 2, 2009 at 4:27 PM, Amit Saha <amitsaha.in@gmail.com> wrote:
> Hello all, > > Perhaps this is too simple to be a 2c-tip, but still a tip. > > The following script (either run by hand) or in a script starts up a > HTTP server and makes available all the files and directories from > which it is started, so as to make them available over the network: > > python -m SimpleHTTPServer & > > By default, it starts off the server on '8000' but that can be changed using: > > python -m SimpleHTTPServer 9090, which starts the server on 9090, and > can be accessed via the browser or any HTTP client using: > > firefox http://127.0.0.1:8000/ > > More on the Python module at > http://docs.python.org/library/simplehttpserver.html
Neat! Anyway, no offense, I've seen a similar tip at http://www.commandlinefu.com. Are you inspired from that site or did you post there too?
regards,
Mulyadi.
Amit Saha [amitsaha.in at gmail.com]
On Wed, Apr 8, 2009 at 10:50 AM, Mulyadi Santosa <mulyadi.santosa@gmail.com> wrote:
> On Thu, Apr 2, 2009 at 4:27 PM, Amit Saha <amitsaha.in@gmail.com> wrote: >> Hello all, >> >> Perhaps this is too simple to be a 2c-tip, but still a tip. >> >> The following script (either run by hand) or in a script starts up a >> HTTP server and makes available all the files and directories from >> which it is started, so as to make them available over the network: >> >> python -m SimpleHTTPServer & >> >> By default, it starts off the server on '8000' but that can be changed using: >> >> python -m SimpleHTTPServer 9090, which starts the server on 9090, and >> can be accessed via the browser or any HTTP client using: >> >> firefox http://127.0.0.1:8000/ >> >> More on the Python module at >> http://docs.python.org/library/simplehttpserver.html > > Neat! Anyway, no offense, I've seen a similar tip at > http://www.commandlinefu.com. Are you inspired from that site or did > you post there too?
I am wholly inspired by that tip
-Amit
-- http://amitksaha.blogspot.com http://amitsaha.in.googlepages.com/ *Bangalore Open Java Users Group*:http:www.bojug.in "Recursion is the basic iteration mechanism in Scheme" --- http://c2.com/cgi/wiki?TailRecursion
Ben Okopnik [ben at linuxgazette.net]
On Wed, Apr 08, 2009 at 11:00:02AM +0530, Amit Saha wrote:
> On Wed, Apr 8, 2009 at 10:50 AM, Mulyadi Santosa > <mulyadi.santosa@gmail.com> wrote: > > > > Neat! Anyway, no offense, I've seen a similar tip at > > http://www.commandlinefu.com. Are you inspired from that site or did > > you post there too? > > I am wholly inspired by that tip
Amit, you really should give credit when you do something like that. We've had a few rough spots here in that regard, and it would be a good idea to take a little extra care to avoid problems in the future.
-- * Ben Okopnik * Editor-in-Chief, Linux Gazette * http://LinuxGazette.NET *
Amit Saha [amitsaha.in at gmail.com]
On Wed, Apr 8, 2009 at 6:16 PM, Ben Okopnik <ben@linuxgazette.net> wrote:
> On Wed, Apr 08, 2009 at 11:00:02AM +0530, Amit Saha wrote: >> On Wed, Apr 8, 2009 at 10:50 AM, Mulyadi Santosa >> <mulyadi.santosa@gmail.com> wrote: >> > >> > Neat! Anyway, no offense, I've seen a similar tip at >> > http://www.commandlinefu.com. Are you inspired from that site or did >> > you post there too? >> >> I am wholly inspired by that tip > > Amit, you really should give credit when you do something like that. > We've had a few rough spots here in that regard, and it would be a good > idea to take a little extra care to avoid problems in the future.
Alright, Thanks for pointing that.
-Amit
-- http://amitksaha.blogspot.com http://amitsaha.in.googlepages.com/ *Bangalore Open Java Users Group*:http:www.bojug.in "Recursion is the basic iteration mechanism in Scheme" --- http://c2.com/cgi/wiki?TailRecursion