nirubi / corrin Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/corrin
Automatically exported from code.google.com/p/corrin
Try to add colors in shell prompt :
1. import the class of "colors" from fabric module
2.make the prompt string
3.when run dbpizza and type a long commad, the line dones not wrap.
原因:
PS1=”e[1;32mue[me[1;33m@e[me[1;35mhe[m:w$ "
此时,在终端中的显示应该是彩色的提示符了,其中的e[1;xxm�
��e[m就是改变终端字体颜色的部分,前者是修改颜色,后者是
恢复到正常显示。但是
这时还会有问题,在提示符中输入第一行时,回车换行不正��
�,导致显示很混乱,因此,除了这个修改之外,还需要将全�
��非打印字符用专用的 bash 转义序列 "[" 和 "]”
括起来。这两个序列通知 bash,被括起来的字符不占用行
上的任何空间,这样就使自动换行能够继续正常工作。最终��
�本如下(可解决带颜色提示符的不换行问题):
PS1=”[e[1;32m]u[e[m][e[1;33m]@[e[m][e[1;35m]h[e[m]:w$ “
》》当尝试在fabric.colors源码中加入"[" 和"]" 不能解决问题
》》使用“python prompt
color”求助google时,发现需要写十六进制,而不是直接字符
http://stackoverflow.com/questions/10953812/adding-colors-in-python-interpreter-
prompt-does-not-wrap-properly
Original issue reported on code.google.com by [email protected]
on 12 Dec 2013 at 12:12
现象:程序闲置一段时间后重新操作报数据库连接丢失,只��
�重启程序
解决:
1. 操作数据库信息后要调用db.session.close()
关闭当前session,将当前连接还给连接池
2. 将连接池连接recyle时间设的小一点(推荐为10s)
Original issue reported on code.google.com by [email protected]
on 13 Dec 2013 at 1:13
What steps will reproduce the problem?
1. update to latest code change
2. python corrin.py
3. cmd "一部分机器" --threads "hostname"
What is the expected output? What do you see instead?
当使用多线程来执行命令结束后,命令行就会错乱,如下面��
�粘贴结果,如果不是用--threads选项,则没有问题。
如果出现错乱后,需要通过退出 corrin.py 再在 linux 下执行
"reset" 来回复
Corrin[us:common:10.10.81.36[001:us_36_controlling_server]]>cmd --childs
--recursion --threads "hostname"
[None] out: im.us.changyou.com
[None] out:
[None] out: changyou_81_65.changyou.com
[None] out:
Count/Error: 18/0 Elapsed: 0:01:43.212685
+-----+-------------------------------------------------------------------------
------------+----------------+-----------------------------+
| Num | Instance
| Elapsed | Result |
+-----+-------------------------------------------------------------------------
------------+----------------+-----------------------------+
| 1 | us:swordgirls:10.10.81.102[006:us_sg_online]
| 0:00:17.785621 | cysglivedb |
| 2 | us:rho:10.10.81.22[004:us_rho_online_admin]
| 0:00:17.993921 | WIN-EANEH361865 |
| 3 | us:rho:10.10.81.21[003:us_rho_account]
| 0:00:18.030121 | WIN-C1G8OOVHC3V |
| 4 | us:rho:10.10.81.110[002:us_rho_staging]
| 0:00:18.058315 | davinci-878a43c |
| 5 | us:swordgirls:10.10.81.84[005:us_sg_KG_online]
| 0:00:18.195757 | svctag-3gmnt2x |
| 6 | us:common:10.10.81.1[008:us_ftp]
| 0:00:00.762516 | im.us.changyou.com |
| 7 | us:totem:10.10.81.97[010:us_totem_test]
| 0:00:00.764906 | 97TOTEMSTAGINGDB |
| 8 | us:partner:10.10.81.37[011:us_KG_billing_partner_test]
| 0:00:00.840612 | Develop37-partner |
| 9 | us:totem:50.18.211.78[009:us_totem_EC2_cc]
| 0:00:00.905030 | us_dv_zk78 |
| 10 | us:gamefuse:10.10.81.148[012:us_KG_billing_partner_live]
| 0:00:00.965682 | us_kg_billdb |
| 11 | us:partner:10.10.81.65[013:us_KG_billing_partner_slave &
gamefuse_test_forum] | 0:00:00.657230 | changyou_81_65.changyou.com |
| 12 | us:gamefuse:10.10.81.98[014:us_gf_db_test]
| 0:00:00.741584 | gf_test_db_98 |
| 13 | us:gamefuse:10.10.81.52[016:us_gf_forum_db]
| 0:00:00.734783 | changyou_81_52.changyou.com |
| 14 | us:common:10.10.81.36[001:us_36_controlling_server]
| 0:00:00.786897 | us_dk_zk_36 |
| 15 | us:common:10.10.81.80[019:for Gamefuse survey page]
| 0:00:00.898199 | localhost |
| 16 |
us:gamefuse:ec2-54-225-93-231.compute-1.amazonaws.com[018:us_gamefuse_PostgreDB]
| 0:00:01.545922 | ip-10-31-199-212 |
| 17 |
us:partner:ec2-54-226-71-17.compute-1.amazonaws.com[017:us_partner_statics_mogon
db] | 0:00:01.589410 | ip-10-29-184-205 |
| 18 | us:gamefuse:107.23.65.195[015:us_gf_rds_cc]
| 0:00:01.956180 | us_gamefuse_zc |
+-----+-------------------------------------------------------------------------
------------+----------------+-----------------------------+
Corrin[us:common:10.10.81.36[001:us_36_controlling_server]]>Corrin[us:common:10.
10.81.36[001:us_36_controlling_server]]>Corrin[us:common:10.10.81.36[001:us_36_c
ontrolling_server]]>Corrin[us:common:10.10.81.36[001:us_36_controlling_server]]>
Corrin[us:common:10.10.81.36[001:us_36_controlling_server]]>Corrin[us:common:10.
10.81.36[001:us_36_controlling_server]]>Corrin[us:common:10.10.81.36[001:us_36_c
ontrolling_server]]>You have new mail in /var/spool/mail/root
[@us_dk_zk_36 corrin]#
[@us_dk_zk_36 corrin]#
[@us_dk_zk_36 corrin]# python corrin.py
Corrin[us:common:10.10.81.36[001:us_36_controlling_server]]>cmd -h
Usage: corrin.py [options]
Options:
-h, --help show this help message and exit
-p PIECE, --piece=PIECE
piece name
--recursion get childs with recursion
-c, --childs get childs
--threads get childs
Corrin[us:common:10.10.81.36[001:us_36_controlling_server]]>cmd --childs
--recursion "hostname"
Count/Error: 18/0 Elapsed: 0:01:40.524597
+-----+-------------------------------------------------------------------------
------------+----------------+-----------------------------+
| Num | Instance
| Elapsed | Result |
+-----+-------------------------------------------------------------------------
------------+----------------+-----------------------------+
| 1 | us:rho:10.10.81.110[002:us_rho_staging]
| 0:00:17.828937 | davinci-878a43c |
| 2 | us:rho:10.10.81.21[003:us_rho_account]
| 0:00:17.986905 | WIN-C1G8OOVHC3V |
| 3 | us:rho:10.10.81.22[004:us_rho_online_admin]
| 0:00:17.967914 | WIN-EANEH361865 |
| 4 | us:swordgirls:10.10.81.84[005:us_sg_KG_online]
| 0:00:17.933924 | svctag-3gmnt2x |
| 5 | us:swordgirls:10.10.81.102[006:us_sg_online]
| 0:00:17.595924 | cysglivedb |
| 6 | us:common:10.10.81.1[008:us_ftp]
| 0:00:00.729903 | im.us.changyou.com |
| 7 | us:totem:50.18.211.78[009:us_totem_EC2_cc]
| 0:00:00.663926 | us_dv_zk78 |
| 8 | us:totem:10.10.81.97[010:us_totem_test]
| 0:00:00.621927 | 97TOTEMSTAGINGDB |
| 9 | us:partner:10.10.81.37[011:us_KG_billing_partner_test]
| 0:00:00.610933 | Develop37-partner |
| 10 | us:gamefuse:10.10.81.148[012:us_KG_billing_partner_live]
| 0:00:00.648935 | us_kg_billdb |
| 11 | us:partner:10.10.81.65[013:us_KG_billing_partner_slave &
gamefuse_test_forum] | 0:00:00.657930 | changyou_81_65.changyou.com |
| 12 | us:gamefuse:10.10.81.98[014:us_gf_db_test]
| 0:00:00.695934 | gf_test_db_98 |
| 13 | us:gamefuse:107.23.65.195[015:us_gf_rds_cc]
| 0:00:01.637937 | us_gamefuse_zc |
| 14 | us:gamefuse:10.10.81.52[016:us_gf_forum_db]
| 0:00:00.694926 | changyou_81_52.changyou.com |
| 15 |
us:partner:ec2-54-226-71-17.compute-1.amazonaws.com[017:us_partner_statics_mogon
db] | 0:00:01.515930 | ip-10-29-184-205 |
| 16 |
us:gamefuse:ec2-54-225-93-231.compute-1.amazonaws.com[018:us_gamefuse_PostgreDB]
| 0:00:01.552086 | ip-10-31-199-212 |
| 17 | us:common:10.10.81.80[019:for Gamefuse survey page]
| 0:00:00.610698 | localhost |
| 18 | us:common:10.10.81.36[001:us_36_controlling_server]
| 0:00:00.569928 | us_dk_zk_36 |
+-----+-------------------------------------------------------------------------
------------+----------------+-----------------------------+
Corrin[us:common:10.10.81.36[001:us_36_controlling_server]]>
Please use labels and text to provide additional information.
Original issue reported on code.google.com by [email protected]
on 9 Jan 2014 at 2:37
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.