1.shell程序格式 #! /bin/bash 首行#!指定shell编译器 # program
除首行的#外,其他的都表示注释 # read var1 read var2 if[ $var1 -eq $var2 ] then echo "$var1 is
equal to $var2" elif...
分类:
其他好文 时间:
2014-05-08 10:36:56
阅读次数:
252
tab 命令补全history 先前输入的命令,!+序号重新执行ctrl+l,clear
清屏ctrl+u 删除当前输入ctrl+c 终止命令ctrl+d 退出系统一、命名别名 #alias 查看已有的别名 #alias copy=cp
让copy可以执行cp的命令 #u...
分类:
系统相关 时间:
2014-05-08 09:12:38
阅读次数:
314
跟踪代码发现,应用启动时的白屏会持续到draw调用完成,这个过程中任何耗时操作将导致白屏时间增长。1.adb shell am start -W -n
yourpakagename/MainActivity-W: wait for launch to complete 这里的launch to co...
分类:
移动开发 时间:
2014-05-08 07:15:37
阅读次数:
340
#!/usr/bash
#createbylhb
#date2014-05-07
#descinstallgearmanandphpextensionforUbuntu12.04.4LTSPHP5.5
apt-getupdate
#安装依赖库
apt-getinstalllibboost-all-devgperflibevent1-devlibcloog-ppl0
mkdir-pv/home/lhb/software&&cd/home/lhb/software
#下载gearma..
分类:
Web程序 时间:
2014-05-08 02:56:01
阅读次数:
365
我们在机房选择、测试网络的质量的时候,往往只根据跳数、延迟、抖动、网络吞吐量等指标来衡量,很多时候跳数并不能完全显示网络拓扑优劣,于是写了个traceroute结合whois的小脚本来直观显示每一跳所处的网络位置。
需要安装mtr和whois
脚本:
[root@localhost ~]# more geotrace.sh
#!/bin/bash
ec...
分类:
其他好文 时间:
2014-05-07 23:56:29
阅读次数:
474
defgetResult(cmd,timeout=2):#命令超时时间
deadline=time.time()+timeout
r=subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE)
whiletime.time()<deadlineandr.poll()isNone:
time.sleep(0.1)
ifr.poll()isNone:#检查子进程
r.kill()
r.wait()
return‘‘
r.wait()
..
分类:
编程语言 时间:
2014-05-07 22:30:17
阅读次数:
504
很早写的,最近别人问过一次,贴出来吧。#!/bin/bash
#
source/etc/profile&>/dev/null
basedir=$(cd`dirname$0`;pwd)
nowmonth=`date+%m`
nowday=`date+%d`
email="$basedir/email/sendemail.sh"
functionGaiMiMa(){
user="$1"
passwd=$(/usr/bin/mkpasswd-l20-d5-c2-C..
分类:
其他好文 时间:
2014-05-07 22:26:08
阅读次数:
951
1.在linux上可以找到哪些shell?哪个档案记录可用的shell?儿linux预设的shell是?
1./bin/bash,/bin/tcsh,/bin/csh 2./etc/shells
3.bash,亦即是/bin/bash2.在shell环境下,有个提示符(prompt),他可以修...
分类:
系统相关 时间:
2014-05-07 21:08:15
阅读次数:
720