Friday, 13. November 2009, 11:01:10
test
Tuesday, 18. December 2007, 03:11:49
Apache, Server
There are two modules that can limit the bandwidth for apache, one is "Bandwidth Module", Version 0.5rc1, Bandwidth and Connection control per Virtual Host or Directory, Last Updated January 28th, 2005,
http://www.ivn.cl/apache/another is the "mod_cband",Version 0.9,A virtual host bandwidth-limiting module provided to solve the problem of limiting virtualhosts bandwidth usage,Last Updated September 07th, 2005,
http://cband.linux.pl/There also two modules that can limit cocurrent connections:
mod_vhost_limit,v0.1,
Restrict the number of simultaneous connections per vhost,
Last Modified : 2004.02.26,
http://www.ivn.cl/apache/mod_limitipconn,Version 0.22,Limit the number of simultaneous connections from a single client IP
address. Contains rudimentary support for detection of proxy clients,Last Updated July 22nd, 2003,
http://dominia.org/djao/limitipconn2.html
Friday, 14. December 2007, 10:51:59
linux
Rational公司提供了完美的检测工具purify来帮助程序员解决以上问题,简而言之,purify就是Unix下C程序质量的保证。
但是,purify目前仅提供了对极少数商业Unix的支持,即Solaris,HP-UX,IRIX这三种最主流商业Unix.而对Linux,Free BSD等非主流但呈上升势头的Unix没有任何支持。所以在Linux下要用到一些其他工具。当然,因为这些工具都是免费的,所以在功能上都没有purify全面。
1.libefence
这个工具的用处是在内存越界时立刻产生core dump文件,这样就使你总是在问题刚发生时就解决之,避免内存越界问题的累积,防止你core dump时找不着北,此工具的用法很简单,它本身是一个lib,你只要在你的Makefile里加上 -lefence,然后将libefence.a放到gcc能找到的目录即可。
2.checkergcc
(to be continued)
注:
libefence 可以在http://sources.isc.org/index.shtml找到
checkergcc属于GNU Project,官方网址为http://www.gnu.org/software/checker/checker.html
Friday, 2. November 2007, 08:22:17
ASCII:
U-00000000 - U-0000007F: 0xxxxxxx
UTF8的编码方式:
U-00000000 - U-0000007F: 0xxxxxxx
U-00000080 - U-000007FF: 110xxxxx 10xxxxxx
U-00000800 - U-0000FFFF: 1110xxxx 10xxxxxx 10xxxxxx
U-00010000 - U-001FFFFF: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
U-00200000 - U-03FFFFFF: 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
U-04000000 - U-7FFFFFFF: 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
GB2312
范围: 0xA1A1 - 0xFEFE
GBK
范围: 0×8140 - 0xFEFE
GB18030:
编码是变长的,其二字节部分与GBK兼容;四字节部分是扩充的字形、字位,其编码范围是首字节0×81-0xfe、二字节0×30-0×39、三字节0×81-0xfe、四字节0×30-0×39。
( GB18030 > GBK > GB2312 )
BIG5
范围: 0xA140 - 0xF9FE, 0xA1A1 - 0xF9FE
可以看到:
各种编码方式都是以 >0x80的字符开头的,所以strstr不会有问题, 但是strchr会有问题,因为GB/BIG5在编码的第二字节用到了<0x80部分,而UTF8没有这个问题。
关于编码方式的检测如果单纯基于纯二进制内容参考下面的文章,基本是基于概率来检测的:
http://www.mozilla.org/projects/intl/UniversalCharsetDetection.html
Tuesday, 30. October 2007, 07:26:19
tor, proxy, GFW
Just install the software tor,
and configure the privoxy as following:
forward-socks4a my.opera.com localhost:9050 .
forward-socks4a *.wikipedia.org localhost:9050 .
then we can access the wiki and opera with tor, and direct access other website without tor.
Showing posts 1 -
5 of 51.