参考:http://github.tiankonguse.com/blog/2015/01/19/cgi-nginx-three/跟着做了一遍,然后根据记忆写的,不清楚有没错漏步骤,希望多多评论多多交流。。。搭建环境安装:nginx、spawn-fcgi、fastcgi、fcgiwrapnginxs...
分类:
其他好文 时间:
2015-09-23 21:05:50
阅读次数:
233
import pexpect,syschild = pexpect.spawn('/home/cf/elk/Summoner/Elk/logstash/test/bin/logstash -f /home/cf/elk/Summoner/Elk/logstash/test/conf.d', time...
分类:
编程语言 时间:
2015-09-16 17:55:06
阅读次数:
237
1、介绍pexpect通过pexpect我们可以实现对ssh,ftp,passwd,telnet等命令进行自动交互,不需要人工干预达到自动目的。2、pexpect的组件介绍2.1、spawn类作用:启动和控制子应用程序,其构造函数如下:classpexpect.spawn(command,args=[],timeout=30,maxread=2000,searchwindowsi..
分类:
其他好文 时间:
2015-09-13 20:06:03
阅读次数:
315
#!/usr/bin/envputhon
importpexpect
importsys
#定义目标主机
r_ip="IP_ADDRSS"
r_user="USERNAME"
r_passwd="PASSWORD"
#定义目标主机nginx日志文件
target_file="/path/to/nginx_access.log"
#运行ssh命令
child=pexpect.spawn(‘/usr/bin/ssh‘,[r_user+‘@‘+r_ip])
#输入..
分类:
其他好文 时间:
2015-09-13 20:04:41
阅读次数:
282
原文来自官网文档:https://docs.python.org/2.7/17.1.subprocess— Subprocess managementNew in version 2.4.Thesubprocessmodule allows you to spawn new processes, c...
分类:
编程语言 时间:
2015-09-12 10:44:14
阅读次数:
405
#!/usr/bin/envpython#-*-coding:utf-8-*-importpexpectimportsysssh=pexpect.spawn(‘sshroot@192.168.20.103‘)fout=file(‘sshlog.txt‘,‘w‘)ssh.logfile=foutssh.expect("root@192.168.20.103‘spassword:")ssh.sendline("yzg1314520")ssh.expect(‘#‘)ssh.sendline(‘ls/home‘)ss..
分类:
编程语言 时间:
2015-09-10 17:32:16
阅读次数:
160
晚上在Linux下搭建环境,代码都下好了,gulp也在全局装好了,按照在Windows下的习惯,直接在目录下敲gulp,结果抛出异常了。开始还以为是权限问题,用了sudo发现没用,就去看了看gulpfile.js,内容如下:‘usestrict‘;
vargulp=require(‘gulp‘);
varg=require(‘gulp-load-plugi..
分类:
Web程序 时间:
2015-09-06 07:28:04
阅读次数:
305
-module(pmap).
-export([pmap/2]).
pmap(F,?L)?->?
??S?=?self(),
??Pids?=?lists:map(fun(I)?->?
????spawn(fun()?->?do_fun(S,?F,?I)?end)
??end,?L),
??gather(Pids).
gathe...
分类:
其他好文 时间:
2015-09-06 01:14:29
阅读次数:
157
expect实现ssh自动登录#!/usr/local/bin/expectset PASSWD [lindex $argv 1]set IP [lindex $argv 0]set CMD [lindex $argv 2]spawn ssh $IP $CMDexpect "(yes/no)...
分类:
其他好文 时间:
2015-09-04 14:05:01
阅读次数:
151
题意:告诉任意两个鱼之间的关系,然后,两条有关系的鱼的权值异或就是 spawn的值,求所有新的值和的最大值。
思路:预处理好任意两条鱼的spawn的值,KM匹配一下即可。
#include
#include
#include
#include
#include
#include
#include<strin...
分类:
其他好文 时间:
2015-08-31 13:34:47
阅读次数:
136