摘要: 1. 确保安装的 fiddler 是最新的 beta 版本,安装地址 http://www.getfiddler.com/dl/Fiddler2BetaSetup.exe 2. 关闭 fiddler 3. 下载并安装 fiddler 证书生成器 FiddlerCertMaker.exe (注:fiddler 证书生成器只能在 Vista 以上系统运行) 阅读全文
posted @ 2014-05-09 15:06 stallman 阅读(766) 评论(0) 推荐(0) 编辑
摘要: 1. HTMLIn the html, add the meta-tag:output->set_content_type('application/html;charset=utf-8'); $this->output->set_output("测试输出"); }}?>2. V... 阅读全文
posted @ 2014-05-03 14:00 stallman 阅读(885) 评论(0) 推荐(0) 编辑
摘要: 001^A^/1/2014/04/11/23/612c65ce-9950-4476-8211-9c996a54e93b.zip^A^51f1a8ad839a107e88b1f24f3bb0826778800^A^493568按照 ^A 分割awk -F "\\\^A\\\^" 阅读全文
posted @ 2014-04-14 14:50 stallman 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 1. 给old-nginx 发送信号,启动new-nginx 作为old-nginx 的子进程。kill -USR2 `cat xx/logs/nginx.pid`2. 给old-nginx发送信号,在处理完所有请求后,不再fork worker进程。kill -WINCH`cat xx/logs/nginx.pid.oldbin`3. 给old-nginx 发送信号,退出old-nginx 的master进程。kill -QUIT`cat xx/logs/nginx.pid.oldbin` 阅读全文
posted @ 2014-04-11 09:57 stallman 阅读(605) 评论(0) 推荐(0) 编辑
摘要: 在现网代码和配置文件里面,发现中文出现乱码。一查发现这些文件是因为“编码(Encoding)”为ANSI。 所以一时痛快地用 notepad++ 通过 “格式M” 选择 “转为UTF-8编码格式” ,打包更新代码。 然后悲剧了。web server response 的信息,莫名地少了几位。再用vim打开,就发现响应信息头部多了一串字符: 阅读全文
posted @ 2014-04-03 14:12 stallman 阅读(8849) 评论(0) 推荐(0) 编辑
摘要: if ( ! function_exists( 'exif_imagetype' ) ) { function exif_imagetype ( $filename ) { if ( ( list($width, $height, $type, $attr) = getimagesize( $filename ) ) !== false ) { return $type; } return false; }}# libexif can also be used to parse image info out of id3 ta... 阅读全文
posted @ 2014-01-08 15:20 stallman 阅读(1498) 评论(0) 推荐(0) 编辑
摘要: #! /bin/bashcat>test1test1<<EOF 这间没有空格 阅读全文
posted @ 2013-07-22 11:14 stallman 阅读(2173) 评论(0) 推荐(1) 编辑
摘要: Lua is a powerful, fast, lightweight, embeddable scripting language. "Lua" (pronounced LOO-ah) means "Moon" in Portuguese. http://www.lua.org http://www.lua.org/manual/5.2/ 阅读全文
posted @ 2013-07-07 16:18 stallman 阅读(525) 评论(0) 推荐(0) 编辑
摘要: 已知一个函数f可以等概率的得到1-5间的随机数,问怎么等概率的得到1-7的随机数。----连续调用函数f两次,就能得到5*5=25种可能的组合串;抛弃最后的四个组合串,就有21中可能性,正好是7的倍数。php的简陋实现如下:<?phpfunction rand5to7 ($p){ switch ($p) { case '11': case '12': case '13': return 1; break; case '14': case '15': ... 阅读全文
posted @ 2013-06-10 16:51 stallman 阅读(177) 评论(0) 推荐(0) 编辑
摘要: "When the only tool you have is a hammer, every problem begins to resemble a nail."当你手里唯一的工具是锤子时,所有的问题看起来就像是钉子。"He that is good with a hammer tends to think everything is a nail."善用锤子的人倾向于把所有的事都看成钉子。"If the only tool you have is a hammer, you tend to see every problem as a n 阅读全文
posted @ 2013-06-10 15:29 stallman 阅读(1636) 评论(0) 推荐(0) 编辑