<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.feedsky.com/styles/temp01.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" 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/" version="2.0"><channel><atom:link href="http://feed.feedsky.com/pigdao" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/pigdao" type="application/rss+xml"></fs:self_link><lastBuildDate>Mon, 12 Dec 2011 09:22:34 GMT</lastBuildDate><title>刀刀 | Python,Nginx,Linux,FreeBSD</title><link>http://tech.foolpig.com</link><language>en</language><pubDate>Mon, 12 Dec 2011 09:22:34 GMT</pubDate><item><title>traceroute和tracert的区别</title><link>http://tech.foolpig.com/2011/12/12/tracert_traceroute/</link><content:encoded>&lt;p&gt;windows下的tracert和linux/BSD/router下的traceroute都用于探测数据包从源到目的经过路由的IP，但两者探测的方法却有差别。&lt;br /&gt;
默认情况下，tracert是向目的地址发出ICMP请求回显数据包，而traceroute是向目的地址的某个端口（大于30000）发送UDP数据报。&lt;br /&gt;
两者用于探测的数据类型不同。但他们也有一个共同点：都是通过设置发送包的TTL的值从1开始、逐次增1的方法来探测。&lt;/p&gt;
&lt;p&gt;也就是说tracert是ICMP，而traceroute是UDP的&lt;/p&gt;
&lt;p&gt;linux 的 traceroute 可加 -I 参数改用 ICMP&lt;/p&gt;
&lt;p&gt;PS：tracepath与traceroute差别不大，但是tracepath不能用-n来取消DNS query&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/586389035/pigdao/feedsky/s.gif?r=http://tech.foolpig.com/2011/12/12/tracert_traceroute/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://tech.foolpig.com/2011/12/12/tracert_traceroute/feed/</wfw:commentRss><description>windows下的tracert和linux/BSD/router下的traceroute都用于探测数据包从源到目的经过路由的IP，但两者探测的方法却有差别。
默认情况下，tracert是向目的地址发出ICMP请求回显数据包，而traceroute是向目...&lt;img src=&quot;http://www1.feedsky.com/t1/586389035/pigdao/feedsky/s.gif?r=http://tech.foolpig.com/2011/12/12/tracert_traceroute/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>traceroute</category><category>tracepath</category><category>东写西读</category><category>tracert</category><pubDate>Mon, 12 Dec 2011 17:22:34 +0800</pubDate><author>foolpig</author><comments>http://tech.foolpig.com/2011/12/12/tracert_traceroute/#comments</comments><guid isPermaLink="false">http://tech.foolpig.com/?p=366</guid><dc:creator>foolpig</dc:creator><fs:srclink>http://tech.foolpig.com/2011/12/12/tracert_traceroute/</fs:srclink><fs:srcfeed>http://tech.foolpig.com/feed/</fs:srcfeed><fs:itemid>feedsky/pigdao/~7082590/586389035/5190929</fs:itemid></item><item><title>[转]Linux下实现自动设置SSH代理</title><link>http://tech.foolpig.com/2011/11/15/%e8%bd%aclinux%e4%b8%8b%e5%ae%9e%e7%8e%b0%e8%87%aa%e5%8a%a8%e8%ae%be%e7%bd%aessh%e4%bb%a3%e7%90%86/</link><content:encoded>&lt;p&gt;SSH的巨大价值体现在能够配置为代理服务器上。不像在Windows下每次还需要手动登录设置，Linux有很好的工具链能够实现自动设置SSH 代理，就是expect和ssh的联合使用，再加上proxychains，任何程序都可以享用代理了，在此我简单介绍一下。&lt;/p&gt;
&lt;p&gt;首先要安装expect和openssh，如果没有，Ubuntu下输入apt-get install expect openssh-client即可安装。接下来需要写一段脚本：&lt;/p&gt;
&lt;div class=&quot;wp_codebox_msgheader&quot;&gt;&lt;span class=&quot;right&quot;&gt;&lt;sup&gt;&lt;a title=&quot;WP-CodeBox HowTo?&quot; href=&quot;http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;color: #99cc00;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;wp_codebox&quot;&gt;
&lt;table border=&quot;0&quot;&gt;
&lt;tbody&gt;
&lt;tr id=&quot;p19331&quot;&gt;
&lt;td id=&quot;p1933code1&quot; class=&quot;code&quot;&gt;
&lt;pre class=&quot;bash&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;font-style: italic; color: #666666;&quot;&gt;#!/usr/bin/expect&lt;/span&gt;
 &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;set&lt;/span&gt; timeout &lt;span style=&quot;color: #000000;&quot;&gt;60&lt;/span&gt;
