上一页 1 2 3 4 5 6 ··· 13 下一页
摘要: ``` !/bin/bash . /etc/rc.d/init.d/functions for i in do user=user$i password= useradd $user & /dev/null grep $user /etc/passwd & /dev/null if [ $? ne 阅读全文
posted @ 2016-07-26 17:25 夏日花开 阅读(117) 评论(0) 推荐(0)
摘要: ``` #!/bin/bash # Create by wxh 2015-07-05 # Version: v0.1 . /etc/rc.d/init.d/functionsnginx=/usr/local/nginx/sbin/nginx prog=nginx pidfile=/usr/local/nginx/logs/nginx.pid RETVAL=0 start() { echo -n $... 阅读全文
posted @ 2016-07-26 17:24 夏日花开 阅读(197) 评论(0) 推荐(0)
摘要: ``` #!/bin/bash echo -e " \033[31m A \033[0m 显示系统IP \033[32m B \033[0m 显示系统运行时间 \033[33m C \033[0m 查看系统负载 \033[34m D \033[0m 查看磁盘空间 \033[35m E \033[0m 退出 " while true do read -t 10 -p "please inp... 阅读全文
posted @ 2016-07-26 17:24 夏日花开 阅读(98) 评论(0) 推荐(0)
摘要: ``` !/bin/bash . /etc/rc.d/init.d/functions MPORT= MPROC= MSOCK=/var/lib/mysqld/mysql.sock MPROG=mysqld if [ $MPORT ne 0 a S $MSOCK ];then action "mys 阅读全文
posted @ 2016-07-26 17:23 夏日花开 阅读(156) 评论(0) 推荐(0)
摘要: ``` #!/bin/bash #*************************** #* copyleft huihui 2015-08-11 #***************************** #* email: huihui@qq.com #* version:v0.1 #***************************** while true do echo -... 阅读全文
posted @ 2016-07-26 17:22 夏日花开 阅读(151) 评论(0) 推荐(0)
摘要: ``` #!/usr/bin/expect set timeout 20 spawn ssh -l root 172.25.254.102 expect "(yes/no)?" send "yes\r" expect "password" send "Asimov\r" expect "#" send "hostname;exit\r" expect eof ``` 阅读全文
posted @ 2016-07-26 17:21 夏日花开 阅读(180) 评论(0) 推荐(0)
摘要: Sys 模块 一,导入sys模块操作 二,sys模块重要函数变量 1)sys.argv命令行的参数,包括脚本的名称 2)sys.path查找模块所在目录的目录名列表 3)sys.platform返回当前系统平台的,如win32,linux。 比如向实现清除终端,linux下用clear,window 阅读全文
posted @ 2016-07-26 17:19 夏日花开 阅读(149) 评论(0) 推荐(0)
摘要: Select,poll,epoll复用 1)select模块以列表的形式接受四个参数,分别是可读对象,可写对象,产生异常的对象,和超时设置。当监控符对象发生变化时,select会返回发生变化的对象列表。 eadable有3种可能:对于用来侦听连接主服务器socket,表示已准备好接受一个到来的连接; 阅读全文
posted @ 2016-07-26 17:14 夏日花开 阅读(182) 评论(0) 推荐(0)
摘要: Urllib模块 POST方法 阅读全文
posted @ 2016-07-26 17:12 夏日花开 阅读(136) 评论(0) 推荐(0)
摘要: 多线程模块 Python的多线程模块有两种实现方法 函数,线程类 一【函数】 调用thread模块中的start_new_thread()函数来创建线程,以线程函数的形式告诉线程该做什么 二【线程类】 调用threading模块,创建threading.Thread的子类来得到自定义线程类 thre 阅读全文
posted @ 2016-07-26 17:07 夏日花开 阅读(192) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 13 下一页