<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ls /proc</title>
	<atom:link href="http://www.lsproc.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lsproc.com/blog</link>
	<description>lsproc.com</description>
	<lastBuildDate>Fri, 21 May 2010 14:29:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Nginx/PHP 文件类型错误解析漏洞：fix_pathinfo</title>
		<link>http://www.lsproc.com/blog/nginx_php_pathinfo_securit/</link>
		<comments>http://www.lsproc.com/blog/nginx_php_pathinfo_securit/#comments</comments>
		<pubDate>Fri, 21 May 2010 03:34:47 +0000</pubDate>
		<dc:creator>lostsnow</dc:creator>
				<category><![CDATA[Program&Database]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[pathinfo]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.lsproc.com/blog/?p=410</guid>
		<description><![CDATA[转载时请标明文章原始出处和作者信息, 作者: lostsnow.http://www.lsproc.com/blog/nginx_php_pathinfo_securit/ 漏洞介绍：nginx是一款高性能的web服务器，使用非常广泛，其不仅经常被用作反向代理，也可以非常好的支持PHP的运行。80sec发现其中存在一个较为严重的安全问题，默认情况下可能导致服务器错误的将任何类型的文件以PHP的方式进行解析，这将导致严重的安全问题，使得恶意的攻击者可能攻陷支持php的nginx服务器。 漏洞分析：nginx默认以cgi的方式支持php的运行，譬如在配置文件当中可以以 location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi_params; } 的方式支持对php的解析，location对请求进行选择的时候会使用URI环境变量进行选择，其中传递到后端Fastcgi的关键变量 SCRIPT_FILENAME由nginx生成的$fastcgi_script_name决定，而通过分析可以看到$fastcgi_script_name是直接由URI环境变量控制的，这里就是产生问题的点。而为了较好的支持PATH_INFO的提取，在PHP 的配置选项里存在cgi.fix_pathinfo选项，其目的是为了从SCRIPT_FILENAME里取出真正的脚本名。 那么假设存在一个http://www.lsproc.com/a.jpg，我们以如下的方式去访问 http://www.lsproc.com/a.jpg/xxx.php 将会得到一个URI /a.jpg/xxx.php 经过location指令，该请求将会交给后端的fastcgi处理，nginx为其设置环境变量SCRIPT_FILENAME，内容为 /scripts/a.jpg/xxx.php 而在其他的webserver如lighttpd当中，我们发现其中的SCRIPT_FILENAME被正确的设置为 /scripts/a.jpg 所以不存在此问题。 后端的fastcgi在接受到该选项时，会根据fix_pathinfo配置决定是否对SCRIPT_FILENAME进行额外的处理，一般情况下如果不对fix_pathinfo进行设置将影响使用PATH_INFO进行路由选择的应用，所以该选项一般配置开启。Php通过该选项之后将查找其中真正的脚本文件名字，查找的方式也是查看文件是否存在，这个时候将分离出SCRIPT_FILENAME和PATH_INFO分别为 /scripts/a.jpg和xxx.php 最后，以/scripts/a.jpg作为此次请求需要执行的脚本，攻击者就可以实现让nginx以php来解析任何类型的文件了。 PHP为什么会接受这样的参数, 并且把a.jpg解析呢? 这就要说到PHP的cgi SAPI中的参数, fix_pathinfo了: ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP&#039;s ; previous behaviour was to [...]]]></description>
			<content:encoded><![CDATA[<p>转载时请标明文章原始出处和作者信息, 作者: <a href="http://www.lsproc.com/blog/">lostsnow</a>.<br /><a href="http://www.lsproc.com/blog/nginx_php_pathinfo_securit/">http://www.lsproc.com/blog/nginx_php_pathinfo_securit/</a></p>
<p>漏洞介绍：nginx是一款高性能的web服务器，使用非常广泛，其不仅经常被用作反向代理，也可以非常好的支持PHP的运行。80sec发现其中存在一个较为严重的安全问题，默认情况下可能导致服务器错误的将任何类型的文件以PHP的方式进行解析，这将导致严重的安全问题，使得恶意的攻击者可能攻陷支持php的nginx服务器。</p>
<p>漏洞分析：nginx默认以cgi的方式支持php的运行，譬如在配置文件当中可以以</p>
<pre class="brush: text">
location ~ \.php$ {
    root html;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
    include fastcgi_params;
}
</pre>
<p>的方式支持对php的解析，location对请求进行选择的时候会使用URI环境变量进行选择，其中传递到后端Fastcgi的关键变量 SCRIPT_FILENAME由nginx生成的$fastcgi_script_name决定，而通过分析可以看到$fastcgi_script_name是直接由URI环境变量控制的，这里就是产生问题的点。而为了较好的支持PATH_INFO的提取，在PHP 的配置选项里存在cgi.fix_pathinfo选项，其目的是为了从SCRIPT_FILENAME里取出真正的脚本名。<br />
那么假设存在一个http://www.lsproc.com/a.jpg，我们以如下的方式去访问</p>
<pre class="brush: text">

http://www.lsproc.com/a.jpg/xxx.php
</pre>
<p>将会得到一个URI</p>
<pre class="brush: text">
/a.jpg/xxx.php
</pre>
<p>经过location指令，该请求将会交给后端的fastcgi处理，nginx为其设置环境变量SCRIPT_FILENAME，内容为</p>
<pre class="brush: text">
/scripts/a.jpg/xxx.php
</pre>
<p>而在其他的webserver如lighttpd当中，我们发现其中的SCRIPT_FILENAME被正确的设置为</p>
<pre class="brush: text">
/scripts/a.jpg
</pre>
<p>所以不存在此问题。<br />
后端的fastcgi在接受到该选项时，会根据fix_pathinfo配置决定是否对SCRIPT_FILENAME进行额外的处理，一般情况下如果不对fix_pathinfo进行设置将影响使用PATH_INFO进行路由选择的应用，所以该选项一般配置开启。Php通过该选项之后将查找其中真正的脚本文件名字，查找的方式也是查看文件是否存在，这个时候将分离出SCRIPT_FILENAME和PATH_INFO分别为</p>
<pre class="brush: text">
/scripts/a.jpg和xxx.php
</pre>
<p>最后，以/scripts/a.jpg作为此次请求需要执行的脚本，攻击者就可以实现让nginx以php来解析任何类型的文件了。</p>
<p>PHP为什么会接受这样的参数, 并且把a.jpg解析呢?<br />
这就要说到PHP的cgi SAPI中的参数, fix_pathinfo了:</p>
<pre class="brush: text">
; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP&#039;s
; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting
; this to 1 will cause PHP CGI to fix it&#039;s paths to conform to the spec. A setting
; of zero causes PHP to behave as before. Default is 1. You should fix your scripts
; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
cgi.fix_pathinfo=1
</pre>
<p>如果开启了这个选项, 那么就会触发在PHP中的如下逻辑:</p>
<pre class="brush: php">
/*
 * if the file doesn&#039;t exist, try to extract PATH_INFO out
 * of it by stat&#039;ing back through the &#039;/&#039;
 * this fixes url&#039;s like /info.php/test
 */
if (script_path_translated &amp;&amp;
     (script_path_translated_len = strlen(script_path_translated)) &gt; 0 &amp;&amp;
     (script_path_translated[script_path_translated_len-1] == &#039;/&#039; ||
//....以下省略.
</pre>
<p>到这里, PHP会认为SCRIPT_FILENAME是a.jpg, 而xxx.php是PATH_INFO, 然后PHP就把a.jpg当作一个PHP文件来解释执行… So…</p>
<p>POC： 访问一个nginx来支持php的站点，在一个任何资源的文件如robots.txt后面加上/xxx.php，这个时候你可以看到如下的区别：</p>
<p>访问http://www.lsproc.com/robots.txt</p>
<pre class="brush: text">
HTTP/1.1 200 OK
Server: nginx/0.6.32
Date: Thu, 20 May 2010 10:05:30 GMT
Content-Type: text/plain
Content-Length: 18
Last-Modified: Thu, 20 May 2010 06:26:34 GMT
Connection: keep-alive
Keep-Alive: timeout=20
Accept-Ranges: bytes
</pre>
<p>访问http://www.lsproc.com/robots.txt/xxx.php</p>
<pre class="brush: text">
HTTP/1.1 200 OK
Server: nginx/0.6.32
Date: Thu, 20 May 2010 10:06:49 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Keep-Alive: timeout=20
X-Powered-By: PHP/5.2.6
</pre>
<p>其中的Content-Type的变化说明了后端负责解析的变化，该站点就可能存在漏洞。</p>
<p>漏洞厂商：http://www.nginx.org</p>
<p>解决方案：</p>
<p>1. 修改php.ini中的cgi.fix_pathinfo为0 (即使你在php.ini中没有找到，也要设置，默认为1)<br />
2. 把nginx的判断正则修改为去除/</p>
<pre class="brush: text">
if ( $fastcgi_script_name ~ \..*\/.*php ) {
    return 403;
}
</pre>
<p>3. 如果上传的文件类型为图片, 使用 gd/imagemagick 等进行处理后再保存, 原始文件务必删除<br />
4. 上传的文件放到一个静态文件server, 此 server 不允许php 文件执行</p>
<p>本文参考链接</p>
<ul>
<li><a href="http://www.80sec.com/nginx-securit.html">http://www.80sec.com/nginx-securit.html</a></li>
<li><a href="http://www.laruence.com/2010/05/20/1495.html">http://www.laruence.com/2010/05/20/1495.html</a></li>
<li><a href="http://www.54chen.com/php-tech/nginx-php-cgi-of-security-hole.html">http://www.54chen.com/php-tech/nginx-php-cgi-of-security-hole.html</a></li>
</ul>
<p>-- EOF --</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>2010-04-12 -- <a href="http://www.lsproc.com/blog/nginx_userid_decode/" title="nginx userid 模块客户端 cookie 解码">nginx userid 模块客户端 cookie 解码</a> (0)</li><li>2010-03-08 -- <a href="http://www.lsproc.com/blog/use_ob_flush_on_nginx_fastcgi/" title="nginx+factcgi 下使用 ob_flush">nginx+factcgi 下使用 ob_flush</a> (0)</li><li>2009-03-29 -- <a href="http://www.lsproc.com/blog/nginx_ssl_config/" title="Nginx SSL 配置">Nginx SSL 配置</a> (23)</li><li>2008-10-23 -- <a href="http://www.lsproc.com/blog/nginx_rewrite_param/" title="nginx rewrite 的一些参数  ">nginx rewrite 的一些参数  </a> (1)</li><li>2008-06-15 -- <a href="http://www.lsproc.com/blog/lighttpd_phpfastcgi_config/" title="lighttpd + PHP(fastcgi) 配置">lighttpd + PHP(fastcgi) 配置</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.lsproc.com/blog/nginx_php_pathinfo_securit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>复制到剪切板 - 兼容 ie, firefox, chrome &amp; flash10</title>
		<link>http://www.lsproc.com/blog/copy_to_clipboard/</link>
		<comments>http://www.lsproc.com/blog/copy_to_clipboard/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 06:48:44 +0000</pubDate>
		<dc:creator>lostsnow</dc:creator>
				<category><![CDATA[Program&Database]]></category>
		<category><![CDATA[clipboard]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.lsproc.com/blog/?p=397</guid>
		<description><![CDATA[转载时请标明文章原始出处和作者信息, 作者: lostsnow.http://www.lsproc.com/blog/copy_to_clipboard/ 从 discuz! 里扒出来的(简易实现), 代码如下: var clipboardswfdata; var setcopy_gettext = function(){ clipboardswfdata = document.getElementById(&#039;data&#039;).value; window.document.clipboardswf.SetVariable(&#039;str&#039;, clipboardswfdata); } var floatwin = function(){ alert(&#039;copy success, &#039; + clipboardswfdata); } &#60;input type=&#34;text&#34; name=&#34;data&#34; value=&#34;xxxxx11111&#34; id =&#34;data&#34; /&#62; &#60;div id=&#34;clipboard_content&#34;&#62; &#60;span class=&#34;clipinner&#34; id=&#34;clipinner&#34;&#62;点此复制到剪贴板 &#60;embed name=&#34;clipboardswf&#34; class=&#34;clipboardswf&#34; id=&#34;clipboardswf&#34; onmouseover=&#34;setcopy_gettext()&#34; devicefont=&#34;false&#34; src=&#34;./clipboard.swf&#34; menu=&#34;false&#34; allowscriptaccess=&#34;sameDomain&#34; swliveconnect=&#34;true&#34; wmode=&#34;transparent&#34; type=&#34;application/x-shockwave-flash&#34; height=&#34;20&#34; width=&#34;100&#34;&#62;&#60;/span&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>转载时请标明文章原始出处和作者信息, 作者: <a href="http://www.lsproc.com/blog/">lostsnow</a>.<br /><a href="http://www.lsproc.com/blog/copy_to_clipboard/">http://www.lsproc.com/blog/copy_to_clipboard/</a></p>
<p>从 discuz! 里扒出来的(简易实现), 代码如下:</p>
<pre class="brush: javascript">
var clipboardswfdata;

var setcopy_gettext = function(){
    clipboardswfdata = document.getElementById(&#039;data&#039;).value;
    window.document.clipboardswf.SetVariable(&#039;str&#039;, clipboardswfdata);
}

var floatwin = function(){
    alert(&#039;copy success, &#039; + clipboardswfdata);
}
</pre>
<pre class="brush: xhtml">
&lt;input type=&quot;text&quot; name=&quot;data&quot; value=&quot;xxxxx11111&quot; id =&quot;data&quot; /&gt;
&lt;div id=&quot;clipboard_content&quot;&gt;
&lt;span class=&quot;clipinner&quot; id=&quot;clipinner&quot;&gt;点此复制到剪贴板
&lt;embed name=&quot;clipboardswf&quot; class=&quot;clipboardswf&quot; id=&quot;clipboardswf&quot; onmouseover=&quot;setcopy_gettext()&quot; devicefont=&quot;false&quot; src=&quot;./clipboard.swf&quot; menu=&quot;false&quot; allowscriptaccess=&quot;sameDomain&quot; swliveconnect=&quot;true&quot; wmode=&quot;transparent&quot; type=&quot;application/x-shockwave-flash&quot; height=&quot;20&quot; width=&quot;100&quot;&gt;&lt;/span&gt;
&lt;/div&gt;
</pre>
<pre class="brush: css">
&lt;style type=&quot;text/css&quot;&gt;
body {font-size:12px;}
.clipinner {position:relative;}
.clipboardswf {position:absolute; left:0; top:0;}
&lt;/style&gt;
</pre>
<p>实现稍微有些恶心, 用了个 onmouseover 事件往 flash 中传递数据</p>
<p>演示地址: <a href="http://www.lsproc.com/demo/clipboard/demo.html">http://www.lsproc.com/demo/clipboard/demo.html</a></p>
<p>另: google code 上有个 zeroclipboard 的项目, 如果想要方便的话, 也可以使用<br />
地址: <a href="http://code.google.com/p/zeroclipboard/">http://code.google.com/p/zeroclipboard/</a>
<p>-- EOF --</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>2009-01-08 -- <a href="http://www.lsproc.com/blog/ajax_char_lose/" title="Ajax 提交数据加号与连接符丢失">Ajax 提交数据加号与连接符丢失</a> (0)</li><li>2008-01-23 -- <a href="http://www.lsproc.com/blog/limit_textarea_length_by_js/" title="Js控制输入字符数限制">Js控制输入字符数限制</a> (0)</li><li>2008-01-12 -- <a href="http://www.lsproc.com/blog/auto_resize_images/" title="自动等比例缩放网页中的图片">自动等比例缩放网页中的图片</a> (0)</li><li>2007-05-13 -- <a href="http://www.lsproc.com/blog/html_or_xhtml/" title="HTML or XHTML, 关于web标准">HTML or XHTML, 关于web标准</a> (0)</li><li>2006-03-01 -- <a href="http://www.lsproc.com/blog/div-and-table-tags/" title="使用DIV之后,什么时候使用TABLE?">使用DIV之后,什么时候使用TABLE?</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.lsproc.com/blog/copy_to_clipboard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>nginx userid 模块客户端 cookie 解码</title>
		<link>http://www.lsproc.com/blog/nginx_userid_decode/</link>
		<comments>http://www.lsproc.com/blog/nginx_userid_decode/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 01:59:32 +0000</pubDate>
		<dc:creator>lostsnow</dc:creator>
				<category><![CDATA[Program&Database]]></category>
		<category><![CDATA[base64]]></category>
		<category><![CDATA[decode]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.lsproc.com/blog/?p=387</guid>
		<description><![CDATA[转载时请标明文章原始出处和作者信息, 作者: lostsnow.http://www.lsproc.com/blog/nginx_userid_decode/ 在网上看到用 ruby 解码的一段程序 http://forum.nginx.org/read.php?2,52592,52592 &#62; cookie_uid = &#34;0Cvz4ktwVPEdbRcMAwMFAg==&#34;; cc = cookie_uid.unpack(&#039;m*&#039;).first; rr = cc.split(&#34;&#34;).map{&#124;c&#124; c[0].to_i}.inject([]) {&#124;v,s&#124; v.push sprintf(&#34;%02X&#34;, s); v; }.values_at(3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12).join(&#34;&#34;) =&#62; &#34;E2F32BD0F154704B0C176D1D02050303&#34; 我用 PHP 写了一个 &#60;?php function nginx_userid_decode($str) { $str_unpacked = unpack(&#039;h*&#039;, base64_decode(str_replace(&#039; &#039;, &#039;+&#039;, $str))); [...]]]></description>
			<content:encoded><![CDATA[<p>转载时请标明文章原始出处和作者信息, 作者: <a href="http://www.lsproc.com/blog/">lostsnow</a>.<br /><a href="http://www.lsproc.com/blog/nginx_userid_decode/">http://www.lsproc.com/blog/nginx_userid_decode/</a></p>
<p>在网上看到用 ruby 解码的一段程序<br />
<a href="http://forum.nginx.org/read.php?2,52592,52592">http://forum.nginx.org/read.php?2,52592,52592</a></p>
<pre class="brush: ruby">
&gt; cookie_uid = &quot;0Cvz4ktwVPEdbRcMAwMFAg==&quot;; cc = cookie_uid.unpack(&#039;m*&#039;).first; rr = cc.split(&quot;&quot;).map{|c| c[0].to_i}.inject([]) {|v,s| v.push sprintf(&quot;%02X&quot;, s); v; }.values_at(3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12).join(&quot;&quot;)
=&gt; &quot;E2F32BD0F154704B0C176D1D02050303&quot;
</pre>
<p>我用 PHP 写了一个</p>
<pre class="brush: php">
&lt;?php
function nginx_userid_decode($str)
{
    $str_unpacked =  unpack(&#039;h*&#039;, base64_decode(str_replace(&#039; &#039;, &#039;+&#039;, $str)));
    $str_split = str_split(current($str_unpacked), 8);
    $str_map = array_map(&#039;strrev&#039;, $str_split);
    $str_dedoded = strtoupper(implode(&#039;&#039;, $str_map));

    return $str_dedoded;
}

// uid=8380A8C09A7E8C4B0A112CC202030303
echo nginx_userid_decode(&#039;wKiAg0uMfprCLBEKAwMDAg==&#039;);
</pre>
<p>update:</p>
<blockquote><p>
<strong>如果 base64 后的编码中含有 '+' , 在 url 传递中或是 $_COOKIE 数组读取中会被转换为空格</strong>
</p></blockquote>
<p>-- EOF --</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>2010-05-21 -- <a href="http://www.lsproc.com/blog/nginx_php_pathinfo_securit/" title="Nginx/PHP 文件类型错误解析漏洞：fix_pathinfo">Nginx/PHP 文件类型错误解析漏洞：fix_pathinfo</a> (2)</li><li>2010-03-08 -- <a href="http://www.lsproc.com/blog/use_ob_flush_on_nginx_fastcgi/" title="nginx+factcgi 下使用 ob_flush">nginx+factcgi 下使用 ob_flush</a> (0)</li><li>2009-03-29 -- <a href="http://www.lsproc.com/blog/nginx_ssl_config/" title="Nginx SSL 配置">Nginx SSL 配置</a> (23)</li><li>2008-10-23 -- <a href="http://www.lsproc.com/blog/nginx_rewrite_param/" title="nginx rewrite 的一些参数  ">nginx rewrite 的一些参数  </a> (1)</li><li>2008-06-15 -- <a href="http://www.lsproc.com/blog/lighttpd_phpfastcgi_config/" title="lighttpd + PHP(fastcgi) 配置">lighttpd + PHP(fastcgi) 配置</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.lsproc.com/blog/nginx_userid_decode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>nginx+factcgi 下使用 ob_flush</title>
		<link>http://www.lsproc.com/blog/use_ob_flush_on_nginx_fastcgi/</link>
		<comments>http://www.lsproc.com/blog/use_ob_flush_on_nginx_fastcgi/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 03:45:23 +0000</pubDate>
		<dc:creator>lostsnow</dc:creator>
				<category><![CDATA[Linux&Webserver]]></category>
		<category><![CDATA[buffer]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[ob_flush]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.lsproc.com/blog/?p=376</guid>
		<description><![CDATA[转载时请标明文章原始出处和作者信息, 作者: lostsnow.http://www.lsproc.com/blog/use_ob_flush_on_nginx_fastcgi/ Nginx与php-cgi是两个独立的程序，通过TCP或Unix套接字通信，不像Apache那样是集成在一起的。所以，Nginx有fastcgi 缓冲区，数据超出缓冲区大小、或程序执行完，才会将内容输出到客户端。如果要使用ob_flush，不能开启gzip压缩输出。 nginx.conf: fastcgi_buffer_size 4k; fastcgi_buffers 8 4k; gzip off; php.ini: output_buffering = Off &#60;?php set_time_limit(0); ob_end_clean(); ob_implicit_flush(1); for($i = 0; $i &#60; 10; $i++) { echo $i . &#34;&#60;br /&#62;\n&#34;; echo str_repeat(&#039;&#039;, 1024*4); sleep(1); } 其中 echo str_repeat('', 1024*4); 使得fastcgi_buffer_size 4k; 的缓冲区满，从而输出内容到浏览器 参考: http://blog.s135.com/nginx_php_v6/2/1/ -- EOF -- Related Posts2010-05-21 -- Nginx/PHP [...]]]></description>
			<content:encoded><![CDATA[<p>转载时请标明文章原始出处和作者信息, 作者: <a href="http://www.lsproc.com/blog/">lostsnow</a>.<br /><a href="http://www.lsproc.com/blog/use_ob_flush_on_nginx_fastcgi/">http://www.lsproc.com/blog/use_ob_flush_on_nginx_fastcgi/</a></p>
<p>Nginx与php-cgi是两个独立的程序，通过TCP或Unix套接字通信，不像Apache那样是集成在一起的。所以，Nginx有fastcgi 缓冲区，数据超出缓冲区大小、或程序执行完，才会将内容输出到客户端。<strong>如果要使用ob_flush，不能开启gzip压缩输出。</strong></p>
<p>nginx.conf:</p>
<pre class="brush: text">fastcgi_buffer_size 4k;
fastcgi_buffers 8 4k;
gzip off;</pre>
<p>php.ini:</p>
<pre class="brush: text">
output_buffering = Off
</pre>
<pre class="brush: php">
&lt;?php
set_time_limit(0);
ob_end_clean();
ob_implicit_flush(1);

for($i = 0; $i &lt; 10; $i++)
{
    echo $i . &quot;&lt;br /&gt;\n&quot;;
    echo str_repeat(&#039;&#039;, 1024*4);
    sleep(1);
}
</pre>
<p>其中 echo str_repeat('', 1024*4);<br />
使得fastcgi_buffer_size 4k; 的缓冲区满，从而输出内容到浏览器</p>
<p>参考: http://blog.s135.com/nginx_php_v6/2/1/
<p>-- EOF --</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>2010-05-21 -- <a href="http://www.lsproc.com/blog/nginx_php_pathinfo_securit/" title="Nginx/PHP 文件类型错误解析漏洞：fix_pathinfo">Nginx/PHP 文件类型错误解析漏洞：fix_pathinfo</a> (2)</li><li>2010-04-12 -- <a href="http://www.lsproc.com/blog/nginx_userid_decode/" title="nginx userid 模块客户端 cookie 解码">nginx userid 模块客户端 cookie 解码</a> (0)</li><li>2008-06-15 -- <a href="http://www.lsproc.com/blog/lighttpd_phpfastcgi_config/" title="lighttpd + PHP(fastcgi) 配置">lighttpd + PHP(fastcgi) 配置</a> (0)</li><li>2009-03-29 -- <a href="http://www.lsproc.com/blog/nginx_ssl_config/" title="Nginx SSL 配置">Nginx SSL 配置</a> (23)</li><li>2008-10-23 -- <a href="http://www.lsproc.com/blog/nginx_rewrite_param/" title="nginx rewrite 的一些参数  ">nginx rewrite 的一些参数  </a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.lsproc.com/blog/use_ob_flush_on_nginx_fastcgi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>python 抓取页面</title>
		<link>http://www.lsproc.com/blog/python_spider/</link>
		<comments>http://www.lsproc.com/blog/python_spider/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 06:34:31 +0000</pubDate>
		<dc:creator>lostsnow</dc:creator>
				<category><![CDATA[Program&Database]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[spider]]></category>

		<guid isPermaLink="false">http://www.lsproc.com/blog/?p=363</guid>
		<description><![CDATA[转载时请标明文章原始出处和作者信息, 作者: lostsnow.http://www.lsproc.com/blog/python_spider/ #coding=utf-8 import sys import urllib2 import gzip import StringIO # 页面url url = &#34;http://china.toocle.com/company/show/pdetail--1000436--10532651.html&#34; # 页面编码 page_encode = &#34;gbk&#34; request = urllib2.Request(url) request.add_header(&#34;Accept-encoding&#34;, &#34;gzip&#34;) usock = urllib2.urlopen(request) page = usock.read() # 处理gzip过的页面 if usock.headers.get(&#039;content-encoding&#039;, None) == &#039;gzip&#039;: page = gzip.GzipFile(fileobj=StringIO.StringIO(page)).read() # 转unicode(gbk/utf8) if not isinstance(page, unicode): page = unicode(page, page_encode) print(page) -- [...]]]></description>
			<content:encoded><![CDATA[<p>转载时请标明文章原始出处和作者信息, 作者: <a href="http://www.lsproc.com/blog/">lostsnow</a>.<br /><a href="http://www.lsproc.com/blog/python_spider/">http://www.lsproc.com/blog/python_spider/</a></p>
<pre class="brush: python">
#coding=utf-8

import sys
import urllib2
import gzip
import StringIO

# 页面url
url = &quot;http://china.toocle.com/company/show/pdetail--1000436--10532651.html&quot;
# 页面编码
page_encode = &quot;gbk&quot;

request = urllib2.Request(url)
request.add_header(&quot;Accept-encoding&quot;, &quot;gzip&quot;)
usock = urllib2.urlopen(request)
page = usock.read()
# 处理gzip过的页面
if usock.headers.get(&#039;content-encoding&#039;, None) == &#039;gzip&#039;:
    page = gzip.GzipFile(fileobj=StringIO.StringIO(page)).read()

# 转unicode(gbk/utf8)
if not isinstance(page, unicode):
    page = unicode(page, page_encode)

print(page)
</pre>
<p>-- EOF --</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>2008-11-10 -- <a href="http://www.lsproc.com/blog/python_pil/" title="python图形处理库Python Imaging Library (PIL)">python图形处理库Python Imaging Library (PIL)</a> (0)</li><li>2008-11-05 -- <a href="http://www.lsproc.com/blog/configure_python_and_django_on_dreamhost/" title="Dreamhost 上编译python并安装django">Dreamhost 上编译python并安装django</a> (7)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.lsproc.com/blog/python_spider/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>firefox crashes again and again</title>
		<link>http://www.lsproc.com/blog/firefox_crashes_again_and_again/</link>
		<comments>http://www.lsproc.com/blog/firefox_crashes_again_and_again/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 02:49:21 +0000</pubDate>
		<dc:creator>lostsnow</dc:creator>
				<category><![CDATA[HoradricCube]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[yslow]]></category>

		<guid isPermaLink="false">http://www.lsproc.com/blog/?p=356</guid>
		<description><![CDATA[转载时请标明文章原始出处和作者信息, 作者: lostsnow.http://www.lsproc.com/blog/firefox_crashes_again_and_again/ 有图有真相 http://crash-stats.mozilla.com/report/index/4e66ca79-89a8-476c-a394-f824d2100125 yslow 是罪魁祸首 -- EOF -- Related Posts2007-07-16 -- Ubuntu 下安装 Tor (0)2006-03-06 -- 我用的Firefox扩展 (0)2006-03-01 -- Web设计札记 (1)]]></description>
			<content:encoded><![CDATA[<p>转载时请标明文章原始出处和作者信息, 作者: <a href="http://www.lsproc.com/blog/">lostsnow</a>.<br /><a href="http://www.lsproc.com/blog/firefox_crashes_again_and_again/">http://www.lsproc.com/blog/firefox_crashes_again_and_again/</a></p>
<p>有图有真相<br />
<a href="http://www.lsproc.com/blog/wp-content/uploads/2010/01/ff-crashes.jpg"><img src="http://www.lsproc.com/blog/wp-content/uploads/2010/01/ff-crashes.jpg" alt="" title="ff-crashes" width="538" height="366" class="alignnone size-full wp-image-357" /></a></p>
<p><a href="http://crash-stats.mozilla.com/report/index/4e66ca79-89a8-476c-a394-f824d2100125">http://crash-stats.mozilla.com/report/index/4e66ca79-89a8-476c-a394-f824d2100125</a><br />
yslow 是罪魁祸首
<p>-- EOF --</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>2007-07-16 -- <a href="http://www.lsproc.com/blog/install_tor_under_ubuntu/" title="Ubuntu 下安装 Tor">Ubuntu 下安装 Tor</a> (0)</li><li>2006-03-06 -- <a href="http://www.lsproc.com/blog/my-firefox-extensions/" title="我用的Firefox扩展">我用的Firefox扩展</a> (0)</li><li>2006-03-01 -- <a href="http://www.lsproc.com/blog/web-design-tips/" title="Web设计札记">Web设计札记</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.lsproc.com/blog/firefox_crashes_again_and_again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>accessibility hosts</title>
		<link>http://www.lsproc.com/blog/accessibility_hosts/</link>
		<comments>http://www.lsproc.com/blog/accessibility_hosts/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 01:58:51 +0000</pubDate>
		<dc:creator>lostsnow</dc:creator>
				<category><![CDATA[HoradricCube]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[hosts]]></category>

		<guid isPermaLink="false">http://www.lsproc.com/blog/?p=350</guid>
		<description><![CDATA[转载时请标明文章原始出处和作者信息, 作者: lostsnow.http://www.lsproc.com/blog/accessibility_hosts/ New: add dropbox # dropbox 174.36.30.71 dropbox.com 174.36.30.71 www.dropbox.com 75.101.129.115 dl.dropbox.com 75.101.159.151 dl-web.dropbox.com 174.36.30.71 forums.dropbox.com #Search 74.125.39.99 www.google.com 74.125.39.103 www.google.com 74.125.39.104 www.google.com 74.125.39.105 www.l.google.com #Images 74.125.39.99 images.google.com 74.125.39.103 images.google.com 74.125.39.104 images.google.com 74.125.39.105 images.google.com 74.125.39.106 images.google.com 74.125.39.147 images.google.com 74.125.77.99 tbn0.google.com 74.125.77.99 tbn1.google.com 74.125.77.103 tbn2.google.com 74.125.77.104 tbn3.google.com 74.125.77.105 tbn4.google.com 74.125.77.106 tbn5.google.com 74.125.77.147 tbn6.google.com #Shopping [...]]]></description>
			<content:encoded><![CDATA[<p>转载时请标明文章原始出处和作者信息, 作者: <a href="http://www.lsproc.com/blog/">lostsnow</a>.<br /><a href="http://www.lsproc.com/blog/accessibility_hosts/">http://www.lsproc.com/blog/accessibility_hosts/</a></p>
<blockquote><p>New: add dropbox</p></blockquote>
<p># dropbox<br />
174.36.30.71    dropbox.com<br />
174.36.30.71     www.dropbox.com<br />
75.101.129.115  dl.dropbox.com<br />
75.101.159.151  dl-web.dropbox.com<br />
174.36.30.71    forums.dropbox.com</p>
<p>#Search<br />
74.125.39.99    www.google.com<br />
74.125.39.103   www.google.com<br />
74.125.39.104   www.google.com<br />
74.125.39.105   www.l.google.com</p>
<p>#Images<br />
74.125.39.99    images.google.com<br />
74.125.39.103   images.google.com<br />
74.125.39.104   images.google.com<br />
74.125.39.105   images.google.com<br />
74.125.39.106   images.google.com<br />
74.125.39.147   images.google.com<br />
74.125.77.99    tbn0.google.com<br />
74.125.77.99    tbn1.google.com<br />
74.125.77.103   tbn2.google.com<br />
74.125.77.104   tbn3.google.com<br />
74.125.77.105   tbn4.google.com<br />
74.125.77.106   tbn5.google.com<br />
74.125.77.147   tbn6.google.com</p>
<p>#Shopping<br />
74.125.39.99    base0.googlehosted.com<br />
74.125.39.103   base1.googlehosted.com<br />
74.125.39.104   base2.googlehosted.com<br />
74.125.39.105   base3.googlehosted.com<br />
74.125.39.106   base4.googlehosted.com<br />
74.125.39.147   base5.googlehosted.com</p>
<p>#Books<br />
74.125.39.100   books.google.com<br />
74.125.39.101   books.google.com<br />
74.125.39.102   books.google.com<br />
74.125.39.113   books.google.com<br />
74.125.39.138   books.google.com<br />
74.125.39.139   books.google.com<br />
74.125.39.100   bks0.books.google.com<br />
74.125.39.100   bks1.books.google.com<br />
74.125.39.101   bks2.books.google.com<br />
74.125.39.102   bks3.books.google.com<br />
74.125.39.113   bks4.books.google.com<br />
74.125.39.138   bks5.books.google.com<br />
74.125.39.139   bks6.books.google.com<br />
74.125.39.113   bks7.books.google.com<br />
74.125.39.138   bks8.books.google.com<br />
74.125.39.139   bks9.books.google.com</p>
<p>#Video<br />
74.125.39.100   video.google.com<br />
74.125.39.101   video.google.com<br />
74.125.39.102   video.google.com<br />
74.125.39.113   video.google.com<br />
74.125.39.138   video.google.com<br />
74.125.39.139   video.google.com<br />
74.125.39.100   0.gvt0.com<br />
74.125.39.101   1.gvt0.com<br />
74.125.39.102   2.gvt0.com<br />
74.125.39.113   3.gvt0.com<br />
74.125.39.138   4.gvt0.com<br />
74.125.39.139   5.gvt0.com</p>
<p>#Mail(POP3/SMTP)<br />
209.85.147.109  pop.gmail.com<br />
209.85.147.109  smtp.gmail.com</p>
<p>#WebMail<br />
64.233.189.18   mail.google.com<br />
64.233.189.19   mail.google.com<br />
64.233.189.83   mail.google.com<br />
64.233.189.18   www.gmail.com<br />
64.233.189.19   www.gmail.com<br />
64.233.189.83   www.gmail.com<br />
64.233.189.19   googlemail.l.google.com</p>
<p>#Docs<br />
64.233.189.101  writely-china.l.google.com<br />
64.233.189.101  writely.l.google.com<br />
64.233.189.102  docs.google.com<br />
64.233.189.101  docs.google.com<br />
64.233.189.100  docs.google.com</p>
<p>#Map<br />
64.233.189.104  map.google.com<br />
64.233.189.99   map.google.com<br />
64.233.189.147  map.google.com<br />
64.233.189.104  maps.google.com<br />
64.233.189.99   maps.google.com<br />
64.233.189.147  maps.google.com<br />
64.233.189.99   maps.gstatic.com<br />
203.208.39.93   khm.google.com<br />
203.208.39.91   mt0.google.com<br />
203.208.39.93   mt1.google.com<br />
203.208.39.91   mt2.google.com<br />
203.208.39.91   mt.l.google.com<br />
64.233.189.99   maps.l.google.com</p>
<p>#Scholar<br />
64.233.189.99   scholar.google.com<br />
64.233.189.104  scholar.google.com<br />
64.233.189.147  scholar.google.com<br />
64.233.189.104  scholar.l.google.com</p>
<p>#Group<br />
64.233.189.102  groups.google.com<br />
64.233.189.100  groups.google.com<br />
64.233.189.101  groups.google.com<br />
64.233.189.101  groups.l.google.com</p>
<p>#Picasa<br />
74.125.39.147   picasa.google.com<br />
74.125.39.91    photos.google.com<br />
74.125.39.91    picasaweb.google.com<br />
74.125.39.93    picasaweb.google.com<br />
74.125.39.136   picasaweb.google.com<br />
74.125.39.190   picasaweb.google.com<br />
74.125.39.91    lh0.ggpht.com<br />
74.125.39.93    lh1.ggpht.com<br />
74.125.39.136   lh2.ggpht.com<br />
74.125.39.190   lh3.ggpht.com<br />
74.125.39.91    lh4.ggpht.com<br />
74.125.39.93    lh5.ggpht.com<br />
74.125.39.136   lh6.ggpht.com<br />
74.125.39.190   lh7.ggpht.com<br />
203.208.39.104 picadaweb.google.com<br />
203.208.39.104 lh1.ggpht.com<br />
203.208.39.104 lh2.ggpht.com<br />
203.208.39.104 lh3.ggpht.com<br />
203.208.39.104 lh4.ggpht.com<br />
203.208.39.104 lh5.ggpht.com<br />
203.208.39.104 lh6.ggpht.com</p>
<p>#Translate<br />
74.125.39.100   translate.google.com<br />
74.125.39.101   translate.google.com<br />
74.125.39.102   translate.google.com<br />
74.125.39.113   translate.google.com<br />
74.125.39.138   translate.google.com<br />
74.125.39.139   translate.google.com</p>
<p>#Reader<br />
74.125.39.99    reader.google.com<br />
74.125.39.103   reader.google.com<br />
74.125.39.104   reader.google.com<br />
74.125.39.105   reader.google.com<br />
74.125.39.106   reader.google.com</p>
<p>#Sites<br />
64.233.161.9    sites.google.com<br />
74.125.53.9     sites.google.com<br />
74.125.39.102   sites.google.com<br />
74.125.39.139   sites.google.com<br />
74.125.45.9     sites.google.com<br />
74.125.39.139   sites.google.com</p>
<p>#Code<br />
74.125.53.9     code.google.com<br />
74.125.45.9     code.google.com<br />
64.233.161.9    code.google.com<br />
74.125.39.102   code.google.com<br />
209.85.137.9    code.google.com<br />
74.125.39.139   code.l.google.com</p>
<p>#Labs<br />
74.125.39.141   www.googlelabs.com<br />
74.125.39.141   appspot.l.google.com<br />
74.125.39.100   labs.google.com<br />
74.125.39.101   labs.google.com<br />
74.125.39.102   labs.google.com<br />
74.125.39.113   labs.google.com<br />
74.125.39.138   labs.google.com<br />
74.125.39.139   labs.google.com</p>
<p>#Knol<br />
74.125.39.100   knol.google.com<br />
74.125.39.101   knol.google.com<br />
74.125.39.102   knol.google.com<br />
74.125.39.113   knol.google.com<br />
74.125.39.138   knol.google.com<br />
74.125.39.139   knol.google.com</p>
<p>#Sketchup<br />
74.125.39.99    sketchup.google.com<br />
74.125.39.103   sketchup.google.com<br />
74.125.39.104   sketchup.google.com<br />
74.125.39.105   sketchup.google.com<br />
74.125.39.106   sketchup.google.com</p>
<p>#Pack<br />
74.125.39.99    pack.google.com<br />
74.125.39.103   pack.google.com<br />
74.125.39.104   pack.google.com<br />
74.125.39.105   pack.google.com<br />
74.125.39.106   pack.google.com</p>
<p>#News<br />
74.125.39.99    news.google.com<br />
74.125.39.103   news.google.com<br />
74.125.39.104   news.google.com<br />
74.125.39.105   news.google.com<br />
74.125.39.106   news.google.com<br />
74.125.39.147   news.google.com<br />
74.125.39.99    nt0.ggpht.com<br />
74.125.39.103   nt1.ggpht.com<br />
74.125.39.104   nt2.ggpht.com<br />
74.125.39.105   nt3.ggpht.com<br />
74.125.39.106   nt4.ggpht.com<br />
74.125.39.147   nt5.ggpht.com</p>
<p>#Calendar<br />
74.125.39.100   calendar.google.com<br />
74.125.39.101   calendar.google.com<br />
74.125.39.102   calendar.google.com<br />
74.125.39.113   calendar.google.com<br />
74.125.39.138   calendar.google.com<br />
74.125.39.139   calendar.google.com</p>
<p>#Blogger<br />
74.125.39.191   www.blogger.com<br />
74.125.39.191   blogger.l.google.com<br />
74.125.39.191   blogger.google.com</p>
<p>#Orkut<br />
74.125.47.85    www.orkut.com<br />
74.125.47.86    www.orkut.com<br />
74.125.47.85    orkut.google.com<br />
74.125.47.86    orkut.l.google.com</p>
<p>#Youtube<br />
74.125.39.100   www.youtube.com<br />
74.125.39.101   www.youtube.com<br />
74.125.39.102   www.youtube.com<br />
74.125.39.113   www.youtube.com</p>
<p>#Toolbar<br />
74.125.39.100   toolbar.google.com<br />
74.125.39.101   toolbar.google.com<br />
74.125.39.102   toolbar.google.com<br />
74.125.39.113   toolbar.google.com</p>
<p>#Apps<br />
74.125.39.99    apps.google.com<br />
74.125.39.103   apps.google.com<br />
74.125.39.104   apps.google.com<br />
74.125.39.115   apps.google.com</p>
<p>#Chrome<br />
74.125.39.99    chrome.google.com<br />
74.125.39.103   chrome.google.com<br />
74.125.39.104   chrome.google.com<br />
74.125.39.115   chrome.google.com</p>
<p>#Finance<br />
74.125.39.99    finance.google.com<br />
74.125.39.103   finance.google.com<br />
74.125.39.104   finance.google.com<br />
74.125.39.115   finance.google.com</p>
<p>#Desktop<br />
74.125.39.99    desktop.google.com<br />
74.125.39.103   desktop.google.com<br />
74.125.39.104   desktop.google.com<br />
74.125.39.115   desktop.google.com</p>
<p>#Ajax<br />
74.125.53.9     ajax.googleapis.com<br />
74.125.45.9     ajax.googleapis.com<br />
64.233.161.9    ajax.googleapis.com<br />
209.85.137.9    ajax.googleapis.com<br />
72.14.203.9     googleapis-ajax.l.google.com</p>
<p>#Modules<br />
74.125.39.132   1.ig.gmodules.com<br />
74.125.39.132   2.ig.gmodules.com<br />
74.125.39.132   3.ig.gmodules.com<br />
74.125.39.132   4.ig.gmodules.com<br />
74.125.39.132   5.ig.gmodules.com<br />
74.125.39.132   6.ig.gmodules.com</p>
<p>#Misc<br />
64.233.189.101  id.google.com<br />
64.233.189.102  id.google.com<br />
64.233.189.100  id.google.com<br />
64.233.189.100  id.l.google.com<br />
74.125.39.132   skins.gmodules.com<br />
74.125.39.132   googlehosted.l.google.com<br />
74.125.39.132   img0.gmodules.com<br />
74.125.39.99    blogsearch.google.com<br />
74.125.39.99    www2.l.google.com<br />
74.125.39.99    www.gstatic.com<br />
74.125.39.100   www3.l.google.com<br />
74.125.39.99    buttons.googlesyndication.com</p>
<p>#twitter<br />
<del datetime="2010-01-26T02:19:12+00:00">168.143.161.20 twitter.com<br />
168.143.161.20 www.twitter.com<br />
128.121.146.229 assets0.twitter.com<br />
128.121.146.229 assets1.twitter.com<br />
128.121.146.101 static.twitter.com<br />
128.121.146.229 assets2.twitter.com<br />
128.121.146.229 assets3.twitter.com<br />
65.74.185.41 twitter.zendesk.com<br />
65.74.185.41 help.twitter.com<br />
168.143.162.107 search.twitter.com</del></p>
<p>#facebook<br />
<del datetime="2010-01-26T02:19:12+00:00">124.40.42.105 www.facebook.com<br />
69.63.180.173 login.facebook.com<br />
69.192.34.110 s-static.ak.facebook.com<br />
69.63.176.69 secure-profile.facebook.com<br />
69.63.176.59 secure-media-sf2p.facebook.com<br />
69.63.178.13 ssl.facebook.com<br />
96.6.122.57 profile.ak.facebook.com<br />
64.211.21.152 b.static.ak.facebook.com<br />
</del></p>
<p>#wikipedia<br />
208.80.152.2 wikipedia.org<br />
208.80.152.2 www.wikipedia.org<br />
208.80.152.2 en.wikipedia.org<br />
208.80.152.2 zh.wikipedia.org</p>
<p>to be continued.......
<p>-- EOF --</p>
<h3  class="related_post_title">Random Posts</h3><ul class="related_post"><li>2010-04-12 -- <a href="http://www.lsproc.com/blog/nginx_userid_decode/" title="nginx userid 模块客户端 cookie 解码">nginx userid 模块客户端 cookie 解码</a> (0)</li><li>2006-03-01 -- <a href="http://www.lsproc.com/blog/div-and-table-tags/" title="使用DIV之后,什么时候使用TABLE?">使用DIV之后,什么时候使用TABLE?</a> (1)</li><li>2008-08-31 -- <a href="http://www.lsproc.com/blog/install_network_card_driver_on_ubuntu/" title="ubuntu 安装Intel PRO100/1000系列网卡驱动">ubuntu 安装Intel PRO100/1000系列网卡驱动</a> (0)</li><li>2007-11-13 -- <a href="http://www.lsproc.com/blog/cakephp_callback_function/" title="Cakephp 的回调函数">Cakephp 的回调函数</a> (0)</li><li>2007-07-10 -- <a href="http://www.lsproc.com/blog/the_end_of_the_fcitx/" title=" Fcitx小企鹅输入法开源项目终止"> Fcitx小企鹅输入法开源项目终止</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.lsproc.com/blog/accessibility_hosts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bash if条件判断参数</title>
		<link>http://www.lsproc.com/blog/bash_if_parameters/</link>
		<comments>http://www.lsproc.com/blog/bash_if_parameters/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 06:10:44 +0000</pubDate>
		<dc:creator>lostsnow</dc:creator>
				<category><![CDATA[Linux&Webserver]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.lsproc.com/blog/?p=348</guid>
		<description><![CDATA[转载时请标明文章原始出处和作者信息, 作者: lostsnow.http://www.lsproc.com/blog/bash_if_parameters/ [ -a FILE ] 如果 FILE 存在则为真。 [ -b FILE ] 如果 FILE 存在且是一个块特殊文件则为真。 [ -c FILE ] 如果 FILE 存在且是一个字特殊文件则为真。 [ -d FILE ] 如果 FILE 存在且是一个目录则为真。 [ -e FILE ] 如果 FILE 存在则为真。 [ -f FILE ] 如果 FILE 存在且是一个普通文件则为真。 [ -g FILE ] 如果 FILE 存在且已经设置了SGID则为真。 [ -h FILE [...]]]></description>
			<content:encoded><![CDATA[<p>转载时请标明文章原始出处和作者信息, 作者: <a href="http://www.lsproc.com/blog/">lostsnow</a>.<br /><a href="http://www.lsproc.com/blog/bash_if_parameters/">http://www.lsproc.com/blog/bash_if_parameters/</a></p>
<p>[ -a FILE ] 如果 FILE 存在则为真。</p>
<p>[ -b FILE ] 如果 FILE 存在且是一个块特殊文件则为真。</p>
<p>[ -c FILE ] 如果 FILE 存在且是一个字特殊文件则为真。</p>
<p>[ -d FILE ] 如果 FILE 存在且是一个目录则为真。</p>
<p>[ -e FILE ] 如果 FILE 存在则为真。</p>
<p>[ -f FILE ] 如果 FILE 存在且是一个普通文件则为真。</p>
<p>[ -g FILE ] 如果 FILE 存在且已经设置了SGID则为真。</p>
<p>[ -h FILE ] 如果 FILE 存在且是一个符号连接则为真。</p>
<p>[ -k FILE ] 如果 FILE 存在且已经设置了粘制位则为真。</p>
<p>[ -p FILE ] 如果 FILE 存在且是一个名字管道(F如果O)则为真。</p>
<p>[ -r FILE ] 如果 FILE 存在且是可读的则为真。</p>
<p>[ -s FILE ] 如果 FILE 存在且大小不为0则为真。</p>
<p>[ -t FD ] 如果文件描述符 FD 打开且指向一个终端则为真。</p>
<p>[ -u FILE ] 如果 FILE 存在且设置了SUID (set user ID)则为真。</p>
<p>[ -w FILE ] 如果 FILE 如果 FILE 存在且是可写的则为真。</p>
<p>[ -x FILE ] 如果 FILE 存在且是可执行的则为真。</p>
<p>[ -O FILE ] 如果 FILE 存在且属有效用户ID则为真。</p>
<p>[ -G FILE ] 如果 FILE 存在且属有效用户组则为真。</p>
<p>[ -L FILE ] 如果 FILE 存在且是一个符号连接则为真。</p>
<p>[ -N FILE ] 如果 FILE 存在 and has been mod如果ied since it was last read则为真。</p>
<p>[ -S FILE ] 如果 FILE 存在且是一个套接字则为真。</p>
<p>[ FILE1 -nt FILE2 ] 如果 FILE1 has been changed more recently than FILE2, or 如果 FILE1FILE2 does not则为真。</p>
<p>exists and [ FILE1 -ot FILE2 ] 如果 FILE1 比 FILE2 要老, 或者 FILE2 存在且 FILE1 不存在则为真。</p>
<p>[ FILE1 -ef FILE2 ] 如果 FILE1 和 FILE2 指向相同的设备和节点号则为真。</p>
<p>[ -o OPTIONNAME ] 如果 shell选项 “OPTIONNAME” 开启则为真。</p>
<p>[ -z STRING ] “STRING” 的长度为零则为真。</p>
<p>[ -n STRING ] or [ STRING ] “STRING” 的长度为非零 non-zero则为真。</p>
<p>[ STRING1 == STRING2 ] 如果2个字符串相同。 “=” may be used instead of “==” for strict POSIX compliance则为真。</p>
<p>[ STRING1 != STRING2 ] 如果字符串不相等则为真。</p>
<p>[ STRING1 < STRING2 ] 如果 “STRING1” sorts before “STRING2” lexicographically in the current locale则为真。</p>
<p>[ STRING1 > STRING2 ] 如果 “STRING1” sorts after “STRING2” lexicographically in the current locale则为真。</p>
<p><del datetime="2010-01-15T06:10:51+00:00">原文(已失效): http://hi.baidu.com/starlotus/blog/item/5707aeca34af14f753664f38.html </del>
<p>-- EOF --</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>2010-01-09 -- <a href="http://www.lsproc.com/blog/linux_timeline/" title="linux timeline">linux timeline</a> (2)</li><li>2008-12-16 -- <a href="http://www.lsproc.com/blog/linux_webserver_cmd/" title="Webserver 维护常用命令">Webserver 维护常用命令</a> (9)</li><li>2008-11-10 -- <a href="http://www.lsproc.com/blog/useful_linux_command/" title="一些 linux 命令">一些 linux 命令</a> (0)</li><li>2008-08-31 -- <a href="http://www.lsproc.com/blog/install_network_card_driver_on_ubuntu/" title="ubuntu 安装Intel PRO100/1000系列网卡驱动">ubuntu 安装Intel PRO100/1000系列网卡驱动</a> (0)</li><li>2008-03-18 -- <a href="http://www.lsproc.com/blog/configure_lamp/" title="lamp 相关配置 [Debian]">lamp 相关配置 [Debian]</a> (2)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.lsproc.com/blog/bash_if_parameters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cacti 图片中文乱码问题</title>
		<link>http://www.lsproc.com/blog/cacti_graph_with_chinese/</link>
		<comments>http://www.lsproc.com/blog/cacti_graph_with_chinese/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 09:02:56 +0000</pubDate>
		<dc:creator>lostsnow</dc:creator>
				<category><![CDATA[Linux&Webserver]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[乱码]]></category>

		<guid isPermaLink="false">http://www.lsproc.com/blog/?p=343</guid>
		<description><![CDATA[转载时请标明文章原始出处和作者信息, 作者: lostsnow.http://www.lsproc.com/blog/cacti_graph_with_chinese/ 首先你需要一个中文字体 如simsun 等 将它放进 /usr/share/fonts目录中 然后执行下面的命令刷新字体缓存 fc-cache -f -v 然后再cacti 中设置 默认字体的路径为你使用的中文字体的路径 测试发现, 字体只能放到系统字体路径当中, 并要刷新字体缓存 -- EOF -- Related Posts2008-03-05 -- 解决webalizer 汉化后图表中乱码的问题 (0)2006-12-27 -- 再谈Wordpress的MySQL乱码问题解决方法 (3)2006-02-26 -- 一切又重新开始了 (0)]]></description>
			<content:encoded><![CDATA[<p>转载时请标明文章原始出处和作者信息, 作者: <a href="http://www.lsproc.com/blog/">lostsnow</a>.<br /><a href="http://www.lsproc.com/blog/cacti_graph_with_chinese/">http://www.lsproc.com/blog/cacti_graph_with_chinese/</a></p>
<p>首先你需要一个中文字体<br />
如simsun 等<br />
将它放进 /usr/share/fonts目录中</p>
<p>然后执行下面的命令刷新字体缓存</p>
<pre class="brush: shell">fc-cache -f -v</pre>
<p>然后再cacti 中设置 默认字体的路径为你使用的中文字体的路径</p>
<p>测试发现, 字体只能放到系统字体路径当中, 并要刷新字体缓存</p>
<p><a href="http://www.lsproc.com/blog/wp-content/uploads/2010/01/localhost_memory.png"><img src="http://www.lsproc.com/blog/wp-content/uploads/2010/01/localhost_memory-600x227.png" alt="" title="localhost_memory" width="600" height="227" class="alignnone size-medium wp-image-346" /></a>
<p>-- EOF --</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>2008-03-05 -- <a href="http://www.lsproc.com/blog/webalizer_graphs_bad_encode/" title="解决webalizer 汉化后图表中乱码的问题">解决webalizer 汉化后图表中乱码的问题</a> (0)</li><li>2006-12-27 -- <a href="http://www.lsproc.com/blog/mysql_encode_error_in_wordpress/" title="再谈Wordpress的MySQL乱码问题解决方法">再谈Wordpress的MySQL乱码问题解决方法</a> (3)</li><li>2006-02-26 -- <a href="http://www.lsproc.com/blog/all-restart/" title="一切又重新开始了">一切又重新开始了</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.lsproc.com/blog/cacti_graph_with_chinese/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>linux timeline</title>
		<link>http://www.lsproc.com/blog/linux_timeline/</link>
		<comments>http://www.lsproc.com/blog/linux_timeline/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 05:45:42 +0000</pubDate>
		<dc:creator>lostsnow</dc:creator>
				<category><![CDATA[Linux&Webserver]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[timeline]]></category>

		<guid isPermaLink="false">http://www.lsproc.com/blog/?p=335</guid>
		<description><![CDATA[转载时请标明文章原始出处和作者信息, 作者: lostsnow.http://www.lsproc.com/blog/linux_timeline/ -- EOF -- Related Posts2010-01-15 -- bash if条件判断参数 (0)2008-12-16 -- Webserver 维护常用命令 (9)2008-11-10 -- 一些 linux 命令 (0)2008-08-31 -- ubuntu 安装Intel PRO100/1000系列网卡驱动 (0)2008-03-18 -- lamp 相关配置 [Debian] (2)]]></description>
			<content:encoded><![CDATA[<p>转载时请标明文章原始出处和作者信息, 作者: <a href="http://www.lsproc.com/blog/">lostsnow</a>.<br /><a href="http://www.lsproc.com/blog/linux_timeline/">http://www.lsproc.com/blog/linux_timeline/</a></p>
<p><div id="attachment_341" class="wp-caption alignnone" style="width: 488px"><a href="http://www.lsproc.com/blog/wp-content/uploads/2010/01/linux-timeline1.png"><img src="http://www.lsproc.com/blog/wp-content/uploads/2010/01/linux-timeline1-478x800.png" alt="linux timeline" title="linux-timeline" width="478" height="800" class="size-medium wp-image-341" /></a><p class="wp-caption-text">linux timeline</p></div>
<p>-- EOF --</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>2010-01-15 -- <a href="http://www.lsproc.com/blog/bash_if_parameters/" title="bash if条件判断参数">bash if条件判断参数</a> (0)</li><li>2008-12-16 -- <a href="http://www.lsproc.com/blog/linux_webserver_cmd/" title="Webserver 维护常用命令">Webserver 维护常用命令</a> (9)</li><li>2008-11-10 -- <a href="http://www.lsproc.com/blog/useful_linux_command/" title="一些 linux 命令">一些 linux 命令</a> (0)</li><li>2008-08-31 -- <a href="http://www.lsproc.com/blog/install_network_card_driver_on_ubuntu/" title="ubuntu 安装Intel PRO100/1000系列网卡驱动">ubuntu 安装Intel PRO100/1000系列网卡驱动</a> (0)</li><li>2008-03-18 -- <a href="http://www.lsproc.com/blog/configure_lamp/" title="lamp 相关配置 [Debian]">lamp 相关配置 [Debian]</a> (2)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.lsproc.com/blog/linux_timeline/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
