09 2014 档案

摘要:转载至:http://wklken.me/posts/2013/03/25/python-tool-fabric.htmlfabrictitle是开发,但是同时要干开发测试还有运维的活 (o(╯□╰)o)近期接手越来越多的东西,发布和运维的工作相当机械,加上频率还蛮高,导致时间浪费还是优点多。修复b... 阅读全文
posted @ 2014-09-29 16:27 李雷雷alexkn 阅读(536) 评论(0) 推荐(0)
摘要:import unittestclass SimpleUnitTest(unittest.TestCase): def test_Fail(self): self.failUnless(True) def test_Fail(self): self.failI... 阅读全文
posted @ 2014-09-27 11:40 李雷雷alexkn 阅读(1374) 评论(0) 推荐(0)
摘要:给出一个例子:def foo(*args,**kwargs): print 'args=',args print 'kwargs=',kwargs print '---------------------------'if __name__=='__main__': foo(... 阅读全文
posted @ 2014-09-27 11:37 李雷雷alexkn 阅读(1221) 评论(0) 推荐(0)
摘要:举个例子:import csvimport ospath='/tmp/'file='test.csv'def generate_csv(path,file): if not os.path.exists(path): os.mkdir(path) files=os.path... 阅读全文
posted @ 2014-09-12 15:59 李雷雷alexkn 阅读(3685) 评论(0) 推荐(0)
摘要:从/mnt目录下读取section配置文件sample.ini[db]host=192.168.1.116hostaddr=192.168.1.116port=5432dbname=class4_dbuser=class4_userpassword =[web_db]host=db.$hostadd... 阅读全文
posted @ 2014-09-11 11:32 李雷雷alexkn 阅读(228) 评论(0) 推荐(0)
摘要:本来在centos里不好装的软件,往往ubuntu里会很好装,但sipp恰恰相反,ubuntu里能装死你。做VOIP测试的话,有时候为了模拟通话中更好的抓包,在环境简陋,又不想使用集线器引起广播风暴的前提下,sipp最好装在本机里,因此,对于装Ubuntu的人,不得不做死装一把!(这东西搞了我2个小... 阅读全文
posted @ 2014-09-04 16:42 李雷雷alexkn 阅读(842) 评论(0) 推荐(0)
摘要:写了个脚本,定时去数据库取schema,并推送到公司的git里。#daily_schema.py#/usr/bin/env pythonimport osimport datetime,timeos.system('mkdir -p /mnt/daily_schema')tmp_now=dateti... 阅读全文
posted @ 2014-09-02 16:49 李雷雷alexkn 阅读(391) 评论(0) 推荐(0)