<?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>小顾de杂记</title>
	<atom:link href="http://ihipop.info/feed" rel="self" type="application/rss+xml" />
	<link>http://ihipop.info</link>
	<description>O(∩_∩)O~&#124;Across the great wall we can reach the every corner in the world.</description>
	<lastBuildDate>Mon, 14 May 2012 08:16:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>PHP DES加密中与C#/ActionScript/Java互操作的算法</title>
		<link>http://ihipop.info/2012/04/3160.html</link>
		<comments>http://ihipop.info/2012/04/3160.html#comments</comments>
		<pubDate>Thu, 26 Apr 2012 05:28:04 +0000</pubDate>
		<dc:creator>ihipop</dc:creator>
				<category><![CDATA[MyOriginal]]></category>
		<category><![CDATA[PHP Note]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[des]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[不一致]]></category>
		<category><![CDATA[加密]]></category>

		<guid isPermaLink="false">http://ihipop.info/?p=3160</guid>
		<description><![CDATA[搜索DES加密 不一致 好像能搜索到很多。
差异一般产生在加密方式，而且是你没指定的加密方式，或者zeroIV初始向量，填充模式等等，你不指定，各个程序和库处理的方式就会不一样，这就是产生差异的原因。
以PHP的mcrypt_cbc函数为例
<blockquote>string mcrypt_cbc ( string $cipher , string $key , string $data , int $mode [, string $iv ] )</blockquote>

cbc是工作模式，DES一共有电子密码本模式（ECB）、加密分组链接模式（CBC）、加密反馈模式（CFB）和输出反馈模式（OFB）四种模式，
在使用 CFB 及 OFB 二种模式时，必须要向量初始化 (Initialization vector, IV)，CBC 模式也可以使用向量初始化。向量初始化的值在加解密时必须是独一无二的，同时也要保持相同。当加密后的资料输出时，也可同时输出密码钥匙 (例如存在文件中)；或者也可以将向量初始化的值与加密后的资料一起输出。

<a href="http://php.net/manual/en/mcrypt.ciphers.php" target="_blank">目前PHP支持的cipher有</a>


<blockquote>MCRYPT_3DES
MCRYPT_ARCFOUR_IV (libmcrypt > 2.4.x only)
MCRYPT_ARCFOUR (libmcrypt > 2.4.x only)
MCRYPT_BLOWFISH
MCRYPT_CAST_128
MCRYPT_CAST_256
MCRYPT_CRYPT
MCRYPT_DES
MCRYPT_DES_COMPAT (libmcrypt 2.2.x only)
MCRYPT_ENIGMA (libmcrypt > 2.4.x only, alias for MCRYPT_CRYPT)
MCRYPT_GOST
MCRYPT_IDEA (non-free)
MCRYPT_LOKI97 (libmcrypt > 2.4.x only)
MCRYPT_MARS (libmcrypt > 2.4.x only, non-free)
MCRYPT_PANAMA (libmcrypt > 2.4.x only)
MCRYPT_RIJNDAEL_128 (libmcrypt > 2.4.x only)
MCRYPT_RIJNDAEL_192 (libmcrypt > 2.4.x only)
MCRYPT_RIJNDAEL_256 (libmcrypt > 2.4.x only)
MCRYPT_RC2
MCRYPT_RC4 (libmcrypt 2.2.x only)
MCRYPT_RC6 (libmcrypt > 2.4.x only)
MCRYPT_RC6_128 (libmcrypt 2.2.x only)
MCRYPT_RC6_192 (libmcrypt 2.2.x only)
MCRYPT_RC6_256 (libmcrypt 2.2.x only)
MCRYPT_SAFER64
MCRYPT_SAFER128
MCRYPT_SAFERPLUS (libmcrypt > 2.4.x only)
MCRYPT_SERPENT(libmcrypt > 2.4.x only)
MCRYPT_SERPENT_128 (libmcrypt 2.2.x only)
MCRYPT_SERPENT_192 (libmcrypt 2.2.x only)
MCRYPT_SERPENT_256 (libmcrypt 2.2.x only)
MCRYPT_SKIPJACK (libmcrypt > 2.4.x only)
MCRYPT_TEAN (libmcrypt 2.2.x only)
MCRYPT_THREEWAY
MCRYPT_TRIPLEDES (libmcrypt > 2.4.x only)
MCRYPT_TWOFISH (for older mcrypt 2.x versions, or mcrypt > 2.4.x )
MCRYPT_TWOFISH128 (TWOFISHxxx are available in newer 2.x versions, but not in the 2.4.x versions)
MCRYPT_TWOFISH192
MCRYPT_TWOFISH256
MCRYPT_WAKE (libmcrypt > 2.4.x only)
MCRYPT_XTEA (libmcrypt > 2.4.x only)</blockquote>
其中PKCS5填充PHP就不支持，<a href="http://www.php.net/manual/zh/ref.mcrypt.php#69782" target="_blank">这里有个实现方法 http://www.php.net/manual/zh/ref.mcrypt.php#69782</a>
C#版本的算法默认一搜索一大堆 ，这里就不再贴了。
PHP相关的代码 <a href="http://gitcafe.com/ihipop/PHP_DES_Collection" target="_blank">可以看我的这个Gitcafe</a>]]></description>
			<content:encoded><![CDATA[<p>搜索DES加密 不一致 好像能搜索到很多。<br />
差异一般产生在加密方式，而且是你没指定的加密方式，或者zeroIV初始向量，填充模式等等，你不指定，各个程序和库处理的方式就会不一样，这就是产生差异的原因。<br />
以PHP的mcrypt_cbc函数为例</p>
<blockquote><p>string mcrypt_cbc ( string $cipher , string $key , string $data , int $mode [, string $iv ] )</p></blockquote>
<p>cbc是工作模式，DES一共有电子密码本模式（ECB）、加密分组链接模式（CBC）、加密反馈模式（CFB）和输出反馈模式（OFB）四种模式，<br />
在使用 CFB 及 OFB 二种模式时，必须要向量初始化 (Initialization vector, IV)，CBC 模式也可以使用向量初始化。向量初始化的值在加解密时必须是独一无二的，同时也要保持相同。当加密后的资料输出时，也可同时输出密码钥匙 (例如存在文件中)；或者也可以将向量初始化的值与加密后的资料一起输出。</p>
<p><a href="http://php.net/manual/en/mcrypt.ciphers.php" target="_blank">目前PHP支持的cipher有</a></p>
<blockquote><p>MCRYPT_3DES<br />
MCRYPT_ARCFOUR_IV (libmcrypt > 2.4.x only)<br />
MCRYPT_ARCFOUR (libmcrypt > 2.4.x only)<br />
MCRYPT_BLOWFISH<br />
MCRYPT_CAST_128<br />
MCRYPT_CAST_256<br />
MCRYPT_CRYPT<br />
MCRYPT_DES<br />
MCRYPT_DES_COMPAT (libmcrypt 2.2.x only)<br />
MCRYPT_ENIGMA (libmcrypt > 2.4.x only, alias for MCRYPT_CRYPT)<br />
MCRYPT_GOST<br />
MCRYPT_IDEA (non-free)<br />
MCRYPT_LOKI97 (libmcrypt > 2.4.x only)<br />
MCRYPT_MARS (libmcrypt > 2.4.x only, non-free)<br />
MCRYPT_PANAMA (libmcrypt > 2.4.x only)<br />
MCRYPT_RIJNDAEL_128 (libmcrypt > 2.4.x only)<br />
MCRYPT_RIJNDAEL_192 (libmcrypt > 2.4.x only)<br />
MCRYPT_RIJNDAEL_256 (libmcrypt > 2.4.x only)<br />
MCRYPT_RC2<br />
MCRYPT_RC4 (libmcrypt 2.2.x only)<br />
MCRYPT_RC6 (libmcrypt > 2.4.x only)<br />
MCRYPT_RC6_128 (libmcrypt 2.2.x only)<br />
MCRYPT_RC6_192 (libmcrypt 2.2.x only)<br />
MCRYPT_RC6_256 (libmcrypt 2.2.x only)<br />
MCRYPT_SAFER64<br />
MCRYPT_SAFER128<br />
MCRYPT_SAFERPLUS (libmcrypt > 2.4.x only)<br />
MCRYPT_SERPENT(libmcrypt > 2.4.x only)<br />
MCRYPT_SERPENT_128 (libmcrypt 2.2.x only)<br />
MCRYPT_SERPENT_192 (libmcrypt 2.2.x only)<br />
MCRYPT_SERPENT_256 (libmcrypt 2.2.x only)<br />
MCRYPT_SKIPJACK (libmcrypt > 2.4.x only)<br />
MCRYPT_TEAN (libmcrypt 2.2.x only)<br />
MCRYPT_THREEWAY<br />
MCRYPT_TRIPLEDES (libmcrypt > 2.4.x only)<br />
MCRYPT_TWOFISH (for older mcrypt 2.x versions, or mcrypt > 2.4.x )<br />
MCRYPT_TWOFISH128 (TWOFISHxxx are available in newer 2.x versions, but not in the 2.4.x versions)<br />
MCRYPT_TWOFISH192<br />
MCRYPT_TWOFISH256<br />
MCRYPT_WAKE (libmcrypt > 2.4.x only)<br />
MCRYPT_XTEA (libmcrypt > 2.4.x only)</p></blockquote>
<p>其中PKCS5填充PHP就不支持，<a href="http://www.php.net/manual/zh/ref.mcrypt.php#69782" target="_blank">这里有个实现方法 http://www.php.net/manual/zh/ref.mcrypt.php#69782</a><br />
C#版本的算法默认一搜索一大堆 ，这里就不再贴了。<br />
PHP相关的代码 <a href="http://gitcafe.com/ihipop/PHP_DES_Collection" target="_blank">可以看我的这个Gitcafe</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ihipop.info/2012/04/3160.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I-GNOKII 我的gnokii分支</title>
		<link>http://ihipop.info/2012/04/3147.html</link>
		<comments>http://ihipop.info/2012/04/3147.html#comments</comments>
		<pubDate>Sat, 21 Apr 2012 08:10:17 +0000</pubDate>
		<dc:creator>ihipop</dc:creator>
				<category><![CDATA[MyOriginal]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[gnokii]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[乱码]]></category>
		<category><![CDATA[短信猫]]></category>

		<guid isPermaLink="false">http://ihipop.info/?p=3147</guid>
		<description><![CDATA[debian squeeze里面的GNOKII是0.6.29的。其中的mysql.c 在处理的时候没有考虑到多字符集的问题。
这样发短信下来中文字符都是乱码（中文文字是?,但是命令发短信行正确。）。
之前虽然有个patch 在 mysql_init (&#38;mysqlIn);后面增加了 mysql_options(&#38;mysqlIn,MYSQL_SET_CHARSET_NAME,"utf8"); 硬编码了链接编码（&#38;mysqlOut）。虽然能解决问题。但是方法很dirty
通过阅读最新的0.6.31，的mysql.c 发现代码中增加了处理编码的部分。
但是我在测试的时候 0.6.31一直没法正常更新processed字段。总是update field failed。而且貌似问题很多
0.6.31 版本的 mysql.c修改比较大，debug比较花时间，就反其道行之，花了一点时间，对GNOKII 0.6.30做了一点修改。把0.6.31的-e选项backport到0.6.30稳定版。
现在我的0.6.30分支在可以使用-e指定mysql字符集。这样只要locale正确，基本上使用smsd发短信中文就不会有乱码（?号）了
项目地址 <a href="http://gitcafe.com/ihipop/I-GNOKII" target="_blank">http://gitcafe.com/ihipop/I-GNOKII</a> 代码稍后会全部填充进去 包括一个守护进程和logwarning
编译指南
<blockquote>sudo apt-get install libglib2.0-dev intltool pkg-config libmysqlclient-dev libpq-dev libsqlite3-dev libusb-dev libical-dev libreadline-dev libpcsclite-dev</blockquote>
<blockquote>smsd --help
smsd - version 1.4.5-p1 from gnokii 0.6.30
Copyright Jan Derfinak

Usage: smsd [options]
-u, --user db_username OR action if -m file
-p, --password db_password
-d, --db db_name
-c, --host db_hostname OR spool directory if -m file
-s, --schema db_schema
<span style="color: #993300;">-e, --encoding client_encoding</span>(Patched by ihipop@gmail.com 2012-04-18)
-m, --module db_module (pq, mysql, sqlite, file)
-l, --libdir path_to_db_module
-f, --logfile file
-t, --phone phone_number
-i, --interval polling_interval_for_incoming_sms's_in_seconds
-S, --maxsms number_of_sms's (only in dumb mode)
-b, --inbox memoryType
-0, --firstpos0
-v, --version
-h, --help</blockquote>]]></description>
			<content:encoded><![CDATA[<p>debian squeeze里面的GNOKII是0.6.29的。其中的mysql.c 在处理的时候没有考虑到多字符集的问题。<br />
这样发短信下来中文字符都是乱码（中文文字是?,但是命令发短信行正确。）。<br />
之前虽然有个patch 在 mysql_init (&amp;mysqlIn);后面增加了 mysql_options(&amp;mysqlIn,MYSQL_SET_CHARSET_NAME,"utf8"); 硬编码了链接编码（&amp;mysqlOut）。虽然能解决问题。但是方法很dirty<br />
通过阅读最新的0.6.31，的mysql.c 发现代码中增加了处理编码的部分。<br />
但是我在测试的时候 0.6.31一直没法正常更新processed字段。总是update field failed。而且貌似问题很多<br />
0.6.31 版本的 mysql.c修改比较大，debug比较花时间，就反其道行之，花了一点时间，对GNOKII 0.6.30做了一点修改。把0.6.31的-e选项backport到0.6.30稳定版。<br />
现在我的0.6.30分支在可以使用-e指定mysql字符集。这样只要locale正确，基本上使用smsd发短信中文就不会有乱码（?号）了<br />
项目地址 <a href="http://gitcafe.com/ihipop/I-GNOKII" target="_blank">http://gitcafe.com/ihipop/I-GNOKII</a> 代码稍后会全部填充进去 包括一个守护进程和logwarning<br />
编译指南</p>
<blockquote><p>sudo apt-get install libglib2.0-dev intltool pkg-config libmysqlclient-dev libpq-dev libsqlite3-dev libusb-dev libical-dev libreadline-dev libpcsclite-dev</p></blockquote>
<blockquote><p>smsd --help<br />
smsd - version 1.4.5-p1 from gnokii 0.6.30<br />
Copyright Jan Derfinak</p>
<p>Usage: smsd [options]<br />
-u, --user db_username OR action if -m file<br />
-p, --password db_password<br />
-d, --db db_name<br />
-c, --host db_hostname OR spool directory if -m file<br />
-s, --schema db_schema<br />
<span style="color: #993300;">-e, --encoding client_encoding</span>(Patched by ihipop@gmail.com 2012-04-18)<br />
-m, --module db_module (pq, mysql, sqlite, file)<br />
-l, --libdir path_to_db_module<br />
-f, --logfile file<br />
-t, --phone phone_number<br />
-i, --interval polling_interval_for_incoming_sms's_in_seconds<br />
-S, --maxsms number_of_sms's (only in dumb mode)<br />
-b, --inbox memoryType<br />
-0, --firstpos0<br />
-v, --version<br />
-h, --help</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ihipop.info/2012/04/3147.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP中的POSIX字符正则类</title>
		<link>http://ihipop.info/2012/04/3136.html</link>
		<comments>http://ihipop.info/2012/04/3136.html#comments</comments>
		<pubDate>Sat, 14 Apr 2012 06:18:48 +0000</pubDate>
		<dc:creator>ihipop</dc:creator>
				<category><![CDATA[MyOriginal]]></category>
		<category><![CDATA[PHP Note]]></category>
		<category><![CDATA[Posix]]></category>
		<category><![CDATA[标点符号]]></category>
		<category><![CDATA[正则表达式]]></category>

		<guid isPermaLink="false">http://ihipop.info/?p=3136</guid>
		<description><![CDATA[[:alnum:]：文字数字字符

[:alpha:]：文字字符

[:digit:]：数字字符

[:graph:]：非空字符（非空格、控制字符）

[:lower:]：小写字符

[:cntrl:]：控制字符

[:print:]：非空字符（包括空格）

[:punct:]：标点符号

[:space:]：所有空白字符（新行，空格，制表符）

[:upper:]：大写字符

[:xdigit:]：十六进制数字（0-9，a-f，A-F）

在使用的时候，记得外面还要套上一对子中括号[]

例如
<blockquote>preg_replace('/[[:punct:]]/i','',$message);</blockquote>]]></description>
			<content:encoded><![CDATA[<p>[:alnum:]：文字数字字符</p>
<p>[:alpha:]：文字字符</p>
<p>[:digit:]：数字字符</p>
<p>[:graph:]：非空字符（非空格、控制字符）</p>
<p>[:lower:]：小写字符</p>
<p>[:cntrl:]：控制字符</p>
<p>[:print:]：非空字符（包括空格）</p>
<p>[:punct:]：标点符号</p>
<p>[:space:]：所有空白字符（新行，空格，制表符）</p>
<p>[:upper:]：大写字符</p>
<p>[:xdigit:]：十六进制数字（0-9，a-f，A-F）</p>
<p>在使用的时候，记得外面还要套上一对子中括号[]</p>
<p>例如</p>
<blockquote><p>preg_replace('/[[:punct:]]/i','',$message);</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ihipop.info/2012/04/3136.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DiscuzX的Debug工具function_debug.php</title>
		<link>http://ihipop.info/2012/04/3127.html</link>
		<comments>http://ihipop.info/2012/04/3127.html#comments</comments>
		<pubDate>Thu, 05 Apr 2012 08:04:18 +0000</pubDate>
		<dc:creator>ihipop</dc:creator>
				<category><![CDATA[Business On Web]]></category>
		<category><![CDATA[Discuz Tech]]></category>
		<category><![CDATA[MyOriginal]]></category>
		<category><![CDATA[discuz]]></category>
		<category><![CDATA[function_debug]]></category>
		<category><![CDATA[调试]]></category>

		<guid isPermaLink="false">http://ihipop.info/?p=3127</guid>
		<description><![CDATA[康盛自己写了一个debug函数集，大概作用如图

<a href="http://ihipop.info/wp-content/uploads/2012/04/141301pzd7zrvzzipz8d99.png"><img class="alignnone size-full wp-image-3128" title="141301pzd7zrvzzipz8d99" src="http://ihipop.info/wp-content/uploads/2012/04/141301pzd7zrvzzipz8d99.png" alt="" width="1023" height="459" /></a>
配置文件里面启用

<blockquote>$_config['debug'] = 'debug';</blockquote>
即可。这里的debug不是唯一的，可以的定义。


<blockquote>   n = 1，debug 标准模式
   n = 2，debug E_ALL模式
   n = 字串，当前 $_GET、$_POST 等 REQUEST 参数中包含 debug=字串 时显示
   </blockquote>

debug文件下载<a href=" http://www.discuz.net/thread-2674451-1-1.html" target="_blank"> http://www.discuz.net/thread-2674451-1-1.html 放到 source/function目录即可
</a>
<img src="http://att.discuz.net/data/attachment/forum/201203/08/18182235sno336oagqaioo.jpg" alt="" width="1181" height="721" />]]></description>
			<content:encoded><![CDATA[<p>康盛自己写了一个debug函数集，大概作用如图</p>
<p><a href="http://ihipop.info/wp-content/uploads/2012/04/141301pzd7zrvzzipz8d99.png" rel="shadowbox[sbpost-3127];player=img;"><img class="alignnone size-full wp-image-3128" title="141301pzd7zrvzzipz8d99" src="http://ihipop.info/wp-content/uploads/2012/04/141301pzd7zrvzzipz8d99.png" alt="" width="1023" height="459" /></a><br />
配置文件里面启用</p>
<blockquote><p>$_config['debug'] = 'debug';</p></blockquote>
<p>即可。这里的debug不是唯一的，可以的定义。</p>
<blockquote><p>   n = 1，debug 标准模式<br />
   n = 2，debug E_ALL模式<br />
   n = 字串，当前 $_GET、$_POST 等 REQUEST 参数中包含 debug=字串 时显示
   </p></blockquote>
<p>debug文件下载<a href=" http://www.discuz.net/thread-2674451-1-1.html" target="_blank"> http://www.discuz.net/thread-2674451-1-1.html 放到 source/function目录即可<br />
</a><br />
<img src="http://att.discuz.net/data/attachment/forum/201203/08/18182235sno336oagqaioo.jpg" alt="" width="1181" height="721" /></p>
]]></content:encoded>
			<wfw:commentRss>http://ihipop.info/2012/04/3127.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一些关于DiscuzX自己js框架的小笔记</title>
		<link>http://ihipop.info/2012/04/3116.html</link>
		<comments>http://ihipop.info/2012/04/3116.html#comments</comments>
		<pubDate>Thu, 05 Apr 2012 03:01:50 +0000</pubDate>
		<dc:creator>ihipop</dc:creator>
				<category><![CDATA[Business On Web]]></category>
		<category><![CDATA[Discuz Tech]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[MyOriginal]]></category>
		<category><![CDATA[DiscuzX]]></category>
		<category><![CDATA[noConflict]]></category>
		<category><![CDATA[_attachEvent]]></category>
		<category><![CDATA[事件]]></category>
		<category><![CDATA[兼容写法]]></category>

		<guid isPermaLink="false">http://ihipop.info/?p=3116</guid>
		<description><![CDATA[<ol>
<ol>
	<li><b>内置的ID选择器</b>
可以使用$('id'),只能简单代替document.getElementById('id')，木有jQuery的$那么全能，所以你在DiscuzX里面如果一定jQuery的话，记得加上<em>jQuery</em>.<em>noConflict</em>() / $.noConflict();，或者用个别名也可以，比如
<code>var j = jQuery.noConflict();，</code>
如果一定是喜欢使用jQuery的$,或者想以后代码可以被无痛拷贝到其他没有$冲突的环境，可以这样做
Reverts the $ alias and then creates and executes a function to provide the $ as a jQuery alias inside the functions scope. Inside the function the original $ object is not available. This works well for most plugins that don't rely on any other library.[javascript]jQuery.noConflict();
(function($) {
  $(function() {
    // more code using $ as alias to jQuery
  });
})(jQuery);
// other code using $ as an alias to the other library[/javascript]</li>
	<li><b>内置的事件监听器的简单包装</b>
我们知道由于addEventListener(firefox,顺序执行)和attachEvent(IE,逆序执行)的存在，discuz对这个东西做了一段简单的包装。统一使用_attachEvent来添加。当然也包装了对应的_detachEvent。
[javascript]function _attachEvent(obj, evt, func, eventobj) {
	eventobj = !eventobj ? obj : eventobj;
	if(obj.addEventListener) {
		obj.addEventListener(evt, func, false);
	} else if(eventobj.attachEvent) {
		obj.attachEvent('on' + evt, func);
	}
}

function _detachEvent(obj, evt, func, eventobj) {
	eventobj = !eventobj ? obj : eventobj;
	if(obj.removeEventListener) {
		obj.removeEventListener(evt, func, false);
	} else if(eventobj.detachEvent) {
		obj.detachEvent('on' + evt, func);
	}
}
[/javascript]


比如下面的天气预报延迟加载代码,页面onload完成后，再过3s，加载江阴的天气信息。这个一看就明白了，不多说
[html]&#60;!--异步载入天气 Start by ihipop @ 2012/3/27 20:46--&#62;
&#60;span id=&#34;_w_loading&#34; style=&#34;display: inline; float: right; margin-right: 5px; color: #c4312a;&#34;&#62;天气信息载入中...:)&#60;/span&#62;
&#60;div style=&#34;display: inline; float: right; margin-top: 7px; background-color: transparent;&#34;&#62;&#60;iframe id=&#34;_w_content&#34; style=&#34;display: none;&#34; src=&#34;&#34; frameborder=&#34;0&#34; marginwidth=&#34;0&#34; marginheight=&#34;0&#34; scrolling=&#34;no&#34; width=&#34;160&#34; height=&#34;20&#34;&#62;&#60;/iframe&#62;&#60;/div&#62;

&#60;script type=&#34;text/javascript&#34;&#62;// &#60;![CDATA[
_attachEvent(window, 'load', function(){
setTimeout(function(){
var _w_src='http://m.weather.com.cn/m/pn4/weather.htm?id=101190202T';
$('_w_loading').style.display='none';
$('_w_content').style.display='inline';
$('_w_content').src=_w_src;
},3000);}, document);
// ]]&#62;&#60;/script&#62;
&#60;!--异步载入天气 Stop by ihipop @ 2012/3/27 20:46--&#62;[/html]</li>
	<li><b>浏览器识别</b></li>
</ol>
</ol>
开发者可以使用
<blockquote>if (BROWSER.firefox){
}</blockquote>
这样的逻辑来判断使用的什么浏览器及其版本。BROWSER.firefox返回的直接就是浏览器的版本号。如果在firefox里面alert(BROWSER.chrome),得到的是0，也就是不是firefox浏览器]]></description>
			<content:encoded><![CDATA[<ol>
<ol>
<li><b>内置的ID选择器</b><br />
可以使用$('id'),只能简单代替document.getElementById('id')，木有jQuery的$那么全能，所以你在DiscuzX里面如果一定jQuery的话，记得加上<em>jQuery</em>.<em>noConflict</em>() / $.noConflict();，或者用个别名也可以，比如<br />
<code>var j = jQuery.noConflict();，</code><br />
如果一定是喜欢使用jQuery的$,或者想以后代码可以被无痛拷贝到其他没有$冲突的环境，可以这样做<br />
Reverts the $ alias and then creates and executes a function to provide the $ as a jQuery alias inside the functions scope. Inside the function the original $ object is not available. This works well for most plugins that don't rely on any other library.
<pre class="brush: jscript; title: ; notranslate">jQuery.noConflict();
(function($) {
  $(function() {
    // more code using $ as alias to jQuery
  });
})(jQuery);
// other code using $ as an alias to the other library</pre>
</li>
<li><b>内置的事件监听器的简单包装</b><br />
我们知道由于addEventListener(firefox,顺序执行)和attachEvent(IE,逆序执行)的存在，discuz对这个东西做了一段简单的包装。统一使用_attachEvent来添加。当然也包装了对应的_detachEvent。</p>
<pre class="brush: jscript; title: ; notranslate">function _attachEvent(obj, evt, func, eventobj) {
	eventobj = !eventobj ? obj : eventobj;
	if(obj.addEventListener) {
		obj.addEventListener(evt, func, false);
	} else if(eventobj.attachEvent) {
		obj.attachEvent('on' + evt, func);
	}
}

function _detachEvent(obj, evt, func, eventobj) {
	eventobj = !eventobj ? obj : eventobj;
	if(obj.removeEventListener) {
		obj.removeEventListener(evt, func, false);
	} else if(eventobj.detachEvent) {
		obj.detachEvent('on' + evt, func);
	}
}
</pre>
<p>比如下面的天气预报延迟加载代码,页面onload完成后，再过3s，加载江阴的天气信息。这个一看就明白了，不多说</p>
<pre class="brush: xml; title: ; notranslate">&lt;!--异步载入天气 Start by ihipop @ 2012/3/27 20:46--&gt;
&lt;span id=&quot;_w_loading&quot; style=&quot;display: inline; float: right; margin-right: 5px; color: #c4312a;&quot;&gt;天气信息载入中...:)&lt;/span&gt;
&lt;div style=&quot;display: inline; float: right; margin-top: 7px; background-color: transparent;&quot;&gt;&lt;iframe id=&quot;_w_content&quot; style=&quot;display: none;&quot; src=&quot;&quot; frameborder=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot; width=&quot;160&quot; height=&quot;20&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;

&lt;script type=&quot;text/javascript&quot;&gt;// &lt;![CDATA[
_attachEvent(window, 'load', function(){
setTimeout(function(){
var _w_src='http://m.weather.com.cn/m/pn4/weather.htm?id=101190202T';
$('_w_loading').style.display='none';
$('_w_content').style.display='inline';
$('_w_content').src=_w_src;
},3000);}, document);
// ]]&gt;&lt;/script&gt;
&lt;!--异步载入天气 Stop by ihipop @ 2012/3/27 20:46--&gt;</pre>
</li>
<li><b>浏览器识别</b></li>
</ol>
</ol>
<p>开发者可以使用</p>
<blockquote><p>if (BROWSER.firefox){<br />
}</p></blockquote>
<p>这样的逻辑来判断使用的什么浏览器及其版本。BROWSER.firefox返回的直接就是浏览器的版本号。如果在firefox里面alert(BROWSER.chrome),得到的是0，也就是不是firefox浏览器</p>
]]></content:encoded>
			<wfw:commentRss>http://ihipop.info/2012/04/3116.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy APT Pinning （Mixed System） on Debian</title>
		<link>http://ihipop.info/2012/03/3111.html</link>
		<comments>http://ihipop.info/2012/03/3111.html#comments</comments>
		<pubDate>Wed, 28 Mar 2012 05:52:55 +0000</pubDate>
		<dc:creator>ihipop</dc:creator>
				<category><![CDATA[Debian/Ubuntu]]></category>
		<category><![CDATA[Linux Manger]]></category>
		<category><![CDATA[MyOriginal]]></category>
		<category><![CDATA[APT Pinning]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[sid]]></category>
		<category><![CDATA[stable]]></category>

		<guid isPermaLink="false">http://ihipop.info/?p=3111</guid>
		<description><![CDATA[基本系统使用spueeze。Pinning的目标是要实现在stable频道安装/降级/升级sid频道的软件包，
首先在source.list.d启用SID源。
[bash]echo 'deb http://mirrors.163.com/debian sid main non-free contrib' >/etc/apt/sources.list.d/sid.list
apt-get update[/bash]


<blockquote> apt-cache policy adduser
adduser:
  已安装：  3.112+nmu2
  候选软件包：3.113+nmu1
  版本列表：
     3.113+nmu1 0
        500 http://mirrors.163.com/debian/ sid/main i386 Packages
 *** 3.112+nmu2 0
        500 http://mirrors.163.com/debian/ squeeze/main i386 Packages
        100 /var/lib/dpkg/status
        </blockquote>
这个时候如果apt-get upgrade，apt-get会按照软件包的版本优先原则，升级可升级软件包，比如，adduser，到3.113+nmu1的 SID频道。
这里我们先升级到SID好了。


<blockquote>apt-cache policy adduser
adduser:
  已安装：  3.113+nmu1
  候选软件包：3.113+nmu1
  版本列表：
 *** 3.113+nmu1 0
        500 http://mirrors.163.com/debian/ sid/main i386 Packages
        100 /var/lib/dpkg/status
     3.112+nmu2 0
        500 http://mirrors.163.com/debian/ squeeze/main i386 Packages</blockquote>
下面设置APT Pinning 把 SID频道的软件包的优先级降低到正常优先级的500以下即可
<strong>/etc/apt/preferences</strong>
<blockquote>Package: *
Pin: release a=unstable
Pin-Priority: 400</blockquote>
看apt策略
<blockquote> apt-cache policy adduser          
adduser:
  已安装：  3.113+nmu1
  候选软件包：3.113+nmu1
  版本列表：
 *** 3.113+nmu1 0
        400 http://mirrors.163.com/debian/ sid/main i386 Packages
        100 /var/lib/dpkg/status
     3.112+nmu2 0
        500 http://mirrors.163.com/debian/ squeeze/main i386 Packages</blockquote>
SID频道的优先级已经到400了。然后我们进行软件包降级


<blockquote>apt-get install adduser/unstable
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
为 adduser 选定了版本 3.113+nmu1 (Debian:unstable [all])
adduser 已经是最新的版本了。
升级了 0 个软件包，新安装了 0 个软件包，要卸载 0 个软件包，有 4 个软件包未被升级。
(debian_chroot)HX11:/# apt-get install adduser/stable
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
为 adduser 选定了版本 3.112+nmu2 (Debian:6.0.4/stable [all])
下列软件包将被【降级】：
  adduser
升级了 0 个软件包，新安装了 0 个软件包，降级了 1 个软件包，要卸载 0 个软件包，有 4 个软件包未被升级。
需要下载 0 B/250 kB 的软件包。
解压缩后会消耗掉 199 kB 的额外空间。
您希望继续执行吗？[Y/n]y
dpkg-preconfigure: 重新开启标准输入失败：
dpkg：警告：即将把 adduser 从 3.113+nmu1 降级到 3.112+nmu2。
(正在读取数据库 ... 系统当前共安装有 24048 个文件和目录。)
正预备替换 adduser 3.113+nmu1 (使用 .../adduser_3.112+nmu2_all.deb) ...
正在解压缩将用于更替的包文件 adduser ...
正在处理用于 man-db 的触发器...
正在设置 adduser (3.112+nmu2) ...
正在安装新版本的配置文件 /etc/deluser.conf ...</blockquote>

Done。

顺便把Debian的Wiki翻译了一部分 <a href="http://wiki.debian.org/zh_CN/AptPreferences" target="_blank">http://wiki.debian.org/zh_CN/AptPreferences</a>]]></description>
			<content:encoded><![CDATA[<p>基本系统使用spueeze。Pinning的目标是要实现在stable频道安装/降级/升级sid频道的软件包，<br />
首先在source.list.d启用SID源。</p>
<pre class="brush: bash; title: ; notranslate">echo 'deb http://mirrors.163.com/debian sid main non-free contrib' &gt;/etc/apt/sources.list.d/sid.list
apt-get update</pre>
<blockquote><p> apt-cache policy adduser<br />
adduser:<br />
  已安装：  3.112+nmu2<br />
  候选软件包：3.113+nmu1<br />
  版本列表：<br />
     3.113+nmu1 0<br />
        500 http://mirrors.163.com/debian/ sid/main i386 Packages<br />
 *** 3.112+nmu2 0<br />
        500 http://mirrors.163.com/debian/ squeeze/main i386 Packages<br />
        100 /var/lib/dpkg/status
        </p></blockquote>
<p>这个时候如果apt-get upgrade，apt-get会按照软件包的版本优先原则，升级可升级软件包，比如，adduser，到3.113+nmu1的 SID频道。<br />
这里我们先升级到SID好了。</p>
<blockquote><p>apt-cache policy adduser<br />
adduser:<br />
  已安装：  3.113+nmu1<br />
  候选软件包：3.113+nmu1<br />
  版本列表：<br />
 *** 3.113+nmu1 0<br />
        500 http://mirrors.163.com/debian/ sid/main i386 Packages<br />
        100 /var/lib/dpkg/status<br />
     3.112+nmu2 0<br />
        500 http://mirrors.163.com/debian/ squeeze/main i386 Packages</p></blockquote>
<p>下面设置APT Pinning 把 SID频道的软件包的优先级降低到正常优先级的500以下即可<br />
<strong>/etc/apt/preferences</strong></p>
<blockquote><p>Package: *<br />
Pin: release a=unstable<br />
Pin-Priority: 400</p></blockquote>
<p>看apt策略</p>
<blockquote><p> apt-cache policy adduser<br />
adduser:<br />
  已安装：  3.113+nmu1<br />
  候选软件包：3.113+nmu1<br />
  版本列表：<br />
 *** 3.113+nmu1 0<br />
        400 http://mirrors.163.com/debian/ sid/main i386 Packages<br />
        100 /var/lib/dpkg/status<br />
     3.112+nmu2 0<br />
        500 http://mirrors.163.com/debian/ squeeze/main i386 Packages</p></blockquote>
<p>SID频道的优先级已经到400了。然后我们进行软件包降级</p>
<blockquote><p>apt-get install adduser/unstable<br />
正在读取软件包列表... 完成<br />
正在分析软件包的依赖关系树<br />
正在读取状态信息... 完成<br />
为 adduser 选定了版本 3.113+nmu1 (Debian:unstable [all])<br />
adduser 已经是最新的版本了。<br />
升级了 0 个软件包，新安装了 0 个软件包，要卸载 0 个软件包，有 4 个软件包未被升级。<br />
(debian_chroot)HX11:/# apt-get install adduser/stable<br />
正在读取软件包列表... 完成<br />
正在分析软件包的依赖关系树<br />
正在读取状态信息... 完成<br />
为 adduser 选定了版本 3.112+nmu2 (Debian:6.0.4/stable [all])<br />
下列软件包将被【降级】：<br />
  adduser<br />
升级了 0 个软件包，新安装了 0 个软件包，降级了 1 个软件包，要卸载 0 个软件包，有 4 个软件包未被升级。<br />
需要下载 0 B/250 kB 的软件包。<br />
解压缩后会消耗掉 199 kB 的额外空间。<br />
您希望继续执行吗？[Y/n]y<br />
dpkg-preconfigure: 重新开启标准输入失败：<br />
dpkg：警告：即将把 adduser 从 3.113+nmu1 降级到 3.112+nmu2。<br />
(正在读取数据库 ... 系统当前共安装有 24048 个文件和目录。)<br />
正预备替换 adduser 3.113+nmu1 (使用 .../adduser_3.112+nmu2_all.deb) ...<br />
正在解压缩将用于更替的包文件 adduser ...<br />
正在处理用于 man-db 的触发器...<br />
正在设置 adduser (3.112+nmu2) ...<br />
正在安装新版本的配置文件 /etc/deluser.conf ...</p></blockquote>
<p>Done。</p>
<p>顺便把Debian的Wiki翻译了一部分 <a href="http://wiki.debian.org/zh_CN/AptPreferences" target="_blank">http://wiki.debian.org/zh_CN/AptPreferences</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ihipop.info/2012/03/3111.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DiscuzX2中相对DiscuzX1.5在插件嵌入点上的一些变化</title>
		<link>http://ihipop.info/2012/03/3081.html</link>
		<comments>http://ihipop.info/2012/03/3081.html#comments</comments>
		<pubDate>Wed, 14 Mar 2012 08:47:22 +0000</pubDate>
		<dc:creator>ihipop</dc:creator>
				<category><![CDATA[Discuz Tech]]></category>
		<category><![CDATA[MyOriginal]]></category>
		<category><![CDATA[PHP Note]]></category>
		<category><![CDATA[DiscuzX]]></category>
		<category><![CDATA[home]]></category>
		<category><![CDATA[家园]]></category>
		<category><![CDATA[嵌入点]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://ihipop.info/?p=3081</guid>
		<description><![CDATA[<span style="font-size: xx-large;">1.<span style="font-size: x-large;">家园模块的嵌入点重构</span></span>

家园模块里面，还是不像其他模块使用。其他模块里面，可以使用
<blockquote>class plugin_identifier_CURSCRIPT {
function CURMODULE_USERDEFINE[_output]() {}
}</blockquote>
来定义脚本嵌入点
CURMODULE 指明了此函数在哪个模块执行，可通过常量 CURMODULE 得到当前页面的 CURMODULE 值。 USERDEFINE 可自定义，比如我习惯用插件identifier来填充，如果函数名以“_output”结尾则会在模板输出前调用，否则会在模块执行前调用。 CURSCRIPT是嵌入点位于的脚本名，如 forum.php 为 forum。
<span style="color: #993300;">在X1.5里面，家园模块的嵌入点被重新格式化为</span>
<blockquote>function space&#124;spacecp_USERDEFINE[_output]() {}</blockquote>
<span style="color: #993300;">在X2里面，家园模块的嵌入点被重新格式化为</span>
<blockquote>function space&#124;spacecp_$_GET['ac']_USERDEFINE[_output]() {}</blockquote>
<span style="color: #993300;">因此带来的问题就是如果用户访问的时候没有带上ac参数，dz会显示默认页面。脚本也不执行。可以在common()之类的全局嵌入点里面修正这个偏差</span>（<span style="color: #800000;">X1.5没有common嵌入点，自己找替代品</span>）
<span style="font-size: xx-large;">2.</span><span style="font-size: x-large;">注册模块的嵌入点的变化。</span>
在X1.5，显示注册成功的方式有两个。如果开启注册ajax，可以使用showmessage的嵌入点来捕获到这个行为，如果没开启注册ajax，显示注册成功的页面是注册模板里面的js显示的。因而插件使用showmessage就不能捕获到这个行为。
这是很坑爹的。DZX1.5 注册成功的提示 不是完全是showmessage来显示的 ！！！！！。经过查阅代码和测试。X1.5上，在注册模块上，如果是inajax 可以使用 $message +$_G['uid']变量来判断是否注册成功，如果是不 inajax 可以使用$param+$_G['uid']变量来判断。 当然，如果你在之前的hook里面写了其他变量的话，也可以拿来这里判断 增加可靠性。
X2注意到了这个问题，完成了修复工作。在X2里面非inajaxd时候，你也可以使用
<blockquote>function register_cczu_sm_message($param) {}</blockquote>
这样的消息钩子来捕获showmessage显示的信息，从而来判断用户是否已经注册成功。
参数$param['param']是传递给showmessage的参数数组。$param['param'][0]就是没有被转转义的英文信息。比如查阅语言包得知 register_succeed和register_succeed_location都可能代表注册成功，那么我们可以这样判断用户注册成功的条件
<blockquote>stripos($param['param'][0], 'register_succeed') !== FALSE</blockquote>
然后执行相关动作。]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: xx-large;">1.<span style="font-size: x-large;">家园模块的嵌入点重构</span></span></p>
<p>家园模块里面，还是不像其他模块使用。其他模块里面，可以使用</p>
<blockquote><p>class plugin_identifier_CURSCRIPT {<br />
function CURMODULE_USERDEFINE[_output]() {}<br />
}</p></blockquote>
<p>来定义脚本嵌入点<br />
CURMODULE 指明了此函数在哪个模块执行，可通过常量 CURMODULE 得到当前页面的 CURMODULE 值。 USERDEFINE 可自定义，比如我习惯用插件identifier来填充，如果函数名以“_output”结尾则会在模板输出前调用，否则会在模块执行前调用。 CURSCRIPT是嵌入点位于的脚本名，如 forum.php 为 forum。<br />
<span style="color: #993300;">在X1.5里面，家园模块的嵌入点被重新格式化为</span></p>
<blockquote><p>function space|spacecp_USERDEFINE[_output]() {}</p></blockquote>
<p><span style="color: #993300;">在X2里面，家园模块的嵌入点被重新格式化为</span></p>
<blockquote><p>function space|spacecp_$_GET['ac']_USERDEFINE[_output]() {}</p></blockquote>
<p><span style="color: #993300;">因此带来的问题就是如果用户访问的时候没有带上ac参数，dz会显示默认页面。脚本也不执行。可以在common()之类的全局嵌入点里面修正这个偏差</span>（<span style="color: #800000;">X1.5没有common嵌入点，自己找替代品</span>）<br />
<span style="font-size: xx-large;">2.</span><span style="font-size: x-large;">注册模块的嵌入点的变化。</span><br />
在X1.5，显示注册成功的方式有两个。如果开启注册ajax，可以使用showmessage的嵌入点来捕获到这个行为，如果没开启注册ajax，显示注册成功的页面是注册模板里面的js显示的。因而插件使用showmessage就不能捕获到这个行为。<br />
这是很坑爹的。DZX1.5 注册成功的提示 不是完全是showmessage来显示的 ！！！！！。经过查阅代码和测试。X1.5上，在注册模块上，如果是inajax 可以使用 $message +$_G['uid']变量来判断是否注册成功，如果是不 inajax 可以使用$param+$_G['uid']变量来判断。 当然，如果你在之前的hook里面写了其他变量的话，也可以拿来这里判断 增加可靠性。<br />
X2注意到了这个问题，完成了修复工作。在X2里面非inajaxd时候，你也可以使用</p>
<blockquote><p>function register_cczu_sm_message($param) {}</p></blockquote>
<p>这样的消息钩子来捕获showmessage显示的信息，从而来判断用户是否已经注册成功。<br />
参数$param['param']是传递给showmessage的参数数组。$param['param'][0]就是没有被转转义的英文信息。比如查阅语言包得知 register_succeed和register_succeed_location都可能代表注册成功，那么我们可以这样判断用户注册成功的条件</p>
<blockquote><p>stripos($param['param'][0], 'register_succeed') !== FALSE</p></blockquote>
<p>然后执行相关动作。</p>
]]></content:encoded>
			<wfw:commentRss>http://ihipop.info/2012/03/3081.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用VirtualBox往portwell的X86板子里面灌系统</title>
		<link>http://ihipop.info/2012/03/3065.html</link>
		<comments>http://ihipop.info/2012/03/3065.html#comments</comments>
		<pubDate>Fri, 09 Mar 2012 14:19:30 +0000</pubDate>
		<dc:creator>ihipop</dc:creator>
				<category><![CDATA[Linux Manger]]></category>
		<category><![CDATA[MyOriginal]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[portwell]]></category>
		<category><![CDATA[SVA]]></category>
		<category><![CDATA[udev]]></category>
		<category><![CDATA[VistualBox]]></category>
		<category><![CDATA[换网卡]]></category>
		<category><![CDATA[物理磁盘]]></category>
		<category><![CDATA[瑞传]]></category>
		<category><![CDATA[缓存]]></category>

		<guid isPermaLink="false">http://ihipop.info/?p=3065</guid>
		<description><![CDATA[公司这块portwell的主板也不知道是啥型号的。只知道是当年SVA出品。壳子什么的还蛮精致的。当初也是SVA当废物清仓了的。
由于不支持从USB启动。所以必须在外面灌好系统后把硬盘再装回去。
当初本来想把笔记本硬盘拔掉然后装上这个小硬盘灌系统的。后来想想，VirtualBox就能完成任务。
VisrualBox可以把物理磁盘映射为虚拟磁盘。这样挂载到虚拟机里面就能装系统了。
不过这个映射功能没有提供图形界面，需要手工完成。
Windows和Linux下方法基本一样。不同的是Windwos使用 \\.\PhysicalDrive1这样来表示第二块硬盘。具体的数字可以在磁盘管理器里面看。
而Linux下的sdb设备可能要赋予当前所有者用户的读写权限(o+rw)
<blockquote>VBoxManage internalcommands createrawvmdk -filename f:/VMDK/PhysicalDrive1.vmdk -rawdisk \\.\PhysicalDrive1</blockquote>
如果提示RAW host disk access VMDK file f:/VMDK/PhysicalDrive1.vmdk created successfully.。表示映射建立成功
<span style="color: #800000;">映射的时候记得这个虚拟磁盘不要在宿主系统里面挂载，否则可能后面灌系统，格式化的的时候会失败。</span>
然后再在VirtualBox里面为虚拟机添加这个磁盘即可。
然后自己制定个DebianISO安装系统。安装完毕后可以简单配置一下，比如装下lrzsz,方便后面使用zmodem传东西（后面有大用处），配置好<a href="http://ihipop.info/?p=3061" target="_blank">serial console</a>
然后把硬盘插回去。接好serial线材，登录console，看看是否正常。
我这里就遇到一个问题。就是安装在虚拟机里面的系统，硬盘插入到这款板子上后发现不认网卡。e100驱动也已经安装。查看udev的日志，发现缺少一些firmware。使用
<blockquote>apt-get install firmware-linux* -d --print-uris</blockquote>（lenny需要启动lenny-backports,squeeze不需要）
得到内核驱动下载地址后，使用zmodem上传上去安装重启即可（那叫一个慢）
如果你重启后还是看不见网卡，删除udev的缓存
<blockquote>rm /etc/udev/rules.d/*-persistent-net.rules</blockquote>
即可。一般更换主板 网卡后eth后面的数字开始重新向上编号的话，也可以删除这里面的缓存来实现。
这款板子带液晶屏。明天上图上驱动。。。
<hr />
PS:推而广之，如使用能模拟CPU的虚拟系统产品(eg.QEMU)进行物理磁盘映射的话 也能给其他构架的板子灌系统了。
PPS:<a href="https://twitter.com/#!/yegle/statuses/96788921807151104" target="_blank">这个和阿里的那些个SA使用RAID1来灌系统相比 简直弱爆了</a>
<blockquote>我们的机器全部是RAID1，于是我安装一台raid1的机器，系统全部安装好，然后拔掉一个硬盘，插上一个新硬盘自动恢复镜像，基本10来分钟恢复好一个硬盘，插到机器上去。这样，还是比装系统来的快。当然啦，型号是一模一样的。。。 8:47 PM Jul 28th, 2011 via OpenVPN Retweeted by yegle
</blockquote>]]></description>
			<content:encoded><![CDATA[<p>公司这块portwell的主板也不知道是啥型号的。只知道是当年SVA出品。壳子什么的还蛮精致的。当初也是SVA当废物清仓了的。<br />
由于不支持从USB启动。所以必须在外面灌好系统后把硬盘再装回去。<br />
当初本来想把笔记本硬盘拔掉然后装上这个小硬盘灌系统的。后来想想，VirtualBox就能完成任务。<br />
VisrualBox可以把物理磁盘映射为虚拟磁盘。这样挂载到虚拟机里面就能装系统了。<br />
不过这个映射功能没有提供图形界面，需要手工完成。<br />
Windows和Linux下方法基本一样。不同的是Windwos使用 \\.\PhysicalDrive1这样来表示第二块硬盘。具体的数字可以在磁盘管理器里面看。<br />
而Linux下的sdb设备可能要赋予当前所有者用户的读写权限(o+rw)</p>
<blockquote><p>VBoxManage internalcommands createrawvmdk -filename f:/VMDK/PhysicalDrive1.vmdk -rawdisk \\.\PhysicalDrive1</p></blockquote>
<p>如果提示RAW host disk access VMDK file f:/VMDK/PhysicalDrive1.vmdk created successfully.。表示映射建立成功<br />
<span style="color: #800000;">映射的时候记得这个虚拟磁盘不要在宿主系统里面挂载，否则可能后面灌系统，格式化的的时候会失败。</span><br />
然后再在VirtualBox里面为虚拟机添加这个磁盘即可。<br />
然后自己制定个DebianISO安装系统。安装完毕后可以简单配置一下，比如装下lrzsz,方便后面使用zmodem传东西（后面有大用处），配置好<a href="http://ihipop.info/?p=3061" target="_blank">serial console</a><br />
然后把硬盘插回去。接好serial线材，登录console，看看是否正常。<br />
我这里就遇到一个问题。就是安装在虚拟机里面的系统，硬盘插入到这款板子上后发现不认网卡。e100驱动也已经安装。查看udev的日志，发现缺少一些firmware。使用</p>
<blockquote><p>apt-get install firmware-linux* -d --print-uris</p></blockquote>
<p>（lenny需要启动lenny-backports,squeeze不需要）<br />
得到内核驱动下载地址后，使用zmodem上传上去安装重启即可（那叫一个慢）<br />
如果你重启后还是看不见网卡，删除udev的缓存</p>
<blockquote><p>rm /etc/udev/rules.d/*-persistent-net.rules</p></blockquote>
<p>即可。一般更换主板 网卡后eth后面的数字开始重新向上编号的话，也可以删除这里面的缓存来实现。<br />
这款板子带液晶屏。明天上图上驱动。。。</p>
<hr />
PS:推而广之，如使用能模拟CPU的虚拟系统产品(eg.QEMU)进行物理磁盘映射的话 也能给其他构架的板子灌系统了。<br />
PPS:<a href="https://twitter.com/#!/yegle/statuses/96788921807151104" target="_blank">这个和阿里的那些个SA使用RAID1来灌系统相比 简直弱爆了</a></p>
<blockquote><p>我们的机器全部是RAID1，于是我安装一台raid1的机器，系统全部安装好，然后拔掉一个硬盘，插上一个新硬盘自动恢复镜像，基本10来分钟恢复好一个硬盘，插到机器上去。这样，还是比装系统来的快。当然啦，型号是一模一样的。。。 8:47 PM Jul 28th, 2011 via OpenVPN Retweeted by yegle
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ihipop.info/2012/03/3065.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting DHCP HostName In Debian &amp;&amp; CentOS</title>
		<link>http://ihipop.info/2012/03/3058.html</link>
		<comments>http://ihipop.info/2012/03/3058.html#comments</comments>
		<pubDate>Fri, 09 Mar 2012 12:29:22 +0000</pubDate>
		<dc:creator>ihipop</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Debian/Ubuntu]]></category>
		<category><![CDATA[Linux Manger]]></category>
		<category><![CDATA[Network Manger]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[hostname]]></category>

		<guid isPermaLink="false">http://ihipop.info/?p=3058</guid>
		<description><![CDATA[In CentOS, Just add 


<blockquote>DHCP_HOSTNAME=foobar</blockquote>

in /etc/sysconfig/network-scripts/ifcfg-[devname]

In Debian Just Define "hostname" in interfases which will be used as the Hostname to be requested (pump, dhcpcd, udhcpc) .This Option  could only be used under The dhcp Method 

PS:edit the dhclient.conf and change this setting also works
<blockquote>send host-name "foobar";</blockquote>]]></description>
			<content:encoded><![CDATA[<p>In CentOS, Just add </p>
<blockquote><p>DHCP_HOSTNAME=foobar</p></blockquote>
<p>in /etc/sysconfig/network-scripts/ifcfg-[devname]</p>
<p>In Debian Just Define "hostname" in interfases which will be used as the Hostname to be requested (pump, dhcpcd, udhcpc) .This Option  could only be used under The dhcp Method </p>
<p>PS:edit the dhclient.conf and change this setting also works</p>
<blockquote><p>send host-name "foobar";</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ihipop.info/2012/03/3058.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nvidia GT240M 在新版驱动下的六分屏问题</title>
		<link>http://ihipop.info/2012/03/3054.html</link>
		<comments>http://ihipop.info/2012/03/3054.html#comments</comments>
		<pubDate>Thu, 08 Mar 2012 11:27:39 +0000</pubDate>
		<dc:creator>ihipop</dc:creator>
				<category><![CDATA[Fix Problems]]></category>
		<category><![CDATA[Linux Manger]]></category>
		<category><![CDATA[MyOriginal]]></category>
		<category><![CDATA[nvidia]]></category>
		<category><![CDATA[sixscreen]]></category>
		<category><![CDATA[六屏]]></category>

		<guid isPermaLink="false">http://ihipop.info/?p=3054</guid>
		<description><![CDATA[哎 难道我这显卡真的老了么？
<img src="https://p.twimg.com/AmAVFaHCEAED5YK.jpg:large" alt="" />

切入正题
xorg.conf 找到Section "Device" 段落 在里面加上这么一个选项
<blockquote>Option "ModeValidation" "NoTotalSizeCheck"</blockquote>
感谢<a href="http://weibo.com/1684988130/y8wVsFffS#3420331949830092" target="_blank">@Jactry</a> &#38;&#38; <a href="https://wiki.archlinux.org/index.php/NVIDIA#Corrupted_screen:_.22Six_screens.22_issue" target="_blank">Arch Wiki</a>
顺便说一下那个快捷键调亮度的问题 <a title="配置xorg.conf使得Nvidia私有驱动支持快捷键亮度调节" href="http://ihipop.info/2010/06/1305.html" target="_blank">传送门在此</a>。]]></description>
			<content:encoded><![CDATA[<p>哎 难道我这显卡真的老了么？<br />
<img src="https://p.twimg.com/AmAVFaHCEAED5YK.jpg:large" alt="" /></p>
<p>切入正题<br />
xorg.conf 找到Section "Device" 段落 在里面加上这么一个选项</p>
<blockquote><p>Option "ModeValidation" "NoTotalSizeCheck"</p></blockquote>
<p>感谢<a href="http://weibo.com/1684988130/y8wVsFffS#3420331949830092" target="_blank">@Jactry</a> &amp;&amp; <a href="https://wiki.archlinux.org/index.php/NVIDIA#Corrupted_screen:_.22Six_screens.22_issue" target="_blank">Arch Wiki</a><br />
顺便说一下那个快捷键调亮度的问题 <a title="配置xorg.conf使得Nvidia私有驱动支持快捷键亮度调节" href="http://ihipop.info/2010/06/1305.html" target="_blank">传送门在此</a>。</p>
]]></content:encoded>
			<wfw:commentRss>http://ihipop.info/2012/03/3054.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

