Re: [gentoo-user] minimal web server

2012-05-08 Thread napalm
On Sat, May 05, 2012 at 03:00:25PM -0700, Keith Dart wrote:
 Re , James said:
  #copy running-config [http | https] url
 
 
 Routers can usually also write to a tftp or ftp server. Those are
 actually simpler to set up. 
 
 To use HTTP you would also have to set up a POST handler. 
 
 
 -- Keith
 
 
 -- 
 
 -- ~
Keith Dart ke...@dartworks.biz
public key: ID: 19017044
http://www.dartworks.biz/
=
 

Well a small web-server is going to handle the POST headers for you -
you're not going to have to write everything from scratch.


pgplg660y1NDh.pgp
Description: PGP signature


Re: [gentoo-user] minimal web server

2012-05-07 Thread Walter Dnes
On Sat, May 05, 2012 at 05:32:54AM +0100, Stroller wrote

 Consider this installation-free alternative:
 http://www.google.co.uk/searchq=one+line+python+web+server

  This.  Here's a Gentoo-specific script, which I saved as ~/bin/webd
that handles Python 2 and 3...

===
#!/bin/bash
cd ${1}
current_python=`eselect python show`
if [ ${current_python:0:7} == python2 ]; then
   python -m SimpleHTTPServer
elif [ ${current_python:0:7} == python3 ]; then
   python -m http.server 8000
fi
===

  If it's called as simply webd, it serves up my home directory.  If
it's called as webd /usr/portage/distfiles it allows access to my
distfiles directory.  Note that the user that launches webd has to have
at least read access to the directories to be served.

-- 
Walter Dnes waltd...@waltdnes.org



Re: [gentoo-user] minimal web server

2012-05-05 Thread Alan McKinnon
On Sat, 5 May 2012 02:39:27 + (UTC)
James wirel...@tampabay.rr.com wrote:

 Hello,
 
 Backing up routers, I  have an option I can
 issue from the a router:
 
 #copy running-config [http | https] url
 
 so if my laptop is running some minimal web
 server (suggestions are most welcome)
 
 and I have local IP connectivity (say
 both on a 10.10.10.x network,
 
 The I could just issue this command?
 
 copy running-config http://10.10.10.laptop web server IP
 
 It should work and  it's simple. What would be 
 some recommendations as to which minimal web server
 I could run on a laptop (simple and small) to
 just backup various router configs to?


How many routers are you backing up and what are your needs?

If you have lots of them and need some kind of record, then rancid is a
most excellent tools. It's also very Unixy so you get bonus points
there.

https://www.shrubbery.net

It's a completely different take on the problem you posed in your mail.

-- 
Alan McKinnnon
alan.mckin...@gmail.com




Re: [gentoo-user] minimal web server

2012-05-05 Thread Mick
On Saturday 05 May 2012 05:32:54 Stroller wrote:
 On 5 May 2012, at 03:39, James wrote:
  …
  #copy running-config [http | https] url
  
  …
  The I could just issue this command?
 
 The question mark terminating this statement seems dubious.
 
 This appears to be a feature of Cisco routers.
 
 http://stack.nil.com/C1256F0A00429755/html/webupload/
 
  copy running-config http://10.10.10.laptop web server IP
  
  It should work and  it's simple. What would be
  some recommendations as to which minimal web server
  I could run on a laptop (simple and small) to
  just backup various router configs to?
 
 www-servers/lighttpd is famously small and on my system all its
 dependencies are already installed. It has a USE=minimal flag you might
 also try, for fewer calories.
 
 As a matter of practice I would not leave any webserver running on my
 laptop, or even installed, for longer than necessary. I would prefer to
 have a home or office webserver to which I could transfer these files and
 from which the router can obtain them. Rationally, I have no idea why I
 imagine one site to be more secure than the other.
 
 Consider this installation-free alternative:
 http://www.google.co.uk/searchq=one+line+python+web+server

Other alternatives are boa, thttpd, nginx.

You can also run netcat as 'nc -l -p 80  backup_20120418.cfg' and then run 
the copy command from the router.

-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] minimal web server

2012-05-05 Thread Eliezer Croitoru

On 05/05/2012 05:39, James wrote:

Hello,

Backing up routers, I  have an option I can
issue from the a router:

#copy running-config [http | https]url

so if my laptop is running some minimal web
server (suggestions are most welcome)

and I have local IP connectivity (say
both on a 10.10.10.x network,

The I could just issue this command?

copy running-config http://10.10.10.laptop web server IP

It should work and  it's simple. What would be
some recommendations as to which minimal web server
I could run on a laptop (simple and small) to
just backup various router configs to?



James


how about small ftp server instead http\https server?

Eliezer
--
Eliezer Croitoru
https://www1.ngtech.co.il
IT consulting for Nonprofit organizations
eliezer at ngtech.co.il



Re: [gentoo-user] minimal web server

2012-05-05 Thread Keith Dart
Re , James said:
 #copy running-config [http | https] url


Routers can usually also write to a tftp or ftp server. Those are
actually simpler to set up. 

To use HTTP you would also have to set up a POST handler. 


-- Keith


-- 

-- ~
   Keith Dart ke...@dartworks.biz
   public key: ID: 19017044
   http://www.dartworks.biz/
   =



Re: [gentoo-user] minimal web server

2012-05-04 Thread Stroller

On 5 May 2012, at 03:39, James wrote:
 … 
 #copy running-config [http | https] url
 
 … 
 The I could just issue this command?

The question mark terminating this statement seems dubious.

This appears to be a feature of Cisco routers.

http://stack.nil.com/C1256F0A00429755/html/webupload/

 copy running-config http://10.10.10.laptop web server IP
 
 It should work and  it's simple. What would be 
 some recommendations as to which minimal web server
 I could run on a laptop (simple and small) to
 just backup various router configs to?

www-servers/lighttpd is famously small and on my system all its dependencies 
are already installed. It has a USE=minimal flag you might also try, for fewer 
calories. 

As a matter of practice I would not leave any webserver running on my laptop, 
or even installed, for longer than necessary. I would prefer to have a home or 
office webserver to which I could transfer these files and from which the 
router can obtain them. Rationally, I have no idea why I imagine one site to be 
more secure than the other.

Consider this installation-free alternative:
http://www.google.co.uk/searchq=one+line+python+web+server

Stroller.