[root@localhost ~]# yum install -y expect # 安装 mkpasswd [root@localhost ~]# mkpasswd # 默认生成9位数的密码 [root@localhost ~]# mkpasswd -l 20 # -l 指定密码长度 [root... ...
分类:
其他好文 时间:
2017-06-08 10:47:48
阅读次数:
123
boot.sh #!/bin/bash SERVERS="node-3.itcast.cn node-4.itcast.cn"PASSWORD=123456BASE_SERVER=172.16.203.100 auto_ssh_copy_id() { expect -c "set timeout - ...
分类:
其他好文 时间:
2017-06-06 13:09:50
阅读次数:
195
https://vjudge.net/problem/UVA-11427 大佬题解: http://www.cnblogs.com/xiong-/archive/2013/08/14/3258476.html ...
分类:
其他好文 时间:
2017-06-05 19:25:48
阅读次数:
181
卷 DataDisk 的文件夹 PATH 列表卷序列号为 4A8E-D95CD:. 1.log Expect-1.32.tar.gz IO-Tty-1.12.tar.gz openssl-1.0.1p.tar.gz perl-5.10.1.tar.gz perl-ldap-0.44.tar.gz X ...
分类:
其他好文 时间:
2017-06-05 10:31:29
阅读次数:
159
#!/bin/bash
#全局变量:用户名,普通用户密码,root密码
loginname="xxxx"
userpwd="xxxx"
rootpwd="xxxx"
#读取iplist(逐行存储IP地址)
cat/root/iplist|whilereadline
do
ip=($line)
#scp脚本及ssh登录执行
/usr/bin/expect<<EOF
settimeout10
spawnscp/root/check_..
分类:
其他好文 时间:
2017-06-02 17:39:34
阅读次数:
173
#!/bin/bash#全局变量:用户名,普通用户密码,root密码loginname="icgsu"userpwd="netentsec"rootpwd="netentsec"#读取iplistcat/root/iplist|whilereadlinedoip=($line)#scp脚本及ssh登录执行/usr/bin/expect<<EOFsettimeout10spawnscp/root/check_and_fix.sh$loginnam..
分类:
其他好文 时间:
2017-06-02 01:16:00
阅读次数:
903
想写自动化脚本的时候,遇到需要交互的,如ssh,scp,就束手无策,直到我知道了expect。 expect 有一系列expect-send对组成,就像聊天一样。 expect A send B expect C send D 先来个例子 #!/usr/bin/expect set timeout ...
分类:
其他好文 时间:
2017-06-01 23:42:55
阅读次数:
215
By francis_haoMay 31,2017 本文翻译了部分Expect的man手册,只选取了个人常用的功能,因此并不完善。 Expect是一个可以和交互式程序对话的程序 概述 介绍 通过脚本,Expect可以知道应该从对话程序中期望得到什么,和应该回应什么。它支持多分支结构,并且用户可以在需... ...
分类:
其他好文 时间:
2017-05-31 23:15:20
阅读次数:
219
Aeroplane chess http://acm.hdu.edu.cn/showproblem.php?pid=4405 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total S ...
分类:
其他好文 时间:
2017-05-30 21:54:06
阅读次数:
267
Map是键值对。也是经常使用的数据结构。Map接口定义了map的基本行为。包含最核心的get和put操作,此接口的定义的方法见下图: JDK中有不同的的map实现,分别适用于不同的应用场景。如线程安全的hashTable和非线程安全的hashMap. 例如以下图是JDK中map接口的子类UML类图, ...
分类:
编程语言 时间:
2017-05-27 15:28:02
阅读次数:
331