spawn &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt; usr&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt; bin&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;ssh&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-D&lt;/span&gt; 本地端口 &lt;span style=&quot;color: #660033;&quot;&gt;-g&lt;/span&gt; 用户名&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;@&lt;/span&gt; 服务器
expect &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;password:&quot;&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;{&lt;/span&gt;
send &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;密码&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;/r&lt;/span&gt; &quot;&lt;/span&gt;
 &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;}&lt;/span&gt;
interact &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;{&lt;/span&gt;
timeout &lt;span style=&quot;color: #000000;&quot;&gt;60&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;{&lt;/span&gt; send &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;把上面的中文替换成对应内容，保存为一个脚本文件，例如sshproxy.sh，然后给它执行权限，chmod +x sshproxy.sh。在终端下运行./sshproxy.sh，就会发现自动登录到了服务器上，而且在本地建立了一个socks5代理。而且使用这段脚本还不用担心会被踢，因为每60秒都要发送一个空格表示还在活动。如果把sshproxy.sh放到自动启动，那么以后每次启动都可以自动建立代理了。&lt;/p&gt;
&lt;p&gt;这种方法建立的代理是socks5代理，在浏览器中很容易配置使用，但如果其他程序也想用它，而没有代理功能，该怎么办呢？在Windows下面的确不好办（需要各种付费的、不稳定的代理转换工具），而在Linux下一切很简单，只需要一个名叫proxychains的工具。Ubuntu安装方法为 apt-get install proxychains。安装完以后要设置/etc/proxychains.conf文件，删除[ProxyList]后面的内容，然后添加&lt;/p&gt;
&lt;div class=&quot;wp_codebox_msgheader&quot;&gt;&lt;span class=&quot;right&quot;&gt;&lt;sup&gt;&lt;a title=&quot;WP-CodeBox HowTo?&quot; href=&quot;http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;color: #99cc00;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;wp_codebox&quot;&gt;
&lt;table border=&quot;0&quot;&gt;
&lt;tbody&gt;
&lt;tr id=&quot;p19332&quot;&gt;
&lt;td id=&quot;p1933code2&quot; class=&quot;code&quot;&gt;
&lt;pre class=&quot;bash&quot; style=&quot;font-family: monospace;&quot;&gt;socks5 127.0.0.1 端口&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;把“端口”替换为SSH代理设置的端口。然后在想要运行的程序前加上proxychains ，即可使用代理。例如输入proxychains wget http://www.youtube.com -r，即可给wget设置SSH代理去下载。&lt;/p&gt;
&lt;p&gt;正如其名，实际上proxychains是个代理链，我们可以设置多个代理，实现多级跳板连接。用在SSH代理上实在是大才小用了。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/586389036/pigdao/feedsky/s.gif?r=http://tech.foolpig.com/2011/11/15/%e8%bd%aclinux%e4%b8%8b%e5%ae%9e%e7%8e%b0%e8%87%aa%e5%8a%a8%e8%ae%be%e7%bd%aessh%e4%bb%a3%e7%90%86/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://tech.foolpig.com/2011/11/15/%e8%bd%aclinux%e4%b8%8b%e5%ae%9e%e7%8e%b0%e8%87%aa%e5%8a%a8%e8%ae%be%e7%bd%aessh%e4%bb%a3%e7%90%86/feed/</wfw:commentRss><description>SSH的巨大价值体现在能够配置为代理服务器上。不像在Windows下每次还需要手动登录设置，Linux有很好的工具链能够实现自动设置SSH 代理，就是expect和ssh的联合使用，再加上proxychains，任何程序...&lt;img src=&quot;http://www1.feedsky.com/t1/586389036/pigdao/feedsky/s.gif?r=http://tech.foolpig.com/2011/11/15/%e8%bd%aclinux%e4%b8%8b%e5%ae%9e%e7%8e%b0%e8%87%aa%e5%8a%a8%e8%ae%be%e7%bd%aessh%e4%bb%a3%e7%90%86/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>linux</category><category>ssh</category><category>代理</category><category>proxy</category><category>东写西读</category><pubDate>Tue, 15 Nov 2011 10:16:25 +0800</pubDate><author>foolpig</author><comments>http://tech.foolpig.com/2011/11/15/%e8%bd%aclinux%e4%b8%8b%e5%ae%9e%e7%8e%b0%e8%87%aa%e5%8a%a8%e8%ae%be%e7%bd%aessh%e4%bb%a3%e7%90%86/#comments</comments><guid isPermaLink="false">http://tech.foolpig.com/?p=365</guid><dc:creator>foolpig</dc:creator><fs:srclink>http://tech.foolpig.com/2011/11/15/%e8%bd%aclinux%e4%b8%8b%e5%ae%9e%e7%8e%b0%e8%87%aa%e5%8a%a8%e8%ae%be%e7%bd%aessh%e4%bb%a3%e7%90%86/</fs:srclink><fs:srcfeed>http://tech.foolpig.com/feed/</fs:srcfeed><fs:itemid>feedsky/pigdao/~7082590/586389036/5190929</fs:itemid></item><item><title>mysql老版本官方下载地址</title><link>http://tech.foolpig.com/2011/09/21/mysql-old-version/</link><content:encoded>&lt;p&gt;http://downloads.mysql.com/archives/&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/586389037/pigdao/feedsky/s.gif?r=http://tech.foolpig.com/2011/09/21/mysql-old-version/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://tech.foolpig.com/2011/09/21/mysql-old-version/feed/</wfw:commentRss><description>http://downloads.mysql.com/archives/...&lt;img src=&quot;http://www1.feedsky.com/t1/586389037/pigdao/feedsky/s.gif?r=http://tech.foolpig.com/2011/09/21/mysql-old-version/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>mysql</category><category>东写西读</category><pubDate>Wed, 21 Sep 2011 15:31:45 +0800</pubDate><author>foolpig</author><comments>http://tech.foolpig.com/2011/09/21/mysql-old-version/#comments</comments><guid isPermaLink="false">http://tech.foolpig.com/?p=364</guid><dc:creator>foolpig</dc:creator><fs:srclink>http://tech.foolpig.com/2011/09/21/mysql-old-version/</fs:srclink><fs:srcfeed>http://tech.foolpig.com/feed/</fs:srcfeed><fs:itemid>feedsky/pigdao/~7082590/586389037/5190929</fs:itemid></item><item><title>mysql启动部分错误及解决办法</title><link>http://tech.foolpig.com/2011/09/01/mysql-start-error/</link><content:encoded>&lt;p&gt;1、 install_mysql_db的时候出现“FATAL ERROR: Could not find ./bin/my_print_defaults”&lt;br /&gt;
解决办法：指定basedir和datadir&lt;br /&gt;
/usr/local/webserver/mysql/scripts/mysql_install_db &amp;#8211;user=mysql &amp;#8211;basedir=/usr/local/webserver/mysql &amp;#8211;datadir=/usr/local/webserver/mysql/data&lt;/p&gt;
&lt;p&gt;2、启动mysqld_safe的时候出现“Fatal error: Can&amp;#8217;t open and lock privilege tables: Table &amp;#8216;mysql.host&amp;#8217; doesn&amp;#8217;t exist”（可以查看日志的得到）&lt;br /&gt;
解决办法：同上，指定datadir&lt;br /&gt;
/usr/local/mysql-5.5.11/bin/mysqld_safe &amp;#8211;user=mysql &amp;#8211;datadir=/data/mysql/3306/data &amp;#038;&lt;/p&gt;
&lt;p&gt;3、启动mysql的时候出现“[ERROR] Plugin &amp;#8216;InnoDB&amp;#8217; init function returned error.”&lt;br /&gt;
原因是以前启动的时候有了innodb的相关信息，只要删除data目录中得ib_logfile0等文件即可&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/586389038/pigdao/feedsky/s.gif?r=http://tech.foolpig.com/2011/09/01/mysql-start-error/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://tech.foolpig.com/2011/09/01/mysql-start-error/feed/</wfw:commentRss><description>1、 install_mysql_db的时候出现“FATAL ERROR: Could not find ./bin/my_print_defaults”
解决办法：指定basedir和datadir
/usr/local/webserver/mysql/scripts/mysql_install_db &amp;#8211;user=mysql &amp;#8211;basedir=/usr/local/webserver/mysql &amp;#8211;da...&lt;img src=&quot;http://www1.feedsky.com/t1/586389038/pigdao/feedsky/s.gif?r=http://tech.foolpig.com/2011/09/01/mysql-start-error/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>解决</category><category>mysql</category><category>启动</category><category>错误</category><category>东写西读</category><pubDate>Thu, 01 Sep 2011 14:50:13 +0800</pubDate><author>foolpig</author><comments>http://tech.foolpig.com/2011/09/01/mysql-start-error/#comments</comments><guid isPermaLink="false">http://tech.foolpig.com/?p=363</guid><dc:creator>foolpig</dc:creator><fs:srclink>http://tech.foolpig.com/2011/09/01/mysql-start-error/</fs:srclink><fs:srcfeed>http://tech.foolpig.com/feed/</fs:srcfeed><fs:itemid>feedsky/pigdao/~7082590/586389038/5190929</fs:itemid></item><item><title>关于阵列卡的配置参数Cache Policy(缓存策略)</title><link>http://tech.foolpig.com/2011/08/31/raid-cache-policy/</link><content:encoded>&lt;p&gt;Read-ahead（预读）启用逻辑驱动器的SCSI预读功能。 可将此参数设为No-Read-Ahead（非预读）、Read-ahead（预读）或Adaptive（自适应）。 默认设置为Adaptive（自适应）。&lt;br /&gt;
  *  No-Read-Ahead（非预读）指定控制器在当前逻辑驱动器中不使用预读方式。&lt;br /&gt;
  *  Read-ahead（预读）指定控制器在当前逻辑驱动器中使用预读方式。&lt;br /&gt;
  *  Adaptive（自适应）指定如果最近两次的磁盘访问出现在连续的扇区内，则控制器开始采用Read-ahead（预读）。 如果所有的读取请求都是随机的，则该算法回复到No-Read-Ahead（非预读），但仍要判断所有的读取请求是否有按顺序操作的可能。&lt;br /&gt;
Cache Policy（高速缓存策略） 适合在特定逻辑驱动器上读取。 它并不影响Read ahead（预读）高速缓存。&lt;br /&gt;
  *  Cached I/O（高速缓存I/O）指定所有读取数据在高速缓存存储器中缓存。&lt;br /&gt;
  *  Direct I/O（直接I/O）指定读取数据不在高速缓存存储器中缓存。 此为默认设置。 它不会代替高速缓存策略设置。数据被同时传送到高速缓存和主机。 如果再次读取同一数据块，则从高速缓存存储器读取&lt;br /&gt;
Write Policy（写入策略） 将高速缓存方法设置为回写或通过写。&lt;br /&gt;
  *  在Write-back（回写）高速缓存中，当控制器高速缓存已接收到某个事务中的所有数据时，该控制器将数据传输完成信号发送给主机。&lt;br /&gt;
  *  在Write-through（通过写）高速缓存中，当磁盘子系统已接收到一个事务中的所有数据时，该控制器将数据传输完成信号发送给主机。&lt;br /&gt;
Write-through（通过写）高速缓存与Write-back（回写）高速缓存相比具有数据安全的优势，但Write-back（回写）高速缓存比起Write-through（通过写）又有性能上的优势。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/586389039/pigdao/feedsky/s.gif?r=http://tech.foolpig.com/2011/08/31/raid-cache-policy/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://tech.foolpig.com/2011/08/31/raid-cache-policy/feed/</wfw:commentRss><description>Read-ahead（预读）启用逻辑驱动器的SCSI预读功能。 可将此参数设为No-Read-Ahead（非预读）、Read-ahead（预读）或Adaptive（自适应）。 默认设置为Adaptive（自适应）。
  *  No-Read-Ahead（非预读）指定控...&lt;img src=&quot;http://www1.feedsky.com/t1/586389039/pigdao/feedsky/s.gif?r=http://tech.foolpig.com/2011/08/31/raid-cache-policy/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>阵列卡</category><category>缓存策略</category><category>cache policy</category><category>东写西读</category><pubDate>Wed, 31 Aug 2011 16:15:32 +0800</pubDate><author>foolpig</author><comments>http://tech.foolpig.com/2011/08/31/raid-cache-policy/#comments</comments><guid isPermaLink="false">http://tech.foolpig.com/?p=362</guid><dc:creator>foolpig</dc:creator><fs:srclink>http://tech.foolpig.com/2011/08/31/raid-cache-policy/</fs:srclink><fs:srcfeed>http://tech.foolpig.com/feed/</fs:srcfeed><fs:itemid>feedsky/pigdao/~7082590/586389039/5190929</fs:itemid></item></channel></rss>
