ITeye博客

python mplayer ffmpeg vp6

pypy · 共 35 篇文章

[置顶] python 字典的扩展变形

class AttrDict(dict): """ http://stackoverflow.com/questions/4984647/\ accessing-dict-keys-like-an-attribute-in-python http://bugs.python.org/issue1469629 """ def __init__(self, source): super(AttrDict, self).__init__(source) def __getattr__(self, key): return self[key] def __setattr__(self, key, v…

2013-10-21T09:02:47Z · 互联网 · 评论(0)

[置顶] geohash的应用 附近地址搜索

http://en.wikipedia.org/wiki/Geohash 简单使用 geohash, redis,bottle, python-geohash 来实现 restful api的地理位置附近人搜素 from bottle import Bottle, run import time import json from redis_pool import Redis R = Redis().connection_pool() import geohash app = Bottle() @app.route('/v1/mark/<longitude:float>/<latitude:…

2013-08-16T11:17:59Z · 互联网 · 评论(0)

[置顶] openstack swift GB/month

http://www.buildcloudstorage.com/2012/01/can-openstack-swift-hit-amazon-s3-like.html

2013-01-04T12:06:16Z · 互联网 · 评论(0)

[置顶] swift benchmark 转载

具体测试移步到下面的blog URL http://www.zmanda.com/blogs/?tag=swift-benchmark

2012-12-26T11:09:07Z · 互联网 · 评论(0)

[置顶] openstack-folsom-architecture 记录

http://ken.pepple.info/openstack/2012/09/25/openstack-folsom-architecture/

2012-12-26T10:34:48Z · 互联网 · 评论(0)

[置顶] puppet 笔记

compile puppet scrip puppet apply modules/flume/manifests/init.pp --modulepath modules/flume/ puppet master --configprint modulepath /etc/puppet/modules:/usr/share/puppet/modules

2012-12-24T12:37:39Z · 互联网 · 评论(0)

[置顶] An Introduction to the Python Web Server Gateway Interface

非原创,来源互联网 In Brief WSGI is a specification, laid out in PEP 333, for a standardized interface between Web servers and Python Web frameworks/applications. The goal is to provide a relatively simple yet comprehensive interface capable of supporting all (or most) interactions between a Web server and …

2012-12-05T13:51:28Z · 互联网 · 评论(0)

[置顶] openstack swift Cluster Health and Telemetry

之前看swift的code主要关注在ring,proxy-server, object-server, container-server, account-server这些组件上,一次有人问我swift如何monitoring的,哦,fuck 我漏了这里,不过我想swift使用WSGI应该比较容易在filter加一个 侦测状态的filter_factory 到原有的WSGI的Pipeline,马上去翻code,果然,这货解耦做的很强悍嘛, https://github.com/openstack/swift/blob/master/swift/common/middleware/recon.…

2012-12-04T17:55:54Z · 互联网 · 评论(0)

[置顶] swift monitoring by swift-dispersion-*

处理系统更新 建议每次都以一个zone为单位进行系统更新和重启。以这种方式进行更新,能使Swift集群保 持可使用和可响应的状态。另一个更新zone的明智的做法是,更新完一个zone时,先让其运行一段时间以保证之前的更新没有导致不利的反应,然后再进行下次更新 处理磁盘错误 当一个磁盘出现错误,第一步要先确保将此盘unmounted,这可使swift更容易地应对此错误,直至问题最终被解决。 如果此磁盘可被立刻替换新硬盘,最好替换此磁盘,格式化,重新mount,然后让副本写入其中。 如果磁盘不能被立即替换,最好让此磁盘保持unmount状态,并从ring中删除此磁盘。这可使此磁盘上的所有副本被移…

2012-12-04T17:32:02Z · 开源软件 · 评论(0)

[置顶] paste deploy python ini 配置文件简单说明

配合 http://www.python.org/dev/peps/pep-0333/ http://pythonpaste.org/deploy/ 看下面的example(从网络上改造而来,出处URL也搞忘记的),很快会对python的paste如何组织wsgi有一个简单的了解, pastedeploylab.ini [default] key1=value1 key2=value2 key3=values [composite:pdl] use=egg:Paste#urlmap /:root /calc:calc [filter:logrequest] username = root p…

2012-12-03T13:27:07Z · 互联网 · 评论(0)

[置顶] 如何友好的 监控与管理 Linux 进程

在做视频编解码的程序,需要fork子进程去调用转码的tools做encode, 这里面就需要能很好的控制进程,让进程类似于跑在沙漏里面,安全,可控的运行, 实现进程的管理接口,其实比较简单的,所有的进程信息来源,均来自 /proc 文件系统 因为是所有进程相关的信息都是通过读取内存proc文件系统,所以没有任何性能问题, tommy@tommy-desktop:~$ cd /proc/ tommy@tommy-desktop:/proc$ ls 1 1176 13 1340 14 1451 15736 20444 20460 240 33 43 59 636 756 8 9299 crypt…

2010-11-11T12:57:48Z · 操作系统 · 评论(0)

[置顶] Linux 文件删除机制

多进程环境下,打开同一个文件,进行读写操作过程中,如果其中一个进程删除这个文件,那么,另外正在读写这个文件会发生什么呢? 1. 正在读写的进程发生异常,因为文件被删除了 2. 正在读写的进程仍然正常读写,好像没有发现发生了什么 我要告诉你的是,在linux环境上,答案2是对的,但是当正在读写的进程退出后,这个文件谁也不能再读写了,或者说,这个文件被删除了 解析如下: Linux 是通过 link 的数量来控制文件删除,只有当一个文件不存在任何 link 的时候,这个文件才会被删除。每个文件都有 2 个 link 计数器—— i_count 和 i_nlink。i_count 的意义是当前使用…

2010-11-10T22:39:54Z · 操作系统 · 评论(0)

[置顶] Webpy + Nginx with FastCGI

Requirements * Nginx 0.8.* or 0.7.* (with fastcgi and rewrite module). * Webpy 0.32 * Spawn-fcgi 1.6.2 * Flup Older versions may work, but aren't tested. Resources * Nginx wiki * Spawn-fcgi * Flup Notes * You may replace index.py with your own file name. * /path/to/www Is the path to the directory …

2010-11-10T16:50:59Z · 互联网 · 评论(0)

[置顶] worker pool

http://celeryq.org/ Overview This is a high level overview of the architecture. he broker delivers tasks to the worker servers. A worker server is a networked machine running celeryd. This can be one or more machines depending on the workload. The result of the task can be stored for later retrieva…

2010-09-27T17:28:14Z · 互联网 · 评论(0)

[置顶] sandbox for python

遇到一台机器上部署多个不同的python程序,管理其之间import不同的libs而麻烦 http://virtualenv.openplans.org/ virtualenv通过隔离包目录和系统环境参数来实现多个相对独立的虚拟环境。 这样可避免过多的第三方库因版本依赖造成问题。 同时每个独立的虚拟环境只需通过打包即可分发,方便了系统部署。 安装 [root@ct53-64-base ~]# pip install -U virtualenv Downloading/unpacking virtualenv Downloading virtualenv-1.5.1.tar.gz (1.4Mb…

2010-09-27T14:47:42Z · 编程语言 · 评论(0)