- 博客(9)
- 资源 (3)
- 问答 (1)
- 收藏
- 关注
原创 ssh 免密码登陆
#!/usr/bin/env python #_*_ coding:utf-8 _*_ import paramiko ssh_private_path = 'home/hello/.ssh/id_rsa' key = paramiko.RSAKey.from_private_key_file(ssh_private_path) ssh = paramiko.SSHCl
2016-06-29 18:20:24 380
原创 ssh登陆
#!/usr/bin/env python #_*_ coding:utf-8 _*_ import paramiko ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect('192.168.145.129',22,'root','exit'
2016-06-29 18:02:29 289
原创 python生产者与消费者问题
#!/usr/bin/env python #_*_ coding:utf-8 _*_ from threading import Thread import time from Queue import Queue class producer(Thread): #producer __init__ def __init__(self,name,queue):
2016-06-29 16:24:47 478
原创 网站打不开
网站打不开 如果作为一个网管人员的话,经常听到同事跟你说,上不去网了,同样的,作为运维的话,经常会有开发的同事,直接一个连接过来说链接打不开了。这是一种经常见到的情况,下面小小的总结下自己的一个思路和经验。 1、维护的网站很多,如果把每个网站多在的服务器都能记得比较清楚的话,是非常难的一件事情,如果能记住的话,当然很好,直接进入服务器就OK,但是如果不是特别清楚的话,我们首先使用ping命令定
2016-06-29 11:00:53 1375
原创 Python查找字符串高亮显示
#!/usr/bin/env python #_*_ coding:utf-8 _*_ user_file = 'userlist.txt' info = raw_input('Input the info to search: ') f = file(user_file,'rb') count = 0 for line in f.xreadlines(): line =
2016-06-07 13:37:07 5931
原创 Python 查找list中的某个元素的所有的下标
#!/usr/bin/env python #_*_ coding:utf-8 _*_ name = ['hello', 'world', 'a', 'b', 'c', 1, 2, 3, 'hello', 'world', 'a', 'b', 'c', 1, 2, 3] first_pos = 0 for i in range(name.count(2)): new_list
2016-06-05 22:19:19 22443
原创 Python 用户登录练习
#!/usr/bin/env python #_*_ coding:utf-8 _*_ import os import sys count=3 retry_count=0 account_file='/home/hello/login.txt' lock_file='/home/hello/lock.txt' while retry_count username=r
2016-06-05 22:18:27 832
原创 Python-2 循环输出
#!/usr/bin/env python #_*_ coding:utf-8 _*_ count = 0 print_num=input('input the number you want to got: ') while count if count == print_num: print 'the number is got',count
2016-06-05 22:17:30 821
原创 python格式化输出
#!/usr/bin/env python #_*_ codeing:utf-8 _*_ name=raw_input('name:') job=raw_input('job:') salary=raw_input('salary:') real_age=23 for i in range(10): age=input('age:') if age > real_
2016-06-05 22:16:38 244
salt-stack简明教程
2017-02-17
haproxy+keepalived不能访问问题
2015-11-26
TA创建的收藏夹 TA关注的收藏夹
TA关注的人