--Strace跟踪解决expect乱码问题----------------------------------2014/07/27情景:需要在本机抓去另外一台远程数据库中的数据。执行语句:./ersh.exp "export LANG=en_US.UTF-8;mysql -uroot -S /tm...
分类:
其他好文 时间:
2014-07-27 23:03:59
阅读次数:
227
核心提示:先列出 HessianPHP 的错误提示: CURL transport error: transfer closed with outstanding read data remaining 基础知识背景: 1)“Expect: 100-continue”的来龙去脉: HTTP/1.1 协议里设计100 (Co...
分类:
其他好文 时间:
2014-07-21 10:17:53
阅读次数:
226
Dictionaries have a method called items that returns a list of tuples, where each tuple is a key-value pair. As you should expect from a dictionary, t...
分类:
其他好文 时间:
2014-07-19 23:02:40
阅读次数:
372
UVA 11427 - Expect the Expected
题目链接
题意:玩一个游戏,赢的概率p,一个晚上能玩n盘,如果n盘都没赢到总赢的盘数比例大于等于p,以后都不再玩了,如果有到p就结束
思路:递推,dp[i][j]表示玩i盘,赢j盘的概率,那么一个晚上玩了n盘小于p的概率递推式为:
dp(i,j)=dp(i?1,j)?(1?p)+dp(i?1,j?1)?p
总和为...
分类:
其他好文 时间:
2014-07-17 16:30:01
阅读次数:
171
D越来越有玩头了~~感觉一下代码的流畅: 1 module main; 2 3 /** 4 * Imports. 5 */ 6 import std.algorithm; 7 import std.array; 8 import std.datetime; 9 import ...
分类:
其他好文 时间:
2014-07-16 21:12:50
阅读次数:
288
前言: ssh命令, 没有指定密码的参数. 以至于在脚本中使用ssh命令的时候, 必须手动输入密码, 才能继续执行. 这样使得脚本的自动化执行变得很差, 尤其当ssh对应的机器数很多的时候, 会令人抓狂.本文讲解了两种方式, 一种借助expect脚本, 一种借助sshpass来实现.*) 借助e.....
分类:
其他好文 时间:
2014-07-11 11:36:13
阅读次数:
277
Rsync(remote synchronize) 是一个远程数据同步工具,可以使用“Rsync算法”同步本地和远程主机之间的文件。
rsync的好处是只同步两个文件不同的部分,相同的部分不在传递。类似于增量备份,
这使的在服务器传递备份文件或者同步文件,比起scp工具要省好多时间。
具体的用法:
1.在本地机器上对两个目录同步
$ rsync -zvr filena...
分类:
其他好文 时间:
2014-07-09 10:39:52
阅读次数:
234
Visual Studio 2013 与 14
如果
Install Visual Studio on the same computer as Visual Studio in 2013 "14" when CTP 14.0.21730.1 DP, a number of known issues.
While we expect that the Visual Stu...
分类:
其他好文 时间:
2014-07-08 16:09:04
阅读次数:
196
2014年第一个脚本,哈哈!!! expect实现远程主机自动执行命令脚本:#!/usr/bin/expect --if { [llength $argv] < 4 } { puts "Usage: $argv0 ip user passwd port commands timeout" exit ...
分类:
其他好文 时间:
2014-07-06 16:23:01
阅读次数:
341
也许很多人认为shell不能并发任务,其实可通过其它一些方式来实现。下面的脚本是我批量快速管理500+服务器脚本,阅读该脚本前建议先看《自动执行远程主机命令expect脚本》、《自动远程拷贝expect脚本》和《getopt:命令行选项、参数处理》用法:Usage: ./multi_main.sh ...
分类:
其他好文 时间:
2014-07-06 16:22:24
阅读次数:
270