Can I do it using python?? about xterm and telnet

2006-07-01 Thread valpa
I'm a net admin for about 20 unix servers, and I need to frequently
telnet on to them and configure them.
It is a tiring job to open a xterm and telnet, username, password to
each server.

Can I  do it automatically by python? After that, there have 20 xterm
consoles opened and telneted to their corresponding servers. Then I
could start to type command in these xterms.

Any suggestion appreciate. Much thanks.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Can I do it using python?? about xterm and telnet

2006-07-03 Thread valpa
Thanks,

But I need to to do complicated job in the xterm consoles for servers.
So I need
to open many xterm consoles and I just want to save my time from
telneting...usr/pwd...

Network Ninja wrote:
> valpa wrote:
> > I'm a net admin for about 20 unix servers, and I need to frequently
> > telnet on to them and configure them.
> > It is a tiring job to open a xterm and telnet, username, password to
> > each server.
> >
> > Can I  do it automatically by python? After that, there have 20 xterm
> > consoles opened and telneted to their corresponding servers. Then I
> > could start to type command in these xterms.
>
>
> I often have to add users/delete local user accounts on routers and
> switches. Each account is a local account, and I got tired of it. My
> very first python program was created to use the telnetlib, and either
> add, delete, or show a list of user accounts. It was very effective,
> because it would change the same accounts on each router and switch.
> Saved me a bunch of time, and got me hooked on python. If you are not
> concerned about security, the telnetlib in python will help you.
> Otherwise, use ssh, as it is more secure. You can even impliment
> public/private keys for password-less log on. If you want some help
> with the code for the telnetlib, let me know.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Can I do it using python?? about xterm and telnet

2006-07-03 Thread valpa
I don't care about security issue by now :), because every one in my
compony know the username/password. It's a shared password. I just want
to login into Unix boxes in an efficiently. so I needn't open a xterm
console and type telent . usr/pwd for a unix box, and open another
xterm, type telnet ...usr/pwd, and so on...


Nicko wrote:
> placid wrote:
> > Jim Segrave wrote:
> > > In article <[EMAIL PROTECTED]>,
> > > valpa <[EMAIL PROTECTED]> wrote:
> > > >I'm a net admin for about 20 unix servers, and I need to frequently
> > > >telnet on to them and configure them.
> > > >It is a tiring job to open a xterm and telnet, username, password to
> > > >each server.
> > >
> > > Don't use telnet. it's clumsy and has security issues.
> >
> > if youre behind a firewall then it shouldnt matter.
>
> No, no, no!  If you have 20 unix servers then this is likely not a tiny
> company.  Most security breaches (according to the FBI/CSI computer
> crime survey) are perpetrated by insiders.  If you log in using telnet,
> and have to enter passwords that allow configurations to be changed,
> then anyone on the local net can get those passwords.  Use SSH instead.
>  Even SSH with passwords is hugely more secure than telnet.
> 
> Nicko

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Can I do it using python?? about xterm and telnet

2006-07-03 Thread valpa
telnet server must have a password, right?

Lawrence D'Oliveiro wrote:
> In article <[EMAIL PROTECTED]>,
>  "valpa" <[EMAIL PROTECTED]> wrote:
>
> >I don't care about security issue by now :), because every one in my
> >compony know the username/password.
>
> Then why bother with a password at all?
> --
> A: Skid-marks in front of the hedgehog.
> Q: What's the difference between a dead hedgehog on the road, and a dead
> top-poster on the road?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Can I do it using python?? about xterm and telnet

2006-07-03 Thread valpa
Maybe I'm not state what I want clearly.

These Unix boxes are not doing important job like email, web server,
etc.
In our lab, these unix boxes are connected to be a network system to
run our protocols and our job is to test the protocols. they are
physically seperated from lab network and seperate from Internet. So I
do not consider the security issue.

There will be a lot of work to do after I login into these servers. I'm
tired to typing the command "telnet".. and I want to do "telnet"
automatically.

Lawrence D'Oliveiro wrote:
> In article <[EMAIL PROTECTED]>,
>  "valpa" <[EMAIL PROTECTED]> wrote:
>
> >I don't care about security issue by now :), because every one in my
> >compony know the username/password.
>
> Then why bother with a password at all?
> --
> A: Skid-marks in front of the hedgehog.
> Q: What's the difference between a dead hedgehog on the road, and a dead
> top-poster on the road?

-- 
http://mail.python.org/mailman/listinfo/python-list


how to convert from Decimal('1.23456789') to Decimal('1.234')

2009-03-22 Thread valpa
I only need the 3 digits after '.'

Is there any way other than converting from/to string?
--
http://mail.python.org/mailman/listinfo/python-list


How can I do bit operation on python float value

2009-03-22 Thread valpa
I have a python float 1.2345678. I know that it is stored as a double
in C type. And I know it actually is 1010101010101 -like format. Then
I want to do some bit operation on it. How?

Sure, I want a float output when I finish the operation.
--
http://mail.python.org/mailman/listinfo/python-list


Re: How can I do bit operation on python float value

2009-03-23 Thread valpa
On 3月23日, 上午3时18分, John Machin  wrote:
> On Mar 23, 5:44 pm, valpa  wrote:
>
> > I have a python float 1.2345678. I know that it is stored as a double
> > in C type. And I know it actually is 1010101010101 -like format. Then
> > I want to do some bit operation on it. How?
>
> > Sure, I want a float output when I finish the operation.
>
> import struct
> pack it into a str [Python 2.X] using d format
> unpack it using Q format, gets you a 64-bit unsigned int
> do "some bit operation" using & | ^ ~ << >> operators
> pack it into a str using Q format
> unpack it into a float using d format
>
> What is "some bit operation"? Perhaps there is already a high-level
> way of doing some of what you want e.g. in the math module: frexp,
> ldexp, isnan, isinf, ...
>
> HTH
> John

Thanks John!

Yes, I want to do a & operation.
The pack way is to convert float to/from string, Is it efficient?

valpa
--
http://mail.python.org/mailman/listinfo/python-list