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

<channel>
	<title>Mr. 21</title>
	<atom:link href="http://mr21.in/feed" rel="self" type="application/rss+xml" />
	<link>http://mr21.in</link>
	<description>KunMing &#124; SysAdmin &#124; Blogger &#124; G Fans</description>
	<lastBuildDate>Thu, 06 Oct 2011 09:23:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<atom:link rel='hub' href='http://mr21.in/?pushpress=hub'/>
		<item>
		<title>Steve Jobs, 1955-2011</title>
		<link>http://mr21.in/my-feeling/steve-jobs-1955-2011.html</link>
		<comments>http://mr21.in/my-feeling/steve-jobs-1955-2011.html#comments</comments>
		<pubDate>Thu, 06 Oct 2011 09:12:23 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[个人感官]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Jobs]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=399</guid>
		<description><![CDATA[哀悼史蒂夫·乔布斯，谨此记。 个人资料： – 出生日期：1955年2月24日 – 出生地：旧金山 – 全名：Steven Paul Jobs – 养父母： Paul machinist和Clara (Hagopian) Jobs – 亲生父母：Joanne Schieble和Abdulfattah... ]]></description>
			<content:encoded><![CDATA[<p>哀悼史蒂夫·乔布斯，谨此记。</p>
<p><img src="/wp-content/uploads/2011/10/Steve-Jobs.jpg" alt="" /><br />
<span id="more-399"></span><br />
<strong>个人资料：</strong></p>
<p>– 出生日期：1955年2月24日<br />
– 出生地：旧金山<br />
– 全名：Steven Paul Jobs<br />
– 养父母： Paul machinist和Clara (Hagopian) Jobs<br />
– 亲生父母：Joanne Schieble和Abdulfattah Jandali(都是教师)<br />
– 婚姻：Laurene (Powell) Jobs (1991年3月18日至今)<br />
– 与Laurene的孩子：Eve、Erin和Reed<br />
– 与Chrisann Brennan的孩子(非婚生)： Lisa Brennan-Jobs (1978年)<br />
– 教育程度：1972年俄勒冈州里德学院一学期<br />
– 宗教：禅宗佛教</p>
<p><strong>其它情况：</strong></p>
<p>– 高中期间，乔布斯请William Hewlett(惠普联合创始人)提供一些零部件以完成他的手工作业。惠普为乔布斯提供了一个实习机会。<br />
– 在1997年重返苹果后，乔布斯年薪为1美元。<br />
– 乔布斯追查他的亲生父母时发现，他的妹妹是小说家Mona Simpson。<br />
– 乔布斯在高中时见到了日后成为苹果联合创始人的Steve Wozniak，那年乔布斯13岁，Wozniak18岁。</p>
<p><strong>乔布斯大事表：</strong></p>
<p>– 1972：高中毕业，进入里德学院，一个学期后辍学。<br />
– 1974：在雅达利工作，同年离开前往印度旅行。<br />
– 1976: 在车库与Steve Wozniak一起创立了苹果，推出了Apple I。<br />
– 1977: 与Wozniak一起推出了Apple II。<br />
– 1980: 苹果推出了Apple III。<br />
– 1983: Apple Lisa电脑推出，以乔布斯的女儿Lisa命名。<br />
– 1984: 苹果推出 Macintosh。<br />
– 1985: 因与管理层的分歧离开苹果，随后创立了电脑公司NeXT。<br />
– 1986: 乔布斯收购了皮克斯动画工作室。<br />
– 1996: 将NeXT出售给苹果，重返苹果担任顾问。<br />
– 1997: 被任命为苹果临时CEO。<br />
– 1998: 苹果推出iMac。<br />
– 2000: 乔布斯成为苹果永久CEO。<br />
– 2001: 苹果推出iPod，到2007年iPod市场份额已达70%。<br />
– 2003年4月28日：推出iTunes商店，到2010年1月，90亿首歌通过iTunes购买。<br />
– 2003年7月：披头士乐队所创的苹果唱片公司起诉苹果的iTunes网站侵犯其商标权，该诉讼与2007年解决。<br />
– 2003: 乔布斯被诊断出患有胰腺癌。<br />
– 2004年7月31日: 手术且切除癌症肿瘤。<br />
– 2005年4月: 乔布斯入选时代杂志100位最具影响力人物。<br />
– 2006：皮克斯与迪士尼合并，乔布斯成为迪士尼董事会成员。<br />
– 2006年4月1日：苹果庆祝30周年。<br />
– 2007年1月9日：乔布斯在Macworld大会上推出了iPhone。<br />
– 2008: 推出了 MacBook Air。<br />
– 2008年6月27日：前苹果股东对乔布斯和一些苹果董事会成员发起集体诉讼，称他们参与倒填股票期权授权日期，涉嫌欺诈投资者。苹果承认在1997年至2002年存在6428份倒填期权日期问题，并为此计入了8400万美元的费用。<br />
– 2008年8月28日：彭博社意外发布乔布斯的讣告。<br />
– 2009年1月5日：乔布斯发公告驳斥健康传言，称过去几年变瘦是因为“荷尔蒙失调”。<br />
– 2009年1月14日：乔布斯宣布将休病假直到2009年6月底。乔布斯对健康问题未作详细说明，只说比想象中的复杂。<br />
– 2009年6月20日：华尔街日报报道，乔布斯在2009年4月进行了肝脏移植。这次手术被田纳西州孟菲斯市的卫理公会大学医院在2009年6月23日证实。<br />
– 2009年6月29日：苹果发言人Steve Dowling宣布乔布斯已重返工作岗位。<br />
– 2010年1月27日：乔布斯推出iPad。<br />
– 2011年1月：乔布斯再次休病假。<br />
– 2011年3月2日：乔布斯发布iPad 2，受到起立欢迎。<br />
– 2011年6月6日：在全球开发者大会上，乔布斯发布iCloud。其他苹果高管展示了OS-X Lion和 iOS-4。<br />
– 2011年8月：苹果和埃克森美孚争夺美国市值最大公司宝座，市值分别为3450亿美元和3500亿美元。<br />
– 2011年8月24日：乔布斯辞去苹果CEO职位，但宣布将担任董事会主席。蒂姆·库克接任CEO。<br />
– 2011年10月5日：乔布斯逝世</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/my-feeling/steve-jobs-1955-2011.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>启用Web服务器的IPv6支持</title>
		<link>http://mr21.in/network-technology/enable-ipv6-support-for-your-webserver.html</link>
		<comments>http://mr21.in/network-technology/enable-ipv6-support-for-your-webserver.html#comments</comments>
		<pubDate>Wed, 06 Apr 2011 12:17:27 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[網際網路]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=370</guid>
		<description><![CDATA[前几天Burst西海岸的VPS开售了，于是21一个鸡冻就入了一个最低配的，看样子貌似我是第14个客户…… 由于Burst在主机配置里面提到了提供IPv6地址，于是昨天发了ticket请求设置，今早来看已经给... ]]></description>
			<content:encoded><![CDATA[<p>前几天Burst西海岸的VPS开售了，于是21一个鸡冻就入了一个最低配的，看样子貌似我是第14个客户……<br />
由于Burst在主机配置里面提到了提供IPv6地址，于是昨天发了ticket请求设置，今早来看已经给我设了4个v6的地址，但是默认安装默认配置的Apache2并不支持IPv6的访问，于是萌生了整理一下各主流Web Server启用IPv6方式访问的设置，其实都不复杂。</p>
<p>21个人喜欢nano编辑器，如果你喜欢vi，稍微换一下命令就行。<br />
如果提示</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">bash</span>: <span style="color: #c20cb9; font-weight: bold;">nano</span>: <span style="color: #7a0874; font-weight: bold;">command</span> not found</pre></td></tr></table></div>

<p>请如下操作</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">Debian<span style="color: #000000; font-weight: bold;">/</span>Ubuntu: <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">nano</span>
CentOS<span style="color: #000000; font-weight: bold;">/</span>Fedora: yum <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">nano</span></pre></td></tr></table></div>

<p>高快直达：1. <a href="http://mr21.in/enable-ipv6-support-for-your-webserver.html#ap2">Apache 2</a> / 2. <a href="http://mr21.in/enable-ipv6-support-for-your-webserver.html#ng">Nginx</a> / 3. <a href="http://mr21.in/enable-ipv6-support-for-your-webserver.html#lhd">Lighttpd</a> / 4. <a href="http://mr21.in/enable-ipv6-support-for-your-webserver.html#iis">IIS 6/7</a><br />
<span id="more-370"></span></p>
<h3><a name="ap2"></a>Apache 2</h3>
<p>一般使用系统<strong>超级牛力apt-get</strong>或者<strong>yum</strong>安装的Apache2都支持了IPv6，只是默认的配置里面不支持，设置办法如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>port.conf
或
<span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>httpd.conf
或
<span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>apache2.conf</pre></td></tr></table></div>

<p>打开nano编辑器后，按Ctrl+W搜索Listen，之后将其修改为如下格式</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="conf" style="font-family:monospace;">Listen 0.0.0.0:80
Listen [::]:80</pre></td></tr></table></div>

<p>然后按Ctrl+O保存，按Ctrl+X退出。之后重启apache2的服务便可：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">Debian<span style="color: #000000; font-weight: bold;">/</span>Ubuntu: invoke-rc.d apache2 restart 或 invoke-rc.d httpd restart
CentOS<span style="color: #000000; font-weight: bold;">/</span>Fedora: service apache2 restart 或 service httpd restart</pre></td></tr></table></div>

<h3><a name="ng"></a>Nginx</h3>
<p>Nginx的话，需要查看一下是否启用了IPv6的支持，在shell输入</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">localhost:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #666666; font-style: italic;"># ./nginx -V</span>
nginx version: nginx<span style="color: #000000; font-weight: bold;">/</span>0.7.67
built by <span style="color: #c20cb9; font-weight: bold;">gcc</span> 4.3.2 <span style="color: #7a0874; font-weight: bold;">&#40;</span>Debian 4.3.2-<span style="color: #000000;">1.1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
TLS SNI support enabled
configure arguments: <span style="color: #660033;">--with-ipv6</span> <span style="color: #660033;">--user</span>=www <span style="color: #660033;">--group</span>=www <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module</pre></td></tr></table></div>

<p>然后查看输出的信息是否包含了<strong>&#8211;with-ipv6</strong>字眼，如果没有，那很遗憾，需要重新编译（请参阅<a href="http://www.vpser.net/build/nginx-lnmp-ipv6.html">这里</a>和<a href="http://www.vpser.net/manage/nginx-upgrade.html">这里</a>）或者卸载掉当前的Nginx使用<a href="http://lnmp.org/">LNMP最新版本</a>，如果有，那么继续：<br />
找到你的nginx配置文件，可以使用如下命令</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">localhost:~<span style="color: #666666; font-style: italic;"># whereis nginx.conf</span>
nginx: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>nginx</pre></td></tr></table></div>

<p>然后编辑该文件</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>nginx.conf</pre></td></tr></table></div>

<p>在Server配置段里面寻找<strong>Listen</strong>增加对IPv6的监听，增加一句<strong>listen  [::]:80;</strong>修改为如下大概效果：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="conf" style="font-family:monospace;">server
        {
                listen       80;
                listen  [::]:80;
                server_name mr21.in www.mr21.in;</pre></td></tr></table></div>

<p>如果想要仅仅监听IPv6而忽略IPv4请求，可以增加<strong>ipv6only=on</strong>的参数：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="conf" style="font-family:monospace;">listen [::]:443 default ipv6only=on;</pre></td></tr></table></div>

<p>如果监听某个特定的IPv6地址，这样</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="conf" style="font-family:monospace;">listen [2607:f0d0:1004:2::2]:80;</pre></td></tr></table></div>

<p>诸如此类，以此类推，之后重启你的Lihttpd即可。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">Debian/Ubuntu: invoke-rc.d nginx restart
CentOS/Fedora: service nginx restart</pre></td></tr></table></div>

<h3><a name="lhd"></a>Lighttpd</h3>
<p>首先，要先确认你的Lighttpd是否支持IPv6，在终端输入<strong>lighttpd -V</strong>，查看是否有<strong>IPv6 support</strong>字样。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;"># lighttpd -V
Build-Date: Sep 30 2008 06:18:08
&nbsp;
Event Handlers:
	+ select (generic)
	+ poll (Unix)
	+ rt-signals (Linux 2.4+)
	+ epoll (Linux 2.6)
	- /dev/poll (Solaris)
	- kqueue (FreeBSD)
&nbsp;
Network handler:
	+ sendfile
&nbsp;
Features:
	+ IPv6 support
	+ zlib support
	+ bzip2 support
	+ crypt support
	+ SSL Support
	+ PCRE support
	- mySQL support
	- LDAP support
	- memcached support
	- FAM support
	- LUA support
	- xml support
	- SQLite support
	- GDBM support</pre></td></tr></table></div>

<p>如果没有<strong>IPv6 support</strong>字样，可能需要升级版本或者重新编译，如果有，编辑Lighttpd的配置文件：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;"># vi lighttpd.conf</pre></td></tr></table></div>

<p>在主配置区添加<strong>server.use-ipv6 = &#8220;enable&#8221;</strong>，以下为同时启用IPv4和IPv6的情况：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="conf" style="font-family:monospace;">server.use-ipv6 = &quot;enable&quot;
server.port = 80
$SERVER[&quot;socket&quot;] == &quot;0.0.0.0:80&quot; {
# 这里为你的站点配置
}</pre></td></tr></table></div>

<p>之后重启你的Lihttpd即可。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">Debian/Ubuntu: invoke-rc.d lighttpd restart
CentOS/Fedora: service lighttpd restart</pre></td></tr></table></div>

<h3><a name="iis"></a>IIS 6/7</h3>
<p>IIS 6/7 步骤比较繁琐，21就不当搬运工了，大家可以移步去 <a href="http://loosky.net/?p=1198">http://loosky.net/?p=1198</a> 瞅瞅；</p>
<p>-EOF-</p>
<p>——————–<br />
引用参考：<br />
1. Enabling IPv6 Support in nginx: <a href="http://kovyrin.net/2010/01/16/enabling-ipv6-support-in-nginx/">http://kovyrin.net/2010/01/16/enabling-ipv6-support-in-nginx/</a>；<br />
2. Lighttpd: Enable IPv6 Support: <a href="http://www.cyberciti.biz/tips/linux-unix-lighttpd-ipv6-support.html">http://www.cyberciti.biz/tips/linux-unix-lighttpd-ipv6-support.html</a>；<br />
3. IPv6的安装与配置： <a href="http://loosky.net/?p=1198">http://loosky.net/?p=1198</a>。</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/network-technology/enable-ipv6-support-for-your-webserver.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>全球开放注册的域名后缀(TLD)</title>
		<link>http://mr21.in/network-technology/avaliable-tld-for-global-register.html</link>
		<comments>http://mr21.in/network-technology/avaliable-tld-for-global-register.html#comments</comments>
		<pubDate>Tue, 18 Jan 2011 01:41:53 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[網際網路]]></category>
		<category><![CDATA[.CN]]></category>
		<category><![CDATA[.IN]]></category>
		<category><![CDATA[BS]]></category>
		<category><![CDATA[cat]]></category>
		<category><![CDATA[CCTV]]></category>
		<category><![CDATA[IM]]></category>
		<category><![CDATA[QQPCC]]></category>
		<category><![CDATA[TLD]]></category>
		<category><![CDATA[域名]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=389</guid>
		<description><![CDATA[[转] 本文转载自博客好玉米（好域名）； 基于作者【原创文章，转载请注明】的要求进行分享，原文在此，感谢QQPCC。 ————————————————————————————————... ]]></description>
			<content:encoded><![CDATA[<div id="copyfrom" style="width:100%;">
<div style="font-size:20pt;float:left;line-height:1.25em;width:50px;">[转]</div>
<div style="float:left; width:630px;">本文转载自博客<a href="http://haoyu.me">好玉米（好域名）</a>；<br />
基于作者【原创文章，转载请注明】的要求进行分享，原文<a href="http://haoyu.me/1008.html">在此</a>，感谢QQPCC。</div>
</div>
<p>——————————————————————————————————————<br />
<strong>21插播：</strong>如果不想看罗嗦话的，请直接按 Ctrl+F 搜索你想要注册的后缀是否在文中。</p>
<h3>零、原作者引言</h3>
<p>　　爱玩小米的朋友其实有一点是非常纠结的，那就是许多后缀其实是不允许咱们国人注册的，也就是说，这些后缀对持有人的身份有严格的限制，就算有好域名也与你无缘。当然，有些朋友通过伪造资料或所谓的“挂靠”来注册这样的域名，但QQPCC要告诉这些朋友，其实这是不安全的，就算你想尽办法、侥幸地避开了注册局的审查，但你永远不是这个域名的主人，域名转移、域名交易都会遇到麻烦……<br />
　　那么，到底那些后缀是你可以堂堂正正地用你的中国身份注册的呢？可能很多朋友并不清楚，QQPCC今天就来给各位爱好小米的朋友说一说，如果还有QQPCC没有发现的，请大家补充。</p>
<h3>一、国际顶级域名</h3>
<ol>普通用户可以注册的有：.com、.net、.org、.info、.biz、.coop、.mobi、.name、.tel。</ol>
<h3>二、区域后缀</h3>
<ol>其实都有限制，只限各大洲自己的组织或公民注册。<br />
不过亚洲的.asia没有关系，因为咱们都是亚洲人，呵呵！<br />
非洲和大洋洲好像现在并没有神码后缀，呵呵，美洲有，但现在只有二级域名开放。<br />
有个特殊的东东，前苏联的.su，ICANN很多次想删除，但前苏联人民对其太有感情了，多年来一直没有删除成功，这个可公开注册。</ol>
<p><span id="more-389"></span></p>
<h3>三、国家（地区）后缀</h3>
<ol>
<li><strong>亚洲各国（地区）后缀开放注册的有：</strong><br />
.kg（吉尔吉斯坦）、.kz（哈萨克斯坦）、.tj（塔吉克斯坦）、.uz（乌兹别克斯坦）、.mn（蒙古）、.tw（台湾）、.af（阿富汗）、.in（印度）、.ir（伊朗）、.pk（巴基斯坦）、.lk（斯里兰卡）、.la（老挝）、.ph（菲律宾）、.tl（东帝汶）、.vn（越南）、.am（亚美尼亚）、.ps（巴勒斯坦）、.ae（阿联酋）。<br />
亚洲还有两个特殊的后缀，一个是.io，好像原来是专门准备给英国的印度洋领地设的，开放注册。<br />
还有一个是.cn，是不开放的，但国人注册没有问题啦，注不注是你的事了。</li>
<li><strong>欧洲各国（地区）后缀开放注册的有：</strong><br />
.by（白俄罗斯）、.cz（捷克）、.md（摩尔多瓦）、.pl（波兰）、.ro（罗马尼亚）、.ru（俄罗斯）、.dk（丹麦）、.gg（根西岛）、.im（马恩岛）、.is（冰岛）、.je（泽西岛）、.lt（立陶宛）、.lv（拉脱维亚）、.se（瑞典）、.es（西班牙）、.gr（希腊）、.me（黑山）、.si（斯洛文尼亚）、.at（奥地利）、.be（比利时）、.ch（瑞士）、.li（列支敦士登）、.lu（卢森堡）。<br />
欧洲也有个特殊的后缀，就是.cat，是专门为推广加泰罗尼亚语设立的，开放注册。</li>
<li><strong>美洲各国（地区）后缀开放注册的有：</strong><br />
.ag（安提瓜和巴布达）、.ai（安圭拉）、.bs（巴哈马）、.cu（古巴）、.dm（多米尼克）、.do（多米尼加共和国）、.gd（格林纳达）、.gp（瓜德罗普岛）、.ht（海地）、.kn（圣基茨和尼维斯）、.lc（圣卢西亚）、.ms（蒙特塞拉特）、.pr（波多黎各）、.tc（特克斯和凯科斯群岛）、.tt（特里尼达和多巴哥）、.vc（圣文森特）、.vg（英属维尔京群岛）、.bz（伯利兹）、.cr（哥斯达黎加）、.mx（墨西哥）、.gl（格陵兰）、.co（哥伦比亚）、.ec（厄瓜多尔）、.gf（法属圭亚那）、.gy（圭亚那合作共和国）、.pe（秘鲁）、.sr（苏里南）。</li>
<li><strong>非洲各国（地区）后缀开放注册的有：</strong><br />
.bi（布隆迪）、.dj（吉布提）、.mu（毛里求斯）、.mw（马拉维）、.sc（塞舌尔）、.ug（乌干达）、.yt（法属马约特岛）、.cd（刚果民主共和国）、.cg（刚果共和国）、.cm（喀麦隆）、.ga（加蓬）、.gq（赤道几内亚）、.st（圣多美）、.td（乍得）、.ly（利比亚）、.ma（摩洛哥）、.ac（阿森松岛）、.na（纳米比亚）、.sh（圣海伦娜）、.ci（科特迪瓦）、.gw（几内亚比绍）、.ne（尼日尔）、.sl（塞拉利昂）、.sn（塞内加尔）、.tg（多哥）。</li>
<li><strong>大洋洲各国（地区）后缀开放注册的有：</strong><br />
.cc（科科斯群岛）、.cx（圣诞岛）、.nf（诺福克岛）、.as（美属萨摩亚）、.fm（密克罗尼西亚）、.ki（基里巴斯）、.mh（马绍尔群岛）、.mp（北马里亚纳群岛）、.nu（纽埃岛）、.pn（皮特凯恩群岛）、.tk（托克劳）、.to（汤加）、.tv（图瓦卢）、.vu（瓦努阿图）、.wf（瓦利斯和富图纳群岛）、.ws（萨摩亚群岛）。</li>
<li><strong>其它</strong><br />
另外，ICANN还专门为南极洲设了几个后缀，有些当然不开放，呵呵，但还是有下面这样几个是开放的：<br />
.gs（南乔治亚）、.hm（赫德和麦当劳群岛）、.tf（法属南极领地）。</li>
</ol>
<p>——————————————————————————————————————<br />
21对原文进行了部分删减和适当的重排，主要是为了方便自己查询，同时也给访问Mr. 21博客的各位提供一点丰富业余生活的资料，目前21本人持有的TLD有.com/.cn/.net/.org/.info/.in/.me/.im/.name/.lu，其中CN是帮朋友注册的，属于余孽，因为白名单及认证和备案的问题，且国内的空间及各种虚拟服务良莠不齐，导致需要用<strong>CN+外国空间</strong>的组合很难实现，会在到期时候直接丢弃，该朋友已经改用.im了。</p>
<p>想当年21个人持有的20多个CN玉米长达三年之久，结果因为2009年12月9日的CCTV的一段“强烈批判”（请参考《<a href="http://mr21.in/recommendations-about-domain-name-registration-in-china.html">关于域名注册的建议</a>》），让我看到了CN玉米在个人把玩领域的覆灭，于是，在徒劳地认证了我的易名账户之后，里面的CN米也就不了了之了。</p>
<p>希望转载<a href="http://haoyu.me/author/qqpcc">QQPCC</a>的这篇文章可以给大家注册域名的时候提供一点参考，毕竟一些后缀以中文拼音的方式来理解还是比价有意思的，比如.lu(路) .gd(广东) .pl(破烂) .lv(驴) .ai(爱) .bs(鄙视) .mn(蒙牛)等…… 当然，这些玩意儿是见仁见智的，大家自己了然就好，哈哈~</p>
<p>同时，21想大家推荐<a href="http://haoyu.me/">好玉米（好域名）博客</a>，至于为什么，花两分钟看一下就知道了~ 作者QQPCC这段时间就出了一系列域名注册方面的文章，大家可以前往参考，我在此列个小清单：</p>
<ol>
<li>为什么那么多国人前赴后继地送死  <a href="http://haoyu.me/985.html">http://haoyu.me/985.html</a></li>
<li>.ORG后缀到底怎么样？  <a href="http://haoyu.me/959.html">http://haoyu.me/959.html</a></li>
<li>请理性看待域名优惠码   <a href="http://haoyu.me/931.html">http://haoyu.me/931.html</a></li>
<li>数字好域名之我见  <a href="http://haoyu.me/882.html">http://haoyu.me/882.html</a></li>
<li>别被域名后缀忽悠了你（一）  <a href="http://haoyu.me/814.html">http://haoyu.me/814.html</a></li>
<li>别被域名后缀忽悠了你（二）  <a href="http://haoyu.me/868.html">http://haoyu.me/868.html</a></li>
<li>域名放在国内好还是放在国外好？  <a href="http://haoyu.me/866.html">http://haoyu.me/866.html</a></li>
<li>国际顶级域名后缀详解  <a href="http://haoyu.me/840.html">http://haoyu.me/840.html</a></li>
</ol>
<p>最后，关于注册商，我个人推荐两家：<br />
国外：Godaddy(<a href="http://www.godaddy.com">http://www.godaddy.com</a>)  传说中的“狗爹”，已经很出名了，支持支付宝；<br />
国内：名优网(<a href="http://999.cc">http://999.cc</a>)  广航的注册代理，涵盖各种稀奇古怪的后缀且价格合理，人民币结算。</p>
<p>-EOF-</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/network-technology/avaliable-tld-for-global-register.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>在OSX的Terminal使用Home和End键</title>
		<link>http://mr21.in/google/use-home-and-end-key-in-the-osx-terminal.html</link>
		<comments>http://mr21.in/google/use-home-and-end-key-in-the-osx-terminal.html#comments</comments>
		<pubDate>Sun, 16 Jan 2011 16:55:01 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[End]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[MacBook]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=386</guid>
		<description><![CDATA[因为能在Mac OS X的Terminal（中文名：终端）里使用Home和End两个按键对我的日常使用来说实在太重要了，我甚至就为Home和End而喜欢上公司配发的ThinkPad X200忽视了我的MacBook Pro，这是一种奢侈的浪... ]]></description>
			<content:encoded><![CDATA[<p>因为能在Mac OS X的Terminal（中文名：终端）里使用<strong>Home</strong>和<strong>End</strong>两个按键对我的日常使用来说实在太重要了，我甚至就为Home和End而喜欢上公司配发的ThinkPad X200忽视了我的MacBook Pro，这是一种奢侈的浪费（甚至Sophy都鼓动我卖掉MacBook Pro），但我之前的《<a href="http://mr21.in/win-to-mac.html">Windows to MacOSX</a>》里Tips1提到的按键技巧都不适用于Terminal，在X200使用越来越顺手的情况下我开始想解决这个问题。</p>
<p><strong>插播：</strong>此技巧适用于iMac或者Mac Pro或者你自己外接键盘的情况，用内置键盘的MacBook用家请路过……</p>
<p>于是打开Google搜索到以下技巧，在此保留待查：<span id="more-386"></span></p>
<ol>
<li>启动终端(Terminal)；<br />
<img src="http://static.zooomr.com/images/9733094_e4cca5dbaf_o.png" width="272" height="155" alt="屏幕快照 2011-01-17 上午12.19.17" /></li>
<li>选择菜单栏的“终端(Terminal)”->“偏好设置(Preferences)”；<br />
<img src="http://static.zooomr.com/images/9733095_1af24cf37c_o.png" width="236" height="246" alt="屏幕快照 2011-01-17 上午12.20.55" /></li>
<li>选择“设置(Settings)”->“键盘(Keyboard)”；<br />
<img src="http://static.zooomr.com/images/9733096_0282fa8ea0.jpg" width="500" height="387" alt="屏幕快照 2011-01-17 上午12.21.07" /></li>
<li>在“键(Key)”这列找到end和home；<br />
<img src="http://static.zooomr.com/images/9733097_a54732054b.jpg" width="500" height="388" alt="屏幕快照 2011-01-17 上午12.21.35" /></li>
<li>双击相应的“键(Key)”值，会出现如此画面，把动作(Action)改成“将字符串发送到shell：(Send string to shell:)”，然后点击下面的输入栏，直接按你中意的键（Ctrl+A表现为<strong>\001</strong>，Ctrl+E表现为<strong>\005</strong>），点击“好(OK)”关闭设置窗口；<br />
<img src="http://static.zooomr.com/images/9733098_9ba22ebcc8.jpg" width="500" height="387" alt="屏幕快照 2011-01-17 上午12.28.54" /></li>
<li>由于Ctrl+A和Ctrl+E在MacOSX里面实际上的作用不大，加上原文作者推荐，我也这么设置了；</li>
<li>关闭“设置”窗口，完事儿。</li>
</ol>
<p>其中，原作者文中提到KeyFixer解决相关软件方面的Home与End问题，这个其实在《<a href="http://mr21.in/win-to-mac.html">Windows to MacOSX</a>》里Tips1提到的按键技巧里大部分都是适用的，我也用得很流畅，唯一不爽不适用的就是这次解决的Terminal问题，这下爽了。</p>
<p><strong>Update: Jan 17th, 2011</strong><br />
囧rz……<br />
我在<a href="http://twitter.com/gordianz">@GordianZ</a>的提醒下突然明悟过来实际上这是应用于台式的iMac或者Mac Pro的键盘技巧，被我悲催得错认为是MBP用的并且对着默认的Ctrl+A/E沾沾自喜，我有罪……我一贯的粗心大意表露无疑，请莫见怪~</p>
<p>-EOF-</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
参考引用：<br />
1. 挨踢人, 挨踢党： <a href="http://www.cnblogs.com/badder/archive/2010/07/04/1770736.html">http://www.cnblogs.com/badder/archive/2010/07/04/1770736.html</a><br />
2. 哥是键盘手：<a href="http://liang.eu/mac/how-to-change-default-behavior-of-home-end-key-on-mac-os-x">http://liang.eu/mac/how-to-change-default-behavior-of-home-end-key-on-mac-os-x</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/google/use-home-and-end-key-in-the-osx-terminal.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SSH和谐主机的iptables设置参考</title>
		<link>http://mr21.in/network-technology/a-iptables-configure-example-for-ssh-host.html</link>
		<comments>http://mr21.in/network-technology/a-iptables-configure-example-for-ssh-host.html#comments</comments>
		<pubDate>Thu, 13 Jan 2011 16:49:55 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[網際網路]]></category>
		<category><![CDATA[denyhosts]]></category>
		<category><![CDATA[fail2ban]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[LNMP]]></category>
		<category><![CDATA[Ping]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=383</guid>
		<description><![CDATA[这是一个关于SSH番羽土啬的话题，标题及文中的“和谐”=“番羽土啬”，感叹一下我们的文字。 因为21现在手上的VPS数量比较乐观（不是壮观……），因此其中有专司VPN和谐的、SSH和谐的、第... ]]></description>
			<content:encoded><![CDATA[<p>这是一个关于SSH番羽土啬的话题，标题及文中的“和谐”=“番羽土啬”，感叹一下我们的文字。</p>
<p>因为21现在手上的VPS数量比较乐观（不是壮观……），因此其中有专司VPN和谐的、SSH和谐的、第三方推和谐的等用途，当然，Mr. 21博客也在其中一个VPS上，用的LNMP包。</p>
<p>写这个话题的起因是这样的，在<a href="http://www.beishan.info">北山老卫</a>大神的Q群里面，有人提到了想以SSH和谐帐号来换取一些东西，因此引发了21对此的讨论。我的主要观点是不支持这么做，因为不安全（可以参考《<a href="http://mr21.in/linux-kernel-root-level-exploit-leveraging-multiple-previous-vulnerabilities.html">利用Linux内核的多个安全漏洞提权</a>》，不过本文内容与此关系不大），加上之前帮番茄童鞋配置iptables，因此引发了21对SSH和谐主机安全方面的思考，其中的一方面就是用iptables来过滤不和谐的东西。</p>
<p>是这样的，因为做实验的这个VPS我只用于SSH和谐，并且一般和谐仅限于Web浏览及各种基于Web的应用，所以，以下策略仅开放SSH的22端口并对其它的东西做了相应的限制。</p>
<h3>初始化防火墙</h3>
<p>第一步，我们总是要把一些知道的和不知道的先通通打倒了再说，于是，请如此：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">#清除现有的规则
~#: iptables -F
~#: iptables -X
~#: iptables -Z
&nbsp;
#设定默认策略为丢弃包
~#: iptables -P FORWARD DROP
~#: iptables -P OUTPUT DROP
~#: iptables -P INPUT DROP</pre></td></tr></table></div>

<p>以上是一些初始化的动作，以下是具有具体功能的策略。</p>
<h3>防火墙规则参考一</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">#允许本地回环
~#: iptables -A INPUT -i lo -p all -j ACCEPT
&nbsp;
#允许22端口接受连接
~#: iptables -A INPUT -p tcp --dport 22 -j ACCEPT
&nbsp;
#允许传入的数据包状态
~#: iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
&nbsp;
#允许传出的数据包状态
~#: iptables -A OUTPUT -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
&nbsp;
#允许传入PING的ICMP包
~#: iptables -A INPUT -p icmp --icmp-type 8 -j ACCEPT</pre></td></tr></table></div>

<p>这几条规则实现的效果是：</p>
<ol>
<li>22端口允许用户主动发起TCP连接，一般用于提供SSH服务，如果你的SSH端口不是22，请修改；</li>
<li>其它端口需要ESTABLISHED、RELATED两种状态的数据包才能通过，而通常这两种状态的数据包在TCP协议上的定义是已经建立了连接的后续数据包，也就说，别人无法对你的任何端口主动发起连接，但是由你主动发起连接的数据包可以通过，比如说看网页的数据；</li>
<li>包状态NEW允许SSH用户对外的主动发起连接；</li>
<li>允许外部用户PING本机，这个嘛，方便自己测试，要不挂了都不知道。</li>
<li>关于数据包状态，我是参考这里 <a href="http://liubin.blog.51cto.com/282313/110394">http://liubin.blog.51cto.com/282313/110394</a> 。</li>
</ol>
<p>这样，虽然防住了外面进来的问题，但一定程度上来说，用户通过SSH登录以后就可以干他想干的事情了，对于应用的范围不能达到一个控制的目的，比如说，我前面提到的“一般和谐仅限于Web浏览及各种基于Web的应用”，是的，和谐嘛，也就是用这些了，顶天了再来个FTP或者跳板另外的SSH，于是，21便想到了稍微BT一点的限制，请看参考二。<br />
<span id="more-383"></span></p>
<h3>防火墙规则参考二</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">#允许本地回环
~#: iptables -A INPUT -i lo -p all -j ACCEPT
&nbsp;
#允许22端口的数据进出
~#: iptables -A INPUT -p tcp --dport 22 -j ACCEPT
~#: iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT
&nbsp;
#允许状态正常的数据包进入
~#: iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
&nbsp;
#允许访问外部的80、81、8080、443等端口
~#: iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT
~#: iptables -A OUTPUT -p tcp --dport 81 -j ACCEPT
~#: iptables -A OUTPUT -p tcp --dport 8080 -j ACCEPT
~#: iptables -A OUTPUT -p tcp --dport 443 -j ACCEPT
&nbsp;
#允许UDP数据包外发，由于浏览器发起的是1024~65536之间的随机端口，无法限制为具体端口
~#: iptables -A OUTPUT -p udp -j ACCEPT
&nbsp;
#允许PING测试的数据包进出
~#: iptables -A INPUT -p icmp --icmp-type 8 -j ACCEPT
~#: iptables -A OUTPUT -p icmp --icmp-type 8 -j ACCEPT</pre></td></tr></table></div>

<p>好吧，规则二实际上能实现跟规则一差不多的效果，就是让SSH和谐用户能正常浏览Web内容及使用Web应用，那区别在哪里呢？之前提到了规则一的SSH用户只要登录进系统，就可以对外发起任何连接了，而规则二只允许用户发起目标端口为80、81、8080、443(https)的TCP连接和任意UDP连接，这样就能有效的限制用户对于SSH的应用范围。</p>
<h3>小结</h3>
<p>基本上，两个规则都实现了主机仅提供SSH服务（参考一）用于浏览网页（参考二）的目的，并且使用iptables对服务器的其它端口都进行了一些屏蔽，同时提供两种规则方式来实现不同的需求，实际上仅仅这样还是不够的，因为让用户登录到shell里面毕竟还是有一定风险的，特别是一些弱密码的用户也有被暴力猜解的风险，我个人是使用fail2ban的方案来解决暴力猜解的问题，请参考《<a href="http://mr21.in/fail2ban-and-lnmp-configration-for-little-memory-vps.html">小内存优化VPS的LNMP及fail2ban配置</a>》，同时还有denyhosts也是用于防止暴力猜解的，可以参考：《<a href="http://www.vpser.net/security/denyhosts.html">Linux VPS上DenyHosts阻止SSH暴力攻击</a>》。</p>
<p>以上内容是21这两天闲来无事的个人研究成果，才疏学浅难免存在一些不合理或不够精简的地方，如果你有任何意见，请留言指教，谢谢。</p>
<p>-EOF-</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
参考引用：<br />
1. Google: <a href="http://www.google.com/ncr">http://www.google.com/ncr</a><br />
2. iptables 状态机制的描述：<a href="http://liubin.blog.51cto.com/282313/110394">http://liubin.blog.51cto.com/282313/110394</a><br />
3. 定制iptables防火墙策略：<a href="http://ailixing.blog.51cto.com/188828/37309">http://ailixing.blog.51cto.com/188828/37309</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/network-technology/a-iptables-configure-example-for-ssh-host.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>系统管理员和程序员</title>
		<link>http://mr21.in/view-points/sysadmin-and-programmer.html</link>
		<comments>http://mr21.in/view-points/sysadmin-and-programmer.html#comments</comments>
		<pubDate>Mon, 10 Jan 2011 17:11:21 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[二一视点]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[程序员]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=379</guid>
		<description><![CDATA[[转] 本文转载自博客Gawain&#8217;s Jail； 基于作者使用的创作共用授权进行分享，原文在此，感谢Guixing。 —————————————————————————————————————— Eve... ]]></description>
			<content:encoded><![CDATA[<div id="copyfrom" style="width:100%;">
<div style="font-size:20pt;float:left;line-height:1.25em;width:50px;">[转]</div>
<div style="float:left; width:630px;">本文转载自博客<a href="http://blog.khsing.net">Gawain&#8217;s Jail</a>；<br />
基于作者使用的<a href="http://creativecommons.org/licenses/by-nd/3.0/">创作共用授权</a>进行分享，原文<a href="http://blog.khsing.net/2011/01/sysadmin-and-programmer.html">在此</a>，感谢Guixing。</div>
</div>
<p>——————————————————————————————————————</p>
<p><a href="http://everythingsysadmin.com">Everythings Sysadmin</a>的作者<a href="http://everythingsysadmin.com/abouttomchris.html">Tom</a>给一个初级系统管理员回了封<a href="http://everythingsysadmin.com/2011/01/learn-os-internals.html">Learn your operating system&#8217;s internals</a>的信，有讲到每次靠重启解决问题和用猜代替知道的时候总是觉得这是对行业和专业的深深打击。然后又讲了系统管理上三个复杂且容易误解的内容：内存子系统，文件子系统和进程。再加一个是安全子系统，然而这三块的内容又是理解安全的必要前提。总之就是一个系统管理员一定要深入操作系统，知道操作系统到底是怎么工作的。Tom还列了几本针对不同操作系统的书出来，</p>
<ul>
<li>Windows：《Windows Internals》, 中文版：<a href="http://book.douban.com/subject/2031396/">《深入解析Windows操作系统》</a>，<br />
	Russinovich, Solomon and Ionescu；</li>
<li>Linux：《Linux Kernel Internals》, Beck, Bohme, Dziadzka, Kunitz et al；</li>
<li>FreeBSD：《The Design and Implementation of the FreeBSD Operating System》，<br />
	中文版：<a href="http://book.douban.com/subject/1737145/">《FreeBSD操作系统设计与实现》</a>，McKusick and Neville-Neil；</li>
<li>The TCP/IP Protocol: 《TCP/IP Illustrated》, W. Richard Stevens，<br />
	中文版：<a href="http://book.douban.com/subject/1088054/">《TCP/IP详解》</a>，W. Richard Stevens</li>
</ul>
<p>无论你是否使用FreeBSD，都应该读一读FreeBSD的那本。TCP/IP那本就不消说了，现在离了网络的计算机啥也不是啊！<br />
还有一个Hacker News的贴是问<a href="http://news.ycombinator.com/item?id=2069477">How to step up my coding skills?</a>，提问的人想在半年到一年的时间里成为一个Skilled Programmer，回贴的都说程序员这摊子浑水深了，这点时间是不够的。顶的最多的是说要写代码，也有列了代码量的。不过我觉得Ixiaus列出的建议还是很实用的，比如下面几条：</p>
<ul>
<li>要成为一个程序员，不是码农。Ctrl+C/V</li>
<li>不要忽视理论、算法、数据结构和数学</li>
<li>学习多个语言，包括面向对象和函数式编程。</li>
</ul>
<p>系统管理员和程序员虽是两个不同的职位，但是学习的内容应该说是差不多的，系统管理员甚至要比之程序员学得更多，了解的更多，按三金的话就是：我们知道的状态比其他人多，修好只不过是把系统调到已知状态。</p>
<p>——————————————————————————————————————</p>
<p>21之所以要转载这篇文章，是因为身为初级SysAdmin的21在没有前辈指点下自己瞎摸索，苦于没有一个明确的学习方向，一直都是东拼西凑的学习，这篇文章在一定程度上指明了21现阶段需要进行学习的内容和方向，我想我在Google Reader上Make Star和Sharing是不够的，于是转载出来与大家分享，共勉之。</p>
<p>-EOF-</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/view-points/sysadmin-and-programmer.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress多用户模式子站点无法加载CSS？</title>
		<link>http://mr21.in/blog-tips/wordpress/wp-multisite-htaccess-not-working.html</link>
		<comments>http://mr21.in/blog-tips/wordpress/wp-multisite-htaccess-not-working.html#comments</comments>
		<pubDate>Mon, 10 Jan 2011 16:49:28 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=376</guid>
		<description><![CDATA[21今天突然手闲，想试试传闻已久的WordPress多站点模式(WordPress Multisite)，于是用手上的一个DirectSpace年付的VPS（性能？淡定……）临时搭建了一个LAMP，按照WordPress Codex的操作一步一步对WordPress进... ]]></description>
			<content:encoded><![CDATA[<p>21今天突然手闲，想试试传闻已久的WordPress多站点模式(WordPress Multisite)，于是用手上的一个<a href="http://www.directspace.net/">DirectSpace</a>年付的VPS（性能？淡定……）临时搭建了一个LAMP，按照<a href="http://codex.wordpress.org/Migrating_Multiple_Blogs_into_WordPress_3.0_Multisite">WordPress Codex的操作</a>一步一步对WordPress进行修改，按照<strong>子目录</strong>的形式最后写入 .htaccess 并建立了子站点，但是出现一个问题，<strong>子站点可以访问，但是无法加载CSS和图片等东西。</strong></p>
<p>初步判断应该是 .htaccess 里面Rewrite规则可能有问题，但那是官方提供的，不应该吧……<br />
于是通过Google大神一番搜索，确定是Rewrite规则有问题，并将 .htaccess 文件替换为以下内容后工作正常：</p>
<p><strong>WordPress Multisite Based Sub-folder Mode</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="conf" style="font-family:monospace;">RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
&nbsp;
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
&nbsp;
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
&nbsp;
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]</pre></td></tr></table></div>

<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;我是分割线&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>我刚才重新弄了一下想重演故障，结果发现没问题了，记得看过一篇POST提到WP有个缓存机制导致了这个问题，不过我把 .htaccess 更新了以上代码后，就工作正常了，一时也没留意是否跟WP给出的范例代码是否有所不同，纠结了……放这儿备查吧。</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;我是分割线&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><strong>Update: Jan 13th, 2011</strong><br />
终于发现问题所在了，由于我手欠，没有使用启用Network功能时 /wp-admin/network.php 提供的 .htaccess 内容，而直接使用了<a href="http://codex.wordpress.org/Create_A_Network">Codex.WordPress提供的Rewrite规则</a>，于是 ……<br />
来自Codex.WordPress的Rewrite规则呈现如下（无法工作的，仅供参考，别用……）：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="conf" style="font-family:monospace;"># BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
&nbsp;
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
&nbsp;
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
&nbsp;
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
# END WordPress</pre></td></tr></table></div>

<p>主要区别在于以下两句，正好影响到的是主题布景(Theme)、后台管理等功能：</p>
<blockquote><p>有效的规则：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="conf" style="font-family:monospace;">RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]</pre></td></tr></table></div>

<p>无效的规则：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="conf" style="font-family:monospace;">RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]</pre></td></tr></table></div>

</blockquote>
<p>-EOF-</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
引用参考：<br />
WordPress Support: <a href="http://wordpress.org/support/topic/wp-multisite-htaccess-not-working">http://wordpress.org/support/topic/wp-multisite-htaccess-not-working</a><br />
Perishable Pre: <a href="http://perishablepress.com/press/2010/07/07/htaccess-code-for-wordpress-multisite/">http://perishablepress.com/press/2010/07/07/htaccess-code-for-wordpress-multisite/</a><br />
WordPress Codex: <a href="http://codex.wordpress.org/Migrating_Multiple_Blogs_into_WordPress_3.0_Multisite">http://codex.wordpress.org/Migrating_Multiple_Blogs_into_WordPress_3.0_Multisite</a><br />
WordPress Codex: <a href="http://codex.wordpress.org/Create_A_Network">http://codex.wordpress.org/Create_A_Network</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/blog-tips/wordpress/wp-multisite-htaccess-not-working.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>利用Linux内核的多个安全漏洞提权</title>
		<link>http://mr21.in/codes/linux-kernel-root-level-exploit-leveraging-multiple-previous-vulnerabilities.html</link>
		<comments>http://mr21.in/codes/linux-kernel-root-level-exploit-leveraging-multiple-previous-vulnerabilities.html#comments</comments>
		<pubDate>Sun, 19 Dec 2010 16:39:31 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[开源盛试]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Kernel Bug]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=372</guid>
		<description><![CDATA[这是来自VPSee的消息，因为我个人试了一下Debian表示没有鸭梨，于是转过来，手痒的Ubunu用户可以试试…… &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-这是手痒的... ]]></description>
			<content:encoded><![CDATA[<p>这是来自<a href="http://www.vpsee.com/2010/12/linux-kernel-root-level-exploit-leveraging-multiple-previous-vulnerabilities/">VPSee的消息</a>，因为我个人试了一下Debian表示没有鸭梨，于是转过来，手痒的Ubunu用户可以试试……</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-这是手痒的分割线&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>系统安全高手 Dan Rosenberg 发布了<a href="http://marc.info/?l=full-disclosure&#038;m=129175358621826&#038;w=2">一段 C 程序</a>，这段200多行的程序利用了 Linux Econet 协议的3个安全漏洞，可以导致本地帐号对系统进行拒绝服务或特权提升，也就是说一个普通用户可以通过运行这段程序后轻松获得 root shell，以下在 update 过的 Ubuntu 10.04 Server LTS 上测试通过：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">uname</span> <span style="color: #660033;">-r</span>
2.6.32-<span style="color: #000000;">21</span>-server
&nbsp;
$ <span style="color: #c20cb9; font-weight: bold;">gcc</span> full-nelson.c <span style="color: #660033;">-o</span> full-nelson
$ .<span style="color: #000000; font-weight: bold;">/</span>full-nelson
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Resolving kernel addresses...
 <span style="color: #7a0874; font-weight: bold;">&#91;</span>+<span style="color: #7a0874; font-weight: bold;">&#93;</span> Resolved econet_ioctl to 0xffffffffa0131510
 <span style="color: #7a0874; font-weight: bold;">&#91;</span>+<span style="color: #7a0874; font-weight: bold;">&#93;</span> Resolved econet_ops to 0xffffffffa0131600
 <span style="color: #7a0874; font-weight: bold;">&#91;</span>+<span style="color: #7a0874; font-weight: bold;">&#93;</span> Resolved commit_creds to 0xffffffff8108b820
 <span style="color: #7a0874; font-weight: bold;">&#91;</span>+<span style="color: #7a0874; font-weight: bold;">&#93;</span> Resolved prepare_kernel_cred to 0xffffffff8108bc00
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Calculating target...
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Failed to <span style="color: #000000; font-weight: bold;">set</span> Econet address.
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Triggering payload...
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Got root<span style="color: #000000; font-weight: bold;">!</span>
<span style="color: #666666; font-style: italic;">#</span></pre></div></div>

<p>由于 RHEL/CentOS 默认不支持 Econet 协议，所以测试没有通过：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">uname</span> <span style="color: #660033;">-r</span>
2.6.18-194.26.1.el5
&nbsp;
$ <span style="color: #c20cb9; font-weight: bold;">gcc</span> full-nelson.c <span style="color: #660033;">-o</span> full-nelson
$ .<span style="color: #000000; font-weight: bold;">/</span>full-nelson
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Failed to open <span style="color: #c20cb9; font-weight: bold;">file</span> descriptors.</pre></div></div>

<p>如果在企业环境用 Ubuntu 的话可能会比较杯具了，几百个帐号里总可以找到一两个帐号被内部或外部人员通过上面这段程序拿到 root，这对服务器的危害是毁灭性的。前天还在说 Ubuntu 在内核方面无作为，现在想起来还有点后怕。VPSee 提醒正在使用多个普通帐号登录 Ubuntu VPS 的朋友及时升级或打内核补丁，出售 VPN/SSH 帐号、提供免费 SSH 的商家尤其要小心 “客户” 捣乱，使用其他 Linux 发行版的朋友也最好检查一下自己的 VPS 有没有这些高危漏洞。</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-这是手痒的分割线&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>21个人的测试，在Debian 5.0.6上测试，结果如下：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">uname</span> <span style="color: #660033;">-r</span>
2.6.26-<span style="color: #000000;">2</span>-xen-amd64
$ <span style="color: #c20cb9; font-weight: bold;">gcc</span> h.c <span style="color: #660033;">-o</span> h
$ .<span style="color: #000000; font-weight: bold;">/</span>h
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Resolving kernel addresses...
 <span style="color: #7a0874; font-weight: bold;">&#91;</span>+<span style="color: #7a0874; font-weight: bold;">&#93;</span> Resolved econet_ioctl to 0xffffffffa017819b
 <span style="color: #7a0874; font-weight: bold;">&#91;</span>+<span style="color: #7a0874; font-weight: bold;">&#93;</span> Resolved econet_ops to 0xffffffffa01791e0
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Failed to resolve kernel symbols.</pre></div></div>

<p>同时，各位提供SSH番羽墙的童鞋，只要把用户的shell设置为nologin便可以表示没有鸭梨了~</p>
<p>-EOF-</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/codes/linux-kernel-root-level-exploit-leveraging-multiple-previous-vulnerabilities.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Convert .htaccess to nginx</title>
		<link>http://mr21.in/software/convert-htaccess-to-nginx.html</link>
		<comments>http://mr21.in/software/convert-htaccess-to-nginx.html#comments</comments>
		<pubDate>Fri, 10 Dec 2010 02:46:22 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[软言软语]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=369</guid>
		<description><![CDATA[这篇，我稍微微博一下好了 …… 这么好的工具，不得不马克一下~ Link: http://www.anilcetin.com/convert-apache-htaccess-to-nginx/ 不过据说有人因此Nginx起不来，大家慎用就是了…… -EOF... ]]></description>
			<content:encoded><![CDATA[<p>这篇，我稍微微博一下好了 …… 这么好的工具，不得不马克一下~</p>
<p>Link: <a href="http://www.anilcetin.com/convert-apache-htaccess-to-nginx/">http://www.anilcetin.com/convert-apache-htaccess-to-nginx/</a></p>
<p>不过据说有人因此Nginx起不来，大家慎用就是了……</p>
<p>-EOF-</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/software/convert-htaccess-to-nginx.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>小内存优化VPS的LNMP及fail2ban配置</title>
		<link>http://mr21.in/software/fail2ban-and-lnmp-configration-for-little-memory-vps.html</link>
		<comments>http://mr21.in/software/fail2ban-and-lnmp-configration-for-little-memory-vps.html#comments</comments>
		<pubDate>Tue, 07 Dec 2010 10:28:00 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[软言软语]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Dropbear]]></category>
		<category><![CDATA[fail2ban]]></category>
		<category><![CDATA[LNMP]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=367</guid>
		<description><![CDATA[哈，大家好，21经过长时间的“沉没”，在这个寒冷的冬日怎么着也该冒泡泡以表无恙呀~ 话说，今天是二四节气中的“大雪”，够不上下雪条件的昆明便下起了稀里哗啦的雨，让21这个电动车... ]]></description>
			<content:encoded><![CDATA[<p>哈，大家好，21经过长时间的“沉没”，在这个寒冷的冬日怎么着也该冒泡泡以表无恙呀~ 话说，今天是二四节气中的“大雪”，够不上下雪条件的昆明便下起了稀里哗啦的雨，让21这个电动车男给冻的 …… 无法用言语形容的呀~</p>
<p>经过近半年时间，21手上开始掌握了一些廉价的VPS进行个人学习和实验，基本配置小至128M OpenVZ大至512M Xen都有，当然，买来以后闲置的时间稍微占多了点，不过由于<a href="http://www.Hawkhost.com">Hawkhost</a>空间12.6到期的刺激，我把<a href="http://mr21.in">Mr. 21</a>和<a href="http://75do.in">75%</a>都搬迁到其中一个512M Xen VPS上并且进行了相关的配置。本着内存能少用就少用、资源能节约就节约的原则，我进行了一些学习和模仿。</p>
<p>文中涉及到的操作基本上都需要root权限，且，21个人喜欢nano编辑器，如果你喜欢vi，稍微换一下命令就行。</p>
<h3>基础调配部分及LNMP</h3>
<p>由于21喜欢用Debian，于是参考了<a href="http://www.vpsee.com">VPSee</a>的文章《<a href="http://www.vpsee.com/2009/06/128mb-vps-optimize-centos5/">64MB VPS 上优化 Debian 5</a>》和<a href="http://www.lowendbox.com">LowEndBox</a>的《<a href="http://www.lowendbox.com/blog/wordpress-cheap-vps-lowendscript/">Bootstraping WordPress/Nginx/PHP/MySQL on a Cheap VPS with lowendscript</a>》，对VPS上的OpenSSH、 syslog-ng用Dropbear和inetutils-syslogd进行了替换，从基础上对资源占用进行了控制，大概操作如下：</p>
<ol>
OpenSSH、 syslog-ng的替换，我使用了LEB的lowendscript，在root用户下，如此操作便可：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>lowendbox<span style="color: #000000; font-weight: bold;">/</span>lowendscript<span style="color: #000000; font-weight: bold;">/</span>raw<span style="color: #000000; font-weight: bold;">/</span>master<span style="color: #000000; font-weight: bold;">/</span>setup-debian.sh
<span style="color: #c20cb9; font-weight: bold;">bash</span> setup-debian.sh system</pre></td></tr></table></div>

<p>如果你参考<a href="http://www.lowendbox.com/blog/wordpress-cheap-vps-lowendscript/">这里</a>，会发现LEB的这个脚本其实还可以安装LNMP里面的NMP(Nginx, MySQL, PHP)三个组件，但是我个人比较喜欢国人的<a href="http://lnmp.org">LNMP</a>，于是仅使用LES脚本进行了系统组件的替换。
</ol>
<p>之后，我安装LNMP 0.5（请参考<a href="http://lnmp.org/install.html">这里</a>）作为WEB服务器，并且进行了一些调整，这个调整请按照自己的需求就好。</p>
<ol>
<li>将Nginx的子线程调整为2个，方法如下：

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>nginx.conf</pre></td></tr></table></div>

<p>找到worker_processes，将其改成下面的样子：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">worker_processes 2;</pre></td></tr></table></div>

<p>然后按Ctrl+O保存，按Ctrl+X退出。</li>
<li>同时，我将PHP-FPM的子线程也调整为2个，方法如下：

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php-fpm.conf</pre></td></tr></table></div>

<p>按Ctrl+W搜索max_children，改成下面这样的格式：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;max_children&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>然后按Ctrl+O保存，按Ctrl+X退出。再来重启nginx和php-fpm：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">invoke-rc.d nginx restart
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>php-fpm restart</pre></td></tr></table></div>

</li>
<li>关于这个……MYSQL的调优，这个……21表示个人水平不足，就不献丑了。</li>
</ol>
<h3>Fail2Ban调配部分</h3>
<p>这是一些比较基础的安全方面的调配。</p>
<ol>
<li>首先，是禁用root用户的ssh登录，由于我们已经用Dropbear替换了OpenSSH，所以跟一般教程针对OpenSSH的修改方式不太一样，大概方法如下：

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>xinetd.d<span style="color: #000000; font-weight: bold;">/</span>dropbear</pre></td></tr></table></div>

<p>然后把其中的server_args修改为如下样子</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;">    server_args     = -i -g</pre></td></tr></table></div>

<p>让 /etc/xinetd.d/dropbear 配置文件看起来像这样</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="conf" style="font-family:monospace;">service ssh
{
    socket_type     = stream
    only_from       = 0.0.0.0
    wait            = no
    user            = root
    protocol        = tcp
    server          = /usr/sbin/dropbear
    server_args     = -i -g
    disable         = no
}</pre></td></tr></table></div>

<p>然后按Ctrl+O保存，按Ctrl+X退出。<br />
<strong>-g</strong>的意思就是禁用root使用密码登录，但可以用公钥登录(public key)（请参考<a href="http://hostingfu.com/article/use-dropbear-ssh-to-save-memory">这里</a>）。<br />
然后重启Dropbear：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">invoke-rc.d xinetd restart</pre></td></tr></table></div>

</li>
<li>
禁用了root账户登录，但是21在某些特定的没有公钥情况下又需要登录SSH，怎么办呢？增加一个普通用户就好了，这个用户不用具备什么特殊权限，只要能登录SSH足矣，大概操作如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">useradd <span style="color: #7a0874; font-weight: bold;">&#91;</span>username<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #660033;">-p</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>password<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></td></tr></table></div>

<p>将<strong>[username]</strong>替换为你想要的用户ID（注：不能为纯数字），<strong>[password]</strong>替换为想要的密码便可。<br />
之后我们以<strong>[username]</strong>登录系统，然后输入<strong>su root</strong>，再输入root密码便可以切换到root用户的shell。<br />
推荐不要使用太简单的ID，比如a/ab/abc什么的，为什么？后面告诉你。
</li>
</ol>
<p><span id="more-367"></span>好了，虽然21禁用了root用户的登录，但是还有个无法避免的问题：暴力猜解，如果我们使用了够简单的ID，例如a/ab/abc之类的，那么很容易被锁定为爆破目标，那我就是喜欢a这个ID怎么办呢？好吧，那只好来点稍微强硬点的措施了，21用fail2ban。fail2ban可以监视你的系统或者应用日志，然后匹配日志的错误信息（正则式匹配）执行iptables屏蔽策略，把某IP的包扔掉，fail to ban~</p>
<p>Fail2ban本身已经内置了不少应用的判断规则了</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> fail2ban <span style="color: #000000; font-weight: bold;">//</span>安装fail2ban
<span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fail2ban<span style="color: #000000; font-weight: bold;">/</span>filter.d<span style="color: #000000; font-weight: bold;">/</span>
apache-auth.conf      apache-overflows.conf  couriersmtp.conf  gssftpd.conf        postfix.conf    qmail.conf      sshd.conf         wuftpd.conf
apache-badbots.conf   common.conf            named-refused.conf  proftpd.conf    sasl.conf       vsftpd.conf       xinetd-fail.conf  apache-noscript.conf
courierlogin.conf     exim.conf              pam-generic.conf    pure-ftpd.conf  sshd-ddos.conf  webmin-auth.conf</pre></td></tr></table></div>

<p>但是我们已经把SSH服务换成了Dropbear，把日志服务换成了inetutils-syslogd，那fail2ban会不会水土不服呢？<br />
哈，这简直是必须的~</p>
<p>我们需要做点工作让fail2ban能适应我们这个精简过的系统，适应Dropbear的错误日志。</p>
<ol>
<li>
首先，Fail2ban需要监视Dropbear的用户登录日志，但是替换成inetutils-syslogd以后，21发现自己的 /var/log/auth.log.1 （没错，我的不是auth.log，是auth.log.1）停滞在某年某月某日了~ 于是稍微看了一下 /var/log/messages 发现里面有我需要的信息，我把它登录信息分离出来方便Fail2ban的读取，如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>syslog.conf</pre></td></tr></table></div>

<p>默认内容如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="config" style="font-family:monospace;">*.*;mail.none;cron.none -/var/log/messages
cron.*                  -/var/log/cron
mail.*                  -/var/log/mail</pre></td></tr></table></div>

<p>增加一个句子将登录信息分离出来，修改为</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="config" style="font-family:monospace;">*.*;mail.none;cron.none -/var/log/messages
cron.*                  -/var/log/cron
mail.*                  -/var/log/mail
authpriv.*              /var/log/auth.log</pre></td></tr></table></div>

<p>到此为止我们拥有了一个单独的包含Dropbear登录信息的日志文件 /var/log/auth.log。</li>
<li>
接下来我们设置Fail2ban，按照常规对SSH进行防御的教程，说的都是针对OpenSSH的设置和判断规则，而显然Dropbear是被遗忘的，甚至Debian的Bug Report里面都有人提到<a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=546913">这样的问题</a>，当然，也有人帮忙<a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=546913#5">解决</a>这样的问题，大牛总是有的~</p>
<p>首先，我们需要下载一个针对Dropbear的判断策略文件，如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=dropbear.conf;att=1;bug=546913&quot;</span> <span style="color: #660033;">-O</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fail2ban<span style="color: #000000; font-weight: bold;">/</span>filter.d<span style="color: #000000; font-weight: bold;">/</span>faidropbear.conf</pre></td></tr></table></div>

<p>然后，在fail2ban的配置里面增加对dropbear的监视和动作：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fail2ban<span style="color: #000000; font-weight: bold;">/</span>jail.conf</pre></td></tr></table></div>

<p>按Ctrl+V一直翻页到最下面空白处，增加以下内容</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="config" style="font-family:monospace;">[ssh-iptables]
enabled  = true
port = ssh
filter   = dropbear
logpath  = /var/log/auth.log</pre></td></tr></table></div>

<p>然后按Ctrl+O保存，按Ctrl+X退出，之后，便是我们的收尾动作了，执行</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">invoke-rc.d fail2ban restart</pre></td></tr></table></div>

</li>
</ol>
<p>完事儿了。</p>
<p>引用参考：<br />
1. Google: <a href="http://www.google.com/ncr">http://www.google.com/ncr</a><br />
2. Debian Bug Report: <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=546913">http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=546913</a><br />
3. LowEndBox: <a href="http://www.lowendbox.com/blog/wordpress-cheap-vps-lowendscript/">http://www.lowendbox.com/blog/wordpress-cheap-vps-lowendscript/</a><br />
4. VPSee: <a href="http://www.vpsee.com/2009/06/64mb-vps-optimize-debian5/">http://www.vpsee.com/2009/06/64mb-vps-optimize-debian5/</a><br />
5. HostingFu: <a href="http://hostingfu.com/article/use-dropbear-ssh-to-save-memory">http://hostingfu.com/article/use-dropbear-ssh-to-save-memory</a><br />
6. Easy Firewall Generator: <a href="http://easyfwgen.morizot.net/gen/">http://easyfwgen.morizot.net/gen/</a></p>
<p>- EOF-</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/software/fail2ban-and-lnmp-configration-for-little-memory-vps.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MacBook Pro &#8211; Fan Control</title>
		<link>http://mr21.in/software/macbook-pro-fan-control.html</link>
		<comments>http://mr21.in/software/macbook-pro-fan-control.html#comments</comments>
		<pubDate>Sun, 22 Aug 2010 13:33:01 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[软言软语]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Fan]]></category>
		<category><![CDATA[MacBook]]></category>
		<category><![CDATA[MBP]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=365</guid>
		<description><![CDATA[这篇文章主要介绍了在Mac OS X、Ubuntu Lucid和Windows 7三个系统平台下对MacBook Pro（以下简称：MBP）的风扇控制，因为不知道为什么的原因，我个人和不少人的MBP都表现出风扇调速迟钝的问题，通常... ]]></description>
			<content:encoded><![CDATA[<p>这篇文章主要介绍了在Mac OS X、Ubuntu Lucid和Windows 7三个系统平台下对MacBook Pro（以下简称：MBP）的风扇控制，因为不知道为什么的原因，我个人和不少人的MBP都表现出风扇调速迟钝的问题，通常都是2000RPM左右，然后等到机器超过90摄氏度后风扇开始提速到6000RPM进行散热，但这个肯定不是我们需要的效果，我们要的是，要么自己控制，要么自动调整。</p>
<h3>Mac OS X</h3>
<div class="imgdivimg2"><a href="http://www.zooomr.com/photos/cmb/9406199/" title="Photo Sharing"><img src="http://static.zooomr.com/images/9406199_0937fd75d4_m.jpg" width="240" height="81" /></a></div>
<p>这个身为MBP原生的，与硬件契合度最高的系统同样存在风扇自动调整的问题，至少在我重置了N次SMC的情况依然还是只能达到90度附近才会提速，于是只能用软件来对付了，我个人觉得效果比较好的是<strong>Fan Control</strong>。</p>
<p>名称：Fan Control<br />
系统：Leopard, Snow Leopard<br />
下载：<a href="http://www.lobotomo.com/products/FanControl/">http://www.lobotomo.com/products/FanControl/</a></p>
<p>安装之后，会在“系统偏好设置”里面增加一个叫“Fan Control”的设置面板。<br />
<img src="http://www.lobotomo.com/products/FanControl/images/screenshot.gif" alt="" /><br />
进去之后三项设置，<br />
Base Speed，初始速度，系统默认是2000RPM，系统启动之后会以这个初始速度为基准；<br />
Lower Threshold，温度下限阀值，这个是配合Base Speed工作的，在这个温度下，转速是Base Speed；<br />
Upper Threshold，温度上限阀值，这个是值达到时系统将以最高转速跑风扇，我的MBP 13是6200。<br />
风扇的转速会自动在Lower和Upper之间自动调整。<span id="more-365"></span></p>
<h3>Ubuntu Lucid (10.04)</h3>
<p>遇到Linux有个好处，直接修改配置文件就行，可以省掉软件了，但是这个没法进行曲线调速了，所以通常我都是直接把速度一步到位直接上到5500RPM，喜欢6000RPM的也行，反正风扇的作用就是处理积热嘛，往高处提一下没有坏处的~</p>
<p>操作如下：<br />
开启终端（Terminal），输入以下指令，之后需要输入你当前用户的密码，然后回车，</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;echo 5000 &gt; /sys/devices/platform/applesmc.768/fan1_min&quot;</span></pre></td></tr></table></div>

<p>通过修改fan1_min中的数字“1”，可以调整各个不同风扇的转速，因为MBP 13只有一个风扇，所以也只有fan1，像MBP 15这一类的，可以分别调整fan1和fan2的转速等。并且每次开机的话系统都会自动重置，所以如果需要每次开机都保持一个转速的话，可以自行修改rc脚本。</p>
<h3>Windows 7</h3>
<p>在Windows下也是需要依靠第三方软件的，据说是有类似于OSX下Fan Control那样的自动调速软件，不过我个人还是比较喜欢把速度调整到5500左右，一次性解决问题。软件叫“Mac/SMC Fan Control for Windows (+ Temp) ”。</p>
<p>名称：Mac/SMC Fan Control for Windows (+ Temp)<br />
平台：32-bit MS Windows (NT/2000/XP), 64-bit MS Windows, Vista, WinXP.<br />
下载：<a href="http://sourceforge.net/projects/macfan/">http://sourceforge.net/projects/macfan/</a></p>
<p>官方没有提到Win7，但是我的Win7-64bit也没有问题的。这是一个基于CLI（CommandLine Interface，命令行界面）的程序，而且同时还需要管理员权限，还要带参数，使用起来稍微有点麻烦，我个人是这么处理的：</p>
<ol>
<li>首先将解压缩后的文件放在\windows\mf目录；</li>
<li>同时在目录里面增加一个批处理文件<strong>mf.cmd</strong>，内容如下：

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="txt" style="font-family:monospace;">@echo off
@echo Input the fan speed (2000-6200): 
set /p speed=
C:\Windows\mf\MacFanx64.exe %speed%</pre></td></tr></table></div>

</li>
<li>之后按住Alt键，把<strong>mf.cmd</strong>拖到桌面上，之后在mf.cmd上右键，选择“属性”，选择“快捷方式”页面，点击“高级”，之后把“以管理员权限运行”勾上。</li>
<li>双击桌面上的“mf.cmd &#8211; 快捷方式”，之后输入你想要调整的风扇转速，回车即可。</li>
</ol>
<p>因为我的是MBP 13，只有一个风扇，所以只需要提供一个参数，如果有多个风扇的话，请依据自己的需要进行修改，按照Mac/SMC Fan Control for Windows (+ Temp) 的说明文件提到的，用法大概如下：</p>
<ul>MacFan.exe &lt;Desired RPM for Fan 1> &lt;Desired RPM for Fan 2 (if applicable)> &lt;Desired RPM for Fan 3 (if applicable)> &lt;Desired RPM for Fan 4 (if applicable)></ul>
<p>基本上，还是不太建议在MBP上使用其它系统，毕竟efi现在还是不能被其它系统较好地支持。不过像我这种爱折腾的人和不少披着MBP的皮WIN的心的人，这样的速度调整还是有必要的，希望这篇文章能帮到你。</p>
<p>引用参考：<br />
Fan Control: <a href="http://www.lobotomo.com/products/FanControl/">http://www.lobotomo.com/products/FanControl/</a><br />
MacFan: <a href="http://sourceforge.net/projects/macfan/">http://sourceforge.net/projects/macfan/</a><br />
Ubuntu Forum: <a href="http://ubuntuforums.org/showthread.php?t=1378663">http://ubuntuforums.org/showthread.php?t=1378663</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/software/macbook-pro-fan-control.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>如何重置Mac OS X的网络配置</title>
		<link>http://mr21.in/network-technology/reset-mac-os-x-network-configuration-factory-default.html</link>
		<comments>http://mr21.in/network-technology/reset-mac-os-x-network-configuration-factory-default.html#comments</comments>
		<pubDate>Tue, 03 Aug 2010 02:23:42 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[網際網路]]></category>
		<category><![CDATA[MBP]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Reset]]></category>
		<category><![CDATA[重置]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=363</guid>
		<description><![CDATA[由于Mac OS X的智能化，大多数情况我们是不需要对系统配置进行过多的干涉的，但是当我们的网络设备及各种网络接口配置不断增加的时候（例如我除了自带的Airport、以太网之外，还有3个VPN，... ]]></description>
			<content:encoded><![CDATA[<p>由于Mac OS X的智能化，大多数情况我们是不需要对系统配置进行过多的干涉的，但是当我们的网络设备及各种网络接口配置不断增加的时候（例如我除了自带的Airport、以太网之外，还有3个VPN，两个PPPoE，一个Modem over Serial Port及一个Kindle USBNetwork的接口），而不同的配置多了有可能会导致一些奇怪的网络问题，这个时候我们可以选择将Mac OS X的网络配置重置到出厂设置的状态（其实就是系统自动检测设备并重新生成配置），这样你的网络配置部分就跟全新的Mac OS X电脑一样了。</p>
<p>很简单，只需要重命名以下这个文件，然后重启即可。<br />
将</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">   <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Preferences<span style="color: #000000; font-weight: bold;">/</span>SystemConfiguration<span style="color: #000000; font-weight: bold;">/</span>preferences.plist</pre></div></div>

<p>改成</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">   <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Preferences<span style="color: #000000; font-weight: bold;">/</span>SystemConfiguration<span style="color: #000000; font-weight: bold;">/</span>preferences.plist.bk</pre></div></div>

<p>然后重启。</p>
<p>具体操作流程如下：<br />
选择Dock上的“应用程序”->“实用工具”->“终端”，然后输入以下命令</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">MBP:~ <span style="color: #000000;">21</span>$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Preferences<span style="color: #000000; font-weight: bold;">/</span>SystemConfiguration<span style="color: #000000; font-weight: bold;">/</span>preferences.plist <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Preferences<span style="color: #000000; font-weight: bold;">/</span>SystemConfiguration<span style="color: #000000; font-weight: bold;">/</span>preferences.plist.bk
Password: （此处输入你当前的密码，无显示，输完回车即可。）</pre></td></tr></table></div>

<p>回车后输入你当前用户的密码，回车，然后重启你的Mac OS X即可。</p>
<p><strong>请注意，你的网络配置会因此丢失，如果有什么特殊的配置，请自行记录。<br />
提示：这个办法无法解决部分OS X通过Airport连接VPN但是无法访问内网的情况。</strong></p>
<p>引用来源：<br />
Steve Jamesson | <a href="http://stevejamesson.com/2008/10/01/reset-mac-os-x-network-configuration-factory-default-airport-interface-disappeared/">Reset Mac OS X network configuration to factory default</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/network-technology/reset-mac-os-x-network-configuration-factory-default.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>答疑：域名不能添加A记录（国内）</title>
		<link>http://mr21.in/network-technology/qa-domain-control-panel-can-not-add-new-record-in-china.html</link>
		<comments>http://mr21.in/network-technology/qa-domain-control-panel-can-not-add-new-record-in-china.html#comments</comments>
		<pubDate>Wed, 21 Jul 2010 07:48:39 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[網際網路]]></category>
		<category><![CDATA[BlogBus]]></category>
		<category><![CDATA[CNNIC]]></category>
		<category><![CDATA[域名]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=362</guid>
		<description><![CDATA[以后我会根据偶尔搜索引擎过来的关键词进行特别的回答，这是第一篇，请多指教！ Q: 我在国内的注册的域名，为什么最近莫名其妙的不能在域名的控制面板里面添加新的记录了？ A: 好吧，还... ]]></description>
			<content:encoded><![CDATA[<p>以后我会根据偶尔搜索引擎过来的关键词进行特别的回答，这是第一篇，请多指教！</p>
<blockquote><p><strong>Q:</strong> 我在国内的注册的域名，为什么最近莫名其妙的不能在域名的控制面板里面添加新的记录了？<br />
<strong style="float:left; height:33pt; margin-right:4pt;">A:</strong> 好吧，还是那个经典的话“建设具有中国特色的社会主义网络”，于是我们有一个东西叫“<strong>备案</strong>”，简单的说，只要是在国内工商注册过的域名/互联网服务商就必须遵守国内的游戏规则，所以，如果出现以上情况，请联系你的注册商客服/代理，询问需要提供什么资料才能恢复使用。
</p></blockquote>
<p>就我个人在易名网的体验来说，目前CN域名想要正常使用需要满足以下条件：</p>
<ol>
<li>域名的主办人不允许为“个人”；</li>
<li>向域名注册商提交资料备案，包括营业执照副本复印件、联络人身份证复印件、备案申请单；</li>
<li>进行域名的ICP备案，也就说你需要买一个国内的空间。</li>
</ol>
<p>我的一个CN域名由于缺少第三个条件，目前的情况为“<strong>该域名已被注册管理机构暂停解析</strong>”。</p>
<p>一般来说，第一步是禁用你的域名控制面板的使用，也就说不能添加记录了，第二步是CNNIC停用你的域名，例如《<a href="http://mr21.in/2010-01/blogbus-banned-emergency-solution.html">BlogBus被封应急方案</a>》里面遇到的那种情况 …… 也许情况不都是这样，但是我的确实如此。</p>
<p>所以，Mr. 21一直建议，不要注册CN域名，不要在国内注册域名。域名注册有风险，入行须谨慎。</p>
<p>延伸阅读：<br />
《<a href="http://mr21.in/2009-12/recommendations-about-domain-name-registration-in-china.html">关于域名注册的建议</a>》<br />
《<a href="http://mr21.in/2010-01/the-virtual-host-guide-no-3-domain-transfer.html">虚拟主机答疑之「域名转移」</a>》</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/network-technology/qa-domain-control-panel-can-not-add-new-record-in-china.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>解决SSH断线后的会话恢复</title>
		<link>http://mr21.in/software/using-screen-when-connecting-to-linux-servers-with-ssh.html</link>
		<comments>http://mr21.in/software/using-screen-when-connecting-to-linux-servers-with-ssh.html#comments</comments>
		<pubDate>Fri, 09 Jul 2010 06:48:46 +0000</pubDate>
		<dc:creator>贰壹</dc:creator>
				<category><![CDATA[软言软语]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[服务器]]></category>

		<guid isPermaLink="false">http://mr21.in/?p=358</guid>
		<description><![CDATA[最近从vpsee\酷胖等博客看到的信息，购买了好几个廉价的VPS在学习，于是就产生了不少基于SSH的困扰，而掉线重连的会话丢失算是一个 …… 感谢GG大神的帮助，我找到了这个工具：screen。 简单... ]]></description>
			<content:encoded><![CDATA[<p>最近从<a href="http://www.vpsee.com/">vpsee</a>\<a href="http://www.whcoupon.com/">酷胖</a>等博客看到的信息，购买了好几个廉价的VPS在学习，于是就产生了不少基于SSH的困扰，而掉线重连的会话丢失算是一个 ……</p>
<p>感谢GG大神的帮助，我找到了这个工具：<strong>screen</strong>。<br />
简单的说，就是这个工具会接管你当前的console会话，然后当前控制台显示的输入/输出就由它负责，如果你掉线后，只要重新启用screen，就是恢复到之前的状态。大概的操作流程如下：</p>
<ol>
<li>以SSH的方式连接你的服务器</li>
<li>安装Screen；<br />
	<strong>debian/ubuntu:</strong> apt-get install screen<br />
	<strong>fedora/centos:</strong> yum install screen</li>
<li>输入<strong style="color:blue;">screen</strong>接管当前会话；</li>
<li>进行自己需要的任何操作；</li>
<li>SSH掉线；</li>
<li>重连SSH并输入<strong style="color:blue;">screen -r</strong>恢复会话；</li>
<li>可以在.bash_profile里加一行<br />
<span style="color:blue;">alias r=&#8217;screen -d `screen -ls |grep Attached|cut -f2|cut -f1 -d&#8221;.&#8221;`;screen -r `screen -ls |grep Detached|cut -f2|cut -f1 -d&#8221;.&#8221;`&#8217;</span><br />
能够方便的切回screen窗口（假设只开了一个screen）。</li>
</ol>
<p>恩，不是啥复杂的东西，但是能解决不小的困扰。</p>
<p>内容引用参考：<br />
雨中的高速公路 &#8211; 《<a href="http://www.rainway.org/2008/05/22/using-screen-when-connecting-to-linux-servers/">在ssh终端下如何解决断线带来的困扰</a>》。</p>
]]></content:encoded>
			<wfw:commentRss>http://mr21.in/software/using-screen-when-connecting-to-linux-servers-with-ssh.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

