<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-6505672740000305035</atom:id><lastBuildDate>Sat, 14 Sep 2024 12:39:24 +0000</lastBuildDate><category>Linux/Unix</category><category>Vim</category><category>ssh</category><category>Archlinux</category><category>mysql</category><category>Veer</category><category>html5</category><category>proxy.pac</category><category>snipMate</category><category>windows</category><category>win键</category><category>CCTree</category><category>CppUnit</category><category>C学习记录</category><category>Free</category><category>High Availability</category><category>JSP学习记录</category><category>Kindle Touch</category><category>Memory</category><category>Openvpn</category><category>Pptp</category><category>QQ</category><category>Samba</category><category>VirtualBox</category><category>Vpn</category><category>actionscript</category><category>awesome</category><category>bash</category><category>cUnit</category><category>chromium/chrome</category><category>coredump</category><category>cscope</category><category>css</category><category>ctags</category><category>debian</category><category>fcitx</category><category>firefox</category><category>flash</category><category>font</category><category>gdb</category><category>gdm</category><category>glassfish</category><category>gnome</category><category>gnome3</category><category>gtest</category><category>heartbeat</category><category>ifs</category><category>iptables</category><category>ipv6</category><category>javascript</category><category>joomla</category><category>lftp</category><category>log4j</category><category>lvs</category><category>pydiction</category><category>sudo</category><category>textMate</category><category>tomcat</category><category>tor</category><category>trap</category><category>unbrick</category><category>video</category><category>wine</category><category>xmodmap</category><category>思考</category><category>注册表</category><category>编程技巧</category><category>触屏</category><category>高可用</category><title>X in Minds</title><description>What&#39;s the X factor in your mind?</description><link>http://xinminds.blogspot.com/</link><managingEditor>noreply@blogger.com (Unknown)</managingEditor><generator>Blogger</generator><openSearch:totalResults>46</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-5457710435651869506</guid><pubDate>Wed, 13 Mar 2013 05:51:00 +0000</pubDate><atom:updated>2013-03-13T13:51:09.446+08:00</atom:updated><title>ssh-agent让远程ssh更方便</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
由于工作上的事情，需要在多台远程服务器之间来回切换，于是ssh便成为日常工作必备。在此之前，每次切换均是在本地新开终端，再敲入ssh命令连接远程服务器，此间操作好不繁琐！&lt;br /&gt;
&lt;br /&gt;
今天不经意间想到：如若使用ssh agent，当可省去新开终端一步。遂用之。&lt;br /&gt;
&lt;br /&gt;
ssh agent的用法很简单，输入下面两条命令即可：&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
ssh-agent $SHELL&lt;br /&gt;
ssh-add PATH_TO_YOUR_IDENTITY&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
虽然早就知道ssh agent的存在，亦知道其用处，然而从未深究其用法，便不知悉其所能带来效率上的提高！&lt;br /&gt;
</description><link>http://xinminds.blogspot.com/2013/03/ssh-agentssh.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-6223510147865818768</guid><pubDate>Wed, 09 Jan 2013 08:34:00 +0000</pubDate><atom:updated>2013-01-18T10:56:53.776+08:00</atom:updated><title>iPhone 5同步GMail联系人</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
刚刚入手了iPhone 5，用着觉得很好，流畅、界面一致，各方面整合得很好，尤其是虚拟键盘的使用上，比起我之前使用的milestone 2是好多了(当然，用ms2的更多是使用实体键盘的，不知道其他android手机的虚拟键盘如何)。&lt;br /&gt;
&lt;br /&gt;
赞完了就进入正题吧：由于之前一直用webOS和android的手机，所以我一直将手机的联系人跟GMail同步的，但转到iOS平台后，发现在 设置-&amp;gt;邮件、通讯录、日历 里直接添加GMail只能同步邮件、日历和备忘录，根本就没有联系人。&lt;br /&gt;
&lt;br /&gt;
这时我就傻眼了，怎么会这样呢？难道用iPhone 5的人都不使用GMail的通讯录吗？于是探索一翻，终于发现：要在 设置-&amp;gt;邮件、通讯录、日历 里添加Exchange，里面填GMail帐号就可以了。&lt;br /&gt;
&lt;br /&gt;
具体步骤如下：&lt;br /&gt;
1. 添加Exchange帐户&lt;br /&gt;
2. 填入相应的电子邮件、密码等&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghDn38tQTkP1EOdmYF4sqeI481E3n1UVP4K732KnzxuDEJGHU5izG1xkd-9Baknj5zAJ4cloOd_jb3bad8SHDLHyYcy2kJhxCvaQnZmLVyoPTVl8Cv8GcMTPIIDf4LD7yMlaMeliBTTjM/s1600/1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghDn38tQTkP1EOdmYF4sqeI481E3n1UVP4K732KnzxuDEJGHU5izG1xkd-9Baknj5zAJ4cloOd_jb3bad8SHDLHyYcy2kJhxCvaQnZmLVyoPTVl8Cv8GcMTPIIDf4LD7yMlaMeliBTTjM/s320/1.png&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
3. 这里的参数最重要了！尤其是 &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;服务器&lt;/span&gt;&lt;/b&gt; 那里必须填上 &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;m.google.com&lt;/span&gt;&lt;/b&gt; 。&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyqs-yGN_ogr3V8or6bCtzOPlPFuIu0kxeDjvdqiXLVg5jaBDTZQ54Q7WXTmUmFLpAGnx_L4CSe3gThOYG5pVIlisjlqGpTB6nuNiIcKRFC6C3IRxJt1mruJpe-5YO2-Z_lbX7tqienrs/s1600/2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyqs-yGN_ogr3V8or6bCtzOPlPFuIu0kxeDjvdqiXLVg5jaBDTZQ54Q7WXTmUmFLpAGnx_L4CSe3gThOYG5pVIlisjlqGpTB6nuNiIcKRFC6C3IRxJt1mruJpe-5YO2-Z_lbX7tqienrs/s320/2.png&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
4. 到这里选择 通讯录 就完成了。&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOph_Ua_EIKp-rHua2ac1rz5Qa5fP_2c4e5cbLmrLoiqm9tY3669A9eOpelchiTe35K4n_5-ADiGe4LIxdUFkMWjFjq4VJSss4Dk1oEThH89DrM7Z_WVJo_VpsBCD8Ueg2p1jkUtsI4Zo/s1600/3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOph_Ua_EIKp-rHua2ac1rz5Qa5fP_2c4e5cbLmrLoiqm9tY3669A9eOpelchiTe35K4n_5-ADiGe4LIxdUFkMWjFjq4VJSss4Dk1oEThH89DrM7Z_WVJo_VpsBCD8Ueg2p1jkUtsI4Zo/s320/3.png&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
总结一下，iOS可能对Apple自家的服务整合的更好，对于Google家的服务整合程度肯定没android平台的深入。不过还好的就是iOS平台添加Google家的服务还不怎么麻烦。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://xinminds.blogspot.com/2013/01/iphone-5gmail.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghDn38tQTkP1EOdmYF4sqeI481E3n1UVP4K732KnzxuDEJGHU5izG1xkd-9Baknj5zAJ4cloOd_jb3bad8SHDLHyYcy2kJhxCvaQnZmLVyoPTVl8Cv8GcMTPIIDf4LD7yMlaMeliBTTjM/s72-c/1.png" height="72" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-2267598190966987405</guid><pubDate>Sat, 05 Jan 2013 03:11:00 +0000</pubDate><atom:updated>2013-01-05T11:11:12.562+08:00</atom:updated><title>2012年终总结</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;border: 0px; font-family: Helvetica, Arial, &#39;Droid Sans&#39;, sans-serif; font-size: 14px; line-height: 19.983333587646484px; margin: 0px; padding: 0px;&quot;&gt;
&lt;span style=&quot;background-color: rgba(255, 255, 255, 0.00392157);&quot;&gt;在迈向2013的同时回首2012，发现2012整体上还是很不错的一年。&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Helvetica, Arial, &#39;Droid Sans&#39;, sans-serif; font-size: 14px; line-height: 19.983333587646484px; margin: 0px; padding: 0px;&quot;&gt;
&lt;span data-mce-style=&quot;background-color: rgba(255, 255, 255, 0.0078125);&quot; style=&quot;background-color: rgba(255, 255, 255, 0.00392157);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Helvetica, Arial, &#39;Droid Sans&#39;, sans-serif; font-size: 14px; line-height: 19.983333587646484px; margin: 0px; padding: 0px;&quot;&gt;
&lt;span data-mce-style=&quot;background-color: rgba(255, 255, 255, 0.0078125);&quot; style=&quot;background-color: rgba(255, 255, 255, 0.00392157);&quot;&gt;整个2012则可以分成上下半年，上半年颓废，下半年逐步学习，收获也不少。&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Helvetica, Arial, &#39;Droid Sans&#39;, sans-serif; font-size: 14px; line-height: 19.983333587646484px; margin: 0px; padding: 0px;&quot;&gt;
&lt;span data-mce-style=&quot;background-color: rgba(255, 255, 255, 0.0078125);&quot; style=&quot;background-color: rgba(255, 255, 255, 0.00392157);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Helvetica, Arial, &#39;Droid Sans&#39;, sans-serif; font-size: 14px; line-height: 19.983333587646484px; margin: 0px; padding: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Helvetica, Arial, &#39;Droid Sans&#39;, sans-serif; font-size: 14px; line-height: 19.983333587646484px; margin: 0px; padding: 0px;&quot;&gt;
2012是我成为网易正式员工的第一年，也许是2011实习和试用期时太忙了，什么实习项目啊、试用期项目啊，还有参加公司篮球比赛拿了第二，于是上天给我过个轻松的半年，所以上半年里并没有太多困难的事情需要处理，然而也导致我颓废了半年。&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Helvetica, Arial, &#39;Droid Sans&#39;, sans-serif; font-size: 14px; line-height: 19.983333587646484px; margin: 0px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Helvetica, Arial, &#39;Droid Sans&#39;, sans-serif; font-size: 14px; line-height: 19.983333587646484px; margin: 0px; padding: 0px;&quot;&gt;
&lt;span data-mce-style=&quot;background-color: rgba(255, 255, 255, 0.0078125);&quot; style=&quot;background-color: rgba(255, 255, 255, 0.00392157);&quot;&gt;下半年就不一样了，工作上的挑战接踵而来，例如去解决game_monitor存在的很隐秘的bug、正式接手了yxsg的维护及维护方面的开发、还有接手平台部机器的维护和lvs的部署。这才发现原来我们的工作需要考虑很多方面的事情，而且所有事情是环环相扣，缺一不可。&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Helvetica, Arial, &#39;Droid Sans&#39;, sans-serif; font-size: 14px; line-height: 19.983333587646484px; margin: 0px; padding: 0px;&quot;&gt;
&lt;span data-mce-style=&quot;background-color: rgba(255, 255, 255, 0.0078125);&quot; style=&quot;background-color: rgba(255, 255, 255, 0.00392157);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Helvetica, Arial, &#39;Droid Sans&#39;, sans-serif; font-size: 14px; line-height: 19.983333587646484px; margin: 0px; padding: 0px;&quot;&gt;
&lt;span data-mce-style=&quot;background-color: rgba(255, 255, 255, 0.0078125);&quot; style=&quot;background-color: rgba(255, 255, 255, 0.00392157);&quot;&gt;在处理越来越多工作方面的事情之后发现，其实我们有很多东西在设计的时候并没有考虑完善，就拿yxsg来说，使用的维护基础架构工具竟然与新版不兼容，导致有很多功能无法实现，即使有些功能可以实现，但实现起来非常麻烦，结果我还要做版本迁移，同时还要重新写相应的维护模块。&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Helvetica, Arial, &#39;Droid Sans&#39;, sans-serif; font-size: 14px; line-height: 19.983333587646484px; margin: 0px; padding: 0px;&quot;&gt;
&lt;span data-mce-style=&quot;background-color: rgba(255, 255, 255, 0.0078125);&quot; style=&quot;background-color: rgba(255, 255, 255, 0.00392157);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Helvetica, Arial, &#39;Droid Sans&#39;, sans-serif; font-size: 14px; line-height: 19.983333587646484px; margin: 0px; padding: 0px;&quot;&gt;
&lt;span data-mce-style=&quot;background-color: rgba(255, 255, 255, 0.0078125);&quot; style=&quot;background-color: rgba(255, 255, 255, 0.00392157);&quot;&gt;lvs是我今年下半年学习的，在学习的过程中有所体会：原来做SA并不是想象中那么容易，对于一个系统，我需要去考虑它的负载均衡，它的可用性，它的安全，而这一切都是我原来所缺乏认识的。原本以为SA会是份很乏味的工作，结果发现竟然挑战重重，越来越有趣味，终于让我有了动力。&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Helvetica, Arial, &#39;Droid Sans&#39;, sans-serif; font-size: 14px; line-height: 19.983333587646484px; margin: 0px; padding: 0px;&quot;&gt;
&lt;span data-mce-style=&quot;background-color: rgba(255, 255, 255, 0.0078125);&quot; style=&quot;background-color: rgba(255, 255, 255, 0.00392157);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Helvetica, Arial, &#39;Droid Sans&#39;, sans-serif; font-size: 14px; line-height: 19.983333587646484px; margin: 0px; padding: 0px;&quot;&gt;
2012过去了，而我正式步入了2013，希望新的一年里工作上有更多的挑战，让我更充实。&lt;/div&gt;
&lt;/div&gt;
</description><link>http://xinminds.blogspot.com/2013/01/2012.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-5890593031107783496</guid><pubDate>Fri, 14 Sep 2012 05:22:00 +0000</pubDate><atom:updated>2012-09-14T13:22:56.063+08:00</atom:updated><title>用vim画表</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
看到标题，有人可能会觉得：用vim画表？不用ms office或者openoffice？&lt;br /&gt;
&lt;br /&gt;
事实上，我仅仅需要将一些数据表格化，并不使用到其它统计功能，无需使用到那么大型的工具；再者我平时使用vim较多，用vim编辑起来效率也挺高；而且，使用vim将数据表格化其实并不麻烦。于是乎，就有用vim画表这么一回事。&lt;br /&gt;
&lt;br /&gt;
方法很简单，一句话可以概括：就是使用vim的特殊字符输入功能，绘制表格边框。其实了解dos下wps制表的朋友对这种方法应该不陌生。&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
在vim里面，虽然不能直接输入特殊字符，但要输入其实并不麻烦。&lt;br /&gt;
例如，如果需要输入下表中第一行的制表字符，即横线，输入的方法：&lt;br /&gt;
首先，保证vim处于Insert模式，也就是按了a, i, o其中一个所进入的模式；&lt;br /&gt;
然后，按Ctrl + k，跟着输入hh。&lt;br /&gt;
就这样，很简单。&lt;br /&gt;
&lt;br /&gt;
下面是我用vim画的简单表格，看起来还不错。注意哦，没有用html画的。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_2qWqUZV6hTrB9YFyK2DoKWXWenfTY-0I5TPEL8WmXv2twjvRvTTNCbJVqxvRoBKQsKplSvOiWS0FdYAQA-r6UffycEbs_5uIblxtn03VcwEr8dIyZ1tQbX2njxhl5B4ZHa8UFrY1N58/s1600/vim_table.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;308&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_2qWqUZV6hTrB9YFyK2DoKWXWenfTY-0I5TPEL8WmXv2twjvRvTTNCbJVqxvRoBKQsKplSvOiWS0FdYAQA-r6UffycEbs_5uIblxtn03VcwEr8dIyZ1tQbX2njxhl5B4ZHa8UFrY1N58/s320/vim_table.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;table rules=&quot;groups&quot;&gt;
&lt;caption&gt;&lt;b&gt;制表字符对应表&lt;/b&gt;&lt;/caption&gt;
&lt;colgroup&gt;&lt;/colgroup&gt;&lt;colgroup&gt;
&lt;/colgroup&gt;&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;字符&lt;/th&gt;&lt;th&gt;vim输入码&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&amp;nbsp;─&lt;/td&gt;&lt;td&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;hh&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;nbsp;│&lt;/td&gt;&lt;td&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;vv&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;nbsp;┌&lt;/td&gt;&lt;td&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dr&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;nbsp;┐&lt;/td&gt;&lt;td&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dl&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;nbsp;└&lt;/td&gt;&lt;td&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ur&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;nbsp;┘&lt;/td&gt;&lt;td&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ul&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;nbsp;├&lt;/td&gt;&lt;td&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;vr&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;nbsp;┤&lt;/td&gt;&lt;td&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;vl&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;nbsp;┬&lt;/td&gt;&lt;td&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dh&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;nbsp;┴&lt;/td&gt;&lt;td&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;uh&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;nbsp;┼&lt;/td&gt;&lt;td&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;vh&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;</description><link>http://xinminds.blogspot.com/2012/09/vim.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_2qWqUZV6hTrB9YFyK2DoKWXWenfTY-0I5TPEL8WmXv2twjvRvTTNCbJVqxvRoBKQsKplSvOiWS0FdYAQA-r6UffycEbs_5uIblxtn03VcwEr8dIyZ1tQbX2njxhl5B4ZHa8UFrY1N58/s72-c/vim_table.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-7236439406411553105</guid><pubDate>Thu, 23 Aug 2012 05:25:00 +0000</pubDate><atom:updated>2012-08-23T13:25:01.893+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">High Availability</category><title>High Availability方案简单比较</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
1. keepalived + lvs&lt;br /&gt;
&amp;nbsp; &amp;nbsp;1.1. keepalived user guide: keepalived for lvs&lt;br /&gt;
&amp;nbsp; &amp;nbsp;1.2. keepalived.conf manual&lt;br /&gt;
&amp;nbsp; &amp;nbsp;1.1.和1.2.配合着阅读，很容易就能掌握keepalived。&lt;br /&gt;
&amp;nbsp; &amp;nbsp;keepalived非常简单易懂，而且配置十分容易且可靠。&lt;br /&gt;
&amp;nbsp; &amp;nbsp;机房里使用组播会有问题？&lt;br /&gt;
&lt;br /&gt;
2. heartbeat + pacemaker + ldirectord + lvs&lt;br /&gt;
&amp;nbsp; &amp;nbsp;2.1. 旧heartbeat方案 heartbeat + haresources + ldirectord + lvs&lt;br /&gt;
&amp;nbsp; &amp;nbsp;2.2. 新heartbeat方案，即linux-ha方案 heartbeat/corosync + pacemaker +&lt;br /&gt;
&amp;nbsp; &amp;nbsp;ldirectord + lvs&lt;br /&gt;
&amp;nbsp; &amp;nbsp;heartbeat新旧两种方案：两种方案对比，旧方案需要多配置haresources（最终还是将haresources转成cib），用于指定ra；新方案指定ra则直接使用pacemaker来操控cib，功能比旧方案要强大，并且十分灵活，但也带来了较高的复杂度，尤其是在使用pacemaker时需要理解的东西比旧方案多得多。&lt;br /&gt;
&amp;nbsp; &amp;nbsp;如果仅是简单使用双机主从策略来实现高可用，可直接使用旧方案（注意，旧方案最多只能支持双机）；但从长远利益来看，使用pacemaker会比较好。&lt;br /&gt;
&lt;br /&gt;
3. summary：&lt;br /&gt;
&amp;nbsp; &amp;nbsp;三种方案中，keepalived方案最为简单，旧heartbeat方案次之，最后是新heartbeat方案。&lt;br /&gt;
&amp;nbsp; &amp;nbsp;keepalived并不限制节点数，而且还可以对节点分组管理，对vip的控制甚至达到设备级别：例如，节点有eth0和eth1，两个都有各自的vip，eth0出现故障并不影响到eth1上的vip&lt;br /&gt;
&amp;nbsp; &amp;nbsp;新heartbeat方案，在ra控制上十分灵活，可以支持多种方案active/passive、N+1、N-N等&lt;br /&gt;
&amp;nbsp; &amp;nbsp;旧heartbeat方案，可以正常工作 =.=&quot;&lt;br /&gt;
&lt;/div&gt;
</description><link>http://xinminds.blogspot.com/2012/08/high-availability.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-5040412463172309152</guid><pubDate>Wed, 22 Aug 2012 06:10:00 +0000</pubDate><atom:updated>2013-01-05T11:17:53.951+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">debian</category><category domain="http://www.blogger.com/atom/ns#">heartbeat</category><category domain="http://www.blogger.com/atom/ns#">lvs</category><category domain="http://www.blogger.com/atom/ns#">高可用</category><title>在debian squeeze上安装和配置heartbeat、pacemaker和ldirectord实现简单的高可用方案</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
注意：下面的操作均以root用户身份执行。&lt;br /&gt;
&lt;br /&gt;
1. 安装heartbeat、pacemaker和ldirectord(事实还需要其它软件，但apt会自动处理信赖关系)&lt;br /&gt;
apt-get install heartbeat pacemaker ldirectord&lt;br /&gt;
&lt;br /&gt;
heartbeat、pacemaker和ldirectord三者之间的关系图(此处借用文章&lt;a href=&quot;http://hi.baidu.com/leolance/item/bdc6ecd9f49fc93b48e1dd49&quot;&gt;http://hi.baidu.com/leolance/item/bdc6ecd9f49fc93b48e1dd49&lt;/a&gt;中的结构图)：&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDdmlEOy-h3XRRH-o5u4ANN5NIt7z9iWc4-Oe-W97PTMqVloqkP-Ti71SDGzL8k9i6bJ06C8zkHAlinsRxzUilwMRqaHysiWAISUESlhyAqiGYLYfa8a7AwaxxNoYyaBsGLcKRXIzlfvA/s1600/d6bf46ddc23a87a639012f95.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDdmlEOy-h3XRRH-o5u4ANN5NIt7z9iWc4-Oe-W97PTMqVloqkP-Ti71SDGzL8k9i6bJ06C8zkHAlinsRxzUilwMRqaHysiWAISUESlhyAqiGYLYfa8a7AwaxxNoYyaBsGLcKRXIzlfvA/s1600/d6bf46ddc23a87a639012f95.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
其中，heartbeat为消息交换和基础结构层，pacemaker为资源分配层中的群集资源管理器(CRM)，此层还包括本地资源管理器(LRM，包含在cluster-glue软件包中)，ldirectord属于资源层，此处资源指代是的linux主机上可用的服务，只要某服务提供符合ocf或lsb标准的控制脚本(即提供了start、stop和status方法的脚本，/etc/init.d下的启停脚本大多符合这一标准)。&lt;br /&gt;
&lt;br /&gt;
下面假设192.168.10.134和192.168.10.136为两个lvs节点，vip为192.168.10.137，两台realserver分别是192.168.11.93和192.168.11.94，realserver上提供http服务。&lt;br /&gt;
&lt;br /&gt;
2. 配置heartbeat&lt;br /&gt;
配置ha.cf之前需要知道各节点的名字(在各节点上运行uname -n所得即是)，并配置各节点的hosts，使得可用节点的名字解析出相应ip。&lt;br /&gt;
例如：在节点192.168.10.134上运行uname -n，得到online10-134，于是在/etc/hosts中添加192.168.10.134 online10-134一行。&lt;br /&gt;
&lt;br /&gt;
注意：ha.cf和authkeys是lvs节点上的配置文件，两个lvs节点上的authkeys必须相同，ha.cf也应相同(可能发心跳的配置有些少不同，其他则相同)。&lt;br /&gt;
&lt;br /&gt;
2.1. ha.cf&lt;br /&gt;
cat /etc/ha.d/ha.cf&lt;br /&gt;
&amp;nbsp; &amp;nbsp; # enable pacemaker, without stonith&lt;br /&gt;
&amp;nbsp; &amp;nbsp; crm yes&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; # log where?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; debugfile /var/logs/heartbeat/ha-debug&lt;br /&gt;
&amp;nbsp; &amp;nbsp; logfile /var/logs/heartbeat/ha-log&lt;br /&gt;
&amp;nbsp; &amp;nbsp; logfacility &amp;nbsp; &amp;nbsp; local0&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; # warning of soon be dead&lt;br /&gt;
&amp;nbsp; &amp;nbsp; warntime 10&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; # declare a host (the other node) dead after:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; deadtime 20&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; # dead time on boot (could take some time until net is up)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; initdead 120&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; # time between heartbeats&lt;br /&gt;
&amp;nbsp; &amp;nbsp; keepalive 2&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; # the nodes&lt;br /&gt;
&amp;nbsp; &amp;nbsp; node online10-134&lt;br /&gt;
&amp;nbsp; &amp;nbsp; node online10-136&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; # heartbeats, over dedicated replication interface!&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ucast eth0 192.168.10.134&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ucast eth0 192.168.10.136&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; # ping the switch to assure we are online&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ping 192.168.10.1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; auto_failback on&lt;br /&gt;
&lt;br /&gt;
2.2. authkeys&lt;br /&gt;
cat /etc/ha.d/authkeys&lt;br /&gt;
&amp;nbsp; &amp;nbsp; auth 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 1 sha1 c4920938a12dfa6d9110834c49479b6c&lt;br /&gt;
&lt;br /&gt;
可用下面命令在一个节点中生成随机的密钥，然后复制到各节点。注意：各节点中的authkeys文件必须相同，权限也必须为0600。&lt;br /&gt;
( echo -ne &quot;auth 1\n1 sha1 &quot;; \&lt;br /&gt;
&amp;nbsp; dd if=/dev/urandom bs=512 count=1 | openssl md5 ) \&lt;br /&gt;
&amp;nbsp; &amp;gt; /etc/ha.d/authkeys&lt;br /&gt;
chmod 0600 /etc/ha.d/authkeys&lt;br /&gt;
&lt;br /&gt;
3. 配置ldirectord&lt;br /&gt;
&lt;br /&gt;
注意：ldirectord.cf是lvs节点上的配置文件，两个lvs节点上的ldirectord.cf内容相同。&lt;br /&gt;
&lt;br /&gt;
cat /etc/ldirectord.cf&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; checktimeout=3&lt;br /&gt;
&amp;nbsp; &amp;nbsp; checkinterval=1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; autoreload=yes&lt;br /&gt;
&amp;nbsp; &amp;nbsp; logfile=&quot;info&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; emailalert=&quot;admin@foo.com&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; emailalertfreq=3600&lt;br /&gt;
&amp;nbsp; &amp;nbsp; emailalertstatus=all&lt;br /&gt;
&amp;nbsp; &amp;nbsp; quiescent=no&lt;br /&gt;
&amp;nbsp; &amp;nbsp; fallback=192.168.10.137:80 gate 3&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; virtual=192.168.10.137:80&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; real=192.168.11.93:80 gate 3&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; real=192.168.11.94:80 gate 3&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; service=http&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scheduler=wrr&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; persistent=60&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; protocol=tcp&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; checktype=connect&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; checkport=80&lt;br /&gt;
&lt;br /&gt;
4. 使用pacemaker添加资源&lt;br /&gt;
pacemaker提供一个交互的shell用于控制资源。以下操作均在crm shell下的configure子项中进行。&lt;br /&gt;
添加vip资源:&lt;br /&gt;
primitive ip ocf:heartbeat:IPaddr2 \&lt;br /&gt;
&amp;nbsp; &amp;nbsp;op monitor interval=&quot;60&quot; timeout=&quot;20&quot; \&lt;br /&gt;
&amp;nbsp; &amp;nbsp;params ip=&quot;192.168.10.137&quot; lvs_support=&quot;true&quot;&lt;br /&gt;
添加ldirectord资源:&lt;br /&gt;
primitive lvs ocf:heartbeat:ldirectord \&lt;br /&gt;
&amp;nbsp; &amp;nbsp;op monitor interval=&quot;20&quot; timeout=&quot;10&quot;&lt;br /&gt;
将vip和ldirectord绑定一个组:&lt;br /&gt;
group ip-lvs ip lvs&lt;/div&gt;
</description><link>http://xinminds.blogspot.com/2012/08/debian-squeezeheartbeatpacemakerldirect.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDdmlEOy-h3XRRH-o5u4ANN5NIt7z9iWc4-Oe-W97PTMqVloqkP-Ti71SDGzL8k9i6bJ06C8zkHAlinsRxzUilwMRqaHysiWAISUESlhyAqiGYLYfa8a7AwaxxNoYyaBsGLcKRXIzlfvA/s72-c/d6bf46ddc23a87a639012f95.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-4384462031942067698</guid><pubDate>Fri, 06 Jul 2012 03:42:00 +0000</pubDate><atom:updated>2012-07-13T10:54:01.234+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Linux/Unix</category><category domain="http://www.blogger.com/atom/ns#">mysql</category><title>在debian squeeze上编译安装mysql-5.5.24</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;由于mysql-5.5已经发布，为了观察mysql-5.5的性能如何，这次决定在deiban上使用mysql-5.5.24，但debian源上并没有mysql-5.5，因此需要编译安装。&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;准备&lt;/b&gt;&lt;br /&gt;
首先去下载mysql-5.5.24&lt;br /&gt;
&lt;br /&gt;
另外从源码编译mysql-5.5.24还需要安装以下包：&lt;br /&gt;
&lt;code&gt;aptitute install cmake make gcc g++ ncurses-dev&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;编译及安装&lt;/b&gt;
&lt;br /&gt;
解压源码包：&lt;br /&gt;
&lt;code&gt;tar xvf mysql-5.5.24.tar.gz &amp;amp;&amp;amp; cd mysql-5.5.24&lt;/code&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
编译及安装：&lt;br /&gt;
&lt;code&gt;cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.5.24 &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install&lt;/code&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;后续操作&lt;/b&gt;&lt;br /&gt;
添加用户和用户组并修改属主：&lt;br /&gt;
&lt;code&gt;
groupadd mysql&lt;br /&gt;
useradd -r -g mysql mysql&lt;br /&gt;
cd /usr/local/mysql-5.5.24&lt;br /&gt;
chown -R mysql .&lt;br /&gt;
chgrp -R mysql .&lt;br /&gt;
scripts/mysql_install_db --user=mysql&lt;br /&gt;
chown -R root .&lt;br /&gt;
&lt;/code&gt;
&lt;br /&gt;
&lt;b&gt;参考&lt;/b&gt;&lt;br /&gt;
源码包中的INSTALL-SOURCE关于安装mysql需要的软件：&lt;br /&gt;
&lt;pre&gt;&lt;pre class=&quot;code&quot; style=&quot;background-color: #f7f9fa; border-bottom-color: rgb(204, 204, 204); border-bottom-style: dashed; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: dashed; border-top-width: 1px; color: #333333; font-family: monospace, serif; font-size: 13px; line-height: 19px; margin-bottom: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em; text-align: justify; width: auto !important;&quot;&gt;Source Installation System Requirements

   Installation of MySQL from source requires several development
   tools. Some of these tools are needed no matter whether you use a
   standard source distribution or a development source tree. Other
   tool requirements depend on which installation method you use.

   To install MySQL from source, your system must have the following
   tools, regardless of installation method:

     * CMake, which is used as the build framework on all platforms.
       CMake can be downloaded from http://www.cmake.org.

     * A good make program. Although some platforms come with their
       own make implementations, it is highly recommended that you
       use GNU make 3.75 or newer. It may already be available on
       your system as gmake. GNU make is available from
       http://www.gnu.org/software/make/.

     * A working ANSI C++ compiler. GCC 4.2.1 or later, Sun Studio 10
       or later, Visual Studio 2008 or later, and many current
       vendor-supplied compilers are known to work.

     * Perl is needed if you intend to run test scripts. Most
       Unix-like systems include Perl. On Windows, you can use a
       version such as ActiveState Perl.&lt;/pre&gt;
&lt;/pre&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;源码包中INSTALL-SOURCE关于mysql的相关操作步骤：&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;code&quot; style=&quot;background-color: #f7f9fa; border-bottom-color: rgb(204, 204, 204); border-bottom-style: dashed; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: dashed; border-top-width: 1px; color: #333333; font-family: monospace, serif; font-size: 13px; line-height: 19px; margin-bottom: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em; text-align: justify; width: auto !important;&quot;&gt;# Preconfiguration setup
shell&amp;gt; groupadd mysql
shell&amp;gt; useradd -r -g mysql mysql
# Beginning of source-build specific instructions
shell&amp;gt; tar zxvf mysql-VERSION.tar.gz
shell&amp;gt; cd mysql-VERSION
shell&amp;gt; cmake .
shell&amp;gt; make
shell&amp;gt; make install
# End of source-build specific instructions
# Postinstallation setup
shell&amp;gt; cd /usr/local/mysql
shell&amp;gt; chown -R mysql .
shell&amp;gt; chgrp -R mysql .
shell&amp;gt; scripts/mysql_install_db --user=mysql
shell&amp;gt; chown -R root .
shell&amp;gt; chown -R mysql data
# Next command is optional
shell&amp;gt; cp support-files/my-medium.cnf /etc/my.cnf
shell&amp;gt; bin/mysqld_safe --user=mysql &amp;amp;
# Next command is optional
shell&amp;gt; cp support-files/mysql.server /etc/init.d/mysql.server&lt;/pre&gt;
&lt;/div&gt;</description><link>http://xinminds.blogspot.com/2012/07/debian-squeezemysql-5524.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-8187068341598467347</guid><pubDate>Mon, 21 May 2012 06:34:00 +0000</pubDate><atom:updated>2012-07-06T11:49:07.686+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Veer</category><category domain="http://www.blogger.com/atom/ns#">触屏</category><title>解决Veer触摸屏无响应</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;这几天想给我的veer试试webOS 2.2.4，谁知道一直刷不成功。&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;一开始不成功时，直接刷回stay，竟然触摸屏不行了，当场吓一跳，立刻刷官方rom，可以了。&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;今天不死心，又想试试2.2.4，可是还是刷不成功，于是又刷回官方rom，可是这次触摸屏真不行了，刷了几次还是那样。难道我的veer这么快就死了？&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 心想，veer能刷机，能正常使用组合键重启和关机，怎么可能会死呢？肯定是触摸屏的驱动有问题了。&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 于是回头查查，原来真的是在刷2.2.4的时候给修改了触摸屏的驱动。后来如果要刷回来的话，要手动把驱动给弄回来。&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 命令是：&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; #stop hidd&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; #/usr/bin/PmTpUpdater -f&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; #start hidd&lt;br /&gt;
&lt;br /&gt;
搞定，收工！&lt;/div&gt;</description><link>http://xinminds.blogspot.com/2012/05/veer.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>4</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-4997134076861777567</guid><pubDate>Sat, 17 Mar 2012 07:30:00 +0000</pubDate><atom:updated>2012-07-06T11:50:24.361+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Kindle Touch</category><category domain="http://www.blogger.com/atom/ns#">unbrick</category><title>Kindle Touch Bricked? --虚惊一场</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;悲剧出现&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 昨天入手的kindle touch，今天让我虚惊一场！

由于kt自带的中文字体实在不行，因此我决定把它换掉。过程无非是越狱，开启usbnet，替换字体。整个过程很简单，很快就搞定了。&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 今天上网一看，原来kt有新固件了，于是reset然后升级，同样很顺利。于是准备换字体，于是touch ENABLE_DIAGS，删掉/diagnostic_logs/并重启，进入之后想disable diagnostic，但提示device_info.xml找不到，不理它继续操作，然后重启，岂料kt还是进入了diagnostic模式。&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 继续那些操作，但kt重启后一直停留在diagnostic模式中！！！难道我的kt这么快就bricked了？这时真是心如刀割啊！&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 忍住悲痛，我Google了一下，发现mobileread的&lt;a href=&quot;http://wiki.mobileread.com/wiki/Kindle_Touch_Hacking&quot;&gt;wiki&lt;/a&gt;中有说：&lt;br /&gt;
&lt;pre&gt;Do not delete /diagnostic_logs/device_info.xml from a USB Drive exorted from the diagnostic recovery menu screen, or it will be difficult to reboot to the main partition.&lt;/pre&gt;
&amp;nbsp; &amp;nbsp; 晴天霹雳啊！！我已经删了，我的kt岂不是没救了？！真命苦啊！我的kt服役还不到24小时啊！&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;峰回路转&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 在不死心的情况下，我再尝试了几次操作，结果是kt一直进入diagnostic模式。这时心里已经滴血了！然而，在偶然一次操作下，点了USB device mode，然后电脑就进入了kindle的根目录，这时我就想：如果重新建立一个device_info.xml文件，会如何？于是一番操作，然后disable diagnostic，没提示device_info.xml找不到了！&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 这时眼前仿佛见到一点希望之光！&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 于是reboot，熟悉的进度条在慢慢的跑。这时心是“砰--砰--”的跳啊！等了一下，kt终于进入了home界面，同时还看到有一本书在pending。于是我赶紧点一本书来看看怎样，ok，完全正常！&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Oh yeah！我亲爱的kt回来啦！&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;总结&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 原来将diagnostic_logs/device_info.xml删掉，同时进入diagnostic模式会导致kindle touch无法disable diags从而不能进入正常模式的；而解决这一问题则可以USB device mode之后，在kindle的根目录下新建diagnostic_logs这个文件夹，并在该文件夹中新建一个名叫device_info.xml的空文件，然后进行disable diags操作就可以了。&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 真是虚惊一场啊！&lt;/div&gt;</description><link>http://xinminds.blogspot.com/2012/03/kindle-touch-bricked.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-2095538792799391650</guid><pubDate>Wed, 07 Mar 2012 08:27:00 +0000</pubDate><atom:updated>2012-03-07T16:27:21.506+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ssh</category><title>为不同host设置独立的ssh选项</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&amp;nbsp; &amp;nbsp; 到厂里之后需要维护很多主机，每次维护都是ssh到主机再操作。出于安全性的考虑，厂里大多数主机都改了sshd的监听端口，同时需要使用public key认证方式。随着时间的推移，需要维护的主机数量也在增多；而这些主机当中各有各的需求选项，例如端口不同等。这样导致我每次维护都需要去看维护的主机的端口是啥，而且每次还要手动输入等，太麻烦了！需要找一个解决方法。&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 于是去查阅ssh相关资料，发现：可以在配置文件$HOME/.ssh/config中为不同的主机设置专属的选项。这样每次连接仅需要ssh host-ip就可以了。下面给出配置文件的例子，相关选项的解释可以查看ssh_config(5)。&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
# Global Option&lt;br /&gt;
# 主生效选项，如果选项在这里设置了，则取这里的值，并忽略Host段中的选项值&lt;br /&gt;
TCPKeepAlive yes&lt;br /&gt;
&lt;br /&gt;
Host 192.168.10.? &amp;nbsp; &amp;nbsp;# 可以使用通配符*和?&lt;br /&gt;
&amp;nbsp;Port 2222&lt;br /&gt;
&amp;nbsp;User You&lt;br /&gt;
&lt;br /&gt;
Host !172.18.10.1 172.18.10.? &amp;nbsp; # 除了172.18.10.1之外的所有主机&lt;br /&gt;
&amp;nbsp;Port 3332&lt;br /&gt;
&amp;nbsp;User He&lt;br /&gt;
&lt;br /&gt;
Host *.domain.domain&lt;br /&gt;
&amp;nbsp;Port 4442&lt;br /&gt;
&amp;nbsp;User She&lt;br /&gt;
&lt;br /&gt;
Host 172.16.10.1 172.16.10.2 172.16.20.2? # 多个主机使用空格分隔&lt;br /&gt;
&amp;nbsp;Port 5552&lt;br /&gt;
&amp;nbsp;User They&lt;/div&gt;
&lt;/code&gt;</description><link>http://xinminds.blogspot.com/2012/03/hostssh.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-8366490668384601407</guid><pubDate>Fri, 24 Feb 2012 09:29:00 +0000</pubDate><atom:updated>2012-07-06T11:49:53.371+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">trap</category><title>trap do_something sig1, sig2, ...</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
最近看了一些bash脚本，其中一些脚本修改了对一些信号的响应。虽然以前有听说过这个功能，但并未主动了解过。现在要用到，于是man了一下，看了trap的简单用法：&lt;br /&gt;
&lt;code&gt;trap do_something sig1, sig2, ...&lt;/code&gt;&lt;br /&gt;
意思是当收到信号sig1, sig2, ... 其中一个信号时，就执行do_something这个操作。&lt;/div&gt;</description><link>http://xinminds.blogspot.com/2012/02/trap-dosomething-sig1-sig2.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-5085891035251043274</guid><pubDate>Sun, 15 Jan 2012 03:45:00 +0000</pubDate><atom:updated>2012-07-06T11:48:04.103+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Linux/Unix</category><category domain="http://www.blogger.com/atom/ns#">win键</category><category domain="http://www.blogger.com/atom/ns#">xmodmap</category><title>在linux下禁用Win键和调换Caps Lock键与左Ctrl键的位置</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
由于新手提实在是有点重，加之在家里也很少会用到这部手提，于是决定把新手提放在厂里，在家里的时候就把那台古董手提拿出来用。可是古董手提的键盘有点毛病: win键有问题，它表面是没按下去的，但实际上却断断续续地告诉系统它是按下去了的。为此，我要禁用它。&lt;br /&gt;
幸亏，在linux下要禁用win键非常容易，仅仅需要两条命令。&lt;br /&gt;
1. xmodmap -e &#39;remove mod4 = Super_L&#39;&lt;br /&gt;
2. xmodmap -e &#39;keycode 133 = &#39;&lt;br /&gt;
第一条命令是将win键(在我的系统是它的keysym是Super_L)从修饰符mod4中去除; 第二条命令则是将keycode 133(win键的keycode)映射为空键。&lt;br /&gt;
可以将其这两命令写成相应的配置文件.xmodmaprc，然后让系统进入桌面环境时自动加载该配置文件。&lt;br /&gt;
配置文件中相应的配置部分:&lt;br /&gt;
&lt;code&gt;
remove mod4 = Super_L&lt;br /&gt;
keycode 133 =&lt;br /&gt;
&lt;/code&gt;
&lt;br /&gt;
调换Caps Lock与左Ctrl键的位置的配置部分:&lt;br /&gt;
&lt;code&gt;
remove lock = Caps_Lock&lt;br /&gt;
remove Control = Control_L&lt;br /&gt;
keysym Control_L = Caps_Lock&lt;br /&gt;
keysym Caps_Lock = Control_L&lt;br /&gt;
add Lock = Caps_Lock&lt;br /&gt;
add Control = Control_L&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;最后使用命令xmodmap .xmodmaprc加载配置文件。&lt;/code&gt;&lt;/div&gt;
&lt;code&gt;
&lt;/code&gt;&lt;/div&gt;</description><link>http://xinminds.blogspot.com/2012/01/linuxwincaps-lockctrl.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-3065753306490047785</guid><pubDate>Thu, 29 Dec 2011 08:50:00 +0000</pubDate><atom:updated>2011-12-29T16:50:04.308+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">pydiction</category><category domain="http://www.blogger.com/atom/ns#">snipMate</category><category domain="http://www.blogger.com/atom/ns#">Vim</category><title>vim + snipmate + pydiction</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
已经用vim写python有一段时间了，越来越觉得不方便。虽然我已经装了snipMate和pydiction，但两者默认配置是有冲突的，因为这两个插件都使用了Tab。今天终于忍不了，决定改一下，让vim使用起来更舒服。&lt;br /&gt;
&lt;br /&gt;
考虑到自己除了写python，还要写shell，c，tex等，显然snipMate的适用范围较广，于是决定pydiction给snipMate让路: 将pydiction的Tab改为Ctrl - n，Shift + Tab改为Ctrl - p (emacs的同学很熟悉这两个键吧？XD)&lt;br /&gt;
&lt;br /&gt;
看了一下python_pydiction.vim代码，修改并不难，就是将相应的键盘映射修改一下。&lt;br /&gt;
首先修改的是Tab的映射: (&lt;b&gt;千万注意符号&amp;gt;并非行尾，最后还有个空格的！！！&lt;/b&gt;)&lt;br /&gt;
&quot;inoremap &amp;lt;silent&amp;gt; &amp;lt;buffer&amp;gt; &amp;lt;Tab&amp;gt;&amp;nbsp;&quot; ==&amp;gt; &quot;inoremap &amp;lt;silent&amp;gt; &amp;lt;buffer&amp;gt; &amp;lt;C-n&amp;gt;&lt;br /&gt;
接着是Shift + Tab的映射: (同意要注意是空格结尾！)&lt;br /&gt;
&quot;inoremap &amp;lt;silent&amp;gt; &amp;lt;buffer&amp;gt; &amp;lt;S-Tab&amp;gt;&amp;nbsp;&quot; ==&amp;gt; &quot;inoremap &amp;lt;silent&amp;gt; &amp;lt;buffer&amp;gt; &amp;lt;C-p&amp;gt; &quot;&lt;br /&gt;
&lt;br /&gt;
到这里，冲突就解决掉了。&lt;br /&gt;
&lt;br /&gt;
对于snipMate的使用，默认的模板已经足够好了，但我还是想改一下来满足我的一个需求，就是#!的补全是:&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
# -*- coding: utf-8 -*-&lt;br /&gt;
# Filename: `正在编辑器的文件的名字`&lt;br /&gt;
&lt;br /&gt;
查了一下snipMate的帮助文档，发现这个插件的确做得很好，需要的工具都提供了。python.snippets的修改如下:&lt;br /&gt;
snippet #!&lt;br /&gt;
&amp;nbsp; &amp;nbsp; #!/usr/bin/env python&lt;br /&gt;
&amp;nbsp; &amp;nbsp; # -*- coding: utf-8 -*-&lt;br /&gt;
&amp;nbsp; &amp;nbsp; # Filename: `Filename(&#39;$1.py&#39;, &#39;filename.py&#39;)&lt;br /&gt;
&lt;br /&gt;
解释一下Filename(&#39;$1.py&#39;, &#39;filename.py&#39;): 如果正在编辑的文件已经有名字了的，则使用当前的名字，如果没有则使用filename.py这个名字。&lt;/div&gt;</description><link>http://xinminds.blogspot.com/2011/12/vim-snipmate-pydiction.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-3941655328733200640</guid><pubDate>Mon, 19 Dec 2011 07:56:00 +0000</pubDate><atom:updated>2011-12-19T15:57:54.827+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">bash</category><category domain="http://www.blogger.com/atom/ns#">ifs</category><title>操作名字有空格的文件</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
最近操作到名字中有空格的文件, 总是出错, 因此查阅了abs, 终于有了一个方法, 就是暂时改变IFS.&lt;br /&gt;
&lt;br /&gt;
例子:&lt;br /&gt;
$ mpc listall&lt;br /&gt;
今天等我来.mp3&lt;br /&gt;
葡萄成熟时.mp3&lt;br /&gt;
单车.mp3&lt;br /&gt;
Beyond-遥望黄家驹不死音乐精神(AMCD)/CDImage.ape&lt;br /&gt;
Diamond Collection/艾薇儿 拉维妮(Avril Lavigne) - My Happy Ending.mp3&lt;br /&gt;
Freedom/阿肯(Akon) - Beautiful.mp3&lt;br /&gt;
King Of Pop CD1/迈克尔 杰克逊(Michael Jackson) - Beat It.mp3&lt;br /&gt;
Rock &#39;N&#39; Roll/约翰 列侬(John Lennon) - Stand By Me.mp3&lt;br /&gt;
The Best Damn Thing/艾薇儿 拉维妮(Avril Lavigne) - When Youre Gone.mp3&lt;br /&gt;
The Best Damn Thing/艾薇儿 拉维妮(Avril Lavigne) - Innocence.mp3&lt;br /&gt;
The Fame/Lady GaGa - Just Dance.mp3&lt;br /&gt;
The Fame/Lady GaGa - Love Game.mp3&lt;br /&gt;
The Fame/Lady GaGa - Paparazzi.mp3&lt;br /&gt;
The Fame/Lady GaGa - Poker Face.mp3&lt;br /&gt;
The Fame/Lady GaGa - The Fame.mp3&lt;br /&gt;
The Fame/Lady GaGa - Brown Eyes.mp3&lt;br /&gt;
The Fame Monster (Deluxe Edition) CD1/Lady GaGa - Bad Romance.mp3&lt;br /&gt;
The Fame Monster (Deluxe Edition) CD1/Lady GaGa - Speechless.mp3&lt;br /&gt;
U-87/陈奕迅 - 浮夸.mp3&lt;br /&gt;
Ultrasound乐之路1997-2003 CD1/陶喆 - Melody.mp3&lt;br /&gt;
Ultrasound乐之路1997-2003 CD2/陶喆 - 爱 很简单.mp3&lt;br /&gt;
十八般武艺/王力宏 - 你不知道的事.mp3&lt;br /&gt;
单曲 - 柴米油盐酱醋茶/王力宏 - 柴米油盐酱醋茶.mp3&lt;br /&gt;
唐朝/唐朝乐队 - 梦回唐朝.mp3&lt;br /&gt;
唐朝/唐朝乐队 - 国际歌.mp3&lt;br /&gt;
天高地厚/信乐团 - 离歌.mp3&lt;br /&gt;
滚石香港黄金十年 伍佰精选/伍佰 - 挪威的森林.mp3&lt;br /&gt;
&lt;br /&gt;
$ IFS=$&#39;\012&#39;&lt;br /&gt;
$ for name in $( mpc listall)&lt;br /&gt;
&amp;gt; do&lt;br /&gt;
&amp;gt; &amp;nbsp; &amp;nbsp; mpc add $name&lt;br /&gt;
&amp;gt; done&lt;br /&gt;
$&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</description><link>http://xinminds.blogspot.com/2011/12/blog-post.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-7178361860731002042</guid><pubDate>Wed, 23 Nov 2011 06:34:00 +0000</pubDate><atom:updated>2011-11-23T14:35:36.876+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Archlinux</category><category domain="http://www.blogger.com/atom/ns#">VirtualBox</category><category domain="http://www.blogger.com/atom/ns#">windows</category><title>Arch Linux + VirtualBox + Windows XP</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;最近厂里的电脑内存加到了4G，因此我可以将其当成Srv来使用了(而且我自己带手提，用台式机就像Srv那样开着吧)。由于办公即时通讯必须使用popo，虽然linux下已有pidgin的插件(由于某些原因，只能内部使用)，奈何bug太多，另功能实在鸡肋，无奈只好使用windows。问题是我习惯了linux，并且已经使用了5年多，而且除了im之外，很多工作上的东西需要使用linux的。于是通过一番思考，得出了这么一个方案：Arch Linux + VirtualBox + Win XP + popo。这个方案，由于之前机器的内存只有2G，虚拟的xp只能使用512M(想想512M，这是4年前的基本配置，用起来有多痛苦)，这太影响效率了。但现在可以将内存加到1G，甚至2G了！&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;由于我想将Arch Linux当成Srv使用，显然并不想开X，而现在的VirtualBox也可以在无X的情况下运行(VBoxManage startvm &lt;your host=&quot;&quot; virtual=&quot;&quot;&gt; --type headless)，可是我使用的XP必须有图形界面啊，没关系，VBox本身支持rdp，也就是windows的远程连接所用到的协议(这需要安装VBox的扩展包)。因此，以上方案确实可行，而我也使用了大半个月了。&lt;/your&gt;&lt;br /&gt;
&lt;br /&gt;
附使用VBoxManage给guest主机添加或切换iso的方法：&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;前两天，由于某些原因需要在xp上使用iso中的工具。在使用图形界面下，添加和切换iso很方便，鼠标动几下就OK了，但现在这里并没有使用图形界面。没关系，cli也可以解决这个问题。&lt;br /&gt;
&lt;br /&gt;
命令格式:&lt;br /&gt;
VBoxManage storageattach 虚拟主机名字 --storagectl &#39;IDE 控制器&#39; --port 1 --device 0 --type dvddrive --medium iso镜像(不是在镜像的当前目录运行该命令的话则需要添加完整路径)&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</description><link>http://xinminds.blogspot.com/2011/11/arch-linux-virtualbox-windows-xp.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-2790750998846217193</guid><pubDate>Tue, 25 Oct 2011 09:04:00 +0000</pubDate><atom:updated>2011-10-25T17:06:31.349+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Linux/Unix</category><category domain="http://www.blogger.com/atom/ns#">Openvpn</category><category domain="http://www.blogger.com/atom/ns#">Pptp</category><category domain="http://www.blogger.com/atom/ns#">Veer</category><category domain="http://www.blogger.com/atom/ns#">Vpn</category><title>Veer使用openvpn转pptp vpn翻墙</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;前几天入手了一个hp veer，商家刷了汉化补丁并安装了一些应用。用着觉得还是不舒服，于是我就重新刷了原版的rom，并用preware安装了一些补丁和应用，用起来顺手很多。但突然发现，veer的vpn配置里只有vpnc和cisco这两种，而我购买的vpn是pptp类型的。在preware里搜了一下pptp无果，难道说我的veer就只能在墙内使用？当然不是了，因为还可以使用openvpn。&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Veer可以使用openvpn，而我手上只有pptp vpn，于是我就想在一台机子里搭建一个openvpn srv，然后将这个openvpn的出口都由pptp转出去，这个转发只需使用iptables就搞定了。显然，这里操作都是在Linux下进行的，其他平台能否使用就不知道了。&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;具体方法: (我使用的是Archlinux)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1. 服务器端&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 安装openvpn&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # pacman -S openvpn&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 生成证书&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # cp -r /usr/share/openvpn/easy-rsa /etc/openvpn&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # cd /etc/openvpn/easy-rsa&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;# . ./vars&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;# ./clean-all&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;# ./build-ca&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # ./build-key-server &lt;b&gt;主机名&lt;/b&gt;   # 注意这里不要添加密码，这里主机名是你的机器的主机名，可用hostname查看&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # ./build-dh&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;# ./build-key &lt;b&gt;客户端主机名&lt;/b&gt;&amp;nbsp; # 同样不加密码，客户端主机名随意弄个就行，如veer。这里所有的证书都保存在/etc/openvpn/easy-rsa/keys中，需要将客户端使用的证书发送给客户端&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 配置openvpn (这里我使用证书验证，使用密码验证的请自行Google) &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /etc/openvpn/openvpn.conf:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;port 1194&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;proto tcp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dev tun0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ca /etc/openvpn/easy-rsa/keys/ca.crt&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cert /etc/openvpn/easy-rsa/keys/&lt;/span&gt;&lt;b style=&quot;background-color: transparent;&quot;&gt;主机名.crt&lt;/b&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp;# 这里要注意证书的名字&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;key /etc/openvpn/easy-rsa/keys/&lt;/span&gt;&lt;b style=&quot;background-color: transparent;&quot;&gt;主机名.key&lt;/b&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp;# 同样是证书的名字&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dh /etc/openvpn/easy-rsa/keys/dh1024.pem&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;server 10.8.0.0 255.255.255.0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # vpn的网段，自己设吧&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ifconfig-pool-persist ipp.txt&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;keepalive 10 120&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;comp-lzo&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;user nobody&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;group nobody&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;persist-key&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;persist-tun&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;status /var/log/openvpn-status.log&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;verb 3&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;log-append /var/log/openvpn&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;status /tmp/vpn.status 10&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;push &quot;dhcp-option DNS 8.8.8.8&quot;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;push &quot;redirect-gateway local&quot;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;修改服务器的转发配置：&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ＃ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ＃ iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o ppp0 -j SNAT --to pptp_vpn网卡的地址&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ＃ /etc/rc.d/iptables save&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;运行openvpn srv:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ＃ /etc/rc.d/openvpn start&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2. 客户端 &amp;nbsp;(即veer)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 在veer里使用preware安装openvpn, Xecutah, XServer, XTerm, openssh等。&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 首先在一台机子上写好客户端的配置，然后使用scp将客户端需要的证书和配置一同传过去就好了。&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 配置文件 veer.conf: (这个名字可以随意起)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; client            remote 服务器的ip 1194&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dev tun0&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; proto tcp&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; resolv-retry infinite&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;nobind&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;persist-key&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;persist-tun&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;verb 2&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;ca ca.crt&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cert &lt;/span&gt;&lt;b style=&quot;background-color: transparent;&quot;&gt;客户端主机名.crt&lt;/b&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; # 注意证书的名字，这些证书就是前面生成的&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; key &lt;/span&gt;&lt;b style=&quot;background-color: transparent;&quot;&gt;客户端主机名.key&lt;/b&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; # 同样是证书的名字&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; comp-lzo&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;使用scp把证书和配置传到veer: (注意，这是在veer上的XTerm中进行操作)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # scp -r root@服务器的ip:/root/openvpn &lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt; # 注意最后有一点，&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;这里假设证书和客户端配置都是放在服务器的/root/openvpn目录中&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # cd openvpn &amp;amp;&amp;amp; openvpn veer.conf         # 认证通过就可以翻墙了&lt;/span&gt;&lt;/div&gt;</description><link>http://xinminds.blogspot.com/2011/10/veeropenvpnpptp-vpn.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-2784199577930342305</guid><pubDate>Mon, 01 Aug 2011 01:42:00 +0000</pubDate><atom:updated>2011-08-01T09:42:35.336+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">gnome3</category><category domain="http://www.blogger.com/atom/ns#">Linux/Unix</category><title>&quot;No default terminal command has been defined&quot; in Gnome 3</title><description>I have just installed arch in my new laptop and setup Mod4+Enter to launch gnome-terminal on gnome 3, but it didn&#39;t come out. After google it, the reason turned out to be: Gnome 3 is pured installed. Here&#39;s the way to solve the problem, just run two commands below:&lt;br /&gt;
&lt;i&gt;gconftool-2 --type=string --set &quot;/desktop/gnome/applications/terminal/exec&quot; &quot;gnome-terminal&quot;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;gconftool-2 --type=string --set &quot;/desktop/gnome/applications/terminal/exec_args&quot; -- &quot;-x&quot;&lt;/i&gt;</description><link>http://xinminds.blogspot.com/2011/08/no-default-terminal-command-has-been.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-7231202879350363964</guid><pubDate>Mon, 01 Aug 2011 01:35:00 +0000</pubDate><atom:updated>2011-08-01T09:35:08.605+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">chromium/chrome</category><category domain="http://www.blogger.com/atom/ns#">proxy.pac</category><title>set up proxy for chromium on awesome</title><description>I use chromium on awesome and my os is arch64. Because of the GFW, I have to setup proxy so that I can surf the Internet smoothly. Here&#39;s the way:&lt;br /&gt;
&lt;br /&gt;
1. (temp way) type the below command in your terminal:&lt;br /&gt;
   auto_proxy=&quot;file:///path/to/your/proxy/pac&quot; chromium-browser&lt;br /&gt;
2. (permenant way) &lt;br /&gt;
   &lt;i&gt;export auto_proxy=&quot;file:///path/to/your/proxy/pac&quot;&lt;/i&gt; in &lt;i&gt;$HOME/.profile&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
then you can surf the Internet out of the GFW.&lt;br /&gt;
&lt;br /&gt;
P.S. you can use the pac generated by http://autoproxy2pac.appspot.com/. Thank autoproxy for the contribution.</description><link>http://xinminds.blogspot.com/2011/08/set-up-proxy-for-chromium-on-awesome.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-2462386261634373819</guid><pubDate>Tue, 24 May 2011 07:44:00 +0000</pubDate><atom:updated>2011-05-24T15:44:57.767+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Linux/Unix</category><category domain="http://www.blogger.com/atom/ns#">Samba</category><title>/etc/fstab &amp; samba</title><description>Our department uses a windows server to share something, but I use arch, so I have to install samba. It&#39;s not difficult to mount that server but it&#39;s inconvenient to mount it manually everytime I reboot.&lt;br /&gt;
So I decide to use /etc/fstab to mount it automatically. Lines in /etc/fstab looks like this:&lt;br /&gt;
&lt;br /&gt;
//Server/folder /mount/point cifs defaults,username=user,password=pass 0 0&lt;br /&gt;
&lt;br /&gt;
It&#39;s a file-sharing server, password is not set. So, we write it like this:&lt;br /&gt;
&lt;br /&gt;
//Server/folder /mount/point cifs defaults,username=user,guest 0 0</description><link>http://xinminds.blogspot.com/2011/05/etcfstab-samba.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-3388122986690410766</guid><pubDate>Sat, 07 May 2011 05:59:00 +0000</pubDate><atom:updated>2011-05-07T13:59:05.451+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">firefox</category><title>firefox: could not read application.ini</title><description>今天firefox很突然启动不了，由于之前更新了系统，就以为要重启，谁知道重启之后还是不行，于是在终端启动firefox，出现了错误:could not read application.ini。Google了一下，有人说在$HOME/.mozilla/firefox里新建一个application.ini就可以，于是&lt;br /&gt;
cd .mozilla/firefox&lt;br /&gt;
touch application.ini&lt;br /&gt;
firefox&lt;br /&gt;
这时firefox成功运行，貌似问题解决了。但当我点击firefox的图标来启动firefox时还是不行，于是又在终端运行firefox，错误依旧。难道在运行firefox的文件夹里都需要application.ini？于是我在home目录里也新建了一个application.ini，但仍然不行。就在这时，我发现家目录里存在一个名字为firefox的文件（这文件是我之前保存firefox相关信息时随便创建的），我怀疑可能是由于这个文件的存在使得firefox不能运行的，于是把这个文件重命名，firefox就正常运行了。&lt;br /&gt;
为什么home目录里面有文件名字为firefox会影响到firefox的运行呢？真奇怪！</description><link>http://xinminds.blogspot.com/2011/05/firefox-could-not-read-applicationini.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-5326563613791254957</guid><pubDate>Sun, 17 Apr 2011 05:34:00 +0000</pubDate><atom:updated>2011-04-17T13:37:33.565+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">lftp</category><title>lftp使用相关一条</title><description>用lftp打开user:passwd@host:port形式的ftp时，如果密码中包含特殊字符@，显然lftp是无法打开的。&lt;br /&gt;
要打开这样形式的ftp路径有两种方法：&lt;br /&gt;
1. 用lftp的选项，-u user, [&amp;ltpass&amp;gt] site -p port&lt;br /&gt;
2. 将特殊字符转义。 假设密码为!@#$，!、@、#、$的转义分别为%21、%40、%23、%24。于是用lftp直接打开时就需要用如下方式：&lt;br /&gt;
lftp user:%21%40%23%24@host:port</description><link>http://xinminds.blogspot.com/2011/04/lftp.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-8716398258631435654</guid><pubDate>Wed, 16 Feb 2011 17:14:00 +0000</pubDate><atom:updated>2011-02-17T01:14:57.971+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">awesome</category><category domain="http://www.blogger.com/atom/ns#">Linux/Unix</category><title>无需退出，快速调试Awesome的新配置</title><description>在实验室时，常常使用awesome，主要是那里的机器屏幕够大。实习之后，很少去实验室，随之也很少用awesome了。&lt;br /&gt;
最近在看代码，同时需要用到gdb调试等等，用gnome每次都需要调整，觉得比较烦，于是怀念起awesome了。于是在本本里通过AUR装上awesome(arch已经将awesome移走了，估计是awesome更新得比较快，还不如放到aur里保持更新速度)。由于配置在实验室的机器里，于是要重新配置一下awesome(对lua不是很熟，毕竟之前只是配置时看了一下，用得不多)。配置完后想看效果的话，老是要先退出awesome再进入，很是麻烦。当然也可以直接Mod4+Ctrl+r直接刷新，但是一旦配置出错，会连awesome都进不了。后来看到arch的wiki里有一种方法：利用Xephyr直接在X的client里面嵌入一个X，再在嵌入的X里面使用新配置运行awesome查看效果。&lt;br /&gt;
具体命令如下：&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: #ebf1f5; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 204, 221); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 204, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 204, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 204, 221); border-top-style: solid; border-top-width: 1px; color: #222222; line-height: 1.1em; padding-bottom: 1em; padding-left: 1em; padding-right: 1em; padding-top: 1em;&quot;&gt;$ Xephyr -ac -br -noreset -screen 1152x720&amp;nbsp;:1 &amp;amp;
$ DISPLAY=:1.0 awesome -c ~/.config/awesome/rc.lua.new&lt;/pre&gt;</description><link>http://xinminds.blogspot.com/2011/02/awesome.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-8436374062410333489</guid><pubDate>Wed, 26 Jan 2011 05:59:00 +0000</pubDate><atom:updated>2011-01-26T14:16:03.988+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">CCTree</category><category domain="http://www.blogger.com/atom/ns#">Vim</category><title>config &amp; hack vim CCTree</title><description>这段时间在用 vim 看代码，虽然已经配置好 cscope，但当要查看函数调用图时，还是不大方便，经 google 后得知 &lt;a href=&quot;http://www.vim.org/scripts/script.php?script_id=2368&quot;&gt;CCTree&lt;/a&gt; 这个很好的插件。&lt;br /&gt;
CCTree 的安装其实很简单，只需下载并将其保存到 .vim/plugin(linux/unix 环境下)就可以使用了，完全不需额外配置。CCTree 的使用方法请查看其&lt;a href=&quot;http://sites.google.com/site/vimcctree&quot;&gt;官方网站&lt;/a&gt;(需翻墙，不过一般能看到这个博客，就表明你已经翻墙了)上的&lt;a href=&quot;http://sites.google.com/site/vimcctree/help&quot;&gt;帮助&lt;/a&gt;。这个本文暂且不提。&lt;br /&gt;
在使用 CCTree 的过程中，发觉 CCTree-Preview 窗口的 highlight 和自己 vim 的 colorscheme(desert) 配合的不是很好。于是在 .vimrc 上加入了下面配置：&lt;br /&gt;
&quot; cctree highlight setting&lt;br /&gt;
highlight CCTreeHiSymbol &amp;nbsp;gui=bold guifg=yellow guibg=darkblue ctermfg=yellow ctermbg=darkblue&lt;br /&gt;
highlight CCTreeHiMarkers &amp;nbsp;gui=bold guifg=yellow guibg=darkblue ctermfg=yellow ctermbg=darkblue&lt;br /&gt;
highlight Ignore ctermfg=black guifg=bg&lt;br /&gt;
&lt;br /&gt;
还有一些方便使用的配置：&lt;br /&gt;
&quot; cctree cscopedb&lt;br /&gt;
let g:CCTreeCscopeDb = &quot;cscope.out&quot;&lt;br /&gt;
&quot; 设置这个之后在敲完命令 CCTreeLoadDB 之后回车就会自动选上 cscope.out&lt;br /&gt;
&lt;br /&gt;
&quot; set updatetime&lt;br /&gt;
set updatetime=0&lt;br /&gt;
&quot; 设置这个之后，光标移动时，CCTree-Preview 里面的内容才会实时进行语法加亮&lt;br /&gt;
&lt;br /&gt;
本来以为设置完 updatetime 就可以很方便的使用 CCTree 了，这时发现，一旦设置了 updatetime，当 CCTree-Preview 里面的内容被加亮之后，就无法使用 CCTreeLoadBufferUsingTag(快捷键为 &amp;lt;CR&amp;gt;，即回车)这个命令了，但仍旧可以使用 CCTreePreviewBufferUsingTag(快捷键为 &amp;lt;Ctrl+p&amp;gt;)。&lt;br /&gt;
查看 cctree.vim 后发现，函数 s:CCTreeLoadBufferFromKeyword 和 s:CCTreePreviewBufferFromKeyword 在调用函数 s:CCTreeGetCurrentKeyword 上有些不同。在将 s:CCTreeLoadBufferFromKeyword 中的调用方式改成和 s:CCTreePreviewBufferFromKeyword 的一样后，就可以在 CCTree-Preview 里正常使用回车进行跳转了。&lt;br /&gt;
修改方式如下：&lt;br /&gt;
将位于function! s:CCTreeLoadBufferFromKeyword中的&lt;br /&gt;
&lt;pre&gt;if s:CCTreeGetXCurrentKeyworkd() == -1
   return
endif
&lt;/pre&gt;替换成&lt;br /&gt;
&lt;pre&gt;call s:CCTreeGetCurrentKeyword()
if s:CCTreekeyword == &#39;&#39;
   return
endif
&lt;/pre&gt;大功告成！</description><link>http://xinminds.blogspot.com/2011/01/config-hack-vim-cctree.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-5267515257566121299</guid><pubDate>Sat, 18 Dec 2010 05:04:00 +0000</pubDate><atom:updated>2010-12-18T13:04:07.628+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">actionscript</category><category domain="http://www.blogger.com/atom/ns#">CppUnit</category><category domain="http://www.blogger.com/atom/ns#">cscope</category><category domain="http://www.blogger.com/atom/ns#">css</category><category domain="http://www.blogger.com/atom/ns#">ctags</category><category domain="http://www.blogger.com/atom/ns#">cUnit</category><category domain="http://www.blogger.com/atom/ns#">flash</category><category domain="http://www.blogger.com/atom/ns#">glassfish</category><category domain="http://www.blogger.com/atom/ns#">gtest</category><category domain="http://www.blogger.com/atom/ns#">html5</category><category domain="http://www.blogger.com/atom/ns#">javascript</category><category domain="http://www.blogger.com/atom/ns#">joomla</category><category domain="http://www.blogger.com/atom/ns#">log4j</category><category domain="http://www.blogger.com/atom/ns#">tomcat</category><category domain="http://www.blogger.com/atom/ns#">Vim</category><title>实习记录</title><description>&lt;ol&gt;&lt;li&gt;html5(video/graceful fallback to flash)&lt;/li&gt;
&lt;div&gt;Write some html5 pages, use the html5 video element to control video and try to fallback to flash if the explorer doesn&#39;t support html5. &lt;/div&gt;&lt;li&gt;log4j&lt;/li&gt;
&lt;div&gt;Use log4j to log the information that when the page was loaded, what source was loaded. &lt;/div&gt;&lt;li&gt;javascript/tomcat/glassfish(rmad)&lt;/li&gt;
&lt;div&gt;Deploy Adserver in glassfish, AdCMS in tomcat, and rmad is written in html5 with javascript. &lt;/div&gt;&lt;li&gt;cUnit/CppUnit/gtest&lt;/li&gt;
&lt;div&gt;Write some code to use cUnit, CppUnit and gtest respectively. Just for study. &lt;/div&gt;&lt;li&gt;actionscript/flash(a game)&lt;/li&gt;
&lt;div&gt;At the beginning of the quick study about ADM&#39;s rich media AD integration, I think it should support both html5 and flash, so go study the flash, and write a simple game with actionscript. &lt;/div&gt;&lt;li&gt;javascript/css/joomla(mod_search/mod_footer/templates)&lt;/li&gt;
&lt;div&gt;&lt;/div&gt;&lt;li&gt;vim/regular expression/tips&lt;/li&gt;
&lt;li&gt;cscope/ctags&lt;/li&gt;
&lt;/ol&gt;</description><link>http://xinminds.blogspot.com/2010/12/blog-post.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6505672740000305035.post-8030580439500303828</guid><pubDate>Fri, 22 Oct 2010 02:21:00 +0000</pubDate><atom:updated>2011-02-17T00:51:01.235+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Free</category><category domain="http://www.blogger.com/atom/ns#">Linux/Unix</category><category domain="http://www.blogger.com/atom/ns#">Memory</category><title>Linux下查看内存使用情况</title><description>&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: 宋体, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px;&quot;&gt;Linux下查看内存使用情况：&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: 宋体, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px;&quot;&gt;1.物理已用内存 = 实际已用内存 - 缓冲 - 缓存&lt;br /&gt;
2.物理空闲内存 = 总物理内存 - 实际已用内存 + 缓冲 + 缓存&lt;br /&gt;
3.应用程序可用空闲内存 = 总物理内存 - 实际已用内存&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: 宋体, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px;&quot;&gt;4.应用程序已用内存 = 实际已用内存 - 缓冲 - 缓存&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;</description><link>http://xinminds.blogspot.com/2010/10/linux-1.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item></channel></rss>