<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.feedsky.com/styles/temp01.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link href="http://feed.feedsky.com/SoniTech" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/SoniTech" type="application/rss+xml"></fs:self_link><lastBuildDate>Wed, 06 Jul 2011 14:35:19 GMT</lastBuildDate><title>SoniTech</title><description>KISS – Keep It Simple and Stupid.</description><link>http://blog.sonitech.org</link><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>1</sy:updateFrequency><language>en</language><pubDate>Wed, 06 Jul 2011 14:35:19 GMT</pubDate><item><title>SSH/SCP Through Gateway</title><link>http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250723/6230762/1/item.html</link><content:encoded>&lt;p&gt;Sometimes we need via a gateway connect to server with ssh/scp, like:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Host_C &amp;#8211;[ssh/scp]&amp;#8211;&gt; Host_G(Gateway) &amp;#8211;[ssh/scp]&amp;#8211;&gt; Host_S&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;first, make sure you can ssh from (Host_C &amp;#8211;&gt; Host_G) and (Host_G &amp;#8211;&gt; Host_S)  with ssh-key&lt;/p&gt;
&lt;p&gt;- ssh is very simple&lt;br /&gt;
ssh to Host_S via Host_G&lt;/li&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;ssh -t sonic@Host_G ssh Host_S&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;- scp is more complex&lt;br /&gt;
1. at Host_C, edit the file ~/.ssh/config, add follow line:&lt;/p&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;host Host_S&lt;br /&gt;
&amp;nbsp; &amp;nbsp; hostname Host_G&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;2. at Host_G, edit the file ~/.ssh/authorized_keys, add command before the Host_C&amp;#8217;s ssh-key&lt;/li&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;command=&amp;quot;sh -c 'ssh Host_S ${SSH_ORIGINAL_COMMAND:-}'&amp;quot; ...ssh-key...&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;here is a problem, you can&amp;#8217;t ssh to Host_G, each times you ssh to Host_G will shift to Host_S&lt;br /&gt;
but we have the other way:&lt;br /&gt;
1. at Host_C, set up ssh-key to localhost, then edit the file ~/.ssh/config, add follow line:&lt;/p&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;host Host_S&lt;br /&gt;
&amp;nbsp; &amp;nbsp; hostname localhost&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;2. at Host_C, edit the file ~/.ssh/authorized_keys, add command before the localhost&amp;#8217;s ssh-key&lt;/li&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;command=&amp;quot;sh -c 'ssh -t Host_G ssh Host_S ${SSH_ORIGINAL_COMMAND:-}'&amp;quot; ...ssh-key...&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;OK, try:&lt;/p&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;ssh Host_S&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;enjoy!&lt;/p&gt;
&lt;p&gt;reference: &lt;BR&gt; http://physics.usc.edu/~bzhang/notes/ssh.html&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/532250723/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250723/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.sonitech.org/2011/07/06/sshscp-through-gateway/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>Sometimes we need via a gateway connect to server with ssh/scp, like: Host_C &amp;#8211;[ssh/scp]&amp;#8211;&gt; Host_G(Gateway) &amp;#8211;[ssh/scp]&amp;#8211;&gt; Host_S first, make sure you can ssh from (Host_C &amp;#8211;&gt; Host_G) and (Host_G &amp;#8211;&gt; Host_S) with ssh-key - ssh is very simple ssh to Host_S via Host_G ssh -t sonic@Host_G ssh Host_S - scp is more complex 1. at [...]&lt;img src=&quot;http://www1.feedsky.com/t1/532250723/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250723/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>ssh</category><category>gateway</category><category>Unix Linux</category><category>scp</category><pubDate>Wed, 06 Jul 2011 22:35:19 +0800</pubDate><author>Sonic</author><comments>http://blog.sonitech.org/2011/07/06/sshscp-through-gateway/#comments</comments><guid isPermaLink="false">http://blog.sonitech.org/?p=2042</guid><dc:creator>Sonic</dc:creator><fs:srclink>http://blog.sonitech.org/2011/07/06/sshscp-through-gateway/</fs:srclink><fs:srcfeed>http://blog.sonitech.org/feed/</fs:srcfeed><fs:itemid>feedsky/SoniTech/~8468113/532250723/6230762</fs:itemid></item><item><title>Dokuwiki 集成 CAS 验证</title><link>http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250724/6230762/1/item.html</link><content:encoded>&lt;p&gt;Install phpCAS to lib/plugins/CAS-1.2.1&lt;/p&gt;
&lt;p&gt;Create inc/auth/cas.class.php&lt;/p&gt;
&lt;div class=&quot;codecolorer-container php geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;php codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;require_once&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;DOKU_INC&lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'inc/auth/plain.class.php'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;include_once&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;DOKU_INC&lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'lib/plugins/CAS-1.2.1/CAS.php'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;//This is the path to your phpCAS library. &amp;nbsp;In my test it is installed in the auth folder, but this could also be a reference to an absolute path on the server, or it could be in the php include path.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
\\Set Your CAS Server Info&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;Server&lt;span style=&quot;color: #339933;&quot;&gt;:&lt;/span&gt;www&lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt;sonitech&lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt;org&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; Port&lt;span style=&quot;color: #339933;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;80&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; PATH&lt;span style=&quot;color: #339933;&quot;&gt;:&lt;/span&gt;cas&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
phpCAS&lt;span style=&quot;color: #339933;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;client&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;CAS_VERSION_2_0&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;'www.sonitech.org'&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;80&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;'cas'&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #009900; font-weight: bold;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; auth_cas &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;extends&lt;/span&gt; auth_plain &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; auth_cas&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;global&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$conf&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;cando&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'external'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #009900; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;auth_plain&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; trustExternal&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$user&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$pass&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$sticky&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #009900; font-weight: bold;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;global&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$USERINFO&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;global&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$conf&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000088;&quot;&gt;$sticky&lt;/span&gt; ? &lt;span style=&quot;color: #000088;&quot;&gt;$sticky&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #009900; font-weight: bold;&quot;&gt;true&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$sticky&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #009900; font-weight: bold;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;//sanity check&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000088;&quot;&gt;$session&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$conf&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'title'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'auth'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; phpCAS&lt;span style=&quot;color: #339933;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;setNoCasServerValidation&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;//I had to set this to avoid an error an authentication.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;phpCAS&lt;span style=&quot;color: #339933;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;isAuthenticated&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000088;&quot;&gt;$user&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; phpCAS&lt;span style=&quot;color: #339933;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;getUser&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/isset&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;isset&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$session&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000088;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'REMOTE_USER'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$user&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000088;&quot;&gt;$USERINFO&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$session&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'info'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000088;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$conf&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'title'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'auth'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'user'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$user&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000088;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$conf&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'title'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'auth'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'pass'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$session&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'pass'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000088;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$conf&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'title'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'auth'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'info'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$USERINFO&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000088;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$conf&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'title'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'auth'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'buid'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$session&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'buid'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000088;&quot;&gt;$USERINFO&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;getUserData&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$user&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000088;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'REMOTE_USER'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$user&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000088;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$conf&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'title'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'auth'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'user'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$user&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000088;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$conf&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'title'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'auth'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'pass'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$pass&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000088;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$conf&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'title'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'auth'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'info'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$USERINFO&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000088;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$conf&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'title'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'auth'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'buid'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; auth_browseruid&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #009900; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; phpCAS&lt;span style=&quot;color: #339933;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;forceAuthentication&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #009900; font-weight: bold;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Edit the file inc/actions.php and replace :&lt;/p&gt;
&lt;div class=&quot;codecolorer-container php geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;php codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; act_auth&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$act&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;global&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$ID&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;global&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$INFO&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;By:&lt;/p&gt;
&lt;div class=&quot;codecolorer-container php geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;php codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; act_auth&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$act&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;global&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$ID&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;global&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$INFO&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;global&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$auth&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$auth&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;cando&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'login'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$act&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;'login'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000088;&quot;&gt;$auth&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;logIn&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Hack to fix logout(modify the doku.php):&lt;/p&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;.......&lt;br /&gt;
&amp;nbsp; //send 404 for missing pages if configured or ID has special meaning to bots&lt;br /&gt;
&amp;nbsp; if(!$INFO['exists'] &amp;amp;&amp;amp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;($conf['send404'] || preg_match('/^(robots\.txt|sitemap\.xml(\.gz)?|favicon\.ico|crossdomain\.xml)$/',$ID)) &amp;amp;&amp;amp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;($ACT == 'show' || substr($ACT,0,7) == 'export_') ){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; header('HTTP/1.0 404 Not Found');&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp; if($ACT == 'logout') {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; phpCAS::logout();&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp; //prepare breadcrumbs (initialize a static var)&lt;br /&gt;
&amp;nbsp; breadcrumbs();&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp; // check upstream&lt;br /&gt;
&amp;nbsp; checkUpdateMessages();&lt;br /&gt;
......&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Configuration:&lt;br /&gt;
Add to your conf/local.php&lt;/p&gt;
&lt;div class=&quot;codecolorer-container php geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;php codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;&lt;span style=&quot;color: #000088;&quot;&gt;$conf&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'authtype'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;'cas'&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/532250724/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250724/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.sonitech.org/2011/07/06/dokuwiki-%e9%9b%86%e6%88%90-cas-%e9%aa%8c%e8%af%81/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>Install phpCAS to lib/plugins/CAS-1.2.1 Create inc/auth/cas.class.php &amp;#60;?php require_once&amp;#40;DOKU_INC.'inc/auth/plain.class.php'&amp;#41;; include_once&amp;#40;DOKU_INC.'lib/plugins/CAS-1.2.1/CAS.php'&amp;#41;; //This is the path to your phpCAS library. &amp;#160;In my test it is installed in the auth folder, but this could also be a reference to an absolute path on the server, or it could be in the php include path. \\Set Your CAS Server Info&amp;#40;Server:www.sonitech.org, [...]&lt;img src=&quot;http://www1.feedsky.com/t1/532250724/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250724/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>cas</category><category>Develop</category><pubDate>Wed, 06 Jul 2011 22:32:50 +0800</pubDate><author>Sonic</author><comments>http://blog.sonitech.org/2011/07/06/dokuwiki-%e9%9b%86%e6%88%90-cas-%e9%aa%8c%e8%af%81/#comments</comments><guid isPermaLink="false">http://blog.sonitech.org/?p=2035</guid><dc:creator>Sonic</dc:creator><fs:srclink>http://blog.sonitech.org/2011/07/06/dokuwiki-%e9%9b%86%e6%88%90-cas-%e9%aa%8c%e8%af%81/</fs:srclink><fs:srcfeed>http://blog.sonitech.org/feed/</fs:srcfeed><fs:itemid>feedsky/SoniTech/~8468113/532250724/6230762</fs:itemid></item><item><title>解决 Ruby 中 SSL 连接的问题</title><link>http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250725/6230762/1/item.html</link><content:encoded>&lt;p&gt;在 Ruby 中如果需要请求 https 的资源的时候，比如：&lt;/p&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;require 'net/https'&lt;br /&gt;
https = Net::HTTP.new('mail.google.com', 443)&lt;br /&gt;
https.use_ssl = true&lt;br /&gt;
https.verify_mode = OpenSSL::SSL::VERIFY_PEER&lt;br /&gt;
https.request_get('/')&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;如果出现下面这个错误的话，说明这台机器没有 CA 证书，无法与 SSL 加密的资源进行加密的通讯：&lt;/p&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;/usr/local/lib/ruby/1.9.1/net/http.rb:678:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;这时候我们需要给这台机器安装 CA 证书，比如在 Ubuntu 上：&lt;/p&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;apt-get install ca-certificates&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;安装完成后所有的证书会放在 /etc/ssl/certs 下面，现在再次执行上面那段代码就没有问题了&lt;/p&gt;
&lt;p&gt;如果证书不在默认路径下，需要在代码中指定，比如：&lt;/p&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;require 'net/https'&lt;br /&gt;
https = Net::HTTP.new('mail.google.com', 443)&lt;br /&gt;
https.use_ssl = true&lt;br /&gt;
https.verify_mode = OpenSSL::SSL::VERIFY_PEER&lt;br /&gt;
https.ca_path = '/home/app/ssl/certs' if File.exists?('/etc/ssl/certs')&lt;br /&gt;
https.request_get('/')&lt;/div&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/532250725/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250725/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.sonitech.org/2011/06/08/%e8%a7%a3%e5%86%b3-ruby-%e4%b8%ad-ssl-%e8%bf%9e%e6%8e%a5%e7%9a%84%e9%97%ae%e9%a2%98/feed/</wfw:commentRss><slash:comments>1</slash:comments><description>在 Ruby 中如果需要请求 https 的资源的时候，比如： require 'net/https' https = Net::HTTP.new('mail.google.com', 443) https.use_ssl = true https.verify_mode = OpenSSL::SSL::VERIFY_PEER https.request_get('/') 如果出现下面这个错误的话，说明这台机器没有 CA 证书，无法与 SSL 加密的资源进行加密的通讯： /usr/local/lib/ruby/1.9.1/net/http.rb:678:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError) 这时候我们需要给这台机器安装 CA 证书，比如在 Ubuntu 上： apt-get install ca-certificates 安装完成后所有的证书会放在 /etc/ssl/certs 下面，现在再次执行上面那段代码就没有问题了 如果证书不在默认路径下，需要在代码中指定，比如： require 'net/https' https = Net::HTTP.new('mail.google.com', 443) [...]&lt;img src=&quot;http://www1.feedsky.com/t1/532250725/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250725/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>Ruby on Rails</category><category>ruby</category><category>openssl</category><pubDate>Wed, 08 Jun 2011 11:33:03 +0800</pubDate><author>Sonic</author><comments>http://blog.sonitech.org/2011/06/08/%e8%a7%a3%e5%86%b3-ruby-%e4%b8%ad-ssl-%e8%bf%9e%e6%8e%a5%e7%9a%84%e9%97%ae%e9%a2%98/#comments</comments><guid isPermaLink="false">http://blog.sonitech.org/?p=2031</guid><dc:creator>Sonic</dc:creator><fs:srclink>http://blog.sonitech.org/2011/06/08/%e8%a7%a3%e5%86%b3-ruby-%e4%b8%ad-ssl-%e8%bf%9e%e6%8e%a5%e7%9a%84%e9%97%ae%e9%a2%98/</fs:srclink><fs:srcfeed>http://blog.sonitech.org/feed/</fs:srcfeed><fs:itemid>feedsky/SoniTech/~8468113/532250725/6230762</fs:itemid></item><item><title>Nginx Rewrite 使用多条件判断</title><link>http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250726/6230762/1/item.html</link><content:encoded>&lt;p&gt;在 Nginx 中可以方便地使用 Rewrite 进行 URL 重定向，但是有时候条件过多，Nginx 的 if 又不支持嵌套（是不是因为性能的考虑？），怎么办呢？&lt;/p&gt;
&lt;p&gt;例子是最好的描述办法，比如说我想要把所有访问 http://www.a.com 的用户请求重定向到 http://www.a.com/app1，所有访问 http://www.b.com 的用户请求重定向到 http://www.b.com/app2，怎么做呢？&lt;/p&gt;
&lt;p&gt;这里要使用两个条件来判断：&lt;br /&gt;
1. 用户请求的域名 (www.a.com 或者 www.b.com)&lt;br /&gt;
2. 请求的 URI (&amp;#8220;/&amp;#8221; 或者 其他)&lt;/p&gt;
&lt;p&gt;虽然 Nginx 的 if 条件判断不支持嵌套，但是我们可以设置一些变量用来做标志位，然后根据标志位进行判断，虽然麻烦了点，问题总算解决了～&lt;/p&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;&amp;nbsp; &amp;nbsp; # rewrite&lt;br /&gt;
&amp;nbsp; &amp;nbsp; set $my_a &amp;quot;no&amp;quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; set $my_b &amp;quot;no&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if ($host = &amp;quot;www.a.com&amp;quot;) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set $my_a &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if ($host = &amp;quot;www.b.com&amp;quot;) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set $my_b &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if ($uri != &amp;quot;/&amp;quot;) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set $my_a &amp;quot;no&amp;quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set $my_b &amp;quot;no&amp;quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if ($my_a = &amp;quot;yes&amp;quot;) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rewrite ^(.*) http://www.a.com/app1;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if ($my_b = &amp;quot;yes&amp;quot;) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rewrite ^(.*) http://www.b.com/app2;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/532250726/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250726/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.sonitech.org/2011/06/01/nginx-rewrite-%e4%bd%bf%e7%94%a8%e5%a4%9a%e6%9d%a1%e4%bb%b6%e5%88%a4%e6%96%ad/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>在 Nginx 中可以方便地使用 Rewrite 进行 URL 重定向，但是有时候条件过多，Nginx 的 if 又不支持嵌套（是不是因为性能的考虑？），怎么办呢？ 例子是最好的描述办法，比如说我想要把所有访问 http://www.a.com 的用户请求重定向到 http://www.a.com/app1，所有访问 http://www.b.com 的用户请求重定向到 http://www.b.com/app2，怎么做呢？ 这里要使用两个条件来判断： 1. 用户请求的域名 (www.a.com 或者 www.b.com) 2. 请求的 URI (&amp;#8220;/&amp;#8221; 或者 其他) 虽然 Nginx 的 if 条件判断不支持嵌套，但是我们可以设置一些变量用来做标志位，然后根据标志位进行判断，虽然麻烦了点，问题总算解决了～ &amp;#160; &amp;#160; # rewrite &amp;#160; &amp;#160; set $my_a &amp;#34;no&amp;#34;; &amp;#160; &amp;#160; set $my_b &amp;#34;no&amp;#34;; &amp;#160; &amp;#160; if ($host = &amp;#34;www.a.com&amp;#34;) { [...]&lt;img src=&quot;http://www1.feedsky.com/t1/532250726/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250726/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>rewrite</category><category>nginx</category><category>Web Server</category><pubDate>Wed, 01 Jun 2011 14:50:11 +0800</pubDate><author>Sonic</author><comments>http://blog.sonitech.org/2011/06/01/nginx-rewrite-%e4%bd%bf%e7%94%a8%e5%a4%9a%e6%9d%a1%e4%bb%b6%e5%88%a4%e6%96%ad/#comments</comments><guid isPermaLink="false">http://blog.sonitech.org/?p=2021</guid><dc:creator>Sonic</dc:creator><fs:srclink>http://blog.sonitech.org/2011/06/01/nginx-rewrite-%e4%bd%bf%e7%94%a8%e5%a4%9a%e6%9d%a1%e4%bb%b6%e5%88%a4%e6%96%ad/</fs:srclink><fs:srcfeed>http://blog.sonitech.org/feed/</fs:srcfeed><fs:itemid>feedsky/SoniTech/~8468113/532250726/6230762</fs:itemid></item><item><title>在 Mac 上用无线流量的 WAP 卡上 3G</title><link>http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250727/6230762/1/item.html</link><content:encoded>&lt;p&gt;前几天在 Google Reader 上无意间看到移动 CMWAP 无线流量的卡竟然可以上 TD 的网络，心想自己也 OUT 太久了，竟然一无所知～ 正好我有一枚（每月20块，不限流量），现在家里用的北京最烂的“宽带通”也让我忍受很久了，在看了几篇文章之后，立马从 TB 买了一个华为的 ET128-2 3G 双模网卡&lt;/p&gt;
&lt;p&gt;如果是 Windows 系统，这个按照大部分文章的思路很快就能搞定了，这篇文章也没必要写了，这篇文章我主要介绍一下 Mac 上的思路&lt;/p&gt;
&lt;p&gt;在收到 3G 网卡后马上插到 Mac 上小测了一下，竟然找不到我的 SIM 卡，是不是悲剧了？买到个坏的？什么情况这是？立即换到 Windows 上测试，哈，竟然没有问题，那肯定就是驱动的问题了&lt;/p&gt;
&lt;p&gt;ET128-2 的规格参数里面写着支持 Mac，不过没有写支持不支持最新的 Snow Leopard 64 位的系统，到了华为的网站，下载了一个最新的固件，找到一台 XP 机器（华为的固件更新程序只支持 XP），更新后回到 Mac 测试，木有问题了，一切正常。&lt;/p&gt;
&lt;p&gt;到这里才进入正题：&lt;/p&gt;
&lt;p&gt;我这个卡只支持 CMWAP 的 接入点（APN），但是移动的这个 &amp;#8220;Mobile Partner&amp;#8221; 连接程序默认是连的 CMNET，并且没有设置的地方，怎么在 Mac 上更改接入点呢？&lt;br /&gt;
进入这个软件的 config data 目录:&lt;/p&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;$ cd /Applications/Mobile Partner.app/Contents/Resources/config/data&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;编辑 SysProfile.prof 和 ProfileLib.prof 这两个文件，把里面的 CMNET 改为 CMWAP 即可。&lt;/p&gt;
&lt;p&gt;这些配置文件里面可以发现一些有趣的东西，比如拨入的号码其实是“*99***1#”&lt;/p&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;&amp;nbsp;&amp;lt;Profile name=&amp;quot;CMCC&amp;quot; type=&amp;quot;&amp;quot; readonly=&amp;quot;true&amp;quot; device=&amp;quot;&amp;quot; user=&amp;quot;&amp;quot; password=&amp;quot;&amp;quot; phonenumber=&amp;quot;*99***1#&amp;quot; autoapn=&amp;quot;false&amp;quot; apn=&amp;quot;CMWAP&amp;quot; chap=&amp;quot;true&amp;quot; pap=&amp;quot;false&amp;quot; ip=&amp;quot;&amp;quot; dns=&amp;quot;&amp;quot; dnsalt=&amp;quot;&amp;quot; wins=&amp;quot;&amp;quot; winsalt=&amp;quot;&amp;quot; imsi=&amp;quot;&amp;quot; popusername=&amp;quot;&amp;quot; Remember=&amp;quot;&amp;quot; langId=&amp;quot;&amp;quot; Style=&amp;quot;&amp;quot; /&amp;gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;修改完这两个文件之后就可以连接了，但是现在还有问题，我们知道，移动的 CMWAP 包月的卡有个问题，只能通过代理（10.0.0.172:80）访问非 Wap 的站点，所以如果想上网的话，更改 Firefox 的 HTTP 代理为:10.0.0.172:80 就可以了，但是，有些不支持代理的软件不就没办法用了吗？ Windows 上可以用类似 &amp;#8220;动感大挪移&amp;#8221; 的软件来解除限制，但是 Mac 上呢？&lt;/p&gt;
&lt;p&gt;与其费那么大的力气，不如来点彻底的，使用 OpenVPN 彻底突破，但是有前提条件：&lt;br /&gt;
- OpenVPN 服务器&lt;br /&gt;
- OpenVPN 服务端口只能是 443（因为移动只开放了 80 和 443）&lt;/p&gt;
&lt;p&gt;网上有很多地方可以提供免费的 OpenVPN 账号，我嫌麻烦，自己架了一个 OpenVPN Server，这里就不写过程了，一搜一大把。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://code.google.com/p/tunnelblick/&quot;&gt;Tunnelblick&lt;/a&gt; 是 Mac 上的一个开源的 OpenVPN 客户端，把你 OpenVPN 客户端需要的证书和密钥准备好，我这里是（ca.crt sonitech-client.crt 和 sonitech-client.key）按提示放到 Tunnelblick 的配置文件目录下，然后创建一个配置文件 sonitech-client.ovpn:&lt;/p&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;client&lt;br /&gt;
dev tun&lt;br /&gt;
proto tcp&lt;br /&gt;
remote 202.x.x.x 443&lt;br /&gt;
resolv-retry infinite&lt;br /&gt;
nobind&lt;br /&gt;
persist-key&lt;br /&gt;
persist-tun&lt;br /&gt;
ca sonitech/ca.crt&lt;br /&gt;
cert sonitech/sonitech-client.crt&lt;br /&gt;
key sonitech/sonitech-client.key&lt;br /&gt;
ns-cert-type server&lt;br /&gt;
comp-lzo&lt;br /&gt;
verb 3&lt;br /&gt;
http-proxy 10.0.0.172 80&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;可以先把最后一行 proxy 注释掉，测试一下连接，如果没问题的话，解除最后一行的注释，用 &amp;#8220;Mobile Partner&amp;#8221; 先连上移动的网络，然后连接 OpenVPN，没问题的话，你就可以畅通无阻了。&lt;/p&gt;
&lt;p&gt;跑到窗口采集到的数据，还不错哦。&lt;br /&gt;
&lt;a href=&quot;http://blog.sonitech.org/saves/uploads/2011/05/Screen-shot-2011-05-21-at-10.01.16-AM.png&quot;&gt;&lt;img src=&quot;http://blog.sonitech.org/saves/uploads/2011/05/Screen-shot-2011-05-21-at-10.01.16-AM.png&quot; alt=&quot;&quot; title=&quot;Screen shot 2011-05-21 at 10.01.16 AM&quot; width=&quot;495&quot; height=&quot;199&quot; class=&quot;alignnone size-full wp-image-2012&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/532250727/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250727/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.sonitech.org/2011/05/21/%e5%9c%a8-mac-%e4%b8%8a%e7%94%a8%e6%97%a0%e7%ba%bf%e6%b5%81%e9%87%8f%e7%9a%84-wap-%e5%8d%a1%e4%b8%8a-3g/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>前几天在 Google Reader 上无意间看到移动 CMWAP 无线流量的卡竟然可以上 TD 的网络，心想自己也 OUT 太久了，竟然一无所知～ 正好我有一枚（每月20块，不限流量），现在家里用的北京最烂的“宽带通”也让我忍受很久了，在看了几篇文章之后，立马从 TB 买了一个华为的 ET128-2 3G 双模网卡 如果是 Windows 系统，这个按照大部分文章的思路很快就能搞定了，这篇文章也没必要写了，这篇文章我主要介绍一下 Mac 上的思路 在收到 3G 网卡后马上插到 Mac 上小测了一下，竟然找不到我的 SIM 卡，是不是悲剧了？买到个坏的？什么情况这是？立即换到 Windows 上测试，哈，竟然没有问题，那肯定就是驱动的问题了 ET128-2 的规格参数里面写着支持 Mac，不过没有写支持不支持最新的 Snow Leopard 64 位的系统，到了华为的网站，下载了一个最新的固件，找到一台 XP 机器（华为的固件更新程序只支持 XP），更新后回到 Mac 测试，木有问题了，一切正常。 到这里才进入正题： 我这个卡只支持 CMWAP 的 接入点（APN），但是移动的这个 &amp;#8220;Mobile Partner&amp;#8221; 连接程序默认是连的 CMNET，并且没有设置的地方，怎么在 Mac 上更改接入点呢？ 进入这个软件的 config [...]&lt;img src=&quot;http://www1.feedsky.com/t1/532250727/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250727/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>openvpn</category><category>mac</category><category>Mobile</category><category>cmwap</category><pubDate>Sat, 21 May 2011 10:07:57 +0800</pubDate><author>Sonic</author><comments>http://blog.sonitech.org/2011/05/21/%e5%9c%a8-mac-%e4%b8%8a%e7%94%a8%e6%97%a0%e7%ba%bf%e6%b5%81%e9%87%8f%e7%9a%84-wap-%e5%8d%a1%e4%b8%8a-3g/#comments</comments><guid isPermaLink="false">http://blog.sonitech.org/?p=2009</guid><dc:creator>Sonic</dc:creator><fs:srclink>http://blog.sonitech.org/2011/05/21/%e5%9c%a8-mac-%e4%b8%8a%e7%94%a8%e6%97%a0%e7%ba%bf%e6%b5%81%e9%87%8f%e7%9a%84-wap-%e5%8d%a1%e4%b8%8a-3g/</fs:srclink><fs:srcfeed>http://blog.sonitech.org/feed/</fs:srcfeed><fs:itemid>feedsky/SoniTech/~8468113/532250727/6230762</fs:itemid></item><item><title>解决 Mac 连接 Samba 3 的问题</title><link>http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250728/6230762/1/item.html</link><content:encoded>&lt;p&gt;前段时间做了一台存储，总共五片硬盘，使用 Raid1 + Raid5 配置，有 2T 供存储的空间，拿来用 Samba 做了个 Share Server，从此暂时不用担心空间以及数据安全的问题了&lt;/p&gt;
&lt;p&gt;但是恼人的事情在后面，配置好 Samba 之后 Windows 用的很好，但是 Mac 上用 Finder 死活连不上，输入 Samba Server 地址（smb://192.168.1.7，输入用户名密码提示错误），废了两天的时间来郁闷此问题，他奶奶的最后终于解决了～&lt;/p&gt;
&lt;p&gt;首先怀疑是用户密码加密问题，从之前的 tdb 存储密码改为 smbpasswd 文件，无奈无果而终&lt;/p&gt;
&lt;p&gt;然后看了下 Samba 的日志，也没发现什么关键的错误信息&lt;/p&gt;
&lt;p&gt;后来想 Samba 使用 NMB 与 Windows 工作组对接，就看了下 NMB 的日志：&lt;/p&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;[2011/05/03 21:23:55, 0] nmbd/nmbd_nameregister.c:register_name(484)&lt;br /&gt;
&amp;nbsp; register_name: NetBIOS name SoniTech PUBLIC SHARE SERVER is too long. Truncating to SONITECH PUBLIC&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;不过这也没什么啊，不过想想还是去改短好了，这一改 Mac 端竟然正常了，这是什么鸟问题啊！&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/532250728/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250728/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.sonitech.org/2011/05/04/%e8%a7%a3%e5%86%b3-mac-%e8%bf%9e%e6%8e%a5-samba3-%e7%9a%84%e9%97%ae%e9%a2%98/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>前段时间做了一台存储，总共五片硬盘，使用 Raid1 + Raid5 配置，有 2T 供存储的空间，拿来用 Samba 做了个 Share Server，从此暂时不用担心空间以及数据安全的问题了 但是恼人的事情在后面，配置好 Samba 之后 Windows 用的很好，但是 Mac 上用 Finder 死活连不上，输入 Samba Server 地址（smb://192.168.1.7，输入用户名密码提示错误），废了两天的时间来郁闷此问题，他奶奶的最后终于解决了～ 首先怀疑是用户密码加密问题，从之前的 tdb 存储密码改为 smbpasswd 文件，无奈无果而终 然后看了下 Samba 的日志，也没发现什么关键的错误信息 后来想 Samba 使用 NMB 与 Windows 工作组对接，就看了下 NMB 的日志： [2011/05/03 21:23:55, 0] nmbd/nmbd_nameregister.c:register_name(484) &amp;#160; register_name: NetBIOS name SoniTech PUBLIC SHARE SERVER is too long. [...]&lt;img src=&quot;http://www1.feedsky.com/t1/532250728/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250728/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>mac</category><category>Unix Linux</category><category>samba</category><pubDate>Wed, 04 May 2011 12:07:14 +0800</pubDate><author>Sonic</author><comments>http://blog.sonitech.org/2011/05/04/%e8%a7%a3%e5%86%b3-mac-%e8%bf%9e%e6%8e%a5-samba3-%e7%9a%84%e9%97%ae%e9%a2%98/#comments</comments><guid isPermaLink="false">http://blog.sonitech.org/?p=2003</guid><dc:creator>Sonic</dc:creator><fs:srclink>http://blog.sonitech.org/2011/05/04/%e8%a7%a3%e5%86%b3-mac-%e8%bf%9e%e6%8e%a5-samba3-%e7%9a%84%e9%97%ae%e9%a2%98/</fs:srclink><fs:srcfeed>http://blog.sonitech.org/feed/</fs:srcfeed><fs:itemid>feedsky/SoniTech/~8468113/532250728/6230762</fs:itemid></item><item><title>修复损坏的 Xen DomU 磁盘镜像</title><link>http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250729/6230762/1/item.html</link><content:encoded>&lt;p&gt;运行中的 Xen Dom0 如果异常掉电的话有可能会造成 Xen DomU 的磁盘镜像文件损坏，如果 DomU 是 Unix/Linux 的话，下一次 Boot 的时候 fsck 会尝试修复文件系统，如果损坏的比较严重，就只能进入 Read-Only File System，我最近就遇到了这个问题，下面是我修复的过程：&lt;/p&gt;
&lt;p&gt;首先使用 DomU 的磁盘镜像虚拟成一个 loop 设备（修改后的内核能支持 64 个 loop 设备）&lt;/p&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;# losetup /dev/loop63 disk.img&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;使用 kpartx 建立块文件（包括卷管理的LV）到设备文件的映射&lt;/p&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;# kpartx -va /dev/loop63&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;如果是用 LVM 的话，读取 LVM 信息（我这里没有是用 LVM ）：&lt;/p&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;# vgscan&lt;br /&gt;
# lvscan&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;使用 e2fsck 对分区进行修复 （使用 LVM 的话路径改为上一步获得的 LVM 的分区）&lt;/p&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;# e2fsck /dev/loop63&lt;br /&gt;
e2fsck 1.39 (29-May-2006)&lt;br /&gt;
/dev/loop63 contains a file system with errors, check forced.&lt;br /&gt;
Pass 1: Checking inodes, blocks, and sizes&lt;br /&gt;
lInodes that were part of a corrupted orphan linked list found. &amp;nbsp;Fix&amp;lt;y&amp;gt;? yes&lt;br /&gt;
&lt;br /&gt;
Inode 984167 was part of the orphaned inode list. &amp;nbsp;FIXED.&lt;br /&gt;
Deleted inode 984169 has zero dtime. &amp;nbsp;Fix&amp;lt;y&amp;gt;? yes&lt;br /&gt;
&lt;br /&gt;
Inode 984170 was part of the orphaned inode list. &amp;nbsp;FIXED.&lt;br /&gt;
Inode 984176 was part of the orphaned inode list. &amp;nbsp;FIXED.&lt;br /&gt;
Inode 984177 was part of the orphaned inode list. &amp;nbsp;FIXED.&lt;br /&gt;
Inode 984178 was part of the orphaned inode list. &amp;nbsp;FIXED.&lt;br /&gt;
Inode 984192 was part of the orphaned inode list. &amp;nbsp;FIXED.&lt;br /&gt;
Inode 984195 was part of the orphaned inode list. &amp;nbsp;FIXED.&lt;br /&gt;
Inode 984196 was part of the orphaned inode list. &amp;nbsp;FIXED.&lt;br /&gt;
Inode 984197 was part of the orphaned inode list. &amp;nbsp;FIXED.&lt;br /&gt;
Inode 984198 was part of the orphaned inode list. &amp;nbsp;FIXED.&lt;br /&gt;
Inode 984199 was part of the orphaned inode list. &amp;nbsp;FIXED.&lt;br /&gt;
Inode 984201 was part of the orphaned inode list. &amp;nbsp;FIXED.&lt;br /&gt;
Inode 984202 was part of the orphaned inode list. &amp;nbsp;FIXED.&lt;br /&gt;
Inode 1968728, i_size is 102337, should be 106496. &amp;nbsp;Fix&amp;lt;y&amp;gt;? yes&lt;br /&gt;
&lt;br /&gt;
Inode 1968728, i_blocks is 208, should be 216. &amp;nbsp;Fix&amp;lt;y&amp;gt;? yes&lt;br /&gt;
&lt;br /&gt;
Pass 2: Checking directory structure&lt;br /&gt;
Pass 3: Checking directory connectivity&lt;br /&gt;
Pass 4: Checking reference counts&lt;br /&gt;
Pass 5: Checking group summary information&lt;br /&gt;
Block bitmap differences: &amp;nbsp;+7895540&lt;br /&gt;
Fix&amp;lt;y&amp;gt;? yes&lt;br /&gt;
&lt;br /&gt;
Free blocks count wrong for group #240 (55, counted=54).&lt;br /&gt;
Fix&amp;lt;y&amp;gt;? yes&lt;br /&gt;
&lt;br /&gt;
Free blocks count wrong (2339653, counted=2339652).&lt;br /&gt;
Fix&amp;lt;y&amp;gt;? yes&lt;br /&gt;
&lt;br /&gt;
Inode bitmap differences: &amp;nbsp;-984167 -(984169--984170) -(984176--984178) -984192 -(984195--984199) -(984201--984202)&lt;br /&gt;
Fix&amp;lt;y&amp;gt;? yes&lt;br /&gt;
&lt;br /&gt;
Free inodes count wrong for group #120 (3664, counted=3678).&lt;br /&gt;
Fix&amp;lt;y&amp;gt;? yes&lt;br /&gt;
&lt;br /&gt;
Free inodes count wrong (1523761, counted=1523775).&lt;br /&gt;
Fix&amp;lt;y&amp;gt;? yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/dev/loop63: ***** FILE SYSTEM WAS MODIFIED *****&lt;br /&gt;
/dev/loop63: 1097665/2621440 files (1.8% non-contiguous), 8146108/10485760 blocks&lt;/div&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/532250729/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250729/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.sonitech.org/2011/04/14/%e4%bf%ae%e5%a4%8d%e6%8d%9f%e5%9d%8f%e7%9a%84-xen-domu-%e7%a3%81%e7%9b%98%e9%95%9c%e5%83%8f/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>运行中的 Xen Dom0 如果异常掉电的话有可能会造成 Xen DomU 的磁盘镜像文件损坏，如果 DomU 是 Unix/Linux 的话，下一次 Boot 的时候 fsck 会尝试修复文件系统，如果损坏的比较严重，就只能进入 Read-Only File System，我最近就遇到了这个问题，下面是我修复的过程： 首先使用 DomU 的磁盘镜像虚拟成一个 loop 设备（修改后的内核能支持 64 个 loop 设备） # losetup /dev/loop63 disk.img 使用 kpartx 建立块文件（包括卷管理的LV）到设备文件的映射 # kpartx -va /dev/loop63 如果是用 LVM 的话，读取 LVM 信息（我这里没有是用 LVM ）： # vgscan # lvscan 使用 e2fsck 对分区进行修复 （使用 LVM 的话路径改为上一步获得的 [...]&lt;img src=&quot;http://www1.feedsky.com/t1/532250729/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250729/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>Virtualization</category><category>xen</category><category>img</category><pubDate>Thu, 14 Apr 2011 17:19:31 +0800</pubDate><author>Sonic</author><comments>http://blog.sonitech.org/2011/04/14/%e4%bf%ae%e5%a4%8d%e6%8d%9f%e5%9d%8f%e7%9a%84-xen-domu-%e7%a3%81%e7%9b%98%e9%95%9c%e5%83%8f/#comments</comments><guid isPermaLink="false">http://blog.sonitech.org/?p=1996</guid><dc:creator>Sonic</dc:creator><fs:srclink>http://blog.sonitech.org/2011/04/14/%e4%bf%ae%e5%a4%8d%e6%8d%9f%e5%9d%8f%e7%9a%84-xen-domu-%e7%a3%81%e7%9b%98%e9%95%9c%e5%83%8f/</fs:srclink><fs:srcfeed>http://blog.sonitech.org/feed/</fs:srcfeed><fs:itemid>feedsky/SoniTech/~8468113/532250729/6230762</fs:itemid></item><item><title>How to fuck GFW on Mac</title><link>http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250730/6230762/1/item.html</link><content:encoded>&lt;p&gt;&lt;strong&gt;Requirement:&lt;/strong&gt;&lt;br /&gt;
- ssh account (not in china)&lt;br /&gt;
- chrome browser&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step by step:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;make a bash script for ssh tunnel
&lt;div class=&quot;codecolorer-container bash geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;bash codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;$ &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;mkdir&lt;/span&gt; bin&lt;br /&gt;
$ &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;cd&lt;/span&gt; bin&lt;br /&gt;
$ &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;touch&lt;/span&gt; ssh_tunnel.sh&lt;br /&gt;
$ &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;chmod&lt;/span&gt; +x ssh_tunnel.sh&lt;br /&gt;
$ open .&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;- open ssh_tunnel.sh use TextEdit&lt;br /&gt;
&lt;a href=&quot;http://blog.sonitech.org/saves/uploads/2011/01/Screen-shot-2011-01-11-at-10.07.51-PM.png&quot;&gt;&lt;img class=&quot;alignnone size-full wp-image-1955&quot; title=&quot;Screen shot 2011-01-11 at 10.07.51 PM&quot; src=&quot;http://blog.sonitech.org/saves/uploads/2011/01/Screen-shot-2011-01-11-at-10.07.51-PM.png&quot; alt=&quot;&quot; width=&quot;566&quot; height=&quot;205&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
- type in and save it:&lt;/p&gt;
&lt;div class=&quot;codecolorer-container bash geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;bash codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;#!/bin/bash&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;ssh&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-qTfnN&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-D&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;8888&lt;/span&gt; username&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;hostname&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;- gen ssh key (empty passphrase)&lt;/p&gt;
&lt;div class=&quot;codecolorer-container bash geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;bash codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;$ &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;ssh-keygen&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-t&lt;/span&gt; dsa&lt;br /&gt;
$ &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;ls&lt;/span&gt; ~&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;.ssh&lt;br /&gt;
id_dsa &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;id_dsa.pub&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;- copy ssh pub key to remote host&lt;/p&gt;
&lt;div class=&quot;codecolorer-container bash geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;bash codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;&lt;span style=&quot;color: #666666;&quot;&gt;$ &lt;/span&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;cat&lt;/span&gt; ~&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;.ssh&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;id_dsa.pub &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;|&lt;/span&gt; &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;ssh&lt;/span&gt; username&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;hostname&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'cat &amp;gt;&amp;gt; ~/.ssh/authorized_keys'&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;- connect ssh tunnel&lt;/p&gt;
&lt;div class=&quot;codecolorer-container bash geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;bash codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;&lt;span style=&quot;color: #666666;&quot;&gt;$ &lt;/span&gt;~&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;bin&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;ssh_tunnel.sh&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;install google chrome&lt;/li&gt;
&lt;p&gt;download link: &lt;a href=&quot;http://www.google.com/chrome&quot;&gt;http://www.google.com/chrome&lt;/a&gt;&lt;/p&gt;
&lt;li&gt;install Proxy Switchy! extension&lt;/li&gt;
&lt;p&gt;Proxy Switchy! link: &lt;a href=&quot;https://chrome.google.com/webstore/detail/caehdcpeofiiigpdhbabniblemipncjj&quot;&gt;https://chrome.google.com/webstore/detail/caehdcpeofiiigpdhbabniblemipncjj&lt;/a&gt;&lt;/p&gt;
&lt;li&gt;configure Proxy Switchy! with ssh tunnel&lt;/li&gt;
&lt;p&gt;- Proxy Switchy! -&amp;gt; Options&lt;br /&gt;
&lt;a href=&quot;http://blog.sonitech.org/saves/uploads/2011/01/Screen-shot-2011-01-11-at-10.58.47-PM.png&quot;&gt;&lt;img class=&quot;alignnone size-full wp-image-1959&quot; title=&quot;Screen shot 2011-01-11 at 10.58.47 PM&quot; src=&quot;http://blog.sonitech.org/saves/uploads/2011/01/Screen-shot-2011-01-11-at-10.58.47-PM.png&quot; alt=&quot;&quot; width=&quot;225&quot; height=&quot;218&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
- new profile&lt;br /&gt;
&lt;a href=&quot;http://blog.sonitech.org/saves/uploads/2011/01/Screen-shot-2011-01-11-at-11.00.28-PM.png&quot;&gt;&lt;img class=&quot;alignnone size-full wp-image-1960&quot; title=&quot;Screen shot 2011-01-11 at 11.00.28 PM&quot; src=&quot;http://blog.sonitech.org/saves/uploads/2011/01/Screen-shot-2011-01-11-at-11.00.28-PM.png&quot; alt=&quot;&quot; width=&quot;676&quot; height=&quot;489&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
- add online gfwlist&lt;/p&gt;
&lt;p&gt;http://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://blog.sonitech.org/saves/uploads/2011/01/Screen-shot-2011-01-11-at-11.03.00-PM.png&quot;&gt;&lt;img class=&quot;alignnone size-full wp-image-1961&quot; title=&quot;Screen shot 2011-01-11 at 11.03.00 PM&quot; src=&quot;http://blog.sonitech.org/saves/uploads/2011/01/Screen-shot-2011-01-11-at-11.03.00-PM.png&quot; alt=&quot;&quot; width=&quot;1004&quot; height=&quot;187&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
save.&lt;br /&gt;
OK, done! click Proxy Switchy! icon change to Auto Switch Mode, then you can try to access youtube.com&lt;/p&gt;
&lt;li&gt;auto start on boot&lt;/li&gt;
&lt;p&gt;if you want auto connected ssh tunnel on boot, just drop ssh_tunnel.sh to your login items&lt;br /&gt;
&lt;a href=&quot;http://blog.sonitech.org/saves/uploads/2011/01/Screen-shot-2011-01-11-at-11.16.31-PM.png&quot;&gt;&lt;img class=&quot;alignnone size-full wp-image-1964&quot; title=&quot;Screen shot 2011-01-11 at 11.16.31 PM&quot; src=&quot;http://blog.sonitech.org/saves/uploads/2011/01/Screen-shot-2011-01-11-at-11.16.31-PM.png&quot; alt=&quot;&quot; width=&quot;669&quot; height=&quot;453&quot; /&gt;&lt;/a&gt;
&lt;/ol&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/532250730/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250730/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.sonitech.org/2011/01/11/how-to-fuck-gfw-on-mac/feed/</wfw:commentRss><slash:comments>2</slash:comments><description>Requirement: - ssh account (not in china) - chrome browser Step by step: make a bash script for ssh tunnel $ mkdir bin $ cd bin $ touch ssh_tunnel.sh $ chmod +x ssh_tunnel.sh $ open . - open ssh_tunnel.sh use TextEdit - type in and save it: #!/bin/bash ssh -qTfnN -D 8888 username@hostname - gen [...]&lt;img src=&quot;http://www1.feedsky.com/t1/532250730/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250730/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>gfw</category><category>mac</category><category>Mac</category><category>tunnel</category><pubDate>Tue, 11 Jan 2011 21:48:29 +0800</pubDate><author>Sonic</author><comments>http://blog.sonitech.org/2011/01/11/how-to-fuck-gfw-on-mac/#comments</comments><guid isPermaLink="false">http://blog.sonitech.org/?p=1951</guid><dc:creator>Sonic</dc:creator><fs:srclink>http://blog.sonitech.org/2011/01/11/how-to-fuck-gfw-on-mac/</fs:srclink><fs:srcfeed>http://blog.sonitech.org/feed/</fs:srcfeed><fs:itemid>feedsky/SoniTech/~8468113/532250730/6230762</fs:itemid></item><item><title>各平台下清除DNS缓存的方法</title><link>http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250731/6230762/1/item.html</link><content:encoded>&lt;p&gt;&lt;/ BR&gt;&lt;/p&gt;
&lt;li&gt;&lt;strong&gt;Mac：&lt;/strong&gt;&lt;/li&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;sudo dscacheutil -flushcache&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;/ BR&gt;&lt;/p&gt;
&lt;li&gt;&lt;strong&gt;Linux：&lt;/strong&gt;&lt;/li&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;rndc flush&lt;br /&gt;
or&lt;br /&gt;
/etc/init.d/nscd restart&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;/ BR&gt;&lt;/p&gt;
&lt;li&gt;&lt;strong&gt;Windows：&lt;/strong&gt;&lt;/li&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;ipconfig /flushdns&lt;/div&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/532250731/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250731/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.sonitech.org/2010/12/18/%e5%90%84%e5%b9%b3%e5%8f%b0%e4%b8%8b%e6%b8%85%e9%99%a4dns%e7%bc%93%e5%ad%98%e7%9a%84%e6%96%b9%e6%b3%95/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>Mac： sudo dscacheutil -flushcache Linux： rndc flush or /etc/init.d/nscd restart Windows： ipconfig /flushdns&lt;img src=&quot;http://www1.feedsky.com/t1/532250731/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250731/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>Develop</category><pubDate>Sat, 18 Dec 2010 10:12:06 +0800</pubDate><author>Sonic</author><comments>http://blog.sonitech.org/2010/12/18/%e5%90%84%e5%b9%b3%e5%8f%b0%e4%b8%8b%e6%b8%85%e9%99%a4dns%e7%bc%93%e5%ad%98%e7%9a%84%e6%96%b9%e6%b3%95/#comments</comments><guid isPermaLink="false">http://www.sonitech.org/?p=1848</guid><dc:creator>Sonic</dc:creator><fs:srclink>http://blog.sonitech.org/2010/12/18/%e5%90%84%e5%b9%b3%e5%8f%b0%e4%b8%8b%e6%b8%85%e9%99%a4dns%e7%bc%93%e5%ad%98%e7%9a%84%e6%96%b9%e6%b3%95/</fs:srclink><fs:srcfeed>http://blog.sonitech.org/feed/</fs:srcfeed><fs:itemid>feedsky/SoniTech/~8468113/532250731/6230762</fs:itemid></item><item><title>解决 Xen Ubuntu DomU 启动后在 console 中卡住</title><link>http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250732/6230762/1/item.html</link><content:encoded>&lt;p&gt;Sonic 最近遇到在 Xen 启动 DomU 的时候卡在登陆前的问题，此问题并不影响 Linux 启动，通过 SSH 登陆还是正常的，但是在 Dom0 通过 console 连入 DomU 的时候卡在：&lt;/p&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;......&lt;br /&gt;
&amp;nbsp;* Starting OpenBSD Secure Shell server sshd &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [ OK ] &lt;br /&gt;
&amp;nbsp;* Running local boot scripts (/etc/rc.local) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[ OK ]&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;应该是虚拟 console 权限的问题，解决方法：&lt;/p&gt;
&lt;p&gt;添加 extra = &amp;#8216;console=hvc0&amp;#8242; 到 DomU 配置文件&lt;/p&gt;
&lt;p&gt;在 DomU 中修改 /etc/event.d/hvc0&lt;/p&gt;
&lt;div class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;&quot;&gt;&lt;div class=&quot;text codecolorer&quot; style=&quot;padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap&quot;&gt;# hvc0 - getty&lt;br /&gt;
#&lt;br /&gt;
# This service maintains a getty on hvc0 from the point the system is&lt;br /&gt;
# started until it is shut down again.&lt;br /&gt;
&lt;br /&gt;
start on stopped rc2&lt;br /&gt;
start on stopped rc3&lt;br /&gt;
start on stopped rc4&lt;br /&gt;
start on stopped rc5&lt;br /&gt;
&lt;br /&gt;
stop on runlevel 0&lt;br /&gt;
stop on runlevel 1&lt;br /&gt;
stop on runlevel 6&lt;br /&gt;
&lt;br /&gt;
respawn&lt;br /&gt;
&lt;br /&gt;
script&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if [ ! -c /dev/hvc0 ]; then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mknod --mode=600 /dev/hvc0 c 204 191;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fi&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; exec /sbin/getty 38400 hvc0&lt;br /&gt;
end script&lt;/div&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/532250732/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250732/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://blog.sonitech.org/2010/12/04/%e8%a7%a3%e5%86%b3-xen-ubuntu-domu-%e5%90%af%e5%8a%a8%e5%90%8e%e5%9c%a8-console-%e4%b8%ad%e5%8d%a1%e4%bd%8f/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>Sonic 最近遇到在 Xen 启动 DomU 的时候卡在登陆前的问题，此问题并不影响 Linux 启动，通过 SSH 登陆还是正常的，但是在 Dom0 通过 console 连入 DomU 的时候卡在： ...... &amp;#160;* Starting OpenBSD Secure Shell server sshd &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; [ OK ] &amp;#160;* Running local boot scripts (/etc/rc.local) &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; [...]&lt;img src=&quot;http://www1.feedsky.com/t1/532250732/SoniTech/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/SoniTech/~8468113/532250732/6230762/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>Virtualization</category><pubDate>Sat, 04 Dec 2010 16:34:20 +0800</pubDate><author>Sonic</author><comments>http://blog.sonitech.org/2010/12/04/%e8%a7%a3%e5%86%b3-xen-ubuntu-domu-%e5%90%af%e5%8a%a8%e5%90%8e%e5%9c%a8-console-%e4%b8%ad%e5%8d%a1%e4%bd%8f/#comments</comments><guid isPermaLink="false">http://blog.sonitech.org/?p=1885</guid><dc:creator>Sonic</dc:creator><fs:srclink>http://blog.sonitech.org/2010/12/04/%e8%a7%a3%e5%86%b3-xen-ubuntu-domu-%e5%90%af%e5%8a%a8%e5%90%8e%e5%9c%a8-console-%e4%b8%ad%e5%8d%a1%e4%bd%8f/</fs:srclink><fs:srcfeed>http://blog.sonitech.org/feed/</fs:srcfeed><fs:itemid>feedsky/SoniTech/~8468113/532250732/6230762</fs:itemid></item></channel></rss>
