一直在每个windows机器上都安装了一份gow ( The lightweight alernative to cygwin), 但是在使用中遇到了几个bug
一直在每个windows机器上都安装了一份gow ( The lightweight alernative to cygwin), 但是在使用中遇到了几个bug
这几天需要在没有desktop的cli下做网站截图,google了一圈,
基本都是采用xvfb作为虚拟x-server来显示,
然后利用firefox/chrome或者qt-webkit类软件来实现截图
firefox/chrome类相对来说麻烦一下,但是通过安装flashplugin, 可以显示flash, 但是一般都需要imagemagick来实现边框移除
qt-webkit类的,比较方便,但是好像flash都无法正常显示, 这点在grab大陆站点的时候尤其郁闷
不过最方便的还是
apt-get install xvfb xfonts-wqy; fontconfig-voodoo -f -s zh_CN之后直接用python来截屏。
示例(ubuntu 8.04 LTS server x64上测试):
firefox with flash screenshot/thumb
webkit2png screenshot
参考链接:
一个python版的开源web截图工具:python-webkit2png
在 Linux 上架設 Screenshot Service
GAE需要python2.5支持,而ubuntu从10.04开始就只支持python version >= 2.6了, 所以只能自个去编译python2.5了
----------
ubuntu10.04已经默认安装了python2.6
sudo apt-get install libssl-dev libsqlite3-dev sqlite3
Python 自带的sqlite3模块只是sqlite的一个接口,包含实现部分, 需要先安装sqlite3再编译python,否则会找不到模块
下载python2.5源码, 解压缩
vim /Path/to/Python-2.5/Modules/Setup.dist
将如下行修改为(去掉开头的#号):
204:# Socket module helper for SSL support; you must comment out the other
205:# socket line above, and possibly edit the SSL variable:
206:SSL=/usr/local/ssl
207:ssl ssl.c
208: -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl
209: -L$(SSL)/lib -lssl -lcrypto
保存退出 => ./configure => make => make altinstall
去http://pypi.python.org/pypi/ssl/1.15下载ssl-version.tar.gz并安装
去http://www.pythonware.com/products/pil/下载Imageing-version.tar.gz并安装
以上两条命令都是python2.5 setup.py install
安装easy_install:
wget http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c11-py2.5.egg
sh setuptools-0.6c11-py2.5.egg
安装gae所需的django
easy_install-2.5 django==1.1.1
==========================
到此就安装完毕了
执行python2.5 /usr/local/lib/python2.5/test/test_socket_ssl.py 进行socket ssl测试
正常的话会打印出:
test_rude_shutdown ...
test_basic ...
test_timeout ...
执行python2.5并import sqlite3 ,无错则sqlite3正常
---------------------------------------
ubuntu 10.10应该也可以如此安装,但是10.04是LTS, 没有去测试10.10
参考文章:
GAE Python SDK on ubuntu 10.10 - SSL, Sqlite problems
wget精确镜像指令
wget –domains=blog.suchasplus.com -m -nH http://blog.suchasplus.com
不过常用的还是这个:
wget -r -p -np -k -c -q -b http://code.google.com/appengine/