不让下载Appengine源代码
2012/04/20 15:28:27 by fred1982, 0 comments.
Note: code downloads are prohibited.
今天莫名其妙的把下载源代码功能给关闭了。悲剧的是,这个操作不可逆。
使用appcfg.py下载appspot部署的程序
2012/04/12 07:17:22 by fred1982, 0 comments.
昨天发现新版的appcfg.py可以下载appspot上部署的应用了。如果丢失了应用源代码。这个功能就很有用了。
../google_appengine/appcfg.py download_app fred -A fred
Use Qt and PyQt
2009/04/17 17:15:19 by fred1982, 2 comments.
下载1ting音乐脚本
2009/02/06 04:58:02 by fred1982, 0 comments.
wget http://scriptz.googlecode.com/svn/trunk/maesinfo-python/rsync-1ting.py
安装 pycurl 和 beautifulsoup ,设置 DOWNLOAD_DIR 就可以了~
AttributeError: 'module' object has no attribute 'getaddrinfo'
2008/09/28 01:19:10 by fred1982, 0 comments.
如果用 Appengine 与 gdata-python client 的话,请不要选择 gdata-python client 的1.2版本,因为至少目前(Appengine 1.1.4)都会遇到
AttributeError: 'module' object has no attribute 'getaddrinfo'
的错误提示,不过使用 gdata-python client 1.1 或是 1.0 是正常的。
Appengine Bulkload 上载中文CSV文档
2008/09/25 15:54:06 by fred1982, 0 comments.
让 Appengine Bulkload 支持UTF-8中文CSV上载吧!环境 Appengine SDK 1.1.3
- 把 google\appengine\ext\bulkload\__init__.py 拷贝到你的目录,比如 patch\bulkload.py,当然不要忘记在patch目录下面放置 __init__.py 文档哦。
- 更改 patch\bulkload.py 内容,只有一处:
..... return (httplib.BAD_REQUEST, ''.join(output)) - buffer = StringIO.StringIO(data) + buffer = StringIO.StringIO(data.encode('utf-8')) reader = csv.reader(buffer, skipinitialspace=True) .....
- 更改你的 myloader.py
- from google.appengine.ext import bulkload + import patch.bulkload as bulkload .... bulkload.Loader.__init__(self, 'Person', - [('name', str), + [('name', lambda x: unicode(x,'utf-8')), ('email', datastore_types.Email), ....
Debug is Bad For Work
2008/09/16 02:27:01 by fred1982, 0 comments.
在Appengine上的LOG记录总是提示
This request used a high amount of CPU,
and was roughly 2.1 times over the average request CPU limit.
High CPU requests have a small quota, and if you exceed this quota,
your app will be temporarily disabled.
结果去group看了一下, 才发现主要是应为开启了debug, 难怪. 只有修改一下django的 setting.py 让她自动判断运行环境了.
如何才能找到一家适合自己的好公司
2008/08/06 11:32:09 by fred1982, 0 comments.
边缘梦是个高手
2008/08/06 03:55:03 by fred1982, 4 comments.
边缘梦是个PHP高手,不过他是要收费的~ 他说
<?php
$newContent = preg_replace("!<table[^?>]*>.+?!is", "", $line['post_content']);
?>
要加 is 才能全文匹配,我觉得他说得对,不过他给别个说PHP要收费的!
ipvsadm命令参考
2008/07/09 13:07:45 by fred1982, 0 comments.
一般选项
- -A --add-service 在内核的虚拟服务器表中添加一条新的虚拟服务器记录。也就是增加一台新的虚拟服务器。
- -E --edit-service 编辑内核虚拟服务器表中的一条虚拟服务器记录。
- -D --delete-service 删除内核虚拟服务器表中的一条虚拟服务器记录。
- -C --clear 清除内核虚拟服务器表中的所有记录。
- -R --restore 恢复虚拟服务器规则
- -S --save 保存虚拟服务器规则,输出为-R 选项可读的格式
- -a --add-server 在内核虚拟服务器表的一条记录里添加一条新的真实服务器记录。也就是在一个虚拟服务器中增加一台新的真实服务器
- -e --edit-server 编辑一条虚拟服务器记录中的某条真实服务器记录
- -d --delete-server 删除一条虚拟服务器记录中的某条真实服务器记录
- -L|-l --list 显示内核虚拟服务器表
- -Z --zero 虚拟服务表计数器清零(清空当前的连接数量等)
- --set tcp tcpfin udp 设置连接超时值
- --start-daemon 启动同步守护进程。他后面可以是master 或backup,用来说明LVS Router 是master 或是backup。在这个功能上也可以采用keepalived 的VRRP 功能。
- --stop-daemon 停止同步守护进程
- -h --help 显示帮助信息
其他的选项:
- -t --tcp-service service-address 说明虚拟服务器提供的是tcp 的服务[vip:port] or [real-server-ip:port]
- -u --udp-service service-address 说明虚拟服务器提供的是udp 的服务[vip:port] or [real-server-ip:port]
- -f --fwmark-service fwmark 说明是经过iptables 标记过的服务类型。
- -s --scheduler scheduler 使用的调度算法,有这样几个选项rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq,默认的调度算法是: wlc.
- -p --persistent [timeout] 持久稳固的服务。这个选项的意思是来自同一个客户的多次请求,将被同一台真实的服务器处理。timeout 的默认值为300 秒。
- -M --netmask netmask persistent granularity mask
- -r --real-server server-address 真实的服务器[Real-Server:port]
- -g --gatewaying 指定LVS 的工作模式为直接路由模式(也是LVS 默认的模式)
- -i --ipip 指定LVS 的工作模式为隧道模式
- -m --masquerading 指定LVS 的工作模式为NAT 模式
- -w --weight weight 真实服务器的权值
- --mcast-interface interface 指定组播的同步接口
- -c --connection 显示LVS 目前的连接 如:ipvsadm -L -c
- --timeout 显示tcp tcpfin udp 的timeout 值 如:ipvsadm -L --timeout
- --daemon 显示同步守护进程状态
- --stats 显示统计信息
- --rate 显示速率信息
- --sort 对虚拟服务器和真实服务器排序输出
- --numeric -n 输出IP 地址和端口的数字形式
Fixed Google Webmaster Tools
2008/07/09 03:35:49 by fred1982, 0 comments.
今天按照google webmaster的说明更新了SEO相关功能,rebots.txt、sitemap等;并添加了RSS订阅功能。
Pidgin 2.4.3
2008/07/08 01:46:42 by fred1982, 0 comments.
How to install Apache, PHP and MySQL 5 on Opensolaris
2008/07/03 08:59:29 by fred1982, 0 comments.
自从前几天安装了opensolaris之后今天才想起来要在上面安装一些应用程序,找了一下发现solaris10是使用pkg来管理软件包,安装了好Apache、PHP、MySQL之后,很想知道我能不能在opensolaris上成功编译。
http://blogs.sun.com/natarajan/entry/how_to_install_apache_php
这里还有关于学习Solaris很好的地方。


