lian xi

xi ti 1

yao qiu: jian ce jiao shi nei suo you kai qi de dian nao,dui yu kai qi de dian nao,xin jian  yong hu ,ruo yong hu cun zai bu gai bian qi  yuan mi ma

jiao ben:

(1)ssh

[[email protected] useradd]# cat ssh
#!/usr/bin/expect
set timeout 3
set ip [ lindex $argv 0 ]
set passwd [ lindex $argv 1 ]
set comm1 [ lindex $argv 2 ]
set comm2 [ lindex $argv 3 ]
set comm3 [ lindex $argv 4 ]
spawn ssh [email protected]$ip $comm1 $comm2 $comm3
expect {
"yes/no"
{send "yes\r";exp_continue}
"password"
{send "${passwd}\r"}
}
expect eof

(2)ssh1

[[email protected] useradd]# cat ssh1
#!/usr/bin/expect
set timeout 3
set ip [ lindex $argv 0 ]
set passwd [ lindex $argv 1 ]
set comm1 [ lindex $argv 2 ]
set comm2 [ lindex $argv 3 ]
set comm3 [ lindex $argv 4 ]
spawn ssh [email protected]$ip $comm1 $comm2  
expect {
"yes/no"
{send "yes\r";exp_continue}
"root"
{send "${passwd}\r";exp_continue}
"New password:"
{send "${comm3}\r";exp_continue}
"Retype new password:"
{send "${comm3}\r"}
}
expect eof

(3)useradd

[[email protected] useradd]# cat useradd
#!/bin/bash
for ((i=226;i<=227;i++))
do
[ -z "$1" -o -z "$2" ] &&
echo "输入电脑密码和要创建的用户" ||
(ping -c1 -w1 172.25.254.$i &>/dev/null &&(
check=`./ssh 172.25.254.$i $1 getent passwd $2 | grep -E "spawn|password" -v`
[ -z ${check} ] &&
(./ssh 172.25.254.$i $1 useradd $2 &>/dev/null;
./ssh1 172.25.254.$i $1 passwd $2 $3 &>/dev/null;
echo success;) ||
echo "$2 exist or passerror") ||
echo down)
done

xi ti 2

dao ji shi

#!/bin/bash
read -p "min:" min
read -p "sec:" sec
read -p "hour:" hour
for ((sec=${sec};sec>=0;sec--))
do
echo -n "倒计时 $hour : $min : $sec "
echo -ne "\r \r"
sleep 1
while [ $sec -le 0 -a $min -gt 0 ]  ;do
     echo -n "倒计时 $hour : $min : $sec "
     echo -ne "\r \r"    
     ((min--))
    sec=60
    break
done
while [ $hour -gt 0 -a $min -le 0  ] ;do
echo -n "倒计时 $hour : $min : $sec "
echo -ne "\r \r"
((hour--))
min=59
done
done

时间: 2024-10-19 00:33:47

lian xi的相关文章

LATEX LIAN XI

$ a^2 $ $ 100 ~m ^{3}$ \(\lim_{n \to \infty} \sum_{k=1}^n \frac{1}{k^2} = \frac{\pi^2}{6}\) \(C {}^{12}_{6}\) $sum_ \(\phi\) \(\mu\) \(f[i][j] = max( f[i+1][j^2],f[i][j])\) \(\frac {x^2} {z}\ \neq w\) \(\frac {x^2} {z}\ = w\) \(y'\) \(\sum_{k}^n\) 原文

HDU 5014 Number Sequence(2014 ACM/ICPC Asia Regional Xi&#39;an Online) 题解

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5014 Number Sequence Problem Description There is a special number sequence which has n+1 integers. For each number in sequence, we have two rules: ● ai ∈ [0,n] ● ai ≠ aj( i ≠ j ) For sequence a and sequ

快速安装破解Adobe Acrobat XI Pro软件

一.在"www.baidu.com"网站上搜索"acrobat pro xi",下载由百度软件中心提供的"Adobe Acrobat XI Pro 11".如下图: 二.安装下载好的"Adobe Acrobat XI Pro 11"软件,安装试用版. 三.下载"amtlib.dll"文件,可去百度搜索"Acrobat amtlib.dll",也可直接去我的网盘下载,分享密码:777c.

hdu 5008(2014 ACM/ICPC Asia Regional Xi&#39;an Online ) Boring String Problem(后缀数组&amp;二分)

Boring String Problem Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 219    Accepted Submission(s): 45 Problem Description In this problem, you are given a string s and q queries. For each que

2014 ACM/ICPC Asia Regional Xi&#39;an Online

03 hdu5009 状态转移方程很好想,dp[i] = min(dp[j]+o[j~i]^2,dp[i]) ,o[j~i]表示从j到i颜色的种数. 普通的O(n*n)是会超时的,可以想到o[]最大为sqrt(n),问题是怎么快速找到从i开始往前2种颜色.三种.四种...o[]种的位置. 离散化之后,可以边走边记录某个数最后一个出现的位置,初始为-1,而所要求的位置就等于 if(last[a[i]]==-1) 该数没有出现过,num[i][1] = i,num[i][j+1] = num[i-1

2014 ACM/ICPC Asia Regional Xi&#39;an Online(HDU 5007 ~ HDU 5017)

题目链接 A题:(字符串查找,水题) 题意 :输入字符串,如果字符串中包含“ Apple”, “iPhone”, “iPod”, “iPad” 就输出 “MAI MAI MAI!”,如果出现 “Sony” 就输出“SONY DAFA IS GOOD!” ,大小写敏感. 思路 : 字符串查找,水题. 1 #include <string.h> 2 #include <stdio.h> 3 #include <iostream> 4 5 using namespace st

BugPhobia开发终结篇章:Beta阶段第XI次Scrum Meeting

0x01 :Scrum Meeting基本摘要 Beta阶段第十一次Scrum Meeting 敏捷开发起始时间 2015/01/06 00:00 A.M. 敏捷开发终止时间 2016/01/10 07:00 A.M. 会议基本内容摘要 ü  沟通方面,此阶段的沟通工作基本完成,无论是与数据组的Solr平台映射或是与学霸APP组的共用后端方面均完成沟通,近期由于考期等相关事务逐渐结束,因此迟滞许久的Scrum Meeting终于最终开启,团队工作进入最终阶段的收尾共组 ü  后端方面,重新梳理搜

HDU 5009 Paint Pearls _(:зゝ∠)_2014 ACM/ICPC Asia Regional Xi&#39;an Online

呵呵 #include <cstdio> #include <algorithm> #include <iostream> #include <cstring> typedef long long ll; using namespace std; const int N = 5 * 10000 + 5; int xval[N], dep; int n, a[N], pre[N]; ll d[N]; int pos[300], dd; void work()

HDU 5014 Number Sequence 贪心 2014 ACM/ICPC Asia Regional Xi&#39;an Online

尽可能凑2^x-1 #include <cstdio> #include <cstring> const int N = 100005; int a[N], p[N]; int init(int x) { int cnt = 0; while(x > 1) { x /= 2; cnt ++; } return cnt + 1; } int main() { int n; while(~scanf("%d", &n)){ for(int i = 0;