<?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>Java traps and pitfalls</title>
	<atom:link href="http://www.viminfo.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.viminfo.com</link>
	<description></description>
	<lastBuildDate>Sat, 05 May 2012 10:08:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>JS条件编译</title>
		<link>http://www.viminfo.com/js%e6%9d%a1%e4%bb%b6%e7%bc%96%e8%af%91.html</link>
		<comments>http://www.viminfo.com/js%e6%9d%a1%e4%bb%b6%e7%bc%96%e8%af%91.html#comments</comments>
		<pubDate>Sat, 05 May 2012 10:08:33 +0000</pubDate>
		<dc:creator>音译控</dc:creator>
				<category><![CDATA[技术杂谈]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[条件编译]]></category>

		<guid isPermaLink="false">http://www.viminfo.com/?p=161</guid>
		<description><![CDATA[最近给公司开发新邮件提醒的浏览器扩展时，需要分别开发搜狗和Chrome版本，而这两个版本绝大部分代码都是相同的，只有少数代码的区别。如果因为这么几行代码的不同而需要分拆到多个js文件中就会存在重复代码，后续有修改时就需要修改多处，维护起来不太方便。 在C语言里，可以根据不同的平台编译出不同的二进制代码，那么是否也可以对JS做这样的处理呢？答案是肯定的，google后发现有两个项目可以处理这个事情，一个是js_build_tools，另一个是js-prepross。试用js_build_tools时发现这个东西只能对单个文件进行处理，不支持fileset，且输入文件不能和输出文件同名，使用起来不太方便。而js-preprocess支持fileset，输入文件可以和输出文件同名。相比js_build_tools，js-preprocess使用较为方便，但也存在一些不足。js-preprocess只支持相对于项目的相对路径，ant的taskname只能命名为preprocess。js_build_tools里的编译指令想比C的编译指令多了注释符号//，对js IDE相对友好。 花了一点时间对js-preprocess做了一些修改，fork的项目地址-&#62;传送门。fork后支持绝对路径，ant的taskname没有限制，编译指令也改成js_build_tools的方式。]]></description>
			<content:encoded><![CDATA[<p>最近给公司开发新邮件提醒的浏览器扩展时，需要分别开发搜狗和Chrome版本，而这两个版本绝大部分代码都是相同的，只有少数代码的区别。如果因为这么几行代码的不同而需要分拆到多个js文件中就会存在重复代码，后续有修改时就需要修改多处，维护起来不太方便。</p>
<p>在C语言里，可以根据不同的平台编译出不同的二进制代码，那么是否也可以对JS做这样的处理呢？答案是肯定的，google后发现有两个项目可以处理这个事情，一个是<a title="js_build_tools" href="http://code.google.com/p/js-build-tools/" target="_blank">js_build_tools</a>，另一个是<a title="js-preprocess" href="https://github.com/bramstein/js-preprocess" target="_blank">js-prepross</a>。试用js_build_tools时发现这个东西只能对单个文件进行处理，不支持fileset，且输入文件不能和输出文件同名，使用起来不太方便。而js-preprocess支持fileset，输入文件可以和输出文件同名。相比js_build_tools，js-preprocess使用较为方便，但也存在一些不足。js-preprocess只支持相对于项目的相对路径，ant的taskname只能命名为preprocess。js_build_tools里的编译指令想比C的编译指令多了注释符号//，对js IDE相对友好。</p>
<p>花了一点时间对js-preprocess做了一些修改，fork的项目地址-&gt;<a title="传送门" href="https://github.com/hfdiao/js-preprocess" target="_blank">传送门</a>。fork后支持绝对路径，ant的taskname没有限制，编译指令也改成js_build_tools的方式。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.viminfo.com/js%e6%9d%a1%e4%bb%b6%e7%bc%96%e8%af%91.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>setSoTimeout does not work with nio SocketChannel</title>
		<link>http://www.viminfo.com/setsotimeout-does-not-work-with-nio-socketchannel.html</link>
		<comments>http://www.viminfo.com/setsotimeout-does-not-work-with-nio-socketchannel.html#comments</comments>
		<pubDate>Tue, 20 Dec 2011 09:39:07 +0000</pubDate>
		<dc:creator>音译控</dc:creator>
				<category><![CDATA[技术杂谈]]></category>

		<guid isPermaLink="false">http://www.viminfo.com/?p=156</guid>
		<description><![CDATA[通过SocketChannel.socket().setSoTimeout(timeout)设置读超时，对于SocketChannel.read(buffer)操作来说是不会有任何效果的，如果SocketChannel设置了blocking mode的话会一致阻塞直到有可读取的内容或EOF。 有人就此给Sun提了个bug（http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4614802）， 但Sun不认为这是个bug： Not a bug. The read methods in SocketChannel (and DatagramChannel) do not support timeouts. If you need the timeout functionality then use the read methods of the associated Socket (or DatagramSocket) object. 既然Sun不认为这是个bug只能自己使用的时候注意了（有人说起码是个Javadoc的bug， absolutely！）]]></description>
			<content:encoded><![CDATA[<p>通过SocketChannel.socket().setSoTimeout(timeout)设置读超时，对于SocketChannel.read(buffer)操作来说是不会有任何效果的，如果SocketChannel设置了blocking mode的话会一致阻塞直到有可读取的内容或EOF。</p>
<p>有人就此给Sun提了个bug（http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4614802）， 但Sun不认为这是个bug：</p>
<pre>Not a bug.  The read methods in SocketChannel (and DatagramChannel) do not
support timeouts.  If you need the timeout functionality then use the read
methods of the associated Socket (or DatagramSocket) object.</pre>
<p>既然Sun不认为这是个bug只能自己使用的时候注意了（有人说起码是个Javadoc的bug， absolutely！）</p>
]]></content:encoded>
			<wfw:commentRss>http://www.viminfo.com/setsotimeout-does-not-work-with-nio-socketchannel.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>网易新邮件提醒Chrome扩展开发</title>
		<link>http://www.viminfo.com/nmpush-chrome.html</link>
		<comments>http://www.viminfo.com/nmpush-chrome.html#comments</comments>
		<pubDate>Sat, 19 Nov 2011 17:26:19 +0000</pubDate>
		<dc:creator>音译控</dc:creator>
				<category><![CDATA[技术杂谈]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[pushmail]]></category>
		<category><![CDATA[新邮件提醒]]></category>
		<category><![CDATA[网易邮箱]]></category>

		<guid isPermaLink="false">http://www.viminfo.com/?p=145</guid>
		<description><![CDATA[最近突然对chrome扩展开发来了兴趣，刚好最近了解了下网易邮箱助手获取新邮件到达的方法就想着自己动手写一个新邮件到达提醒的chrome扩展（其实挺蛋疼的，网易邮箱网页版本身就提供了提醒功能）。协议可以通过抓包来了解，也比较简单易懂。 周六睡醒就花了几个小时一边看chrome扩展的开发文档一边码代码，花了几个小时就把第一版弄出来了，chrome的扩展开发还是挺方便的。 一般来说，extensions都会有一个背景页面（background_page）用于主流程处理，逻辑代码通常都在这里。除了流程处理外一般还会有extension的设置需要处理，那么一般也会提供一个选项页面（options_page）。extension各个页面之间可以通过chrome.extension的api来进行通讯，比如可以通过chrome.extension.getBackgroudPage()获得背景页面的DOM树。API都相对比较简单，用的时候翻翻手册就很容易明白了（PS：360翻译的质量真不敢恭维）。 项目代码托管在google code上，有兴趣的可以自行查看。 TODO： 1. 目前版本账号密码都是明文保存的，可以改成md5处理。 2. 点击进入邮箱查看邮件。 3. 5秒后自动关闭弹窗。 4. 自动更新。 5. 多账号支持。 6. 异常情况处理。]]></description>
			<content:encoded><![CDATA[<p>最近突然对chrome扩展开发来了兴趣，刚好最近了解了下网易邮箱助手获取新邮件到达的方法就想着自己动手写一个新邮件到达提醒的chrome扩展（其实挺蛋疼的，网易邮箱网页版本身就提供了提醒功能）。协议可以通过抓包来了解，也比较简单易懂。</p>
<p>周六睡醒就花了几个小时一边看chrome扩展的<a href="http://open.chrome.360.cn/html/dev_manifest.html">开发文档</a>一边码代码，花了几个小时就把第一版弄出来了，chrome的扩展开发还是挺方便的。</p>
<p>一般来说，extensions都会有一个背景页面（background_page）用于主流程处理，逻辑代码通常都在这里。除了流程处理外一般还会有extension的设置需要处理，那么一般也会提供一个选项页面（options_page）。extension各个页面之间可以通过chrome.extension的api来进行通讯，比如可以通过chrome.extension.getBackgroudPage()获得背景页面的DOM树。API都相对比较简单，用的时候翻翻手册就很容易明白了（PS：360翻译的质量真不敢恭维）。</p>
<p>项目代码托管在google code上，有兴趣的可以自行<a href="http://code.google.com/p/nmpush/">查看</a>。</p>
<p>TODO：<br />
<del> 1. 目前版本账号密码都是明文保存的，可以改成md5处理。</del><br />
<del> 2. 点击进入邮箱查看邮件。</del><br />
<del> 3. 5秒后自动关闭弹窗。</del><br />
<del> 4. 自动更新。</del><br />
5. 多账号支持。<br />
6. 异常情况处理。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.viminfo.com/nmpush-chrome.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[RT] Using stunnel to telnet into GMail IMAP</title>
		<link>http://www.viminfo.com/using-stunnel-to-telnet-into-gmail-imap.html</link>
		<comments>http://www.viminfo.com/using-stunnel-to-telnet-into-gmail-imap.html#comments</comments>
		<pubDate>Mon, 17 Oct 2011 13:58:03 +0000</pubDate>
		<dc:creator>音译控</dc:creator>
				<category><![CDATA[技术杂谈]]></category>
		<category><![CDATA[GMail]]></category>
		<category><![CDATA[IMAP]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[stunnel]]></category>
		<category><![CDATA[telnet]]></category>

		<guid isPermaLink="false">http://www.viminfo.com/?p=130</guid>
		<description><![CDATA[PS: 原文被墙， 转来方便墙内翻阅。 最近在搞IMAP相关的东西， 一直头疼不知道怎么命令行下测gmail的一些行为， 这篇文章真是帮大忙了。 By edwin &#8211; Posted on 12 February 2009 Here is a case study of how stunnel can be used to test an SSL based protocol. We will create an stunnel configuration that reroutes the &#8230;<p class="read-more"><a href="http://www.viminfo.com/using-stunnel-to-telnet-into-gmail-imap.html">继续阅读 &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>PS: <a href="http://wiredbytes.com/node/8">原文</a>被墙， 转来方便墙内翻阅。 最近在搞IMAP相关的东西， 一直头疼不知道怎么命令行下测gmail的一些行为， 这篇文章真是帮大忙了。</p>
<p>By edwin &#8211; Posted on 12 February 2009</p>
<p>Here is a case study of how stunnel can be used to test an SSL based protocol. We will create an stunnel configuration that reroutes the IMAP port (TCP 143) to the Secure IMAP port (TCP 993) on GMail&#8217;s IMAP server (imap.gmail.com). We will than test the setup by using telnet.</p>
<p>I will be using Ubuntu 8.10 (Intrepid Ibex).</p>
<p>First, let&#8217;s install stunnel.</p>
<p>sudo apt-get install stunnel</p>
<p>Edit /etc/default/stunnel4, change ENABLED=0 to ENABLED=1</p>
<p>Edit /etc/stunnel/stunnel.conf as shown in the example below:</p>
<p>; Sample stunnel configuration file by Michal Trojnara 2002-2006<br />
; Some options used here may not be adequate for your particular configuration<br />
; Please make sure you understand them (especially the effect of chroot jail)</p>
<p>; Certificate/key is needed in server mode and optional in client mode<br />
;cert = /etc/stunnel/mail.pem<br />
;key = /etc/stunnel/mail.pem</p>
<p>; Protocol version (all, SSLv2, SSLv3, TLSv1)<br />
sslVersion = SSLv3</p>
<p>; Some security enhancements for UNIX systems &#8211; comment them out on Win32<br />
chroot = /var/lib/stunnel4/<br />
setuid = stunnel4<br />
setgid = stunnel4<br />
; PID is created inside chroot jail<br />
pid = /stunnel4.pid</p>
<p>; Some performance tunings<br />
socket = l:TCP_NODELAY=1<br />
socket = r:TCP_NODELAY=1<br />
;compression = rle</p>
<p>; Workaround for Eudora bug<br />
;options = DONT_INSERT_EMPTY_FRAGMENTS</p>
<p>; Authentication stuff<br />
;verify = 2<br />
; Don&#8217;t forget to c_rehash CApath<br />
; CApath is located inside chroot jail<br />
;CApath = /certs<br />
; It&#8217;s often easier to use CAfile<br />
;CAfile = /etc/stunnel/certs.pem<br />
; Don&#8217;t forget to c_rehash CRLpath<br />
; CRLpath is located inside chroot jail<br />
;CRLpath = /crls<br />
; Alternatively you can use CRLfile<br />
;CRLfile = /etc/stunnel/crls.pem</p>
<p>; Some debugging stuff useful for troubleshooting<br />
debug = 7<br />
output = /var/log/stunnel4/stunnel.log</p>
<p>; Use it for client mode<br />
client = yes</p>
<p>; Service-level configuration</p>
<p>;[pop3s]<br />
;accept = 995<br />
;connect = 110</p>
<p>[imaps]<br />
accept = 143<br />
connect = imap.gmail.com:993</p>
<p>;[ssmtp]<br />
;accept = 465<br />
;connect = 25</p>
<p>;[https]<br />
;accept = 443<br />
;connect = 80<br />
;TIMEOUTclose = 0</p>
<p>; vim:ft=dosini</p>
<p>Start up Stunnel</p>
<p>sudo /etc/init.d/stunnel4 start</p>
<p>Verify that the IMAP is listening on the local server.</p>
<p>netstat -an | grep -iw LISTEN<br />
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN</p>
<p>The following requires that your GMail account have IMAP enabled. This is not enabled by default. Replace username@gmail.com with your real email address. Replace password with your real password.</p>
<p>telnet localhost 143<br />
Trying 127.0.0.1&#8230;<br />
Connected to localhost.<br />
Escape character is &#8216;^]&#8217;.<br />
* OK Gimap ready for requests from 71.65.199.7 c5if2789008nfi.67<br />
)<br />
01 LOGIN username@gmail.com password<br />
01 OK username@gmail.com authenticated (Success)<br />
02 LOGOUT<br />
* BYE LOGOUT Requested<br />
02 OK 73 good day (Success)<br />
Connection closed by foreign host.</p>
<p>That&#8217;s it. If you&#8217;re feeling adventourous you can use Hydra to brute force an account you own.</p>
<p>./hydra -l yourfriend@gmail.com -P password.txt -V localhost imap</p>
]]></content:encoded>
			<wfw:commentRss>http://www.viminfo.com/using-stunnel-to-telnet-into-gmail-imap.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>如何抓iPad的http[s]请求</title>
		<link>http://www.viminfo.com/ipad_http_analysis.html</link>
		<comments>http://www.viminfo.com/ipad_http_analysis.html#comments</comments>
		<pubDate>Sat, 14 May 2011 21:13:47 +0000</pubDate>
		<dc:creator>音译控</dc:creator>
				<category><![CDATA[技术杂谈]]></category>
		<category><![CDATA[analysis]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[HTTPS]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[抓包]]></category>

		<guid isPermaLink="false">http://dhf.blog.163.com/blog/static/119043159201141542718380</guid>
		<description><![CDATA[&#160; &#160; &#160; &#160; ipad上目前没发现有抓包的工具， 就算有也应该不会好用到哪里去， 但要对ipad的http或https请求进行抓包该怎么办呢？方法还是有的， 前提是有两块能上网的网卡（至少有...<p class="read-more"><a href="http://www.viminfo.com/ipad_http_analysis.html">继续阅读 &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
ipad上目前没发现有抓包的工具， 就算有也应该不会好用到哪里去， 但要对ipad的http或https请求进行抓包该怎么办呢？方法还是有的， 前提是有两块能上网的网卡（至少有一块无线网卡，主要是当无线路由用，本身有无线路由的就忽略connectify这一步吧）以及一个Windows操作系统（都怪Fiddler2只有windows版本）。</p>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
首先， 通过Ad-hoc open（Access Point等其他方式也可以， 我懒得输密码就设成Ad-hoc open了）将无线网卡共享出去（可以通过<a href="http://www.connectify.me/">Connectify</a>傻瓜化地设置， 不过dhcp似乎经常出问题啊）， 如图：</div>
<div style="text-align: center;"><a href="http://www.viminfo.com/wp-content/uploads/2011/05/3340545023603014284.png"><img class="alignnone size-full wp-image-42" title="3340545023603014284" src="http://www.viminfo.com/wp-content/uploads/2011/05/3340545023603014284.png" alt="" width="292" height="438" /></a></div>
<p>&nbsp;</p>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
然后， 开启<a href="http://www.fiddler2.com/fiddler2/">Fiddler2</a> （一个强大的http[s]抓包工具）， 如果需要抓取https的话需要在Tools-&gt;Fiddler Options-&gt;HTTPS里勾选上Decrypt https traffic， 如图：</div>
<div>
<div style="text-align: center;"><a href="http://www.viminfo.com/wp-content/uploads/2011/05/3759661263924513498.png"><img class="alignnone size-full wp-image-43" title="3759661263924513498" src="http://www.viminfo.com/wp-content/uploads/2011/05/3759661263924513498.png" alt="" width="556" height="375" /></a></div>
<div style="text-align: left;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
接着需要设置Fiddler2的代理服务，如果不希望抓取非ipad的http请求请不要勾选WinINET Connections的相关选项</div>
<div style="text-align: left;">
<div style="text-align: center;"><a href="http://www.viminfo.com/wp-content/uploads/2011/05/3883791728654295312.png"><img class="alignnone size-full wp-image-44" title="3883791728654295312" src="http://www.viminfo.com/wp-content/uploads/2011/05/3883791728654295312.png" alt="" width="556" height="374" /></a></div>
<div style="text-align: left;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
最后就是设置ipad的wifi了， wifi通过刚刚共享的无线进行上网并将HTTP代理设置为手动， 服务器地址填上192.168.2.1，端口填上8888（就是Fiddler2-&gt;Tools-&gt;Fiddler Options中填写的Fiddler listens on port），这样ipad上的所有http[s]请求都能在Fiddler2上看到了。</div>
<div style="text-align: left;"></div>
<p><br/></p>
<div style="text-align: left;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
PS： Fiddler2抓https请求是通过伪造证书来实现的，需要信任这个伪造的证书。</div>
</div>
<p>&nbsp;
</p></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.viminfo.com/ipad_http_analysis.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>如何修改deb安装包里的依赖关系/冲突</title>
		<link>http://www.viminfo.com/deb_dependence_modify.html</link>
		<comments>http://www.viminfo.com/deb_dependence_modify.html#comments</comments>
		<pubDate>Sat, 12 Mar 2011 12:15:18 +0000</pubDate>
		<dc:creator>音译控</dc:creator>
				<category><![CDATA[技术杂谈]]></category>
		<category><![CDATA[conflict]]></category>
		<category><![CDATA[deb]]></category>
		<category><![CDATA[dependence]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://dhf.blog.163.com/blog/static/119043159201121271033202</guid>
		<description><![CDATA[&#160;&#160; &#160;今天装code::blocks时， 总是提示&#160;"错误： 破坏已有软件包 'codeblocks-common' 对 codeblocks (&#60; 10.05-1) 的冲突关系"， 直接打开deb包修改里面的control文件也没用，关闭后又恢复原样<p class="read-more"><a href="http://www.viminfo.com/deb_dependence_modify.html">继续阅读 &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<div>&nbsp;&nbsp; &nbsp;今天装code::blocks时， 总是提示&nbsp;<font size="2"  >“<span style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px; font-family: 微软雅黑; line-height: normal;"  ><font color="#FF0000"  >错误： 破坏已有软件包 &#8216;codeblocks-common&#8217; 对 codeblocks (&lt; 10.05-1) 的冲突关系</font>“， 直接打开deb包修改里面的control文件也没用，关闭后又恢复原样了。在&nbsp;<a href="http://ubuntuforums.org/showthread.php?t=636724"    >ubuntuforms</a>&nbsp;搜到一段shell脚本倒是可以修改control文件后重新生成一个deb包， 脚本如下：</span></font>
<div><font face="微软雅黑"  size="2"  ><span style="line-height: 20px; -webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  ><br /></span></font></div>
<div><font face="微软雅黑"  size="2"  >
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >#!/bin/bash</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  ></div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >if [[ -z "$1" ]]; then</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >&nbsp;&nbsp;echo “Syntax: $0 debfile”</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >&nbsp;&nbsp;exit 1</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >fi</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  ></div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >DEBFILE=”$1&#8243;</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >TMPDIR=`mktemp -d /tmp/deb.XXXXXXXXXX` || exit 1</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >OUTPUT=`basename “$DEBFILE” .deb`.modfied.deb</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  ></div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >if [[ -e "$OUTPUT" ]]; then</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >&nbsp;&nbsp;echo “$OUTPUT exists.”</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >&nbsp;&nbsp;rm -r “$TMPDIR”</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >&nbsp;&nbsp;exit 1</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >fi</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  ></div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >dpkg-deb -x “$DEBFILE” “$TMPDIR”</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >dpkg-deb &#8211;control “$DEBFILE” “$TMPDIR”/DEBIAN</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  ></div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >if [[ ! -e "$TMPDIR"/DEBIAN/control ]]; then</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >&nbsp;&nbsp;echo DEBIAN/control not found.</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  ></div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >&nbsp;&nbsp;rm -r “$TMPDIR”</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >&nbsp;&nbsp;exit 1</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >fi</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  ></div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >CONTROL=”$TMPDIR”/DEBIAN/control</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  ></div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >MOD=`stat -c “%y” “$CONTROL”`</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >vi “$CONTROL”</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  ></div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >if [[ "$MOD" == `stat -c "%y" "$CONTROL"` ]]; then</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >&nbsp;&nbsp;echo Not modfied.</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >else</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >&nbsp;&nbsp;echo Building new deb&#8230;</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >&nbsp;&nbsp;dpkg -b “$TMPDIR” “$OUTPUT”</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >fi</div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  ></div>
<div style="-webkit-border-horizontal-spacing: 5px; -webkit-border-vertical-spacing: 5px;"  >rm -r “$TMPDIR”</div>
<p></font></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.viminfo.com/deb_dependence_modify.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu下安装TP Link TL-WN821N 无线网卡驱动</title>
		<link>http://www.viminfo.com/ubuntu_tp-link_tl-wn821n.html</link>
		<comments>http://www.viminfo.com/ubuntu_tp-link_tl-wn821n.html#comments</comments>
		<pubDate>Wed, 19 Jan 2011 06:05:07 +0000</pubDate>
		<dc:creator>音译控</dc:creator>
				<category><![CDATA[技术杂谈]]></category>
		<category><![CDATA[tl-wn821n]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[无线网卡]]></category>

		<guid isPermaLink="false">http://dhf.blog.163.com/blog/static/119043159201101914847859</guid>
		<description><![CDATA[&#160;&#160;&#160;&#160;&#160;&#160;&#160; 前几天笔记本自带的无线网卡似乎坏了，系统没有识别这个设备，就买了TP Link的USB无线网卡TL-WN821N。插上后发现Ubuntu根本没有识别这个设备，还是无法上网。&#038;...<p class="read-more"><a href="http://www.viminfo.com/ubuntu_tp-link_tl-wn821n.html">继续阅读 &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 前几天笔记本自带的无线网卡似乎坏了，系统没有识别这个设备，就买了TP Link的USB无线网卡TL-WN821N。插上后发现Ubuntu根本没有识别这个设备，还是无法上网。<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 郁闷之下，切回windows（TP Link随机光盘带有windows的驱动），上网搜索后发现有<a href="http://madwifi-project.org/" >madwifi</a>这个开源项目，但是该项目目前还不支持usb接口的网卡（其他两个版本ath5k/ath9k的设备支持列表也没找到TL-WN821N）。后来发现有人提到用ndiswrapper可以安装windows下的驱动文件，并且用IOGEAR GWU623.zip里面的驱动文件可以正常安装使用。但我这台机安装ndiswrapper后再装上GWU623的驱动，却还是无法上网！删掉这个驱动后用TL-WN821N自带光盘里的驱动文件，能正常上网了，oh yeah</div>
]]></content:encoded>
			<wfw:commentRss>http://www.viminfo.com/ubuntu_tp-link_tl-wn821n.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>桌游马尼拉规则调整乱想</title>
		<link>http://www.viminfo.com/boardgame_manila_rule_extension.html</link>
		<comments>http://www.viminfo.com/boardgame_manila_rule_extension.html#comments</comments>
		<pubDate>Thu, 26 Aug 2010 15:19:17 +0000</pubDate>
		<dc:creator>音译控</dc:creator>
				<category><![CDATA[休闲娱乐]]></category>
		<category><![CDATA[桌游]]></category>
		<category><![CDATA[马尼拉]]></category>

		<guid isPermaLink="false">http://dhf.blog.163.com/blog/static/119043159201072611523222</guid>
		<description><![CDATA[&#160;&#160; &#160; &#160; &#160;今天跟着同事试着学了一把马尼拉，游戏还不错，不过5个人玩时间倒是长了些，花了快2个小时。前3回合凭着做海贼的天赋，暴发了一把，后面主要就是靠股票和上船...<p class="read-more"><a href="http://www.viminfo.com/boardgame_manila_rule_extension.html">继续阅读 &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;今天跟着同事试着学了一把马尼拉，游戏还不错，不过5个人玩时间倒是长了些，花了快2个小时。前3回合凭着做海贼的天赋，暴发了一把，后面主要就是靠股票和上船运货稳扎稳打了，最后居然大胜。
<div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;今天这局买港口话事权的价格普遍偏高，有一局我居然花了31块大洋买话事权，大家都太冲动了些，都是冲着股票去的。这里的股票只有升值（或者保值），如果改成和现实一样，既有可能涨也有可能跌的话游戏会不会更刺激呢？而且再加上一支海盗的股票，可选择的就更多了。刚开局的时候所有股票价格都为30，货物运送成功1次则股票价格涨1格，最多连涨3格（3次后就算继续运送成功也不涨）；货物运送失败1次则股票价格跌1格，同样，最多连跌3格；而海盗每成功劫1条船股票价格涨1格，1回合内没有劫到船则股票价格跌1格，连涨连跌次数同样是3格。这样调整之后，投资股票时则需要更谨慎，购买话事权的时候也或许会更冷静一些。</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.viminfo.com/boardgame_manila_rule_extension.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql字符默认不区分大小写？</title>
		<link>http://www.viminfo.com/mysql_case_insensitive.html</link>
		<comments>http://www.viminfo.com/mysql_case_insensitive.html#comments</comments>
		<pubDate>Thu, 19 Aug 2010 03:53:25 +0000</pubDate>
		<dc:creator>音译控</dc:creator>
				<category><![CDATA[技术杂谈]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[大小写]]></category>
		<category><![CDATA[数据库]]></category>

		<guid isPermaLink="false">http://dhf.blog.163.com/blog/static/1190431592010719113538183</guid>
		<description><![CDATA[&#160;&#160; &#160; &#160; &#160;最近发现短链接服务在生成短链接时经常会发生碰撞，刚开始单纯地以为是生成算法有问题，毕竟就算是4位的短链接也有62^4个链接可能（26个字母的大小写+10个数字<p class="read-more"><a href="http://www.viminfo.com/mysql_case_insensitive.html">继续阅读 &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;最近发现短链接服务在生成短链接时经常会发生碰撞，刚开始单纯地以为是生成算法有问题，毕竟就算是4位的短链接也有62^4个链接可能（26个字母的大小写+10个数字），如果生成算法没问题的话发生碰撞的概率应该是较小的。
<div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;检查了一遍代码，生成算法也确实有一些问题，但都不是主要问题。今天随手在mysql里select了一下，发现查询的时候居然不区分大小写！那么其实4位的短链接就只有36^4个链接可能（160多万而已）！查阅了mysql相关文档，大致了解了mysql字符集及校对规则的选取方式：</div>
<div><font face="Arial">&nbsp;&nbsp; &nbsp; &nbsp; 1. 如果指定了字符集和校对规则，那么采用指定的字符集和校对规则。<br />&nbsp;&nbsp; &nbsp; &nbsp; 2. 如果指定了字符集但没有指定校对规则，那么采用指定的字符集和该字符集的默认校对规则。</font></div>
<div><font face="Arial">&nbsp;&nbsp; &nbsp; &nbsp; 3. 否则，采用服务器字符集和服务器校对规则。</font></div>
<div><font face="Arial">&nbsp;&nbsp; &nbsp; &nbsp; 可以通过show collation命令查询支持的校对规则及字符集默认的校对规则。</font></div>
<div><font face="Arial">&nbsp;&nbsp; &nbsp; &nbsp; mysql数据库也差不多支撑不住目前的需求了，反正要迁移到分布式数据库了就暂时不理这个问题了。但越来越觉得是应该好好完整地将mysql手册看一遍了。</font></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.viminfo.com/mysql_case_insensitive.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>邮件信头中Return-Path、Reply-To和From的区别</title>
		<link>http://www.viminfo.com/return-path_reply-to_from.html</link>
		<comments>http://www.viminfo.com/return-path_reply-to_from.html#comments</comments>
		<pubDate>Sat, 31 Jul 2010 18:14:27 +0000</pubDate>
		<dc:creator>音译控</dc:creator>
				<category><![CDATA[技术杂谈]]></category>
		<category><![CDATA[from]]></category>
		<category><![CDATA[reply-to]]></category>
		<category><![CDATA[return-path]]></category>
		<category><![CDATA[信头]]></category>

		<guid isPermaLink="false">http://dhf.blog.163.com/blog/static/11904315920107121427424</guid>
		<description><![CDATA[&#160;&#160; &#160; &#160; &#160;懒得自己写，直接引用一段别人的回复（原贴传送门），大致跟自己之前的实践及查看的文档相符。&#160;&#160; &#160; &#160; &#160;1)The Return-Path (sometimes called the Reverse-Path o...<p class="read-more"><a href="http://www.viminfo.com/return-path_reply-to_from.html">继续阅读 &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;懒得自己写，直接引用一段别人的回复（<a href="http://stackoverflow.com/questions/1235534/what-is-the-behavior-difference-between-return-path-reply-to-and-from" >原贴传送门</a>），大致跟自己之前的实践及查看的文档相符。
<div>
<div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<span style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; border-collapse: collapse;">1)The Return-Path (sometimes called the Reverse-Path or Envelope-FROM &#8212; all of these terms can be used interchangeably) is the value used during the SMTP session. As you can see, this does not need to be the same value that is actually found in the mail headers. Only the recipient&#8217;s mail server is supposed to add a Return-Path header to the top of the email. This records the actual Return-Path sender during the SMTP session. If a Return-Path header is already exists in the email, then that header is to be removed, and replaced by the recipient&#8217;s mail server.</span></div>
<p><span style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 18px; border-collapse: collapse;">
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; background-position: initial initial; background-repeat: initial initial;">All bounces that occur during the SMTP session should go back to the Return-Path value. Some servers may accept all email, and then queue it locally, until it has a free thread to deliver it to the recipient&#8217;s mailbox. If the recipient doesn&#8217;t exist, it should bounce it back to the recorded Return-Path value.</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; background-position: initial initial; background-repeat: initial initial;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Note, not all mail servers obey this rule. Some mail servers will bounce it back to the FROM address.</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; background-position: initial initial; background-repeat: initial initial;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;2)The FROM address is the value actually found in the FROM header. This is supposed to be who the message is FROM. This is what you see as the “FROM” in most mail clients. If an email does not have a Reply-To header, then all human (mail client) replies should go back to the FROM address.</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; background-position: initial initial; background-repeat: initial initial;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;3)The Reply-To header is added by the sender (or the sender&#8217;s software). It is where all human replies should be addressed too. Basically, when the user clicks “reply”, the Reply-To value should be the value used as the recpient of the newly composed email. The Reply-To value should not be used by any server. It is meant for client side use.</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; background-position: initial initial; background-repeat: initial initial;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;However, as you can tell, not all mail servers obey the RFC standards or recommendations.</p>
<p></span></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.viminfo.com/return-path_reply-to_from.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

