1.安装git2.配置git git config --global user.name "username" git config --global user.email "user@gmail.com"查看配置 git config --list3.获取开源项目 ,git 支持使用不同协议...
分类:
其他好文 时间:
2015-09-22 16:08:00
阅读次数:
116
最近在开发的时候遇到一个mysql的子查询删除原表数据的问题。在网上也看了很多方法,基本也是然并卵(不是写的太乱就是效率太慢)。公司DBA给了一个很好的解决方案,让人耳目一新。 DELETE fb.* FROM froadbill.bill fb LEFT JOIN froadbill.refund...
分类:
数据库 时间:
2015-09-22 16:06:24
阅读次数:
170
由于实验的要求,需要统计一系列的字符串通过百度搜索得到的关键词个数,于是使用python写了一个相关的脚本。在写这个脚本的过程中遇到了很多的问题,下面会一一道来。ps:我并没有系统地学习过python,只是很久之前用过它,感觉用起来还比较方便,于是这回又把它拾起来使用了。当然这也是考虑到手上有pyt...
分类:
编程语言 时间:
2015-09-22 16:06:02
阅读次数:
218
读取操作import xlrd打开 Excel 文件excel = xlrd.open_workbook('excel.xls')查看 sheet 名excel.sheet_names()得到第一个工作表,或者通过索引顺序,或工作表名称table = excel.sheets()[0]table =...
分类:
编程语言 时间:
2015-09-22 16:04:10
阅读次数:
149
pass #!/usr/bin/env?python
import?os,commands
a?=?os.system(‘ls?/mnt‘)
print?‘a:‘,a
print?‘------------------------------‘
(status,?output)?=?commands.getstatusoutput(‘ls?/mnt‘)
prin...
分类:
编程语言 时间:
2015-09-22 14:55:21
阅读次数:
159
pyhton利用pexpect模块实现svnchekout一,安装pexpectpipinstallpexpect二,python脚本实现#!/usr/bin/envpython
#-*-coding:utf-8-*-
importpexpect
username=‘admin‘
password=‘passwd‘
svnurl=‘http://mysvnurl.com/svnproject‘
if__name__==‘__main__‘:
svn_link=‘svn..
分类:
编程语言 时间:
2015-09-22 14:46:36
阅读次数:
2915
#!/usr/bin/envpython#-*-coding:utf-8-*-importsysfromthreadingimportThreadimportsubprocessfromQueueimportQueuenum_threads=3ips=[‘127.0.0.1‘,‘192.168.20.140‘]q=Queue()defpingme(i,queue):whileTrue:ip=queue.get()print‘Thread%spinging%s‘%(i,ip)ret=subprocess.cal..
分类:
编程语言 时间:
2015-09-22 14:45:14
阅读次数:
341
代码如下#!/usr/bin/python
importos
importjson
data={}
diskname_list=[]
disk_list=[]
command=‘‘‘iostat|awk‘{print$1}‘|grep^[vd]‘‘‘
lines=os.popen(command).readlines()
forlineinlines:
disk_name=line.strip(‘\n‘)
disk_list.append(disk_name)
fordisk_namein..
分类:
其他好文 时间:
2015-09-22 14:43:46
阅读次数:
213
字符串的基本操作计数:len('span')字符串相加:'abc'+'def''ni!'*7取值取第一个值取倒数第二个值第一个和第4个值取除了最后一个值以外的值数据类型的转换int将字符串转换成数字类型str将数字转换成字符串类型
分类:
编程语言 时间:
2015-09-22 14:36:16
阅读次数:
162
1.执行次数最多的TOP10SQL"db2 "select * from sysibmadm.snapdyn_sql order by NUM_EXECUTIONS desc fetch first 10 rows only"2、平均执行时间最长的TOP10SQL"db2 "select * fro...
分类:
数据库 时间:
2015-09-22 14:19:41
阅读次数:
896