寻觅生命中的那一片浅草......

文章属于类别 Python

Syrupy

Syrupy is a Python script that regularly takes snapshots of the memory and CPU load of one or more running processes, so as to dynamically build up a profile of their usage of system resources.

https://github.com/jeetsukumaran/Syrupy

当Django1.5遇上uwsgi-1.0.4:查不到最新数据

最近做的功能,涉及ORM,数据明明已经插入数据库,但在页面上却查不到,一开始以为是cache的问题,但最后google发现是Django和uwsgi直接衔接出了问题:
Using #django 1.5 on #uwsgi ? You’ll want at least 1.3, otherwise DB connections aren’t closed between requests.
解决办法就是升级uwsgi
参考:
https://twitter.com/raphaelbarrois/status/337924659666362368
https://groups.google.com/forum/#!topic/django-users/8OgkXAjuvDM

func热更新模块

我们使用的salt是可以热更新模块的,最近在看func,所以想实现一番

代码请猛击下面的地址,比较暴力的实现方法

func热更新模块

假设你增加一个文件,里面有一个ping方法

/usr/local/lib/python2.7/site-packages/func/minion/modules/mc_ping.py

则直接执行下面的命令即可,无需重启func

func “*129*” call mc_ping ping

xmlrpc over ssl

最近在看func的源码,深奥,经大师指点,看完代码要自己实现一次,搞了个比较简单的

源码见

https://github.com/johncanlam/sslxmlrpc

zz:Selenium+Phantomjs数据抓取环境配置

直接发个地址,就不复制粘贴了
数据抓取的艺术(一):Selenium+Phantomjs数据抓取环境配置

2024年三月
« 5月    
 123
45678910
11121314151617
18192021222324
25262728293031