![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
terry_csdn
这个作者很懒,什么都没留下…
展开
-
python_打印pstree效果
from subprocess import PIPE,Popen import shlex def pstree(): cmd = 'ps ax -o pid,ppid,command' sub = Popen(shlex.split(cmd),stdout=PIPE) return sub.stdout.readlines()[1:] def parse_ps(string原创 2013-11-22 11:20:55 · 1292 阅读 · 0 评论 -
python_修改配置文件参数
#!/usr/bin/python #coding:utf8 import os,re,csv def readcsv(f): flist = [] with open(f,'rU') as d: reader = csv.reader(d) for row in reader: flist.append(row[0]) return ','.join(flist[1:]原创 2013-11-15 13:53:15 · 1673 阅读 · 0 评论 -
python_收集服务器基本信息
之前都是一直自己写模块收集服务器基本信息,后来看到facter收集的信息很全面,所以就拿来用用,嘿嘿 1、facter安装 facter是基于puppet的,所以安装puppet即可。 yum -y install puppet 2、facter收集的数据: architecture => x86_64 augeasversion => 0.9.0 blockdevice_xvda_si原创 2013-11-27 14:25:07 · 1710 阅读 · 0 评论 -
网站访问量可视化
最近有一个项目需要将网站访问量动态的在中国地图中显示出来,点击每个省份后会单独进入这个省的地图,显示省的详细数据, 之前试了下kartograph,但是生成地图实在难看,所以换了现在用的jquary,里边已经有做好的中国省份地图数据,js格式的,但是遗憾的是好像没有省份详细得地图数据, 所以这块只能稍后自己做了,话不多说,先看下效果图: 大概流程: 首先生成一个json格式的文件,原创 2014-01-02 11:29:05 · 1562 阅读 · 0 评论 -
vagrant 打包问题
最近使用vagrant 部署开发环境,在打包的时候遇到如下问题: A directory was not specified to package. This should never happen and is a result of an internal inconsistency. 使用的版本为: vagrant 1.4.2 和 VirtualBox-4.3.6 在百度网上查原创 2014-01-08 11:57:28 · 649 阅读 · 0 评论