<?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>风叶</title>
	<atom:link href="http://blog.myhnet.cn/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.myhnet.cn</link>
	<description>秋湍泻石髓 风叶聚云根</description>
	<lastBuildDate>Mon, 08 Feb 2010 04:47:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>未来</title>
		<link>http://blog.myhnet.cn/2010/02/04/%e6%9c%aa%e6%9d%a5/</link>
		<comments>http://blog.myhnet.cn/2010/02/04/%e6%9c%aa%e6%9d%a5/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 07:28:57 +0000</pubDate>
		<dc:creator>myhnet</dc:creator>
				<category><![CDATA[私人日记]]></category>

		<guid isPermaLink="false">http://blog.myhnet.cn/?p=923</guid>
		<description><![CDATA[马上就是农历2010年了，毕业马上就是3年半了，到现在，一事无成。。。
]]></description>
			<content:encoded><![CDATA[<p>马上就是农历2010年了，毕业马上就是3年半了，到现在，一事无成。。。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.myhnet.cn/2010/02/04/%e6%9c%aa%e6%9d%a5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>搞定PXE中的网卡驱动</title>
		<link>http://blog.myhnet.cn/2010/01/25/add-nic-driver-to-intrid-img-for-pxe/</link>
		<comments>http://blog.myhnet.cn/2010/01/25/add-nic-driver-to-intrid-img-for-pxe/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 11:59:55 +0000</pubDate>
		<dc:creator>myhnet</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[asus]]></category>
		<category><![CDATA[网络引导]]></category>
		<category><![CDATA[网卡驱动]]></category>
		<category><![CDATA[网卡支持]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[initrd]]></category>
		<category><![CDATA[initrd.img]]></category>
		<category><![CDATA[nic]]></category>
		<category><![CDATA[nic adapter]]></category>
		<category><![CDATA[nic driver]]></category>
		<category><![CDATA[PXE]]></category>

		<guid isPermaLink="false">http://blog.myhnet.cn/?p=905</guid>
		<description><![CDATA[硬件：
主板ASUS P5QL Pro
软件：
CentOS 5.4 64bit
公司最近进的一台机器用的是用的华硕p5ql pro的板子，要上centos系统，最开始没有注意到没有centos54居然不支持网卡驱动，等到PXE加载完，installation报找不到ks文件（我指定了ks的），我这才意识到，原来centos54并不支持这个网卡。。。
实在是不想刻碟，太麻烦，想起来原来赵小明老师跟我们讲过，这种情况，只要把网卡的驱动加载到启动用的initrd.img中就可以了，于是就开始看看怎么把驱动加载到启动文件当中。
首先，当然是要找一台机器把驱动编译好。
驱动可以在asus的官方网站可以下载到。
编译的机器，最好用没有升过级的内核，不然，不保证可以直接用。
编译好之后，可以得到一个名称为 atl1e.ko 的文件
这个，就是我们要用到的文件
接下来，才是重头戏，我们要把这个文件加入到initrd.img中。
开始之前，建议参考一下这篇文s档： http://www.ibm.com/developerworks/cn/linux/l-linux-netinst/index.html
如果你发现里面的那个脚本不能用，恭喜你，你碰到了跟我一样的问题了，我这篇文章的意义就在于此！
使用file命令，我们可以知道initrd.img这个文件是一个gzip文件，那么，我们就要用gzip进行解压
mv initrd.img initrd.img.gzgunzip initrd.img.gz
再使用file命令，我们又可以得知，解压之后的文件，是一个cpio格式的文件，那么，我就可以用cpio来进行解压
cpio -ivmd &#60; initrd.img
解压之后，我们会得到许多目录与文件，因为我们要修改的只是驱动部分，所以要用到的就只有modules目录。
进入这个目录，我们只能看到五个文件
module-info&#160; modules.alias&#160; modules.cgz&#160; modules.dep&#160; pci.ids
其中module-info是记录硬件设备信息的，在这个文件里面，我们要添加如下三行
atl1e	eth	&#34;AR8121/AR8113 PCI-E Ethernet Adapter&#34;
其实的atl1e是模块名称，eth是设备类型(eth代表以太网卡)，第三行是模块的描述
然后就是第二个文件，modules.alias，在这个文件里面，我们只要添加一行
alias pci:v00001969d00001026sv*sd*bc*sc*i* atl1e
虽然只有一行，但是解释起来还是挺麻烦的。这里涉及到一些硬件相关的信息。
其1969是硬件厂商的信息，可以从http://www.pcidatabase.com/查到是Atheros Communications的产品，而1026是产品的编号，继续查询可以得知是AR8121/AR8113的芯片。
这些信息的得到，是比较麻烦的，当然，我用的是一张很老的debian的救援盘，然后用lspci -n得到这些数据的
其他的，sv,sd,sc,i等等我也搞不太清楚是什么意思，我反正照着r8169的抄。你可以看看这篇文章：http://www.examda.com/linux/fudao/20091227/094826740-3.html。
接下来，我们跳过modules.cgz，讲讲modules.dep。
这是一个描述模块之间的依赖关系的文件，因为在这块网卡的驱动中没有找到相关的依赖说明，所以我就没有修改此文件。
pci.ids这个文件，是modules目录里面，我们要修改的第二重要的文件
在这个文件里面，我们要添加网卡的对应关系，要添加如下两行：
1969&#160; Atheros(R)&#160;&#160; &#160; &#160; &#160;1026&#160; AR8121/AR8113 PCI-E Ethernet Adapter
记得这两行的写法有一个从属关系，1026是从属于1969的
最后，让我们来说说modules.cgz，通过file命令，我们又可以得知到，这是一个gzip文件，同样，我们要进行解压：
mv modules.cgz modules.cgz.gzgunzipmodules.cgz.gz
新到的新的modules.cgz，又是一个cpio文件，我们又要用cpio来进行解压
cpio -ivmd &#60; modules
之后，就会得到2.6.18-164.el5这么一个目录，把我们开始得到的atl1e.ko文件拷贝到其中的2.6.18-164.el5/x86_64/目录中（其中还有其他许多ko文件）。
所有的工作都做得差不多了，接下来就是要进行封装了。
首先是封装modules.cgz
find 2.6.18-164.el5/&#124;cpio&#160; -o -H crc &#62; newmodulesgzip newmodulesrm -rf 2.6.18-164.el5 modulesmv newmodules.gz modules.cgz
这里要注意的是把旧的文件modules.cgz文件与解压生成的目录删除以减少体积
这里封装好之后，我们要封装整个intrid.img文件了。
rm -f initrd.img vmlinuzfind . [...]]]></description>
			<content:encoded><![CDATA[<p><strong>硬件：</strong><br />
主板ASUS P5QL Pro</p>
<p><strong>软件：</strong><br />
CentOS 5.4 64bit</p>
<p>公司最近进的一台机器用的是用的华硕p5ql pro的板子，要上centos系统，最开始没有注意到没有centos54居然不支持网卡驱动，等到PXE加载完，installation报找不到ks文件（我指定了ks的），我这才意识到，原来centos54并不支持这个网卡。。。</p>
<p>实在是不想刻碟，太麻烦，想起来原来赵小明老师跟我们讲过，这种情况，只要把网卡的驱动加载到启动用的initrd.img中就可以了，于是就开始看看怎么把驱动加载到启动文件当中。</p>
<p><strong>首先，当然是要找一台机器把驱动编译好。</strong><br />
驱动可以在asus的官方网站可以下载到。<br />
编译的机器，最好用没有升过级的内核，不然，不保证可以直接用。<br />
编译好之后，可以得到一个名称为<em> atl1e.ko </em>的文件<br />
这个，就是我们要用到的文件</p>
<p>接下来，才是重头戏，我们要把这个文件加入到initrd.img中。<br />
开始之前，建议参考一下这篇文s档： <a href="http://www.ibm.com/developerworks/cn/linux/l-linux-netinst/index.html" target="_blank">http://www.ibm.com/developerworks/cn/linux/l-linux-netinst/index.html</a><br />
如果你发现里面的那个脚本不能用，恭喜你，你碰到了跟我一样的问题了，我这篇文章的意义就在于此！</p>
<p>使用file命令，我们可以知道initrd.img这个文件是一个gzip文件，那么，我们就要用gzip进行解压</p>
<div class="hl-surround"><div class="hl-main">mv initrd.img initrd.img.gz<br />gunzip initrd.img.gz</div></div>
<p>再使用file命令，我们又可以得知，解压之后的文件，是一个cpio格式的文件，那么，我就可以用cpio来进行解压</p>
<div class="hl-surround"><div class="hl-main">cpio -ivmd &lt; initrd.img</div></div>
<p>解压之后，我们会得到许多目录与文件，因为我们要修改的只是驱动部分，所以要用到的就只有modules目录。</p>
<p>进入这个目录，我们只能看到五个文件</p>
<div class="hl-surround"><div class="hl-main">module-info&nbsp; modules.alias&nbsp; modules.cgz&nbsp; modules.dep&nbsp; pci.ids</div></div>
<p>其中<em>module-info</em>是记录硬件设备信息的，在这个文件里面，我们要添加如下三行</p>
<div class="hl-surround"><div class="hl-main">atl1e<br />	eth<br />	&quot;AR8121/AR8113 PCI-E Ethernet Adapter&quot;</div></div>
<p>其实的<em>atl1e</em>是模块名称，<em>eth</em>是设备类型(eth代表以太网卡)，第三行是模块的描述</p>
<p>然后就是第二个文件，<em>modules.alias</em>，在这个文件里面，我们只要添加一行</p>
<div class="hl-surround"><div class="hl-main">alias pci:v00001969d00001026sv*sd*bc*sc*i* atl1e</div></div>
<p>虽然只有一行，但是解释起来还是挺麻烦的。这里涉及到一些硬件相关的信息。<br />
其1969是硬件厂商的信息，可以从<a href="http://www.pcidatabase.com/" target="_blank">http://www.pcidatabase.com/</a>查到是Atheros Communications的产品，而1026是产品的编号，继续查询可以得知是AR8121/AR8113的芯片。<br />
这些信息的得到，是比较麻烦的，当然，我用的是一张很老的debian的救援盘，然后用lspci -n得到这些数据的</p>
<p>其他的，<em>sv,sd,sc,i</em>等等我也搞不太清楚是什么意思，我反正照着r8169的抄。你可以看看这篇文章：<a href="http://www.examda.com/linux/fudao/20091227/094826740-3.html" target="_blank">http://www.examda.com/linux/fudao/20091227/094826740-3.html</a>。</p>
<p>接下来，我们跳过<em>modules.cgz</em>，讲讲<em>modules.dep</em>。<br />
这是一个描述模块之间的依赖关系的文件，因为在这块网卡的驱动中没有找到相关的依赖说明，所以我就没有修改此文件。</p>
<p><em>pci.ids</em>这个文件，是modules目录里面，我们要修改的第二重要的文件<br />
在这个文件里面，我们要添加网卡的对应关系，要添加如下两行：</p>
<div class="hl-surround"><div class="hl-main">1969&nbsp; Atheros(R)<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;1026&nbsp; AR8121/AR8113 PCI-E Ethernet Adapter</div></div>
<p><font color=red>记得这两行的写法有一个从属关系，1026是从属于1969的</font></p>
<p>最后，让我们来说说<em>modules.cgz</em>，通过file命令，我们又可以得知到，这是一个gzip文件，同样，我们要进行解压：</p>
<div class="hl-surround"><div class="hl-main">mv modules.cgz modules.cgz.gz<br />gunzipmodules.cgz.gz</div></div>
<p>新到的新的<em>modules.cgz</em>，又是一个cpio文件，我们又要用cpio来进行解压</p>
<div class="hl-surround"><div class="hl-main">cpio -ivmd &lt; modules</div></div>
<p>之后，就会得到2.6.18-164.el5这么一个目录，把我们开始得到的<em>atl1e.ko</em>文件拷贝到其中的<em>2.6.18-164.el5/x86_64/</em>目录中（其中还有其他许多ko文件）。</p>
<p>所有的工作都做得差不多了，接下来就是要进行封装了。<br />
首先是封装modules.cgz</p>
<div class="hl-surround"><div class="hl-main">find 2.6.18-164.el5/|cpio&nbsp; -o -H crc &gt; newmodules<br />gzip newmodules<br />rm -rf 2.6.18-164.el5 modules<br />mv newmodules.gz modules.cgz</div></div>
<p>这里要注意的是把旧的文件modules.cgz文件与解压生成的目录删除以减少体积</p>
<p>这里封装好之后，我们要封装整个intrid.img文件了。</p>
<div class="hl-surround"><div class="hl-main">rm -f initrd.img vmlinuz<br />find . | cpio -c -o &gt; ../new<br />gzip ../new<br />mv ../new.gz initrd.img</div></div>
<p>同上面的一样，要把一些与intrid.img不相干的文件文件删除以减少体积。</p>
<p>这个时候所有的东西时都管弄完了，你再用这个新生成的initrd.img进行引导，就可以正确的识别你的网卡并从网络读取文件了。</p>
<p><font color=red><strong>最后要注意的是：</strong></font><br />
装好的系统并不能使用这块网卡，装好系统之后，还是要进行网卡的编译。<br />
当然，你也可以学我的，在kickstart文件当中，用%post来完成网卡的编译</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.myhnet.cn/2010/01/25/add-nic-driver-to-intrid-img-for-pxe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>从pfx文件得到crt以及key文件</title>
		<link>http://blog.myhnet.cn/2010/01/21/convert-pfx-file-to-crt-files/</link>
		<comments>http://blog.myhnet.cn/2010/01/21/convert-pfx-file-to-crt-files/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 08:48:29 +0000</pubDate>
		<dc:creator>myhnet</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[certs]]></category>
		<category><![CDATA[crt]]></category>
		<category><![CDATA[证书]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[pfx]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[加密]]></category>

		<guid isPermaLink="false">http://blog.myhnet.cn/?p=902</guid>
		<description><![CDATA[IIS一般使用pfx文件，而apache却使用的是crt+key文件，有时候客户只给pfx文件，这个时候，就要直接进行转换了
以下操作如pfx文件没有设置密码，请直接敲回画
从pfx文件得到key文件：
openssl pks12 -in site.pfx -nocerts -nodes -out site.key
从pfx文件得到crt文件
openssl pkcs12 -in site.pfx -clcerts -nokeys -out site.crt
]]></description>
			<content:encoded><![CDATA[<p>IIS一般使用pfx文件，而apache却使用的是crt+key文件，有时候客户只给pfx文件，这个时候，就要直接进行转换了</p>
<p>以下操作如pfx文件没有设置密码，请直接敲回画<br />
从pfx文件得到key文件：</p>
<div class="hl-surround"><div class="hl-main">openssl pks12 -in site.pfx -nocerts -nodes -out site.key</div></div>
<p>从pfx文件得到crt文件</p>
<div class="hl-surround"><div class="hl-main">openssl pkcs12 -in site.pfx -clcerts -nokeys -out site.crt</div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.myhnet.cn/2010/01/21/convert-pfx-file-to-crt-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>删除 RDP 客户端中的终端服务器许可证[转]</title>
		<link>http://blog.myhnet.cn/2010/01/19/the-remote-computer-disconnected-the-session-because-of-an-error-in-the-licensing-protocol-please-try-connecting-to-the-remote-computer-again-or-contact-your-server-administrator/</link>
		<comments>http://blog.myhnet.cn/2010/01/19/the-remote-computer-disconnected-the-session-because-of-an-error-in-the-licensing-protocol-please-try-connecting-to-the-remote-computer-again-or-contact-your-server-administrator/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 12:28:46 +0000</pubDate>
		<dc:creator>myhnet</dc:creator>
				<category><![CDATA[M$ & Window$]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[licensing]]></category>
		<category><![CDATA[rdesktop]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[vista]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.myhnet.cn/?p=895</guid>
		<description><![CDATA[the remote computer disconnected the session because of an error in the licensing protocol. please try connecting to the remote computer again or contact your server administrator.
来源：http://support.microsoft.com/kb/187614/zh-cn
如果某个未经授权的客户端首次连接到终端服务器，终端服务器将向该客户端发出一个临时的终端服务器客户端访问许可证 (CAL) 令牌。用户登录到会话后，终端服务器指示许可证服务器将发出的临时终端服务器 CAL 令牌标记为已验证。在客户端下一次连接时，系统会尝试将已验证的临时终端服务器 CAL 令牌升级为完全终端服务器 CAL 令牌。如果没有许可证令牌可用，则临时终端服务器 CAL 令牌将继续工作 90 天。该许可证存储在客户端的注册表中。
32 位 RDP 客户端将其许可证存储在 HKEY_LOCAL_MACHINE\Software\Microsoft\MSLicensing 项下。
重要说明：此部分、方法或任务包含有关如何修改注册表的步骤。但是，注册表修改不当可能会出现严重问题。因此，请一定严格按照下列步骤操作。为了获得进一步保护，请在修改注册表之前对其进行备份。这样就可以在出现问题时还原注册表。有关如何备份和还原注册表的更多信息，请单击下面的文章编号，以查看 Microsoft 知识库中相应的文章：
322756  (http://support.microsoft.com/kb/322756/ ) 如何在 Windows 中备份和还原注册表
要清理客户端的许可证缓存，只需删除此项及其子项。在客户端下一次连接到服务器时，它将获得另一个许可证。
对于 16 位 RDP [...]]]></description>
			<content:encoded><![CDATA[<div class="hl-surround"><div class="hl-main">the remote computer disconnected the session because of an error in the licensing protocol. please try connecting to the remote computer again or contact your server administrator.</div></div>
<p>来源：<a href="http://support.microsoft.com/kb/187614/zh-cn">http://support.microsoft.com/kb/187614/zh-cn</a></p>
<p>如果某个未经授权的客户端首次连接到终端服务器，终端服务器将向该客户端发出一个临时的终端服务器客户端访问许可证 (CAL) 令牌。用户登录到会话后，终端服务器指示许可证服务器将发出的临时终端服务器 CAL 令牌标记为已验证。在客户端下一次连接时，系统会尝试将已验证的临时终端服务器 CAL 令牌升级为完全终端服务器 CAL 令牌。如果没有许可证令牌可用，则临时终端服务器 CAL 令牌将继续工作 90 天。该许可证存储在客户端的注册表中。</p>
<p>32 位 RDP 客户端将其许可证存储在 HKEY_LOCAL_MACHINE\Software\Microsoft\MSLicensing 项下。</p>
<p>重要说明：此部分、方法或任务包含有关如何修改注册表的步骤。但是，注册表修改不当可能会出现严重问题。因此，请一定严格按照下列步骤操作。为了获得进一步保护，请在修改注册表之前对其进行备份。这样就可以在出现问题时还原注册表。有关如何备份和还原注册表的更多信息，请单击下面的文章编号，以查看 Microsoft 知识库中相应的文章：<br />
322756  (http://support.microsoft.com/kb/322756/ ) 如何在 Windows 中备份和还原注册表</p>
<p>要清理客户端的许可证缓存，只需删除此项及其子项。在客户端下一次连接到服务器时，它将获得另一个许可证。</p>
<p>对于 16 位 RDP 客户端，请运行 regedit /v。然后删除“\Software\Microsoft\MSLicensing”下的项以清理客户端的许可证缓存。还可以删除 \Windows\System\Regdata 中的 BIN 文件。</p>
<p>Macintosh RDP 客户端将许可证存储在本地计算机上 /users/Shared/Microsoft/RDC Crucial Server Information/ 下的文件夹层次结构中的一个文件内。要清理 Macintosh 客户端的许可证缓存，请删除此文件夹中的内容。客户端将在下一次连接时尝试从服务器获得新许可证。</p>
<p>如果删除运行 Windows Vista 或更高版本的客户端上的 HKEY_LOCAL_MACHINE\Software\Microsoft\MSLicensing 子项，则以后连接终端服务器的尝试可能会失败。并且，您会收到以下错误消息：</p>
<div class="hl-surround"><div class="hl-main">An Error occurred in the Licensing Protocol</div></div>
<p>要解决此问题，请右键单击“远程桌面连接”快捷方式，然后单击“以管理员身份运行”。默认情况下，远程桌面连接以具有最低用户权限的用户身份运行。默认情况下，受限用户不具有向 HKEY_LOCAL_MACHINE 写入注册表项的权限。因此，重写 MSLicensing 项的尝试失败。使用管理凭据启动“远程桌面连接”可提供写入所需注册表项所必需的权限。 </p>
<p>后记：<br />
这个东西一直困扰我好久，因为自己不用windows，而在linux下面，可以直接用-n newname来解决，所以就一直隔这里了。这几天被同事一直催着解决这个问题，没办法，这下仔细研究了一下。<br />
看样子，选中关键词很重要啊。。。。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.myhnet.cn/2010/01/19/the-remote-computer-disconnected-the-session-because-of-an-error-in-the-licensing-protocol-please-try-connecting-to-the-remote-computer-again-or-contact-your-server-administrator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux文本模式下发送带附件的Email</title>
		<link>http://blog.myhnet.cn/2009/11/12/how-to-send-email-with-attachment-in-linux-text-terminal/</link>
		<comments>http://blog.myhnet.cn/2009/11/12/how-to-send-email-with-attachment-in-linux-text-terminal/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 10:19:44 +0000</pubDate>
		<dc:creator>myhnet</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[attach]]></category>
		<category><![CDATA[attachment]]></category>
		<category><![CDATA[consol]]></category>
		<category><![CDATA[邮件]]></category>
		<category><![CDATA[附件]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[mail with attachment]]></category>
		<category><![CDATA[mailx]]></category>
		<category><![CDATA[nail]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[uuencode]]></category>
		<category><![CDATA[带附件的Email]]></category>
		<category><![CDATA[带附件邮件]]></category>
		<category><![CDATA[文本模式]]></category>

		<guid isPermaLink="false">http://blog.myhnet.cn/?p=882</guid>
		<description><![CDATA[最近写一个脚本，需要直接在linux文本终端里面直接发送附件，而linux自带的那个什么mail命令，是由mailx包生成的，本身不带发送附件的功能。
放狗搜了一圈，发现基本上使用的都是mailx+uuencode这招。详情见http://www.webjx.com/server/linux-2724.html&#8221;
但是这种方式，是将文件转成ASCII码进行传输，在某些客户端(比如某些web客户端)，很可能收到的就是一堆乱码。为了解决这个问题，我推荐另一个文本模式的邮件客户端：nail
不知道centos的官方源中有没有，但是，在rpmforge的源里面是肯定有的。装好之后，本身只会生成/usr/bin/nail这个命令，要是你很习惯用mail这个命令的话，可以考虑自己建立一个软链。
另附rpmforge源中nail包的information
# yum info nailLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile&#160;* addons: centos.ustc.edu.cn&#160;* base: centos.ustc.edu.cn&#160;* extras: centos.ustc.edu.cn&#160;* rpmforge: ftp-stud.fht-esslingen.de&#160;* updates: centos.ustc.edu.cnInstalled PackagesName&#160; &#160; &#160; &#160;: nailArch&#160; &#160; &#160; &#160;: x86_64Version&#160; &#160; : 12.3Release&#160; &#160; : 4.el5.rfSize&#160; &#160; &#160; &#160;: 612 kRepo&#160; &#160; &#160; &#160;: installedSummary&#160; &#160; : Enhanced implementation of the mailx commandURL&#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>最近写一个脚本，需要直接在linux文本终端里面直接发送附件，而linux自带的那个什么mail命令，是由mailx包生成的，本身不带发送附件的功能。</p>
<p>放狗搜了一圈，发现基本上使用的都是mailx+uuencode这招。详情见<a href="http://www.webjx.com/server/linux-2724.html" target="_blank">http://www.webjx.com/server/linux-2724.html&#8221;</a></p>
<p>但是这种方式，是将文件转成ASCII码进行传输，在某些客户端(比如某些web客户端)，很可能收到的就是一堆乱码。为了解决这个问题，我推荐另一个文本模式的邮件客户端：<strong><em>nail</em></strong></p>
<p>不知道centos的官方源中有没有，但是，在rpmforge的源里面是肯定有的。装好之后，本身只会生成/usr/bin/nail这个命令，要是你很习惯用mail这个命令的话，可以考虑自己建立一个软链。</p>
<p>另附rpmforge源中nail包的information</p>
<div class="hl-surround"><div class="hl-main"># yum info nail<br />Loaded plugins: fastestmirror<br />Loading mirror speeds from cached hostfile<br />&nbsp;* addons: centos.ustc.edu.cn<br />&nbsp;* base: centos.ustc.edu.cn<br />&nbsp;* extras: centos.ustc.edu.cn<br />&nbsp;* rpmforge: ftp-stud.fht-esslingen.de<br />&nbsp;* updates: centos.ustc.edu.cn<br />Installed Packages<br />Name&nbsp; &nbsp; &nbsp; &nbsp;: nail<br />Arch&nbsp; &nbsp; &nbsp; &nbsp;: x86_64<br />Version&nbsp; &nbsp; : 12.3<br />Release&nbsp; &nbsp; : 4.el5.rf<br />Size&nbsp; &nbsp; &nbsp; &nbsp;: 612 k<br />Repo&nbsp; &nbsp; &nbsp; &nbsp;: installed<br />Summary&nbsp; &nbsp; : Enhanced implementation of the mailx command<br />URL&nbsp; &nbsp; &nbsp; &nbsp; : http://nail.sourceforge.net/<br />License&nbsp; &nbsp; : BSD<br />Description: Nail is an enhanced mail command, which provides the functionality<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : of the POSIX mailx command. It is derived from Berkeley Mail.<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : <br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : Additionally to the POSIX features, nail can work with Maildir/ e-mail<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : storage format (as well as mailboxes), supports IMAP, POP3 and SMTP<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : procotols (including over SSL) to operate with remote hosts, handles mime<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : types and different charsets. There are a lot of other useful features,<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : see nail.html in the documentation.<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : <br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : And as its ancient analogues, nail can be used as a mail script language,<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : both for sending and receiving mail.</div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.myhnet.cn/2009/11/12/how-to-send-email-with-attachment-in-linux-text-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>利用apache的proxy来做负载均衡</title>
		<link>http://blog.myhnet.cn/2009/11/09/make-load-balance-rules-with-mod_proxy-in-apache/</link>
		<comments>http://blog.myhnet.cn/2009/11/09/make-load-balance-rules-with-mod_proxy-in-apache/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 11:11:41 +0000</pubDate>
		<dc:creator>myhnet</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[负载均衡]]></category>
		<category><![CDATA[load balance]]></category>
		<category><![CDATA[mod_proxy]]></category>
		<category><![CDATA[mod_proxy_balancer]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[代理]]></category>
		<category><![CDATA[代理负载均衡]]></category>

		<guid isPermaLink="false">http://blog.myhnet.cn/?p=873</guid>
		<description><![CDATA[虽然很早以前就知道得用apche的mod_proxy可以用来做负载均衡，可由于太懒，一直都没有去做。今天刚好工作上也要做这个，所以就实验了一把。
要使用apache的负载均衡功能，首得得开启下面这几个模块：
LoadModule proxy_module modules/mod_proxy.soLoadModule proxy_balancer_module modules/mod_proxy_balancer.soLoadModule proxy_http_module modules/mod_proxy_http.so
其中mod_proxy提供代理服务器功能，mod_proxy_balancer提供负载均衡功能， mod_proxy_http让代理服务器能支持HTTP协议。
然后，要在httpd.conf中加入这么一段配置：
ProxyRequests Off&#60;Proxy balancer://mycluster&#62;&#160;&#160; &#160;BalancerMember http://192.168.0.1&#160;&#160; &#160;BalancerMember http://192.168.0.2&#60;/Proxy&#62;ProxyPass /mycluster !ProxyPass / balancer://mycluster&#60;Location /mycluster&#62;&#160;&#160; &#160;SetHandler balancer-manager&#160;&#160; &#160;Order Deny,Allow&#160;&#160; &#160;Deny from all&#160;&#160; &#160;Allow from localhost&#60;/Location&#62;
从上面的 ProxyRequests Off 这条可以看出，实际上负载均衡器就是一个反向代理， 只不过它的代理转发地址不是某台具体的服务器，而是一个 balancer:// 协议：
ProxyPass / balancer://mycluster
下面那段是用来监视负载均衡的工作情况的，然后访问 http://localhost/mycluster/ 即可看到负载均衡的工作状况。你也可以利用这个工具将其中某一个终端要暂时从集群中移出，或者临时修改某个终端的参数（如factor等）。
这个地方要特别注意的是下面这行配置：
ProxyPass /mycluster !
如果没有这行配置，当你访问http://localhost/mycluster/也会被转发到终端上去。
改完之后重启服务器，访问你的Apache所在服务器的地址，即可看到负载均衡的效果了。 打开 mycluster的界面，可以看到请求是平均分配的。
当然，你也可以像我这个配置这样修改其中的某些参数，来获得最大的负载均衡的功效
ProxyRequests OffProxyPass /mycluster !ProxyPass / balancer://mycluster/ stickysession=BALANCEIDProxyPassReverse / http://192.168.0.1/ProxyPassReverse / http://192.168.0.2/&#60;Proxy balancer://mycluster&#62;&#160;&#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>虽然很早以前就知道得用apche的mod_proxy可以用来做负载均衡，可由于太懒，一直都没有去做。今天刚好工作上也要做这个，所以就实验了一把。</p>
<p>要使用apache的负载均衡功能，首得得开启下面这几个模块：</p>
<div class="hl-surround"><div class="hl-main">LoadModule proxy_module modules/mod_proxy.so<br />LoadModule proxy_balancer_module modules/mod_proxy_balancer.so<br />LoadModule proxy_http_module modules/mod_proxy_http.so</div></div>
<p>其中mod_proxy提供代理服务器功能，mod_proxy_balancer提供负载均衡功能， mod_proxy_http让代理服务器能支持HTTP协议。</p>
<p>然后，要在httpd.conf中加入这么一段配置：</p>
<div class="hl-surround"><div class="hl-main">ProxyRequests Off<br />&lt;Proxy balancer://mycluster&gt;<br />&nbsp;&nbsp; &nbsp;BalancerMember http://192.168.0.1<br />&nbsp;&nbsp; &nbsp;BalancerMember http://192.168.0.2<br />&lt;/Proxy&gt;<br />ProxyPass /mycluster !<br />ProxyPass / balancer://mycluster<br />&lt;Location /mycluster&gt;<br />&nbsp;&nbsp; &nbsp;SetHandler balancer-manager<br />&nbsp;&nbsp; &nbsp;Order Deny,Allow<br />&nbsp;&nbsp; &nbsp;Deny from all<br />&nbsp;&nbsp; &nbsp;Allow from localhost<br />&lt;/Location&gt;</div></div>
<p>从上面的 ProxyRequests Off 这条可以看出，实际上负载均衡器就是一个反向代理， 只不过它的代理转发地址不是某台具体的服务器，而是一个 balancer:// 协议：</p>
<div class="hl-surround"><div class="hl-main">ProxyPass / balancer://mycluster</div></div>
<p>下面那段<Location /mycluster>是用来监视负载均衡的工作情况的，然后访问 http://localhost/mycluster/ 即可看到负载均衡的工作状况。你也可以利用这个工具将其中某一个终端要暂时从集群中移出，或者临时修改某个终端的参数（如factor等）。</p>
<p>这个地方要特别注意的是下面这行配置：</p>
<div class="hl-surround"><div class="hl-main">ProxyPass /mycluster !</div></div>
<p>如果没有这行配置，当你访问http://localhost/mycluster/也会被转发到终端上去。</p>
<p>改完之后重启服务器，访问你的Apache所在服务器的地址，即可看到负载均衡的效果了。 打开 mycluster的界面，可以看到请求是平均分配的。</p>
<p>当然，你也可以像我这个配置这样修改其中的某些参数，来获得最大的负载均衡的功效</p>
<div class="hl-surround"><div class="hl-main">ProxyRequests Off<br />ProxyPass /mycluster !<br />ProxyPass / balancer://mycluster/ stickysession=BALANCEID<br />ProxyPassReverse / http://192.168.0.1/<br />ProxyPassReverse / http://192.168.0.2/<br />&lt;Proxy balancer://mycluster&gt;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;BalancerMember http://192.168.0.1 route=http1 loadfactor=7<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;BalancerMember http://192.168.0.2 route=http2 loadfactor=3<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ProxySet lbmethod=byrequests<br />&lt;/Proxy&gt;<br />&lt;Location /mycluster&gt;<br />&nbsp;&nbsp; &nbsp;SetHandler balancer-manager<br />&nbsp;&nbsp; &nbsp;Order Deny,Allow<br />&nbsp;&nbsp; &nbsp;Deny from all<br />&nbsp;&nbsp; &nbsp;Allow from localhost<br />&lt;/Location&gt;</div></div>
<p>其中，stickysession=BALANCEID设置根据下面的route=http1/2来进行session的绑定。因为很多网站的变量，如登陆信息等，可能是储存在服务器端的内存中的，如果不设置这个变量，用户来访问是还是不段的在不同的终端之间切换，用户就会不停的退出<br />
loadfactor=7这个是设置不同的终端的负载均衡的权重，数值越来，转发的数量就越多。<br />
而ProxySet lbmethod=byrequests是用来设置负载均衡的算法。通常有三种取值：byrequests（按照请求次数均衡，默认值），bytraffic（按照流量均衡），bybusyness（按照繁忙程度均衡）。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.myhnet.cn/2009/11/09/make-load-balance-rules-with-mod_proxy-in-apache/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>还没有收房</title>
		<link>http://blog.myhnet.cn/2009/11/09/%e8%bf%98%e6%b2%a1%e6%9c%89%e6%94%b6%e6%88%bf/</link>
		<comments>http://blog.myhnet.cn/2009/11/09/%e8%bf%98%e6%b2%a1%e6%9c%89%e6%94%b6%e6%88%bf/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 01:28:05 +0000</pubDate>
		<dc:creator>myhnet</dc:creator>
				<category><![CDATA[房子，房子]]></category>

		<guid isPermaLink="false">http://blog.myhnet.cn/?p=871</guid>
		<description><![CDATA[本来说10月底交房，搞到现在还没有交房
一个小问题到现在还没解决。。。
千比较万比较，最后还是找了一家装修公司来装
以后会省不少事情
可惜钱现在就开始超支了
只是半包，家装公司就已经收了3W多
买瓷片，厨柜，又花了几1W了
到时候还有吊顶，五金，灯饰等等又是不少的花费啊
]]></description>
			<content:encoded><![CDATA[<p>本来说10月底交房，搞到现在还没有交房<br />
一个小问题到现在还没解决。。。</p>
<p>千比较万比较，最后还是找了一家装修公司来装<br />
以后会省不少事情<br />
可惜钱现在就开始超支了<br />
只是半包，家装公司就已经收了3W多<br />
买瓷片，厨柜，又花了几1W了<br />
到时候还有吊顶，五金，灯饰等等又是不少的花费啊</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.myhnet.cn/2009/11/09/%e8%bf%98%e6%b2%a1%e6%9c%89%e6%94%b6%e6%88%bf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>生平第二个认证</title>
		<link>http://blog.myhnet.cn/2009/11/06/%e7%94%9f%e5%b9%b3%e7%ac%ac%e4%ba%8c%e4%b8%aa%e8%ae%a4%e8%af%81/</link>
		<comments>http://blog.myhnet.cn/2009/11/06/%e7%94%9f%e5%b9%b3%e7%ac%ac%e4%ba%8c%e4%b8%aa%e8%ae%a4%e8%af%81/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 12:11:17 +0000</pubDate>
		<dc:creator>myhnet</dc:creator>
				<category><![CDATA[私人日记]]></category>

		<guid isPermaLink="false">http://blog.myhnet.cn/?p=867</guid>
		<description><![CDATA[anyway，生平第二个认证，也是第一个网络方面的认证算拿到手了
JNCIA-ER
Juniper Networks Certified Internet Associate, ER
]]></description>
			<content:encoded><![CDATA[<p>anyway，生平第二个认证，也是第一个网络方面的认证算拿到手了<br />
JNCIA-ER<br />
Juniper Networks Certified Internet Associate, ER</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.myhnet.cn/2009/11/06/%e7%94%9f%e5%b9%b3%e7%ac%ac%e4%ba%8c%e4%b8%aa%e8%ae%a4%e8%af%81/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
