安装源 wget?http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm?-Uvh?epel-release*rpm
yum?install?fcgi-devel?spawn-fcgi?-y 编译安装fcgiwrap git?clone?git://githu...
分类:
其他好文 时间:
2015-08-12 17:06:46
阅读次数:
249
什么是CGI CGI全称是“公共网关接口”(Common Gateway Interface),HTTP服务器与你的或其它机器上的程序进行“交谈”的一种工具,其程序须运行在网络服务器上。 CGI可以用任何一种语言编写,只要这种语言具有标准输入、输出和环境变量。如php,perl,tcl等 什么...
分类:
Web程序 时间:
2015-08-10 17:43:42
阅读次数:
148
对于获取多台服务器状态且不用交互需要用到expect,但有时候expect无法获取返回值,这里解释一下expect如何获取返回值
expect -c "
spawn $1;
expect {
\"(yes/no)?\" {send \"yes\n\";expect \"assword:\";send \"$2\n\"}
...
分类:
其他好文 时间:
2015-08-08 15:02:16
阅读次数:
799
#!/usr/bin/expectset timeout 30set ip [lindex $argv 0]spawn ssh root@$ip expect {"yes/no" { send "yes\r"; exp_continue }"password:" { send "123456\r" ...
分类:
其他好文 时间:
2015-08-06 20:02:33
阅读次数:
119
总nodejs是一种单线程模型,但是,使用nodejs的child_process模块可以实现多进程任务。利用child_process可以创建子进程,实现子进程和主进程之间的通信。nodejs v0.12.7版本child_process提供以下同步和异步的方式创建进程:异步创建:
child_process.spawn(command[, args][, options])
op...
分类:
Web程序 时间:
2015-07-31 18:20:27
阅读次数:
134
python(pexpect)简单的自动ssh脚本#vissh.py#!/usr/bin/python按a或i进入编辑模式importpexpectchild=pexpect.spawn(‘sshming@10.0.0.2‘)child.expect(‘password:‘)child.sendline(‘123456‘)child.interact()child.close()按Esc键退出编辑模式:wq(保存并退出)#pythonssh.py要..
分类:
编程语言 时间:
2015-07-22 16:36:56
阅读次数:
406
批量上传SSH公钥一世浮沉首先需要安装pythonyuminstallpython-y编写一个python脚本如下:#vissh.py#!/usr/bin/pythonimportsysimportpexpectip=sys.argv[1]password=sys.argv[2]expect_list=[‘(yes/no)‘,‘password:‘]p=pexpect.spawn(‘ssh-copy-id%s‘%ip)##如果公钥不是在默认..
分类:
Web程序 时间:
2015-07-21 19:00:12
阅读次数:
588
写了一个脚本来传输文件,类似于这样:sendsystem(){
expect -c "
spawn scp $ORACLE_BASE/oradata/$ORACLE_SID/system01.dbf oracle@$S_IP:$ORACLE_BASE/oradata/standby/
expect {
yes/no { sen...
分类:
其他好文 时间:
2015-07-16 19:56:55
阅读次数:
344
继上一篇《debian+nginx配置初探--php环境、反向代理和负载均衡》成功之后,有点小兴奋,终于不用整lvs那么复杂来搞定负载,但还是有很多概念没弄清楚。什么是CGI、FastCGI、PHP-CGI、PHP-FPM、Spawn-FCGI?CGI全称是“通用网关接口”(Common Gatew...
分类:
其他好文 时间:
2015-07-05 10:49:09
阅读次数:
84
expect用法
[#!/usr/bin/expect]
这一行告诉操作系统脚本里的代码使用那一个shell来执行。这里的expect其实和linux下的bash、windows下的cmd是一类东西。 注意:这一行需要在脚本的第一行。
[set timeout 30]
基本上认识英文的都知道这是设置超时时间的,现在你只要记住他的计时单位是:秒 。timeout -1 为永不超时
[spaw...
分类:
系统相关 时间:
2015-07-01 12:27:53
阅读次数:
287