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

<channel>
	<title>Linux kernel, wifi hack, security &#38; Golang</title>
	<atom:link href="http://wifihack.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://wifihack.net/blog</link>
	<description>simple is powerful</description>
	<pubDate>Fri, 30 Apr 2010 13:07:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Go 语言中文社区成立</title>
		<link>http://wifihack.net/blog/2010/02/golang-chinese-user-group/</link>
		<comments>http://wifihack.net/blog/2010/02/golang-chinese-user-group/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 14:25:44 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
		
		<category><![CDATA[golang]]></category>

		<category><![CDATA[go]]></category>

		<category><![CDATA[golang-china]]></category>

		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=490</guid>
		<description><![CDATA[Go 中文社区

Go官方网站
Go中文官网
中文论坛(测试中&#8230;)
中文用户讨论组(邮件)
中文翻译(SVN)
GitHub与Google Code同步(GIT)
QQ群: 102319854（申请加入请到中文论坛留言）

Go中文文档翻译计划

Install Go 初稿完成
Go Tutorial 初稿完成
Effective Go 初稿25%

翻译的详细信息参考 翻译计划
TODO
1. 创建一个wiki用于资料的收集和整理
2. 把翻译的中文文档发送给Go官方。
3. 翻译PKG相关的文档。
4. 创建一个Blog用于发布有关Go的新闻
5. 用Go做个具体的开源项目。
]]></description>
			<content:encoded><![CDATA[<div>Go 中文社区</div>
<ol>
<li><a rel="nofollow" href="http://golang.org/">Go官方网站</a></li>
<li><a rel="nofollow" href="http://golang-china.org/">Go中文官网</a></li>
<li><a rel="nofollow" href="http://bbs.golang-china.org/">中文论坛(测试中&#8230;)</a></li>
<li><a rel="nofollow" href="https://groups.google.com/group/golang-china/">中文用户讨论组(邮件)</a></li>
<li><a rel="nofollow" href="http://code.google.com/p/golang-china/">中文翻译(SVN)</a></li>
<li><a rel="nofollow" href="http://github.com/border/golang-china">GitHub与Google Code同步(GIT)</a></li>
<li>QQ群: 102319854（申请加入请到<a rel="nofollow" href="http://bbs.golang-china.org/">中文论坛</a>留言）</li>
</ol>
<p>Go中文文档翻译计划</p>
<ol>
<li><a rel="nofollow" href="http://golang-china.googlecode.com/svn/trunk/doc/install_zh.html">Install Go</a> 初稿完成</li>
<li><a rel="nofollow" href="http://code.google.com/p/golang-china/source/browse/trunk/doc/go_tutorial_zh.txt/">Go Tutorial</a> 初稿完成</li>
<li><a rel="nofollow" href="http://golang-china.googlecode.com/svn/trunk/doc/effective_go_zh.html">Effective Go</a> 初稿25%</li>
</ol>
<p>翻译的详细信息参考 <a rel="nofollow" href="http://code.google.com/p/golang-china/wiki/TranslationProject">翻译计划</a></p>
<p>TODO</p>
<p>1. 创建一个wiki用于资料的收集和整理</p>
<p>2. 把翻译的中文文档发送给Go官方。</p>
<p>3. 翻译PKG相关的文档。</p>
<p>4. 创建一个Blog用于发布有关Go的新闻</p>
<p>5. 用Go做个具体的开源项目。</p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2010/02/golang-chinese-user-group/feed/</wfw:commentRss>
		</item>
		<item>
		<title>传说中的中文编程</title>
		<link>http://wifihack.net/blog/2010/01/chinese-programming-in-golang/</link>
		<comments>http://wifihack.net/blog/2010/01/chinese-programming-in-golang/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 15:16:27 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
		
		<category><![CDATA[golang]]></category>

		<category><![CDATA[go]]></category>

		<category><![CDATA[golang-china]]></category>

		<category><![CDATA[Google]]></category>

		<category><![CDATA[helloworld]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=487</guid>
		<description><![CDATA[border@ubuntu:~/work/go/tutorial$ cat helloworld.go

package main

import fmt &#8220;fmt&#8221;

func 输出函数(s string) {
fmt.Printf(s)
}

func main() {
fmt.Printf(&#8221;Hello, 中文\n&#8221;)
变量 := &#8220;传说中的中文编程\n&#8221;
输出函数(变量)
}


border@ubuntu:~/work/go/tutorial$ 8g helloworld.go
border@ubuntu:~/work/go/tutorial$ 8l -o helloworld helloworld.8
border@ubuntu:~/work/go/tutorial$ ./helloworld
Hello, 中文
传说中的中文编程


GO中文资料参考: http://golang-china.org
GO中文用户组: https://groups.google.com/group/golang-china/


&#8211;
Bian Jiang
Blog:  http://www.wifihack.net/
]]></description>
			<content:encoded><![CDATA[<div>border@ubuntu:~/work/go/tutorial$ cat helloworld.go</div>
<blockquote>
<div>package main</div>
<div></div>
<div>import fmt &#8220;fmt&#8221;</div>
<div></div>
<div>func 输出函数(s string) {</div>
<div>fmt.Printf(s)</div>
<div>}</div>
<div></div>
<div>func main() {</div>
<div>fmt.Printf(&#8221;Hello, 中文\n&#8221;)</div>
<div>变量 := &#8220;传说中的中文编程\n&#8221;</div>
<div>输出函数(变量)</div>
<div>}</div>
</blockquote>
<div></div>
<div>border@ubuntu:~/work/go/tutorial$ 8g helloworld.go</div>
<div>border@ubuntu:~/work/go/tutorial$ 8l -o helloworld helloworld.8</div>
<div>border@ubuntu:~/work/go/tutorial$ ./helloworld</div>
<div>Hello, 中文</div>
<div>传说中的中文编程</div>
<div></div>
<div>
<div>GO中文资料参考: <a href="http://golang-china.org">http://golang-china.org</a></div>
<div><a href="http://golang-china.org"></a>GO中文用户组: <a href="https://groups.google.com/group/golang-china/">https://groups.google.com/group/golang-china/</a></div>
</div>
<div></div>
<p><span style="color: #888888;">&#8211;<br />
Bian Jiang<br />
Blog:  <a href="http://www.wifihack.net/" target="_blank">http://www.wifihack.net/</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2010/01/chinese-programming-in-golang/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Go语言中的type 和 interface 相关的问题</title>
		<link>http://wifihack.net/blog/2010/01/type-and-interface-in-golang/</link>
		<comments>http://wifihack.net/blog/2010/01/type-and-interface-in-golang/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 16:23:44 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
		
		<category><![CDATA[golang]]></category>

		<category><![CDATA[go]]></category>

		<category><![CDATA[golang-china]]></category>

		<category><![CDATA[interface]]></category>

		<category><![CDATA[type]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=484</guid>
		<description><![CDATA[
在Go语言中，每个type都是不同的，这里的type和c语言中的typedef还是有些区别的，

在Go中不能用type派生出来的int类型数据去替换内置的int类型. 比如:
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-




border@wifihack:~/work/go/tutorial$ cat type1.go




package main









import &#8220;fmt&#8221;









type MyTypeA int









func printInt(i int) {




fmt.Printf(&#8221;%d\n&#8221;, i)




}









func main() {




var a MyTypeA = 0




printInt(a)




}




border@wifihack:~/work/go/tutorial$ 8g type1.go




type1.go:13: cannot use a (type MyTypeA) as type int in function argument





&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-

你不能把type派生出来的int类型的MyTypeA传递给printInt(i int)函数。所以 MyTypeA 与 int 不能直接替换。

同样的道理如果你自己定义了2个相同的类型比如:




type MyTypeA int


type MyTypeB int


var a MyTypeA = 0


var b MyTypeB = 0


a = b 或 b = a 都是错误的，编译不通过。




如果你非要使用printInt(i [...]]]></description>
			<content:encoded><![CDATA[<div>
<div>在Go语言中，每个type都是不同的，这里的type和c语言中的typedef还是有些区别的，</div>
<div></div>
<div>在Go中不能用type派生出来的int类型数据去替换内置的int类型. 比如:</div>
<div>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</div>
</div>
<blockquote>
<div>
<div>
<div>border@wifihack:~/work/go/tutorial$ cat type1.go</div>
</div>
</div>
<div>
<div>
<div>package main</div>
</div>
</div>
<div>
<div>
<div></div>
</div>
</div>
<div>
<div>
<div>import &#8220;fmt&#8221;</div>
</div>
</div>
<div>
<div>
<div></div>
</div>
</div>
<div>
<div>
<div>type MyTypeA int</div>
</div>
</div>
<div>
<div>
<div></div>
</div>
</div>
<div>
<div>
<div>func printInt(i int) {</div>
</div>
</div>
<div>
<div>
<div>fmt.Printf(&#8221;%d\n&#8221;, i)</div>
</div>
</div>
<div>
<div>
<div>}</div>
</div>
</div>
<div>
<div>
<div></div>
</div>
</div>
<div>
<div>
<div>func main() {</div>
</div>
</div>
<div>
<div>
<div>var a MyTypeA = 0</div>
</div>
</div>
<div>
<div>
<div>printInt(a)</div>
</div>
</div>
<div>
<div>
<div>}</div>
</div>
</div>
<div>
<div>
<div>border@wifihack:~/work/go/tutorial$ 8g type1.go</div>
</div>
</div>
<div>
<div>
<div>type1.go:13: cannot use a (type MyTypeA) as type int in function argument</div>
</div>
</div>
</blockquote>
<div>
<div>
<div>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</div>
</div>
<div>你不能把type派生出来的int类型的MyTypeA传递给printInt(i int)函数。所以 MyTypeA 与 int 不能直接替换。</div>
<div></div>
<div>同样的道理如果你自己定义了2个相同的类型比如:</div>
<div></div>
</div>
<blockquote>
<div>
<div>type MyTypeA int</div>
</div>
<div>
<div>type MyTypeB int</div>
</div>
<div>
<div>var a MyTypeA = 0</div>
</div>
<div>
<div>var b MyTypeB = 0</div>
</div>
<div>
<div>a = b 或 b = a 都是错误的，编译不通过。</div>
</div>
</blockquote>
<div>
<div></div>
<div>如果你非要使用printInt(i int)这个函数也行，但是必须把传进去的数据类型转换为int类型。</div>
<div></div>
</div>
<blockquote>
<div>
<div>printInt(a)</div>
</div>
</blockquote>
<div>
<div>替换成</div>
</div>
<blockquote>
<div>
<div>printInt(int(a))</div>
<div></div>
</div>
</blockquote>
<div>
<div>就可以解决编译问题，但是Go提供了另一种解决方法接口(interface)，你可以通过一个空接口来实现, 例如:</div>
<div></div>
<div>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</div>
<div>
<div>border@wifihack:~/work/go/tutorial$ cat type2.go</div>
<div>package main</div>
<div></div>
<div>import &#8220;fmt&#8221;</div>
<div></div>
<div>type MyTypeA int</div>
<div></div>
<div>type Empty interface {}</div>
<div></div>
<div>func printInt(i Empty) {</div>
<div>fmt.Printf(&#8221;%d\n&#8221;, i)</div>
<div>}</div>
<div></div>
<div>func main() {</div>
<div>var a MyTypeA = 0</div>
<div>printInt(a)</div>
<div>}</div>
<div>border@wifihack:~/work/go/tutorial$ 8g type2.go</div>
<div>border@wifihack:~/work/go/tutorial$ 8l -o type2 type2.8</div>
<div>border@wifihack:~/work/go/tutorial$ ./type2</div>
<div>0</div>
<div>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</div>
</div>
<div></div>
<div></div>
<div>如果使用接口(interface)就和类型无关，你也可以在printInt函数里面输出字符串看看效果:</div>
<div>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</div>
<div>package main</div>
<div></div>
<div>import &#8220;fmt&#8221;</div>
<div></div>
<div>type MyTypeA int</div>
<div>type MyTypeB int</div>
<div></div>
<div>func printInt(i interface{}) {</div>
<div>fmt.Printf(&#8221;%d\n&#8221;, i)</div>
<div>fmt.Printf(&#8221;%s\n&#8221;, i)</div>
<div>}</div>
<div></div>
<div>func main() {</div>
<div>var a MyTypeA = 0</div>
<div>var b MyTypeB = 2</div>
<div>printInt(a)</div>
<div>printInt(b)</div>
<div>var s string = &#8220;Hello, 中文&#8221;</div>
<div>printInt(s)</div>
<div>}</div>
<div></div>
</div>
<div>
<div>border@wifihack:~/work/go/tutorial$ ./type</div>
<div>0</div>
<div>%s(main.MyTypeA=0)</div>
<div>2</div>
<div>%s(main.MyTypeB=2)</div>
<div>%d(string=Hello, 中文)</div>
<div>Hello, 中文</div>
<div>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</div>
</div>
<div></div>
<p>参考: <a href="https://groups.google.com/group/golang-nuts/browse_thread/thread/bf4174fc5cbafa13#870a9034b11a8651" target="_blank">https://groups.google.com/group/golang-nuts/browse_thread/thread/bf4174fc5cbafa13#870a9034b11a8651</a></p>
<div>GO中文资料参考: <a href="http://golang-china.org">http://golang-china.org</a></div>
<div><a href="http://golang-china.org"></a>GO中文用户组: <a href="https://groups.google.com/group/golang-china/">https://groups.google.com/group/golang-china/</a></div>
<div>
&#8211;<br />
Bian Jiang<br />
Blog:  <a href="http://www.wifihack.net/" target="_blank">http://www.wifihack.net/</a></div>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2010/01/type-and-interface-in-golang/feed/</wfw:commentRss>
		</item>
		<item>
		<title>GCC宣布对Google Go语言的支持</title>
		<link>http://wifihack.net/blog/2010/01/gcc-to-merge-go-support/</link>
		<comments>http://wifihack.net/blog/2010/01/gcc-to-merge-go-support/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 09:31:25 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
		
		<category><![CDATA[OpenSource]]></category>

		<category><![CDATA[golang]]></category>

		<category><![CDATA[Gcc]]></category>

		<category><![CDATA[go]]></category>

		<category><![CDATA[golang-china]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=475</guid>
		<description><![CDATA[GCC项目组织宣布， 允许gccgo(Google 推出的新语言GO)增加到gcc的主分支，更详细的信息可能要在GCC4.5或之后的版本中体现。 也就是说在不远的将来GO语言将是Linux的标配。
GO语言: http://www.golang.org
GO中文资料参考: http://golang-china.org
GO中文用户组: https://groups.google.com/group/golang-china/
]]></description>
			<content:encoded><![CDATA[<p><a href="http://lwn.net/Articles/371466/">GCC项目组织宣布</a>，<a rel="attachment wp-att-476" href="http://wifihack.net/blog/2010/01/gcc-to-merge-go-support/bumper320x180/"><img class="alignright size-full wp-image-476" title="bumper320x180" src="http://wifihack.net/blog/wp-content/uploads/2010/01/bumper320x180.png" alt="bumper320x180" width="205" height="115" /></a> 允许gccgo(Google 推出的新语言GO)增加到gcc的主分支，更详细的信息可能要在GCC4.5或之后的版本中体现。 也就是说在不远的将来GO语言将是Linux的标配。</p>
<p><span style="background-color: #ffffff;">GO语言: <a href="http://www.golang.org">http://www.golang.org</a></span></p>
<p>GO中文资料参考: <a href="http://golang-china.org">http://golang-china.org</a></p>
<p>GO中文用户组: <a href="https://groups.google.com/group/golang-china/">https://groups.google.com/group/golang-china/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2010/01/gcc-to-merge-go-support/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google Code 与 Github代码同步</title>
		<link>http://wifihack.net/blog/2010/01/google-code-svn-and-github-sync/</link>
		<comments>http://wifihack.net/blog/2010/01/google-code-svn-and-github-sync/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 13:50:27 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
		
		<category><![CDATA[Tech.Notes]]></category>

		<category><![CDATA[Git]]></category>

		<category><![CDATA[GitHub]]></category>

		<category><![CDATA[golang]]></category>

		<category><![CDATA[golang-china]]></category>

		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=469</guid>
		<description><![CDATA[git config --global user.name "Bian Jiang"
git config --global user.email borderj@gmail.com
git svn clone https://golang-china.googlecode.com/svn/trunk -s
git remote add origin git@github.com:border/golang-china.git
git push origin master
git svn rebase // 本地与Goolge Code 代码同步
git push // 上传本地的代码到github
git svn dcommit // 上传本地的代码到Google Code 
在Github上创建ssh授权参考: http://wifihack.net/blog/2008/12/permission-denied-on-github/
&#8211;EOF&#8211;
http://www.wifihack.net
]]></description>
			<content:encoded><![CDATA[<pre class="prettyprint"><code><span class="pln">git config --global user.name "Bian Jiang"</span></code></pre>
<pre class="prettyprint"><code><span class="pln">git config --global user.email borderj@gmail.com</span></code></pre>
<pre class="prettyprint"><code><span class="pln">git svn clone https://golang-china.googlecode.com/svn/trunk</span><span class="com"> -s</span><span class="pln">
git remote add origin git@github.com:border/golang-china.git</span><span class="pln">
git push origin master</span></code></pre>
<pre class="prettyprint"><span style="font-family: monospace; ">git svn rebase // 本地与Goolge Code 代码同步</span></pre>
<pre class="prettyprint"><code><span class="pln">git push // 上传本地的代码到github</span></code></pre>
<pre class="prettyprint"><code><span class="pln">git svn dcommit // 上传本地的代码到Google Code </span></code></pre>
<p>在Github上创建ssh授权参考: <a href="http://wifihack.net/blog/2008/12/permission-denied-on-github/">http://wifihack.net/blog/2008/12/permission-denied-on-github/</a></p>
<p>&#8211;EOF&#8211;<br />
http://www.wifihack.net</p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2010/01/google-code-svn-and-github-sync/feed/</wfw:commentRss>
		</item>
		<item>
		<title>百度被黑，被定向到伊朗网军网站</title>
		<link>http://wifihack.net/blog/2010/01/baidu-hacked-by-%e2%80%9ciranian-cyber-army%e2%80%9d/</link>
		<comments>http://wifihack.net/blog/2010/01/baidu-hacked-by-%e2%80%9ciranian-cyber-army%e2%80%9d/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 02:49:04 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
		
		<category><![CDATA[Security]]></category>

		<category><![CDATA[baidu]]></category>

		<category><![CDATA[down]]></category>

		<category><![CDATA[Hacking]]></category>

		<category><![CDATA[iranian cyber army]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=460</guid>
		<description><![CDATA[Baidu is suddenly unavailable, with sources all over China confirming this.
It seems that China’s most popular search engine, with a market share of over 77% has been hacked by Iranian hackers.
At present, the website is unavailable, but we have found a screenshot from Twitter user Budi Putra.
It seems that the website has had its DNS hacked by [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://baidu.com">Baidu</a> is suddenly unavailable, with sources all over China confirming this.<img class="alignright" title="Baidu Hacked By Iranian Cyber Army" src="http://thenextweb.com/asia/files/2010/01/Picture-42.png" alt="" width="68%" height="55%" /></p>
<p>It seems that China’s most popular search engine, with a market share of <a href="http://brainstormtech.blogs.fortune.cnn.com/2009/12/28/google-v-baidu-which-company-will-win-china/">over 77%</a> has been hacked by Iranian hackers.</p>
<p>At present, the website is unavailable, but we have found a screenshot from Twitter user <a href="http://www.twitter.com/budip">Budi Putra</a>.</p>
<p>It seems that the website has had its DNS hacked by the “Iranian cyber Army”, the same guys that <a href="http://thenextweb.com/2009/12/18/twitter-hacked-earlier-running/">hacked Twitter</a> a few weeks ago. The process, called DNS cache poisoning, is the corruption of an Internet server’s domain name system (DNS) table by replacing an Internet address with that of another, rogue address, in this case what the Iranian Cyber Army want you to see.</p>
<p>Exactly why The Iranian Cyber Army has decided to target Baidu.com is unknown but sources say it might be in relation to Iran’s nuclear ambitions, although no one is certain.</p>
<p>Can someone read Persian and translate this?</p>
<p><strong>Update:</strong></p>
<p>We’re being told the site is now accessible from some parts of the world. Still not so from Europe. Please let us know in the comments.</p>
<p>中文参考: <a href="http://solidot.org/articles/10/01/12/0046222.shtml">http://solidot.org/articles/10/01/12/0046222.shtml</a></p>
<p>原文: <a href="http://thenextweb.com/asia/2010/01/12/breaking-baidu-hacked-iranian/">http://thenextweb.com/asia/2010/01/12/breaking-baidu-hacked-iranian/</a></p>
<p>- Bian Jiang</p>
<p>http://www.wifihack.net</p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2010/01/baidu-hacked-by-%e2%80%9ciranian-cyber-army%e2%80%9d/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Pthread创建线程后必须使用join或detach释放线程资源</title>
		<link>http://wifihack.net/blog/2009/12/pthread-create-join-detach-release-thread/</link>
		<comments>http://wifihack.net/blog/2009/12/pthread-create-join-detach-release-thread/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 14:22:09 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
		
		<category><![CDATA[Kernel]]></category>

		<category><![CDATA[Tech.Notes]]></category>

		<category><![CDATA[detach]]></category>

		<category><![CDATA[join]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[pthread]]></category>

		<category><![CDATA[thread]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=446</guid>
		<description><![CDATA[这两天在看Pthread 资料的时候，无意中看到这样一句话(man pthread_detach):

Either pthread_join(3) or pthread_detach() should be called for each thread
       that an application creates, so that system resources for the thread can be
       released.  (But note that the resources of all threads are freed when the
     [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: arial, sans-serif;"><span>这两天在看Pthread 资料的时候，无意中看到<a href="http://www.kernel.org/doc/man-pages/online/pages/man3/pthread_detach.3.html" target="_blank">这样</a>一句话(man pthread_detach):</span></span></p>
<div>
<pre><span style="font-family: arial, sans-serif;"><span><span><span style="font-family: 'Courier New', monospace; line-height: 18px; font-size: 12px; white-space: pre;">Either <a href="http://www.kernel.org/doc/man-pages/online/pages/man3/pthread_join.3.html" target="_blank">pthread_join(3)</a> or <strong>pthread_detach</strong>() should be called for each thread
       that an application creates, so that system resources for the thread can be
       released.  (But note that the resources of all threads are freed when the
       process terminates.)</span></span></span></span></pre>
<p>也就是说：每个进程创建以后都应该调用pthread_join 或 pthread_detach 函数，只有这样在线程结束的时候资源(线程的描述信息和stack)才能被释放.</p>
<p>之后又查了<a>pthread_join</a> 但是没有明确说明必须调用pthread_join 或 pthread_detach.</p>
<p>但是再查了 Pthread for win32 <a href="http://sourceware.org/pthreads-win32/manual/pthread_join.html" target="_blank">pthread_join</a></p>
<blockquote><p>When a joinable thread terminates, its memory resources (thread descriptor and stack) are not deallocated until another thread performs pthread_join on it. Therefore, <span>pthread_join must be called  once  for each joinable thread created to avoid <strong>memory leaks</strong>.</span></p></blockquote>
</div>
<div><span style="font-family: arial, sans-serif;"><span><span style="font-family: verdana, 'ms song', Arial, Helvetica, sans-serif; color: #ff0000; font-size: small;"><span><br />
</span></span></span></span></div>
<div><span style="font-family: verdana, 'ms song', Arial, Helvetica, sans-serif;"><span>才知道如果在新线程里面没有调用<span>pthread_join 或 pthread_detach会导致内存泄漏, 如果你创建的线程越多，你的内存利用率就会越高, 直到你再无法创建线程，最终只能结束进程。</span></span></span></div>
<div><span style="font-family: verdana, 'ms song', Arial, Helvetica, sans-serif; color: #ff0000; font-size: small;"><span><br />
</span></span></div>
<div><span style="font-family: arial, sans-serif;"><span><span style="font-family: verdana, 'ms song', Arial, Helvetica, sans-serif; font-size: small;"><span>解决方法有三个:</span></span></span></span></div>
<div><span style="font-family: arial, sans-serif;"><span><span style="font-family: verdana, 'ms song', Arial, Helvetica, sans-serif; font-size: small;"><span>1.   线程里面调用<span> <span><strong><em>pthread_detach(pthread_self()) </em><span style="font-weight: normal;">这个方法最简单</span></strong></span></span></span></span></span></span></div>
<div><span style="font-family: arial, sans-serif;"><span><span style="font-family: verdana, 'ms song', Arial, Helvetica, sans-serif; color: #ff0000; font-size: small;"><span><span style="color: #000000;"><span style="font-family: 'Courier New'; font-size: small;"><span>2<strong>. <span style="font-weight: normal;">在创建线程的设置</span><em>PTHREAD_CREATE_DETACHED</em><span style="font-weight: normal;">属性</span></strong></span></span></span></span></span></span></span></div>
<div><span style="font-family: arial, sans-serif;"><span><span style="font-family: verdana, 'ms song', Arial, Helvetica, sans-serif; color: #ff0000; font-size: small;"><span><span style="color: #000000;"><span style="font-family: 'Courier New'; font-size: small;"><span><strong><span>3. </span><span style="font-weight: normal;">创建线程后用</span><span> <strong><em>pthread_join()</em></strong> <span style="font-weight: normal;">一直等待子线程结束。</span></span></strong></span></span></span></span></span></span></span></div>
<div><span style="font-family: arial, sans-serif;"><span><span style="font-family: verdana, 'ms song', Arial, Helvetica, sans-serif; color: #ff0000; font-size: small;"><span><span style="color: #000000;"><span style="font-family: 'Courier New'; font-size: small;"><span><strong><span><span style="font-weight: normal;"><br />
</span></span></strong></span></span></span></span></span></span></span></div>
<div>下面是几个简单的例子</div>
<div>1. <span>调用 <span> <span><strong><em>pthread_detach(pthread_self())</em></strong></span></span></span></div>
<div>
<blockquote>
<div>
<div>#include &lt;stdio.h&gt;</div>
<div>#include &lt;stdlib.h&gt;</div>
<div>#include &lt;pthread.h&gt;</div>
<div>void *PrintHello(void)</div>
<div>{</div>
<div>pthread_detach(pthread_self());</div>
<div>int stack[1024 * 20] = {0,};</div>
<div>//sleep(1);</div>
<div>long tid = 0;</div>
<div>//printf(&#8221;Hello World! It&#8217;s me, thread #%ld!\n&#8221;, tid);</div>
<div>//pthread_exit(NULL);</div>
<div>}</div>
<div>int main (int argc, char *argv[])</div>
<div>{</div>
<div>pthread_t pid;</div>
<div>int rc;</div>
<div>long t;</div>
<div>while (1) {</div>
<div>printf(&#8221;In main: creating thread %ld\n&#8221;, t);</div>
<div>rc = pthread_create(&amp;pid, NULL, PrintHello, NULL);</div>
<div>if (rc){</div>
<div>printf(&#8221;ERROR; return code from pthread_create() is %d\n&#8221;, rc);</div>
<div>//exit(-1);</div>
<div>}</div>
<div>sleep(1);</div>
<div>}</div>
<div>printf(&#8221; \n&#8212; main End &#8212;- \n&#8221;);</div>
<div>pthread_exit(NULL);</div>
<div>}</div>
</div>
</blockquote>
<div>
<div><span style="font-family: arial, sans-serif;"><span><span style="font-family: verdana, 'ms song', Arial, Helvetica, sans-serif; color: #ff0000; font-size: small;"><span><span style="color: #000000;"><span style="font-family: 'Courier New'; font-size: small;"><span>2<strong>. <span style="font-weight: normal;">在创建线程的设置</span><span style="font-weight: normal;">PTHREAD_CREATE_DETACHED</span><span style="font-weight: normal;">属性</span></strong></span></span></span></span></span></span></span></div>
<div><span style="font-family: arial, sans-serif;"><span><span style="font-family: verdana, 'ms song', Arial, Helvetica, sans-serif; color: #ff0000; font-size: small;"><span><span style="color: #000000;"><span style="font-family: 'Courier New'; font-size: small;"><span><strong><span></p>
<blockquote>
<div><span style="font-weight: normal;"></p>
<div>#include &lt;stdio.h&gt;</div>
<div>#include &lt;stdlib.h&gt;</div>
<div>#include &lt;pthread.h&gt;</div>
<div>void *PrintHello(void)</div>
<div>{</div>
<div>int stack[1024 * 20] = {0,};</div>
<div>//pthread_exit(NULL);</div>
<div>//pthread_detach(pthread_self());</div>
<div>}</div>
<div>int main (int argc, char *argv[])</div>
<div>{</div>
<div>pthread_t pid;</div>
<div>int rc;</div>
<div>long t;</div>
<div>while (1) {</div>
<div>printf(&#8221;In main: creating thread %ld\n&#8221;, t);</div>
<div>pthread_attr_t attr;</div>
<div>pthread_t thread;</div>
<div>pthread_attr_init (&amp;attr);</div>
<div>pthread_attr_setdetachstate (&amp;attr, PTHREAD_CREATE_DETACHED);</div>
<div>rc = pthread_create(&amp;pid, &amp;attr, PrintHello, NULL);</div>
<div>pthread_attr_destroy (&amp;attr);</div>
<div>if (rc){</div>
<div>printf(&#8221;ERROR; return code from pthread_create() is %d\n&#8221;, rc);</div>
<div>//exit(-1);</div>
<div>}</div>
<div>sleep(1);</div>
<div>}</div>
<div>printf(&#8221; \n&#8212; main End &#8212;- \n&#8221;);</div>
<div>pthread_exit(NULL);</div>
<div>}</div>
<p></span></div>
</blockquote>
<p></span></strong></p>
<p></span></span></span></span></span></span></span></div>
<div><span style="font-family: arial, sans-serif;"><span style="font-family: verdana, 'ms song', Arial, Helvetica, sans-serif; color: #ff0000; font-size: small;"><span style="color: #000000;"><span style="font-family: 'Courier New'; font-size: small;">3. 创建线程后用 pthread_join() 一直等待子线程结束。</span></span></span></span></div>
<div><span style="font-family: arial, sans-serif;"><span><span style="font-family: verdana, 'ms song', Arial, Helvetica, sans-serif; color: #ff0000; font-size: small;"><span><span style="color: #000000;"><span style="font-family: 'Courier New'; font-size: small;"><span><strong><span><br />
</span></strong></span></span></span></span></span></span></span></div>
</div>
<div>
<blockquote>
<div>
<div>#include &lt;stdio.h&gt;</div>
<div>#include &lt;stdlib.h&gt;</div>
<div>#include &lt;pthread.h&gt;</div>
<div>void *PrintHello(void)</div>
<div>{</div>
<div>int stack[1024 * 20] = {0,};</div>
<div>//sleep(1);</div>
<div>long tid = 0;</div>
<div>//pthread_exit(NULL);</div>
<div>//pthread_detach(pthread_self());</div>
<div>}</div>
<div>int main (int argc, char *argv[])</div>
<div>{</div>
<div>pthread_t pid;</div>
<div>int rc;</div>
<div>long t;</div>
<div>while (1) {</div>
<div>printf(&#8221;In main: creating thread %ld\n&#8221;, t);</div>
<div>rc = pthread_create(&amp;pid, NULL, PrintHello, NULL);</div>
<div>if (rc){</div>
<div>printf(&#8221;ERROR; return code from pthread_create() is %d\n&#8221;, rc);</div>
<div>//exit(-1);</div>
<div>}</div>
<div>pthread_join(pid, NULL);</div>
<div>sleep(1);</div>
<div>}</div>
<div>printf(&#8221; \n&#8212; main End &#8212;- \n&#8221;);</div>
<div>pthread_exit(NULL);</div>
<div>}</div>
</div>
</blockquote>
</div>
<div><a href="http://wifihack.net/blog/?attachment_id=447">测试代码下载</a></div>
</div>
<div>参考: 1. <a href="http://www.cnblogs.com/bits/archive/2009/12/04/no_join_or_detach_memory_leak.html" target="_blank">http://www.cnblogs.com/bits/archive/2009/12/04/no_join_or_detach_memory_leak.html</a></div>
<div>2. Linux 多线程应用中如何编写安全的信号处理函数 <a href="http://www.ibm.com/developerworks/cn/linux/l-cn-signalsec/index.html?ca=drs-cn-0618" target="_blank">http://www.ibm.com/developerworks/cn/linux/l-cn-signalsec/index.html?ca=drs-cn-0618</a></div>
<div>3. man pthread_detach <a href="http://www.kernel.org/doc/man-pages/online/pages/man3/pthread_detach.3.html" target="_blank">http://www.kernel.org/doc/man-pages/online/pages/man3/pthread_detach.3.html</a></div>
<div><a href="http://www.kernel.org/doc/man-pages/online/pages/man3/pthread_detach.3.html" target="_blank"></a>4. man pthread_join <a href="http://www.kernel.org/doc/man-pages/online/pages/man3/pthread_join.3.html" target="_blank">http://www.kernel.org/doc/man-pages/online/pages/man3/pthread_join.3.html</a><br />
&#8211;<br />
Bian Jiang<br />
Blog:  <a href="http://www.wifihack.net/" target="_blank">http://www.wifihack.net/</a></div>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2009/12/pthread-create-join-detach-release-thread/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Sleeping in a .BAT script</title>
		<link>http://wifihack.net/blog/2009/12/sleeping-in-a-bat-script/</link>
		<comments>http://wifihack.net/blog/2009/12/sleeping-in-a-bat-script/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 04:55:09 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
		
		<category><![CDATA[Tech.Notes]]></category>

		<category><![CDATA[Bat]]></category>

		<category><![CDATA[script]]></category>

		<category><![CDATA[sleep]]></category>

		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=443</guid>
		<description><![CDATA[这里有列了两个方法：
1. Ping 实现
@ECHO OFF
rem &#8211;#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;
rem &#8211;# Script : sleep.BAT
rem &#8211;# Tested : Microsoft Windos XP [Version 5.1.2600]
rem &#8211;# Purpose : Sleep for number of seconds
rem &#8211;# Every 2 pings to localhost takes about 1 second
rem &#8211;#
rem &#8211;# Usage : sleep.BAT {# of seconds to sleep}
rem &#8211;#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;
ECHO %TIME%
FOR /l %%a IN (%1,-1,1) do (ECHO 1 &#62;NULL [...]]]></description>
			<content:encoded><![CDATA[<p>这里有列了两个方法：</p>
<p>1. Ping 实现</p>
<blockquote><p>@ECHO OFF</p>
<p>rem &#8211;#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>rem &#8211;# Script : sleep.BAT</p>
<p>rem &#8211;# Tested : Microsoft Windos XP [Version 5.1.2600]</p>
<p>rem &#8211;# Purpose : Sleep for number of seconds</p>
<p>rem &#8211;# Every 2 pings to localhost takes about 1 second</p>
<p>rem &#8211;#</p>
<p>rem &#8211;# Usage : sleep.BAT {# of seconds to sleep}</p>
<p>rem &#8211;#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>ECHO %TIME%</p>
<p>FOR /l %%a IN (%1,-1,1) do (ECHO 1 &gt;NULL %%as&amp;ping -n 2 -w 1 127.0.0.1&gt;NUL)</p>
<p>ECHO %TIME%</p></blockquote>
<p>2. VBScript 实现</p>
<blockquote><p>@echo off</p>
<p>echo Wscript.Sleep WScript.Arguments(0) &gt;%tmp%\delay.vbs</p>
<p>cscript //b //nologo %tmp%\delay.vbs 5000</p>
<p>del %tmp%\delay.vbs &gt; nul</p></blockquote>
<p>当然你也可以用C自己写个。</p>
<p>参考: <a href="http://it.toolbox.com/blogs/database-solutions/sleeping-in-a-bat-script-22111">http://it.toolbox.com/blogs/database-solutions/sleeping-in-a-bat-script-22111</a></p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2009/12/sleeping-in-a-bat-script/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google发布免费DNS解析服务</title>
		<link>http://wifihack.net/blog/2009/12/google-public-dns/</link>
		<comments>http://wifihack.net/blog/2009/12/google-public-dns/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 03:25:52 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
		
		<category><![CDATA[Others]]></category>

		<category><![CDATA[DNS]]></category>

		<category><![CDATA[Google]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Mac]]></category>

		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=438</guid>
		<description><![CDATA[本文来自: Solidot.
Google宣布 推出免费的DNS解析服务Google Public DNS。
DNS协议是Web的重要组成部分，它就如同是互联网的“电话簿”。每次访问一个网站，计算机都须执行一次DNS查询。复杂的网页在载入之前需执行多次DNS查询，其结果是普通网民每天必须执行数百次DNS查询，这会降低用户的浏览体验。Google推出Public DNS便是试图改进浏览体验，让互联网变得更快(在TTL记录过期之前执行prefetching，更新缓存)，更安全（支持新的DNS安全扩展DNSSEC）。Google Public DNS托管在Google分布在全世界的数据中心，它使用选播路由算法（Anycast Routing）把用户的DNS解析请求发送到地理位置最近的数据中心。Google Public DNS遵循DNS标准，向用户的计算机提供正确的响应，不会有任何屏蔽、过滤，或重新定向等妨碍用户浏览体验的行为。Google Public DNS的IP地址为：8.8.8.8以及8.8.4.4。


修改TCP/IP的DNS服务器地址：

Microsoft Windows
DNS settings are specified in the TCP/IP Properties window for the selected network connection.
Example: Changing DNS server settings on Microsoft Windows Vista

Go the Control Panel.
Click Network and Internet, then Network and Sharing Center, then Manage network connections.
Select the connection for which you want to configure Google Public [...]]]></description>
			<content:encoded><![CDATA[<p>本文来自: <a href="http://it.solidot.org/it/09/12/04/0144201.shtml">Solidot</a>.<br />
Google<a href="http://googlecode.blogspot.com/2009/12/introducing-google-public-dns-new-dns.html">宣布</a> <a href="http://tech.slashdot.org/story/09/12/03/1814238/Google-Launches-Public-DNS-Resolver">推出</a>免费的DNS解析服务<a href="http://code.google.com/speed/public-dns/">Google Public DNS</a>。</p>
<div class="intro"><a href="http://zh.wikipedia.org/zh-cn/%E5%9F%9F%E5%90%8D%E6%9C%8D%E5%8B%99%E5%99%A8">DNS协议</a>是Web的重要组成部分，它就如同是互联网的“电话簿”。每次访问一个网站，计算机都须执行一次DNS查询。复杂的网页在载入之前需执行多次DNS查询，其结果是普通网民每天必须执行数百次DNS查询，这会降低用户的浏览体验。Google推出Public DNS便是试图改进浏览体验，让互联网变得更快(在TTL记录过期之前执行prefetching，更新缓存)，更安全（支持新的DNS安全扩展<a href="http://www.dnssec.net/">DNSSEC</a>）。Google Public DNS托管在Google分布在全世界的数据中心，它使用选播路由算法（Anycast Routing）把用户的DNS解析请求发送到地理位置最近的数据中心。Google Public DNS遵循DNS标准，向用户的计算机提供正确的响应，不会有任何屏蔽、过滤，或重新定向等妨碍用户浏览体验的行为。Google Public DNS的IP地址为：8.8.8.8以及8.8.4.4。</div>
<div class="intro"><em><br />
</em></div>
<div class="full">修改TCP/IP的DNS服务器地址：</div>
<div class="full">
<h4>Microsoft Windows</h4>
<p>DNS settings are specified in the <strong>TCP/IP Properties</strong> window for the selected network connection.</p>
<p><strong>Example: Changing DNS server settings on Microsoft Windows Vista</strong></p>
<ol>
<li>Go the <strong>Control Panel</strong>.</li>
<li>Click <strong>Network and Internet</strong>, then <strong>Network and Sharing Center</strong>, then <strong>Manage network connections</strong>.</li>
<li>Select the connection for which you want to configure Google Public DNS. For example:
<ul>
<li>To change the settings for an Ethernet connection, right-click <strong>Local Area Connection</strong>, and click <strong>Properties</strong>.</li>
<li>To change the settings for a wireless connection, right-click<strong> Wireless Network Connection</strong>, and click <strong>Properties</strong>.</li>
</ul>
<p>If you are prompted for an administrator password or confirmation, type the password or provide confirmation.</li>
<li>Select the <strong>Networking</strong> tab. Under <strong>This connection uses the following items</strong>, click<strong>Internet Protocol Version 4 (TCP/IPv4)</strong>, and then click <strong>Properties</strong>.</li>
<li>Click <strong>Advanced</strong> and select the <strong>DNS</strong> tab. If there are any DNS server IP addresses listed there, write them down for future reference, and remove them from this window.</li>
<li>Click <strong>OK</strong>.</li>
<li>Select <strong>Use the following DNS server addresses</strong>. If there are any IP addresses listed in the <strong>Preferred DNS server</strong> or <strong>Alternate DNS server</strong>, write them down for future reference.</li>
<li>Replace those addresses with the IP addresses of the Google DNS servers: 8.8.8.8 and 8.8.4.4.</li>
<li>Restart the connection you selected in step 3.</li>
<li>Test that your setup is working correctly; see <a href="http://code.google.com/speed/public-dns/docs/using.html#testing">Testing your new settings</a> below.</li>
<li>Repeat the procedure for additional network connections you want to change.</li>
</ol>
<h4>Mac OS X</h4>
<p>DNS settings are specified in the <strong>Network</strong> window.</p>
<p><strong>Example: Changing DNS server settings on Mac OS 10.5</strong></p>
<ol>
<li>From the <strong>Apple</strong> menu, click <strong>System Preferences</strong>, then click <strong>Network</strong>. If you are prompted for an administrator password or confirmation, type the password or provide confirmation.</li>
<li>Select the connection for which you want to configure Google Public DNS. For example:
<ul>
<li>To change the settings for an Ethernet connection, select <strong>Built-In Ethernet</strong>, and click <strong>Advanced</strong>.</li>
<li>To change the settings for a wireless connection, select <strong>Airport</strong>, and click<strong>Advanced</strong>.</li>
</ul>
</li>
<li>Select the <strong>DNS</strong> tab.</li>
<li>Click + to replace any listed addresses with, or add, the Google IP addresses at the top of the list: 8.8.8.8 and 8.8.4.4.</li>
<li>Click <strong>Apply</strong> and <strong>OK</strong>.</li>
<li>Test that your setup is working correctly; see <a href="http://code.google.com/speed/public-dns/docs/using.html#testing">Testing your new settings</a> below.</li>
<li>Repeat the procedure for additional network connections you want to change.</li>
</ol>
<h4>Linux</h4>
<p>DNS settings are specified in /etc/resolv.conf in most distributions.</p>
<p><strong>Example: Changing DNS server settings on Ubuntu</strong></p>
<ol>
<li>Edit /etc/resolv.conf:
<pre>sudo vi /etc/resolv.conf</pre>
</li>
<li>If any <code>nameserver</code> lines appear, write down the IP addresses for future reference.</li>
<li>Replace the <code>nameserver</code> lines with, or add, the following lines:
<pre>nameserver 8.8.8.8
nameserver 8.8.4.4</pre>
</li>
<li>Save and exit.</li>
<li>Restart any Internet clients you are using.</li>
<li>Test that your setup is working correctly; see <a href="http://code.google.com/speed/public-dns/docs/using.html#testing">Testing your new settings</a> below.</li>
</ol>
</div>
<p>–<br />
Bian Jiang<br />
Blog:  <a href="http://www.wifihack.net/">http://www.wifihack.net/ </a></p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2009/12/google-public-dns/feed/</wfw:commentRss>
		</item>
		<item>
		<title>vim 快速查找</title>
		<link>http://wifihack.net/blog/2009/12/vim-quick-search/</link>
		<comments>http://wifihack.net/blog/2009/12/vim-quick-search/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 07:17:03 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
		
		<category><![CDATA[Tech.Notes]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Notes]]></category>

		<category><![CDATA[Tips]]></category>

		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=436</guid>
		<description><![CDATA[在用vim的时候要经常搜索，但是有的时候会忘记＊和 # 这两个快捷键，所以记录如下
在通常模式下:

/ 向下查找
? 向上查找
* 向下查找当前光标下的单词
# 向上查找当前光标下的单词.
f{char} 跳到当前行,当前位置右边的{char}的位置. 如
using namespace std;
用f; 将会跳到;所在的位置.
F{char} 类似f{char},不过,是左边.
t{char} 类似f{char},不过,把光标放在{char}的前一个位置.
T{char} 类似t{char},不过,是左边.
; 重复t T f T 指令
, 朝相反方向重复t T f T 指令

&#8211;
Bian Jiang
Blog:  http://www.wifihack.net/
]]></description>
			<content:encoded><![CDATA[<p>在用vim的时候要经常搜索，但是有的时候会忘记＊和 # 这两个快捷键，所以记录如下</p>
<p>在通常模式下:</p>
<p><span></p>
<p>/ 向下查找</p>
<p>? 向上查找</p>
<p>* 向下查找当前光标下的单词</p>
<p># 向上查找当前光标下的单词.</p>
<p>f{char} 跳到当前行,当前位置右边的{char}的位置. 如</p>
<p>using namespace std;</p>
<p>用f; 将会跳到;所在的位置.</p>
<p>F{char} 类似f{char},不过,是左边.</p>
<p>t{char} 类似f{char},不过,把光标放在{char}的前一个位置.</p>
<p>T{char} 类似t{char},不过,是左边.</p>
<p>; 重复t T f T 指令</p>
<p>, 朝相反方向重复t T f T 指令</span><br />
<span style="color: #888888;"><br />
&#8211;<br />
Bian Jiang<br />
Blog:  <a href="http://www.wifihack.net/" target="_blank">http://www.wifihack.net/</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2009/12/vim-quick-search/feed/</wfw:commentRss>
		</item>
		<item>
		<title>安装tftp,ftp,samba,nfs</title>
		<link>http://wifihack.net/blog/2009/11/install-tftp-ftp-sambanfs/</link>
		<comments>http://wifihack.net/blog/2009/11/install-tftp-ftp-sambanfs/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 09:13:27 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
		
		<category><![CDATA[Embedded]]></category>

		<category><![CDATA[Tech.Notes]]></category>

		<category><![CDATA[ftp]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[nfs]]></category>

		<category><![CDATA[samba]]></category>

		<category><![CDATA[tftp]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=429</guid>
		<description><![CDATA[tftp,ftp和nfs是在嵌入式linux开发环境中经常要用到的传输工具，samba则是在linux和windows下的文件传输工具。
一. tftp安装

1.安装
sudo apt-get install tftpd tftp openbsd-inetd
2.建立tftp主目录
其中用户名和组是你平时使用的主要用户，请不要用root用户作为你的主要操作用户，因为那样很容易把系统搞乱。
sudo mkdir /tftpboot
sudo chown -R tan:tan /tftpboot
3.配置
修改文件：/etc/inetd.conf， 确认文件中包含有类似下面这一行内容：
#emacs /etc/inetd.conf
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot
4.启动tftp
可以重启动电脑，或者执行：
sudo /etc/init.d/openbsd-inetd reload
5.测试
测试从Tftp服务器传入/传出文件：
tftp localhost
二. ftp安装

1.安装
sudo apt-get install vsftpd
2.配置 修改文件“etc/vsftpd.conf”
#不允许匿名登录
anonymous_enable=NO

#本地用户可用
local_enable=YES

#可写
write_enable=YES

#不需要显示某目录下文件信息
#dirmessage_enable=YES

#登录消息
ftpd_banner=Hello~~

#最大连接用户数
max_clients=10

#限制每个IP的进程
max_per_ip=5

#最大传输速率(bit/s)
local_max_rate=256000

#隐藏帐号
hide_ids=YES
3.启动ftp
sudo /etc/init.d/vsftpd restart
4.安装ftp client
系统自带的ftp client中文乱码。
sudo apt-get install filezilla
三. samba安装

1.安装
sudo apt-get install samba smbfs
2.配置
修改文件“/etc/samba/smb.conf”
配置例子（建立一个共享名称为“share”的samba资源）：
[share]
comment = linux share
#共享目录
path = /opt
guest ok = yes

#写权限用户名
write list = tan

printable = no
directory [...]]]></description>
			<content:encoded><![CDATA[<p>tftp,ftp和nfs是在嵌入式linux开发环境中经常要用到的传输工具，samba则是在linux和windows下的文件传输工具。</p>
<h2 id="一.tftp安装">一. tftp安装<a class="anchor" title="Link to this section" href="http://10.0.0.102/ipq/wiki/%E5%AE%89%E8%A3%85TFTP/ftp/samba/nfs#%E4%B8%80.tftp%E5%AE%89%E8%A3%85"><br />
</a></h2>
<p><strong>1.安装</strong></p>
<pre class="wiki">sudo apt-get install tftpd tftp openbsd-inetd</pre>
<p><strong>2.建立tftp主目录</strong><br />
其中用户名和组是你平时使用的主要用户，请不要用root用户作为你的主要操作用户，因为那样很容易把系统搞乱。</p>
<pre class="wiki">sudo mkdir /tftpboot
sudo chown -R tan:tan /tftpboot</pre>
<p><strong>3.配置</strong><br />
修改文件：/etc/inetd.conf， 确认文件中包含有类似下面这一行内容：</p>
<pre class="wiki">#emacs /etc/inetd.conf
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot</pre>
<p><strong>4.启动tftp</strong><br />
可以重启动电脑，或者执行：</p>
<pre class="wiki">sudo /etc/init.d/openbsd-inetd reload</pre>
<p><strong>5.测试</strong><br />
测试从Tftp服务器传入/传出文件：</p>
<pre class="wiki">tftp localhost</pre>
<h2 id="二.ftp安装">二. ftp安装<a class="anchor" title="Link to this section" href="http://10.0.0.102/ipq/wiki/%E5%AE%89%E8%A3%85TFTP/ftp/samba/nfs#%E4%BA%8C.ftp%E5%AE%89%E8%A3%85"><br />
</a></h2>
<p><strong>1.安装</strong></p>
<pre class="wiki">sudo apt-get install vsftpd</pre>
<p><strong>2.配置</strong> 修改文件“etc/vsftpd.conf”</p>
<pre class="wiki">#不允许匿名登录
anonymous_enable=NO

#本地用户可用
local_enable=YES

#可写
write_enable=YES

#不需要显示某目录下文件信息
#dirmessage_enable=YES

#登录消息
ftpd_banner=Hello~~

#最大连接用户数
max_clients=10

#限制每个IP的进程
max_per_ip=5

#最大传输速率(bit/s)
local_max_rate=256000

#隐藏帐号
hide_ids=YES</pre>
<p><strong>3.启动ftp</strong></p>
<pre class="wiki">sudo /etc/init.d/vsftpd restart</pre>
<p><strong>4.安装ftp client</strong><br />
系统自带的ftp client中文乱码。</p>
<pre class="wiki">sudo apt-get install filezilla</pre>
<h2 id="三.samba安装">三. samba安装<a class="anchor" title="Link to this section" href="http://10.0.0.102/ipq/wiki/%E5%AE%89%E8%A3%85TFTP/ftp/samba/nfs#%E4%B8%89.samba%E5%AE%89%E8%A3%85"><br />
</a></h2>
<p><strong>1.安装</strong></p>
<pre class="wiki">sudo apt-get install samba smbfs</pre>
<p><strong>2.配置</strong><br />
修改文件“/etc/samba/smb.conf”<br />
配置例子（建立一个共享名称为“share”的samba资源）：</p>
<pre class="wiki">[share]
comment = linux share
#共享目录
path = /opt
guest ok = yes

#写权限用户名
write list = tan

printable = no
directory mask 0775
create mask 0775
wide links = no</pre>
<p><strong>3.写权限用户口令</strong><br />
如果定义了写特权用户，则该用户必须有samba口令，samba口令与系统用户口令是不同的。</p>
<pre class="wiki">smbpasswd -a 用户名</pre>
<p><strong>4.启动</strong></p>
<pre class="wiki">sudo /etc/init.d/samba restart</pre>
<p><strong>5.在xp上的共享连接问题处理</strong><br />
在XP上连接samba资源时，出现以下提示的处理：</p>
<pre class="wiki">指定的网络文件夹目前是以其它用户名和密码进行映射的。
要用其他用户名和密码进行连接，首先请断开所有现有连接到该网络共享的映射。</pre>
<p>处理：</p>
<ol>
<li>断开连接<br />
找到该共享连接名称</p>
<pre class="wiki">net use</pre>
<p>删除该连接(共享连接名可以是“\\”“开头的全名，也可以是映射的盘符）</p>
<pre class="wiki">net use /delete &lt;共享连接名&gt;</pre>
<p>然后重新连接即可。</li>
</ol>
<h2 id="四.NFS">四. NFS<a class="anchor" title="Link to this section" href="http://10.0.0.102/ipq/wiki/%E5%AE%89%E8%A3%85TFTP/ftp/samba/nfs#%E5%9B%9B.NFS"><br />
</a></h2>
<p>NFS(Network File System, 网络文件系统)可以通过网络将分享不同主机(不同的OS)的目录——可以通过NFS挂载远程主机的目录, 访问该目录就像访问本地目录一样!</p>
<p>一般而言, 使用nfs能够方便地使各unix-like系统之间实现共享. 但如果需要在unix-like和windows系统之间共享, 就得使用samba了!</p>
<p>NFS运行在SUN的RPC(Remote Procedure Call, 远程过程调用)基础上, RPC定义了一种与系统无关的方法来实现进程间通信. 由此, NFS server也可以看作是RPC server.</p>
<p>正因为NFS是一个RPC服务程序, 所以在使用它之前, 先要映射好端口——通过portmap设定. 比如: 某个NFS client发起NFS服务请求时, 它需要先得到一个端口(port). 所以它先通过portmap得到port number. (不仅NFS, 所有的RPC服务程序启动之前, 都需要设定好portmap)</p>
<p>与NFS相关的几个文件, 命令:<br />
1. /etc/exports</p>
<blockquote><p>对NFS卷的访问是由exports来批准, 它枚举了若干有权访问NFS服务器上文件系统的主机名.</p></blockquote>
<p>2. /sbin/exportfs</p>
<blockquote><p>维护NFS的资源共享. 可以通过它重新设定 /etc/exports 的共享目录, 卸载NFS Server共享的目录或者重新共享等.</p></blockquote>
<p>3. /usr/sbin/showmount</p>
<blockquote><p>用在 NFS Server 端，而 showmount 则主要用在 Client 端. showmount 可以用來查看 NFS 共享的目录资源.</p></blockquote>
<p>4. /var/lib/nfs/xtab</p>
<blockquote><p>NFS的记录文档: 通过它可以查看有哪些Client 连接到NFS主机的记录.</p></blockquote>
<p>下面这几个并不直接负责NFS, 实际上它们负责所有的RPC<br />
5. /etc/default/portmap</p>
<blockquote><p>实际上, portmap负责映射所有的RPC服务端口, 它的内容非常非常之简单(后面详述)</p></blockquote>
<p>6. /etc/hosts.deny</p>
<blockquote><p>设定拒绝portmap服务的主机</p></blockquote>
<p>7. /etc/hosts.allow</p>
<blockquote><p>设定允许portmap服务的主机</p></blockquote>
<p><strong>安装NFS</strong><br />
Debian/Ubuntu上默认是没有安装NFS服务器的，首先要安装NFS服务程序：</p>
<pre class="wiki">sudo apt-get install nfs-kernel-server</pre>
<p>安装nfs-kernel-server时，apt会自动安装nfs-common和portmap，服务端和客户程序都一块安装了。</p>
<p>客户端需要安装客户端程序。如果是Debian/Ubuntu系统，客户端包名称是“nfs-common”：</p>
<pre class="wiki">sudo apt-get install nfs-commmon</pre>
<p>nfs-common和nfs-kernel-server都依赖于portmap!</p>
<p><strong>配置NFS</strong><br />
<strong>配置portmap</strong></p>
<p>方法1: 编辑/etc/default/portmap, 将 -i 127.0.0.1 去掉.</p>
<p>方法2: 执行</p>
<pre class="wiki">sudo dpkg-reconfigure portmap</pre>
<p>对Should portmap be bound to the loopback address? 选N.</p>
<p><strong>配置/etc/hosts.deny</strong><br />
（禁止任何host（主机）能和你的NFS服务器进行NFS连接)，加入：</p>
<pre class="wiki">### NFS DAEMONS
portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL</pre>
<p><strong>配 置/etc/hosts.allow</strong><br />
允许那些你想要的主机和你的NFS服务器建立连接。下列步骤将允许任何IP地址以192.168.2开头的主机（连 接到NFS服务器上），也可以指定特定的IP地址。参看man页 hosts_access(5), hosts_options(5)。加入：</p>
<pre class="wiki">### NFS DAEMONS
portmap: 192.168.2.
lockd: 192.168.2.
rquotad: 192.168.2.
mountd: 192.168.2.
statd: 192.168.2.</pre>
<p>/etc/hosts.deny 和 /etc/hosts.allow 设置对portmap的访问. 采用这两个配置文件有点类似&#8221;mask&#8221;的意思. 现在/etc/hosts.deny中禁止所有用户对portmap的访问. 再在/etc/hosts.allow 中允许某些用户对portmap的访问. 运行</p>
<pre class="wiki">sudo /etc/init.d/portmap restart</pre>
<blockquote><p>重启portmap daemon.</p></blockquote>
<p><strong>配置/etc/exports</strong><br />
NFS挂载目录及权限由/etc/exports文件定义</p>
<p>比如我要将将我的home目录中的/home/zp/share目录让192.168.2.*的IP共享, 则在该文件末尾添加下列语句：</p>
<pre class="wiki">/home/zp/share 192.168.2.*(rw,sync,no_root_squash)</pre>
<blockquote><p>或者：</p>
<pre class="wiki">/home/zp/share 192.168.2.0/24(rw,sync,no_root_squash)</pre>
</blockquote>
<p>192.168.2.* 网段内的NFS客户端能够共享NFS服务器/home/zp/share目录内容.且有读,写权限, 并且该用户进入/home/zp/share目录后的身份为root</p>
<p>最好加上sync, 否则 &#8220;sudo exportfs -r&#8221; 时会给出警告, sync是NFS的默认选项.</p>
<p>运行</p>
<pre class="wiki">showmount -e</pre>
<p>查看NFS server的export list.</p>
<p>若更改了/etc/exports, 运行</p>
<pre class="wiki">sudo exportfs -r</pre>
<p>更新</p>
<p>运行</p>
<pre class="wiki">sudo /etc/init.d/nfs-kernel-server restart</pre>
<p>重启nfs服务</p>
<p>/etc/exports实际上就是nfs服务器的核心配置文件了.</p>
<p><strong>测试NFS</strong><br />
可以尝试一下挂载本地磁盘(假设NFS服务器IP地址为：192.128.2.1，NFS目录为“/home/zp/share”)</p>
<pre class="wiki">sudo mount 192.168.2.1:/home/zp/share /mnt</pre>
<p>运行</p>
<pre class="wiki">df</pre>
<p>看看结果.</p>
<p>卸载NFS目录</p>
<pre class="wiki">sudo umount /mnt</pre>
<p>注意被拷贝文件的读／写权限！<br />
另外, 可以使用一定的参数:<br />
使用加参数的办法：</p>
<pre class="wiki">mount -o nolock,rsize=1024,wsize=1024,timeo=15 192.168.2.130:/tmp/ /tmp/

--EOF--</pre>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2009/11/install-tftp-ftp-sambanfs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[Kernel] Debian-ubuntu-kernel-install</title>
		<link>http://wifihack.net/blog/2009/11/kernel-debian-ubuntu-kernel-install/</link>
		<comments>http://wifihack.net/blog/2009/11/kernel-debian-ubuntu-kernel-install/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 03:13:56 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
		
		<category><![CDATA[Kernel]]></category>

		<category><![CDATA[Debian]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=425</guid>
		<description><![CDATA[第一步 安装必要的工具
首先要安装必要的包。 
包有：libncurses5-dev（menuconfig需要的）和essential

sudo apt-get install build-essential kernel-package
sudo apt-get install make
sudo apt-get install gcc
另外，查看系统是否有这样的两个命令 

mkinitramfs mkisofs
这两个工具在编译内核时用来生成 *.img文件的。如果没有就需安装。
第二步 下载内核
到www.kernel.org下载新内核到/usr/src 
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.5.tar.bz2
我下载的是linux-2.6.30.5.tar.bz2(原来的内核是2.6.24-24-generic)
第三步 编译前的准备
察看当前内核的版本
border@ubuntu:/usr/src$ uname -a
Linux ubuntu 2.6.24-24-generic #1 SMP Tue Jun 30 20:28:53 UTC 2009 i686 GNU/Linux
 建议最好下载比当前已安装版本高的内核
解压linux-2.6.30.5.tar.gz到linux-2.6.30.5
cd /usr/src
sudo tar xjvf linux-2.6.30.5.tar.bz2
cd linux-2.6.30.5/

第四步 开始编译
cd /usr/src/linux-2.6.30.5/ //以下所有的工作都在/usr/src/linux-2.6.30.5/下完成

sudo make menuconfig  //用menuconfig的话还需要Ncurses，或者用
sudo make xconfig
sudo make menuconfig  //一般是用menuconfig
 
配置完以后保存（系统中保存的一份内核配置文件是在/usr/src/linux-2.6.30.5下名为.config,你也可以自己在别的地方另存一份）
也可以cp原来在/boot目录下的config-2.6.xx 到当前目录下，在make menuconfig是使用这个配置文件。

sudo make [...]]]></description>
			<content:encoded><![CDATA[<p><span>第一步</span><span> </span><span>安装必要的工具</span></p>
<p><span>首先要安装必要的包。</span><span> </span><span><br />
</span><span>包有：</span><span>libncurses5-dev</span><span>（</span><span>menuconfig</span><span>需要的）和</span><span>essential</span><span><br />
</span></p>
<blockquote><p><span>sudo apt-get install build-essential kernel-package</span><br />
<span>sudo apt-get install make</span><br />
<span>sudo apt-get install gcc</span></p></blockquote>
<p><span>另外，查看系统是否有这样的两个命令</span><span> </span><span><br />
</span></p>
<blockquote><p><span>mkinitramfs mkisofs</span></p></blockquote>
<p><span>这两个工具在编译内核时用来生成</span><span> *.img</span><span>文件的。如果没有就需安装。</span></p>
<p><span>第二步</span><span> </span><span>下载内核</span></p>
<p><span>到</span><span>www.kernel.org</span><span>下载新内核到</span><span>/usr/src </span></p>
<blockquote><p><span>wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.5.tar.bz2</span></p></blockquote>
<p><span>我下载的是</span><span>linux-2.6.30.5.tar.bz2(</span><span>原来的内核是</span><span>2.6.24-24-generic)</span></p>
<p><span>第三步</span><span> </span><span>编译前的准备</span></p>
<p><span>察看当前内核的版本</span></p>
<blockquote><p><span>border@ubuntu:/usr/src$ uname -a</span><br />
<span>Linux ubuntu 2.6.24-24-generic #1 SMP Tue Jun 30 20:28:53 UTC 2009 i686 GNU/Linux</span></p></blockquote>
<p><span> <span style="background-color: #ffffff;">建议最好下载比当前已安装版本高的内核</span></span></p>
<p><span style="font-size: small; background-color: #ffffff;"><span>解压</span><span>linux-</span><span>2.6.30.5.</span><span>tar.gz</span><span>到</span><span>linux-</span><span>2.6.30.5</span></span></p>
<blockquote><p><span>cd /usr/src</span><br />
<span>sudo tar xjvf linux-2.6.30.5.tar.bz2</span><br />
<span><span style="font-size: x-small;"><span>cd </span></span><span>linux-2.6.30.5/</span></span></p></blockquote>
<p><span><br />
</span><span>第四步</span><span> </span><span>开始编译</span></p>
<p>cd /usr/src/linux-2.6.30.5/ //<span>以下所有的工作都在</span><span>/usr/src/linux-2.6.30.5/</span><span>下完成</span><span><br />
</span></p>
<blockquote><p><span><span>sudo make menuconfig  //</span><span>用</span><span>menuconfig</span><span>的话还需要</span><span>Ncurses</span><span>，或者用</span></span><br />
<span>sudo make xconfig</span><br />
<span><span>sudo make menuconfig  //</span><span>一般是用</span><span>menuconfig</span></span></p></blockquote>
<p><span> </span></p>
<p><span>配置完以后保存（系统中保存的一份内核配置文件是在</span><span>/usr/src/</span><span>linux-2.6.30.5</span><span>下名为</span><span>.config,</span><span>你也可以自己在别的地方另存一份）</span><span><br />
</span><span>也可以</span><span>cp</span><span>原来在</span><span>/boot</span><span>目录下的</span><span>config-2.6.xx </span><span>到当前目录下，在</span><span>make menuconfig</span><span>是使用这个配置文件。</span><span><br />
</span></p>
<blockquote><p><span><span>sudo make clean //</span><span>清除旧数据</span><span> </span><span>，新解压的内核源码就不需要这一步了</span></span><br />
<span><span>sudo make –j4 </span><span>可以分四个线程来进行编译工作</span></span><br />
<span><span>sudo make bzImage //</span><span>编译内核，将保存到</span><span>/usr/src/</span><span>linux-2.6.30.5</span><span>/arch/i386/boot/</span><span>下</span></span><br />
<span><span>sudo make modules //</span><span>编译模块</span></span><br />
<span><span>sudo make modules_install //</span><span>安装模块，执行完后会显示DEPMOD </span></span>2.6.30.5<br />
<span><span>sudo mkinitramfs -o /boot/initrd.img-2.6.30.5 </span><span>2.6.30.5      // </span></span>2.6.30.5为modules_install 执行完成后显示的<span><span>DEPMOD </span></span>2.6.30.5， 注意: 2.6.30.5 前面有空格<br />
<span><span>sudo make install //</span><span>安装内核</span></span></p></blockquote>
<p><span>如果你想把编译的结果打包为Deb包，可以参考<a rel="nofollow" href="http://www.naumann.cc/?p=107/">这里</a> 和 <a rel="nofollow" href="http://ubuntuforums.org/showthread.php?t=311158">这里</a> .<br />
</span></p>
<blockquote><p><span>sudo make-kpkg clean</span><br />
<span>sudo make-kpkg &#8211;revision eee701 kernel_image</span><br />
<span>sudo dpkg -i linux-image-2.6.30_eee701_i386.deb</span></p></blockquote>
<p><span>安装完后</span><span>/boot</span><span>下将增加以下几个文件（用</span><span>ls -l *30*</span><span>查看）</span></p>
<blockquote><p><span>border@ubuntu:/boot$ ls -l *30*</span><br />
<span>-rw-r&#8211;r&#8211; 1 root root   96237 2009-08-25 17:41 config-2.6.30.5</span><br />
<span>-rw-r&#8211;r&#8211; 1 root root 7896051 2009-08-25 17:38 initrd.img-2.6.30.5</span><br />
<span>-rw-r&#8211;r&#8211; 1 root root 1095789 2009-08-25 17:41 System.map-2.6.30.5</span><br />
<span>-rw-r&#8211;r&#8211; 1 root root 2324720 2009-08-25 17:41 vmlinuz-2.6.30.5</span></p></blockquote>
<p><span>给</span><span>/boot/grub/menu.lst</span><span>中添加一个新的启动项，如我的</span><span>menu.lst</span><span>增加了如下一段文字</span></p>
<blockquote><p><span>title           Ubuntu kernel 2.6.30.5</span><br />
<span>root            (hd0,0)</span><br />
<span>kernel          /boot/vmlinuz-2.6.30.5 vga=794 root=/dev/sda1 ro</span><br />
<span>initrd          /boot/initrd.img-2.6.30.5</span><br />
<span>quiet</span></p></blockquote>
<p><span><br />
ps: 上面在kernel一行后面的 &#8220;</span><span>vga=794 root=/dev/sda1 ro</span><span>&#8221; 是从你之前的启动项取得的。<br />
重新启动即可。</span></p>
<p>参考:<br />
1.   <a href="http://ubuntuforums.org/showthread.php?t=311158">http://ubuntuforums.org/showthread.php?t=311158</a><br />
2.   &#8220;creating a kernel 2.6.30 deb file&#8221; <a href="http://www.naumann.cc/?p=107">http://www.naumann.cc/?p=107</a></p>
<p>&#8211;<br />
Bian Jiang<br />
Blog:  http://www.wifihack.net/</p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2009/11/kernel-debian-ubuntu-kernel-install/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Weekly Tweets for 2009-11-15</title>
		<link>http://wifihack.net/blog/2009/11/weekly-tweets-for-2009-11-15/</link>
		<comments>http://wifihack.net/blog/2009/11/weekly-tweets-for-2009-11-15/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 14:59:00 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
		
		<category><![CDATA[Others]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/2009/11/weekly-tweets-for-2009-11-15/</guid>
		<description><![CDATA[
Microsoft Patents Sudo?!!  http://bit.ly/4CcgrQ #
name.com Renewal promo code &#8220;CURIE&#8221; http://bit.ly/3t0eDE #

Powered by Twitter Tools
]]></description>
			<content:encoded><![CDATA[<ul class="aktt_tweet_digest">
<li>Microsoft Patents Sudo?!!  <a href="http://bit.ly/4CcgrQ" rel="nofollow">http://bit.ly/4CcgrQ</a> <a href="http://twitter.com/b0rder/statuses/5642812949" class="aktt_tweet_time">#</a></li>
<li>name.com Renewal promo code &#8220;CURIE&#8221; <a href="http://bit.ly/3t0eDE" rel="nofollow">http://bit.ly/3t0eDE</a> <a href="http://twitter.com/b0rder/statuses/5642031886" class="aktt_tweet_time">#</a></li>
</ul>
<p class="aktt_credit">Powered by <a href="http://alexking.org/projects/wordpress">Twitter Tools</a></p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2009/11/weekly-tweets-for-2009-11-15/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Weekly Tweets for 2009-11-08</title>
		<link>http://wifihack.net/blog/2009/11/weekly-tweets-for-2009-11-08/</link>
		<comments>http://wifihack.net/blog/2009/11/weekly-tweets-for-2009-11-08/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 14:59:00 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
		
		<category><![CDATA[Others]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/2009/11/weekly-tweets-for-2009-11-08/</guid>
		<description><![CDATA[
Linux kernel the other null pointer dereference in fs/pipe.c  http://lwn.net/Articles/360329/ #
Google chrome 下载地址(需要穿墙) http://twitzap.com/u/Gig  DEB 包 http://twitzap.com/u/hqs #

Powered by Twitter Tools
]]></description>
			<content:encoded><![CDATA[<ul class="aktt_tweet_digest">
<li>Linux kernel the other null pointer dereference in fs/pipe.c  <a href="http://lwn.net/Articles/360329/" rel="nofollow">http://lwn.net/Articles/360329/</a> <a href="http://twitter.com/b0rder/statuses/5444092511" class="aktt_tweet_time">#</a></li>
<li>Google chrome 下载地址(需要穿墙) <a href="http://twitzap.com/u/Gig" rel="nofollow">http://twitzap.com/u/Gig</a>  DEB 包 <a href="http://twitzap.com/u/hqs" rel="nofollow">http://twitzap.com/u/hqs</a> <a href="http://twitter.com/b0rder/statuses/5409116553" class="aktt_tweet_time">#</a></li>
</ul>
<p class="aktt_credit">Powered by <a href="http://alexking.org/projects/wordpress">Twitter Tools</a></p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2009/11/weekly-tweets-for-2009-11-08/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Weekly Tweets for 2009-11-01</title>
		<link>http://wifihack.net/blog/2009/11/weekly-tweets-for-2009-11-01/</link>
		<comments>http://wifihack.net/blog/2009/11/weekly-tweets-for-2009-11-01/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 14:59:00 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
		
		<category><![CDATA[Others]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/2009/11/weekly-tweets-for-2009-11-01/</guid>
		<description><![CDATA[
北京竟然下这么大的雪，真是罕见。 #

Powered by Twitter Tools
]]></description>
			<content:encoded><![CDATA[<ul class="aktt_tweet_digest">
<li>北京竟然下这么大的雪，真是罕见。 <a href="http://twitter.com/b0rder/statuses/5327948667" class="aktt_tweet_time">#</a></li>
</ul>
<p class="aktt_credit">Powered by <a href="http://alexking.org/projects/wordpress">Twitter Tools</a></p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2009/11/weekly-tweets-for-2009-11-01/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
