Monthly Archives: 2015年8月

Linux-NTP-让你真正明白Linux NTP(包括历史、参数解释、安装配置)

← Continue Reading
1.如何查看ntp是否配置成功? 2.如何了解ntp列出的参数的含义? 3.restrict关键字的作用是什么? 贴出关键信息: # watch ntpq -p Every 2.0s: ntpq -p                                  Sat Jul  7 00:41:45 2007      remote           refid      st t wh...

expect的基本用法

← Continue Reading
目录] 1.摘要 2.关键字 3.简介 4.Expect综述 5.callback 6.passwd 和一致性检查 7.rogue 和伪终端 8.ftp 9.fsck 10.多进程控制:作业控制 11.交互式使用Expect 12.交互式Expect编程 13.非交互式程序的控制 14.Expect的速度 15.安全方面的考虑 16.Expect资源 17.参考书籍 1.[摘要] 现代的Shell...

expect实现自动登录

← Continue Reading
使用expect实现简单自动登录,从网上看了几个脚本不错,借鉴一下 NO.1 #!/bin/sh auto_login_ssh(){ expect -c " set timeout -1; spawn -noecho ssh -o StrictHostKeyChecking=no $2 ${@:3}; expect *assword:*; send -- $1\r; interact;"...

Linux 下安装python软件包(pip、nose、virtualenv、distribute )

← Continue Reading
新手刚开始学习Python,目前学习《笨方法学python》ing~ 在学习习题46时需要安装几个软件包:pip、nose、virtualenv、distribute !在此记录Linux下安装python软件包的安装方法: 1、首先我们刚刚pip是什么? 在pip的python官网上我们可以看到,pip 是“A tool for installing and managing Python pa...

shell 指令 杀死mysql指定用户的所有进程

← Continue Reading
#例 $2横向第二栏用户栏 for i in $(mysql -uroot -p123456 -se "show processlist" | awk '{if($2=="admin")print $1}');do mysql -uroot -p123456 -e "kill $i";done

python中文注释报错问题

← Continue Reading
初步学习python,发现使用中文注释会报 File "regular.python", line 9 SyntaxError: Non-ASCII character '\xe5' in file chineseDemo.python on line 9, but no encoding declared; see http://www.python.org/peps/pep-0263.html...