
Linux/Unix
d_yang
啥都懂, 啥都不精通.
展开
-
LIGHTTPD+FASTCGI+WEB.PY ON DEBIAN
写于http://www.funcat.cn/blog/archives/166 终于配置好了环境, 可以当作production server了. 下面是笔记: 由于Debian下Python2.5更新会有问题, 所以我沿用原有的2.4. 1. 先下载lighttpd的源码: wget http://www.lighttpd.net/download/lighttpd-1.4.19原创 2008-08-21 13:46:00 · 1241 阅读 · 5 评论 -
Twisted.web的性能测试
想了解一下twisted单独作为web服务器的性能。 所以用webpy写一个简单的页面,挂上twisted的wsgi跑一下。测试代码:import webfrom twisted.web2 import wsgi,server, channel, staticfrom twisted.application import service, strportsurls =原创 2009-04-26 13:36:00 · 3922 阅读 · 1 评论 -
笔记:安装Stackless
aptitude install libreadline-dev./configure --prefix=/opt/stackless --with-readline --with-zlib=/usr/includemakemake install原创 2009-04-24 21:48:00 · 1640 阅读 · 0 评论 -
svn hook的post-commit不执行咋办?
在post-commit文件上加: export LANG=zh_CN.UTF-8 update: post-commit.tmpl只是post-commit.bat的一个模板, 执行的是post-commit.bat(win), 在linux下是post-commit. 如果你用win, 修改bat就可以了.原创 2009-04-30 14:58:00 · 9113 阅读 · 2 评论 -
Twistd一个诡异的地方
有个不好的习惯,老喜欢用root帐号。运行twistd程序的时候,代码老是报错,找不到包之类的。无意中看到:http://linux.die.net/man/1/twistdNote that if twistd is run as root, the working directory is not searched for Python modules.是否是这原创 2009-05-02 10:27:00 · 2519 阅读 · 1 评论 -
Twisted Cron的用法
可以像使用linux下cron那样使用twisted的scheduling.http://code.google.com/p/twistedcronservice/ 不过我更喜欢用twisted自己的Scheduling utility http://twistedmatrix.com/trac/browser/trunk/twisted/internet/task.py加上C原创 2009-04-30 16:47:00 · 2787 阅读 · 0 评论 -
Twisted TimerService的使用(以及由此带来的诡异事件)
TimerService是twisted里提供的一个对loopingcall的service封装。是在服务运行的期间反复执行某个方法的手段。 文档里没有,其实也很简单。 #! /usr/bin/python# -*- coding: utf-8 -*-Created on May 5, 2009@author: Danielfro原创 2009-05-05 15:28:00 · 3325 阅读 · 0 评论 -
Trivial About Apache+mod_wsgi+TG2
1. Apache2启动时找不到mod_wsgi:mod_wsgi没ln到正确的文件上ln -s /usr/lib/apache2/modules/mod_wsgi.so /usr/lib/apache2/modules/mod_wsgi.so-2.5 2. cPickle.so:: PyUnicodeUCS2_DecodeUTF8错误Python编译的参数,和Python m原创 2009-04-30 13:56:00 · 1259 阅读 · 0 评论 -
Athena LivePage的页面刷新异常和解决方法
Athena的LivePage对象很好用,但是在刷新的时候,会有一个异常:exceptions.AssertionError: Cannot render a LivePage more than once 官方说法是: LivePage instances maintain server-side state that corresponds to the connection原创 2009-05-07 14:05:00 · 2216 阅读 · 0 评论 -
Twisted adbapi的使用
Twisted adbapi没有太多文档。这段时间我一直在用Twisted + sqlite(3), 效果还是不错的。主要的代码: from twisted.enterprise import adbapi _conn = adbapi.ConnectionPool(sqlite3, ./NewsDB.db) def countCB原创 2009-05-06 14:10:00 · 10399 阅读 · 0 评论 -
解决mmseg.3.0b3的编译问题
在debian 5下编译mmseg.3.0b3, 碰到了:g++ -DHAVE_CONFIG_H -I. -I. -I.. -fPIC -I.. -I.. -I../src/css -I../src/utils -D_REENTRANT -D_LARGEFILE64_SOURCE -g -O2 -MT UnigramCorpusReader.lo -MD -MP -MF .deps原创 2009-03-05 15:14:00 · 1300 阅读 · 0 评论 -
GeoName的全文检索
GeoName(http://www.geonames.org/) 是一个开源的location->lan/lon的数据库.任何人都可以下载他们提供的数据(http://download.geonames.org/export/dump).官方也提供调用的各种接口. 也可以在线用一下看看效果. 利用这些数据, 我们可以很容易查找某个地名, 及其相关的信息(lan, lon...e.t.c..)原创 2008-10-14 14:10:00 · 3053 阅读 · 0 评论 -
INSTALLING LEOPARD FROM REMOVABLE DISK(USB2)
Just out of curiosity, I download a package of leopard install disk(6.9 G).Here are the steps to install it:1. Use Disk Utility to restore the package to a partition of removable disk(USB2). Make sur原创 2008-08-21 14:06:00 · 816 阅读 · 0 评论 -
web.py .3开发环境搭建
1. 安装python环境. http://www.python.org2. 安装setuptools. 这样我们就可以在后面直接使用easy_install来自动安装库了. http://pypi.python.org/pypi/setuptoolspython setup.py install 就可以了.在Windows下, 记得把easy_install的目录添加到系统的p原创 2008-08-28 13:34:00 · 2615 阅读 · 1 评论 -
FMS 2(linux)的一个权限问题
装完FMS 2后, 协作的部分一切正常, 但是, 到了stream的录制, 就不能了.查看log:"flash media server 2 failed to record no space left on device"立刻开始怀疑是权限问题,ps -aux后, 果然, fmscore和fmedge都是以nobody运行的. 而application目录是用root创建的.chown -R原创 2008-09-07 14:59:00 · 792 阅读 · 0 评论 -
Trac+SVN+Lighttpd安装笔记
不是太容易. Pain past is pleasure, anyway. 1. 为了使用认证的htpasswd,安装: aptitude install apache2-utils 2. 安装SVN和其python的binding, 创建svn项目: aptitude install subversion python-subversion 创建svn项目: svnadmin c原创 2008-09-18 16:00:00 · 2408 阅读 · 0 评论 -
Trac的中文问题
这是一个简单的检查列表:1. 检查project目录下, conf/truc.ini 文件.修改default charset为utf-8.2. 检查数据库, 默认的character set为utf8干脆删除重建了:create database trac defalt character set utf8原创 2008-09-19 09:41:00 · 936 阅读 · 0 评论 -
Sphinx 0.9.8起步
又是俄罗斯产的.Indexer, Searcher....Nginx, Sphinx, 全是nx结尾, 表明自己很牛.不比去表明, 有数据说话:通过国外《High Performance MySQL》专家组的测试可以看出,根据主键进行查询的类似“SELECT ... FROM ... WHERE id = ...”的SQL语句(其中id为PRIMARY KEY),每秒钟能够处理10000次以上原创 2008-09-21 17:34:00 · 1602 阅读 · 1 评论 -
解决Mod_wsgi模块的编译错误
在编译nginx的mod_wsgi模块时, 会碰到一个错误.cc1: warnings being treated as errors../mod_wsgi/src/ngx_http_wsgi_module.c: In function ‘ngx_http_wsgi_handler’:../mod_wsgi/src/ngx_http_wsgi_module.c:624: warni原创 2008-10-07 17:22:00 · 3143 阅读 · 1 评论 -
解决SVN的一个错误配置
check out的时候, SVN报错:svn: Not authorized to open root of edit operation 原因:svnserve.conf 文件里, 有个配置没设置好:[general]### These options control access to the repository for unauthenticated### and authenticat原创 2008-10-07 14:30:00 · 1380 阅读 · 0 评论 -
Sphinx的一个应用实例
我把我blog的数据(中英文混合)导出, 作为数据来源, 来说明sphinx的使用.准备数据源导入数据:mysql -u root -p test 配置Sphinx配置data source:source blog{ type = mysql sql_host = localhost sql_us原创 2008-10-13 14:19:00 · 4818 阅读 · 0 评论 -
Twist+pyMongo+MongoDB测试结果
两台测试机,机器的配置就不写了。代码也不贴了。 主要是测试pymongo在twisted下的稳定度,和可能出现的同步问题(或许没有) Inser: mail:/home/jintong# ab -kc 10 -t 30 http://192.168.2.7:8080/tThis is ApacheBench, Version 2.3 Copyrigh原创 2010-01-08 16:35:00 · 2992 阅读 · 0 评论