<?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>陈志伟博客 &#187; 软件应用</title>
	<atom:link href="http://chenzhiwei.net/category/soft/feed/" rel="self" type="application/rss+xml" />
	<link>http://chenzhiwei.net</link>
	<description>善始者实繁，克终者盖寡。</description>
	<lastBuildDate>Tue, 03 Jan 2012 09:14:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>gpg的使用说明</title>
		<link>http://chenzhiwei.net/2011/10/how-to-use-gpg/</link>
		<comments>http://chenzhiwei.net/2011/10/how-to-use-gpg/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 02:19:12 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[软件应用]]></category>
		<category><![CDATA[gpg]]></category>
		<category><![CDATA[加密]]></category>

		<guid isPermaLink="false">http://chenzhiwei.net/?p=30433</guid>
		<description><![CDATA[GPG也称GnuPG，是Gnu Privacy Guard的简写。GPG是一个以GNU通用公共许可证释出的开放源码用于加密或签名的软件。目前很多人、很多领域都在使用GPG。 GPG使用起来很简单，请确保自己已经安装了gpg软件。下面一简单的使用方法： 生成钥匙： gpg --gen-key 根据提示选择适合自己的加密方式，一般先默认的就行。（RSA、2048） 将公钥上传到钥匙服务器： gpg --send-keys 60F06EDA 以文本文件方式导出公钥： --export -a -o your-public-key.asc 这个公钥是要对大家公开的，这样别人才能用你的公钥来加密文件，然后你用私钥解密文件。 导出私钥： gpg --export-secret-keys -o your-secret-key.gpg 这个是备份自己的私钥，当你换电脑或想在其他地方使用gpg时，可以将自己的私钥导入，然后使用。 导入公钥、私钥的方法： gpg &#8211;import your-public/secret-key 用公钥对文件加密： gpg -e file.txt 加密后的文件为file.txt.gpg 用私钥对文件进行签名： gpg -s file.txt 签名后的文件名为file.txt.gpg 公钥加密后的文件只能用私钥进行解密： gpg -d file.txt.gpg 私钥签名后的文件只能用公钥进行解密： gpg -d file.txt.gpg 关于gpg还有很多其他用法，这里就不多说了，自己可以查阅manual文档。 下面是gpg官方中文使用文档：http://www.gnupg.org/howtos/zh/GPGMiniHowto-1.html 我的gpg public key在about页面。 &#169; 2011, chenzhiwei.net. 版权所有. [...]]]></description>
			<content:encoded><![CDATA[<p>GPG也称GnuPG，是Gnu Privacy Guard的简写。GPG是一个以GNU通用公共许可证释出的开放源码用于加密或签名的软件。目前很多人、很多领域都在使用GPG。</p>
<p>GPG使用起来很简单，请确保自己已经安装了gpg软件。下面一简单的使用方法：<span id="more-30433"></span></p>
<p><strong>生成钥匙：</strong></p>
<pre>gpg --gen-key</pre>
<pre>根据提示选择适合自己的加密方式，一般先默认的就行。（RSA、2048）</pre>
<pre><strong>将公钥上传到钥匙服务器：</strong></pre>
<pre>gpg --send-keys 60F06EDA</pre>
<pre><strong>以文本文件方式导出公钥：</strong></pre>
<pre>--export -a -o your-public-key.asc</pre>
<pre>这个公钥是要对大家公开的，这样别人才能用你的公钥来加密文件，然后你用私钥解密文件。</pre>
<pre><strong>导出私钥：</strong></pre>
<pre>gpg --export-secret-keys -o your-secret-key.gpg</pre>
<p>这个是备份自己的私钥，当你换电脑或想在其他地方使用gpg时，可以将自己的私钥导入，然后使用。</p>
<p><strong>导入公钥、私钥的方法：</strong></p>
<p>gpg &#8211;import your-public/secret-key</p>
<p><strong>用公钥对文件加密：</strong></p>
<p>gpg -e file.txt</p>
<p>加密后的文件为file.txt.gpg</p>
<p><strong>用私钥对文件进行签名：</strong></p>
<p>gpg -s file.txt</p>
<p>签名后的文件名为file.txt.gpg</p>
<p><strong>公钥加密后的文件只能用私钥进行解密：</strong></p>
<p>gpg -d file.txt.gpg</p>
<p><strong>私钥签名后的文件只能用公钥进行解密：</strong></p>
<p>gpg -d file.txt.gpg</p>
<p>关于gpg还有很多其他用法，这里就不多说了，自己可以查阅manual文档。</p>
<p>下面是gpg官方中文使用文档：<a href="http://www.gnupg.org/howtos/zh/GPGMiniHowto-1.html" target="_blank">http://www.gnupg.org/howtos/zh/GPGMiniHowto-1.html</a></p>
<p>我的gpg public key在about页面。</p>
<p style="font-weight: bold;">&copy; 2011, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="gpg的使用说明" href="http://chenzhiwei.net/2011/10/how-to-use-gpg/">http://chenzhiwei.net/2011/10/how-to-use-gpg/</a></p><hr /><div  class="related_post_title">随机日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2009/03/google-big/" title="Google 产品很好很强大">Google 产品很好很强大</a></li><li><a href="http://chenzhiwei.net/2008/10/baiduyoua-baifubao/" title="百度有啊+百付宝上线了">百度有啊+百付宝上线了</a></li><li><a href="http://chenzhiwei.net/2009/04/portable-unbuntu-under-windows/" title="运行在Windows下的Portable Ubuntu">运行在Windows下的Portable Ubuntu</a></li><li><a href="http://chenzhiwei.net/2009/07/this-is-the-first-post/" title="this is the first post">this is the first post</a></li><li><a href="http://chenzhiwei.net/2009/09/update-blog-sina-miniblog-yahoo-meme/" title="很久没有更新博客了">很久没有更新博客了</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2011/10/how-to-use-gpg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一个apache为两个不同端口的网站提供服务</title>
		<link>http://chenzhiwei.net/2011/07/one-apache-hosts-two-site-with-different-port/</link>
		<comments>http://chenzhiwei.net/2011/07/one-apache-hosts-two-site-with-different-port/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 14:52:39 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[软件应用]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://chenzhiwei.net/?p=30431</guid>
		<description><![CDATA[一个apache开启两个主进程，两个配置文件，服务两个不同端口的网站。 有以下需求： 1. 机器上只安装一个apache。 2. 机器上要放置两个网站，一个端口为80，允许外网访问；另一个网站端口为8080，只允许内网访问。 实现方法： 1. 写两个配置文件httpd1.conf和httpd2.conf。 2. 两个配置文件中除了监听的端口、DocumentRoot和PidFile路径不同外其他地方均可相同（根据自己需求适当修改）。 3. 分别使用以下命令启动或关闭： /usr/sbin/httpd -f /etc/httpd/httpd1.conf -k start&#124;stop&#124;restart /usr/sbin/httpd -f /etc/httpd/httpd2.conf -k start&#124;stop&#124;restart 另外：/usr/sbin/httpd -k restart 命令只会导致子进程（apache用户进程）重新启动，而主进程（root用户）是不会重新启动的。 &#169; 2011, chenzhiwei.net. 版权所有. 本文永久链接：http://chenzhiwei.net/2011/07/one-apache-hosts-two-site-with-different-port/相关日志Shell I/O重定向haproxy是个什么东西安装并配置subversion服务Linux下的NFS,VSFTP,Samba的简单配置海明码详解]]></description>
			<content:encoded><![CDATA[<p>一个apache开启两个主进程，两个配置文件，服务两个不同端口的网站。</p>
<p><strong>有以下需求：</strong></p>
<p>1. 机器上只安装一个apache。</p>
<p>2. 机器上要放置两个网站，一个端口为80，允许外网访问；另一个网站端口为8080，只允许内网访问。<span id="more-30431"></span></p>
<p><strong>实现方法：</strong></p>
<p>1. 写两个配置文件httpd1.conf和httpd2.conf。</p>
<p>2. 两个配置文件中除了监听的端口、DocumentRoot和PidFile路径不同外其他地方均可相同（根据自己需求适当修改）。</p>
<p>3. 分别使用以下命令启动或关闭：</p>
<p>/usr/sbin/httpd -f /etc/httpd/httpd1.conf -k start|stop|restart<br />
/usr/sbin/httpd -f /etc/httpd/httpd2.conf -k start|stop|restart</p>
<p>另外：/usr/sbin/httpd -k restart 命令只会导致子进程（apache用户进程）重新启动，而主进程（root用户）是不会重新启动的。</p>
<p style="font-weight: bold;">&copy; 2011, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="一个apache为两个不同端口的网站提供服务" href="http://chenzhiwei.net/2011/07/one-apache-hosts-two-site-with-different-port/">http://chenzhiwei.net/2011/07/one-apache-hosts-two-site-with-different-port/</a></p><hr /><div  class="related_post_title">相关日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2011/08/shell-io-redirection/" title="Shell I/O重定向">Shell I/O重定向</a></li><li><a href="http://chenzhiwei.net/2011/05/what-is-haproxy/" title="haproxy是个什么东西">haproxy是个什么东西</a></li><li><a href="http://chenzhiwei.net/2011/04/install-and-config-svn/" title="安装并配置subversion服务">安装并配置subversion服务</a></li><li><a href="http://chenzhiwei.net/2011/03/linux-nfs-vsftp-samba/" title="Linux下的NFS,VSFTP,Samba的简单配置">Linux下的NFS,VSFTP,Samba的简单配置</a></li><li><a href="http://chenzhiwei.net/2010/12/detailed-explanation-of-hamming-code/" title="海明码详解">海明码详解</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2011/07/one-apache-hosts-two-site-with-different-port/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ubuntu11.04下使用pptp vpn</title>
		<link>http://chenzhiwei.net/2011/07/use-pptp-vpn-under-ubuntu11-04/</link>
		<comments>http://chenzhiwei.net/2011/07/use-pptp-vpn-under-ubuntu11-04/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 08:00:46 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[软件应用]]></category>
		<category><![CDATA[pptp]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://chenzhiwei.net/?p=30429</guid>
		<description><![CDATA[ubuntu11.04使用VPN上网需要以下四个包：network-manager-pptp、network-manager-pptp-gnome、pptp-linux和pptpd。默认情况下ubuntu11.04是没有安装network-manager-pptp-gnome和pptpd这两个包的，这也就导致了连接VPN时报错：vpn connection failed because the vpn service start failed. 安装以上几个软件后，重启X，然后连接就OK了。更详细的设置说明请移步这里：http://hi.baidu.com/sean_lee/blog/item/4e50b303d9ec20fb08fa939f.html &#169; 2011, chenzhiwei.net. 版权所有. 本文永久链接：http://chenzhiwei.net/2011/07/use-pptp-vpn-under-ubuntu11-04/相关日志Ubuntu+WinXP双系统修复grub2引导的方法LAMP安装配置小记windows下硬盘安装ubuntu的方法运行在Windows下的Portable Ubuntu使用ubuntu linux手记]]></description>
			<content:encoded><![CDATA[<p>ubuntu11.04使用VPN上网需要以下四个包：network-manager-pptp、network-manager-pptp-gnome、pptp-linux和pptpd。默认情况下ubuntu11.04是没有安装network-manager-pptp-gnome和pptpd这两个包的，这也就导致了连接VPN时报错：vpn connection failed because the vpn service start failed.</p>
<p>安装以上几个软件后，重启X，然后连接就OK了。更详细的设置说明请移步这里：<a href="http://hi.baidu.com/sean_lee/blog/item/4e50b303d9ec20fb08fa939f.html" target="_blank">http://hi.baidu.com/sean_lee/blog/item/4e50b303d9ec20fb08fa939f.html</a></p>
<p style="font-weight: bold;">&copy; 2011, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="ubuntu11.04下使用pptp vpn" href="http://chenzhiwei.net/2011/07/use-pptp-vpn-under-ubuntu11-04/">http://chenzhiwei.net/2011/07/use-pptp-vpn-under-ubuntu11-04/</a></p><hr /><div  class="related_post_title">相关日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2010/10/ubuntu-and-winxp-repair-grub2/" title="Ubuntu+WinXP双系统修复grub2引导的方法">Ubuntu+WinXP双系统修复grub2引导的方法</a></li><li><a href="http://chenzhiwei.net/2010/10/install-lamp-on-ubuntu/" title="LAMP安装配置小记">LAMP安装配置小记</a></li><li><a href="http://chenzhiwei.net/2010/03/install-ubuntu-under-windows/" title="windows下硬盘安装ubuntu的方法">windows下硬盘安装ubuntu的方法</a></li><li><a href="http://chenzhiwei.net/2009/04/portable-unbuntu-under-windows/" title="运行在Windows下的Portable Ubuntu">运行在Windows下的Portable Ubuntu</a></li><li><a href="http://chenzhiwei.net/2009/03/how-to-use-ubuntu/" title="使用ubuntu linux手记">使用ubuntu linux手记</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2011/07/use-pptp-vpn-under-ubuntu11-04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>svn与git</title>
		<link>http://chenzhiwei.net/2011/05/svn-vs-git/</link>
		<comments>http://chenzhiwei.net/2011/05/svn-vs-git/#comments</comments>
		<pubDate>Sun, 08 May 2011 10:06:38 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[软件应用]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[分布式]]></category>

		<guid isPermaLink="false">http://chenzhiwei.net/?p=30426</guid>
		<description><![CDATA[svn与git各有各的优点，听说svn的下个版本要添加分布式支持。不管怎样，软件都是在跟着用户需求走。以后一切都在云中，这个云是不是浮云很快就清楚了。 &#169; 2011, chenzhiwei.net. 版权所有. 本文永久链接：http://chenzhiwei.net/2011/05/svn-vs-git/相关日志安装并配置subversion服务]]></description>
			<content:encoded><![CDATA[<p>svn与git各有各的优点，听说svn的下个版本要添加分布式支持。不管怎样，软件都是在跟着用户需求走。以后一切都在云中，这个云是不是浮云很快就清楚了。</p>
<p style="font-weight: bold;">&copy; 2011, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="svn与git" href="http://chenzhiwei.net/2011/05/svn-vs-git/">http://chenzhiwei.net/2011/05/svn-vs-git/</a></p><hr /><div  class="related_post_title">相关日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2011/04/install-and-config-svn/" title="安装并配置subversion服务">安装并配置subversion服务</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2011/05/svn-vs-git/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>安装并配置subversion服务</title>
		<link>http://chenzhiwei.net/2011/04/install-and-config-svn/</link>
		<comments>http://chenzhiwei.net/2011/04/install-and-config-svn/#comments</comments>
		<pubDate>Sat, 23 Apr 2011 08:51:22 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[软件应用]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[版本控制]]></category>

		<guid isPermaLink="false">http://chenzhiwei.net/?p=30425</guid>
		<description><![CDATA[上周一直在看svn相关的东西，虽然现在git的势头很猛，但是svn的优势还是很明显。下面我只写出svn的安装及配置方法，其他内容可以在线查看这本书《Subversion与版本控制》。安装方法比较简单，直接在命令行里输入：yum install subversion或apt-get install subversion就可以了。 1.创建版本库 # svnadmin create /var/svndir/repos 在目录/var/svndir/repos下创建一个新的版本库，执行该命令后会在repos目录下创建以下目录conf,dav,db,hooks,locks和以下文件format,README.txt 将某个项目导入到版本库： # svn import /var/myproject file:///var/svndir/repos/myproject -m “initial import” 2.增加网络访问支 1).使用svn自有协议 svnserve（默认端口为3690） # svnserve -d -r /var/svndir/repos 该命令指定svn客户端只能访问repos下的版本(svn://host.name/***)。 # svnserve -d 该命令没有指定目录，可以访问所有版本库(svn://host.name/var/svndir/repos/***) 2).使用apache服务器模块(mod_dav_svn) 注：一般安装mod_dav_svn之后配置文件就会自动修改，若配置文件没有自动修改，我们可以在httpd.conf中增加以下内容来使用mod_dav_svn模块： LoadModule dav_module         modules/mod_dav.so LoadModule dav_svn_module     modules/mod_dav_svn.so 在apache配置文件中添加以下内容 A.只有一个版本库repos &#60;Location /repos&#62; DAV svn SVNPath /var/svndir/repos &#60;/Location&#62; 通过 http://host.name/repos/*** 来访问，即： # svn co http://host.name/repos/testprject   testproject B.有多个版本库 &#60;Location /svn&#62; DAV svn SVNParentPath /var/svndir &#60;/Location&#62; 通过 http://host.name/svn/repos1/***,http://host.name/svn/repos2/*** 来访问 3.增加访问权限 1).svnserve方式设置访问权限 修改conf/svnserve.conf文件内容为： [general] anon-access [...]]]></description>
			<content:encoded><![CDATA[<p>上周一直在看svn相关的东西，虽然现在git的势头很猛，但是svn的优势还是很明显。下面我只写出svn的安装及配置方法，其他内容可以在线查看这本书<a href="http://i18n-zh.googlecode.com/svn/www/svnbook-1.4/index.html" target="_blank">《Subversion与版本控制》</a>。安装方法比较简单，直接在命令行里输入：yum install subversion或apt-get install subversion就可以了。<span id="more-30425"></span></p>
<p><strong>1.创建版本库</strong><br />
# svnadmin create /var/svndir/repos<br />
在目录/var/svndir/repos下创建一个新的版本库，执行该命令后会在repos目录下创建以下目录conf,dav,db,hooks,locks和以下文件format,README.txt</p>
<p>将某个项目导入到版本库：<br />
# svn import /var/myproject file:///var/svndir/repos/myproject -m “initial import”</p>
<p><strong>2.增加网络访问支</strong><br />
1).使用svn自有协议 svnserve（默认端口为3690）<br />
# svnserve -d -r /var/svndir/repos<br />
该命令指定svn客户端只能访问repos下的版本(svn://host.name/***)。<br />
# svnserve -d<br />
该命令没有指定目录，可以访问所有版本库(svn://host.name/var/svndir/repos/***)<br />
2).使用apache服务器模块(mod_dav_svn)<br />
注：一般安装mod_dav_svn之后配置文件就会自动修改，若配置文件没有自动修改，我们可以在httpd.conf中增加以下内容来使用mod_dav_svn模块：<br />
LoadModule dav_module         modules/mod_dav.so<br />
LoadModule dav_svn_module     modules/mod_dav_svn.so</p>
<p>在apache配置文件中添加以下内容<br />
A.只有一个版本库repos<br />
&lt;Location /repos&gt;<br />
DAV svn<br />
SVNPath /var/svndir/repos<br />
&lt;/Location&gt;<br />
通过 http://host.name/repos/*** 来访问，即：<br />
# svn co http://host.name/repos/testprject   testproject<br />
B.有多个版本库<br />
&lt;Location /svn&gt;<br />
DAV svn<br />
SVNParentPath /var/svndir<br />
&lt;/Location&gt;<br />
通过 http://host.name/svn/repos1/***,http://host.name/svn/repos2/*** 来访问</p>
<p><strong>3.增加访问权限</strong><br />
1).svnserve方式设置访问权限<br />
修改conf/svnserve.conf文件内容为：<br />
[general]<br />
anon-access = none    #意思是不允许匿名访问<br />
auth-access = write     #通过用户名和密码访问的用户有写权限(用户名和密码在下面的passwd文件里)<br />
password-db = passwd    #指定存放用户名和密码的文件，这里是相对路径(我们可以使用绝对路径)。<br />
realm = My First Repository    #用户登录时的显示信息</p>
<p>修改passwd文件内容为：<br />
[users]<br />
zhiwei = 123456    #用户名为zhiwei，密码为123456</p>
<p>2).apache模块(mod_dav_svn)方式设置访问权限<br />
修改apache配置文件httpd.conf，增加如下内容：<br />
&lt;Location /svn&gt;<br />
DAV svn<br />
SVNParentPath /data0/svndir<br />
AuthType Basic   #基本认证方式<br />
AuthName “Subversion repository”   #登录时显示信息<br />
AuthUserFile /etc/svn-auth-file   #存放认证用户的用户名和密码<br />
Require valid-user   #意思是需要输入用户名和密码才能访问<br />
&lt;/Location&gt;</p>
<p>创建/etc/svn-auth-file文件，并增加用户名和密码：<br />
# htpasswd -cm /etc/svn-auth-file zhiwei   //创建文件并增加用户名zhiwei,接下来会让输入密码，-c参加是创建文件的意思，-m参数是使用md5方式加密用户密码<br />
New password: ***<br />
Re-type new password: ****</p>
<p>注：我们可以用cat /etc/svn-auth-file来查看文件内容：<br />
zhiwei:$apr1$r4gGX&#8230;$TZuXKjRt.GD7vfGieR96f0</p>
<p>以下是允许所有人以只读方式访问：<br />
&lt;Location /svn&gt;<br />
DAV svn<br />
SVNParentPath /data0/svndir<br />
AuthType Basic   #基本认证方式<br />
AuthName “Subversion repository”   #登录时显示信息<br />
AuthUserFile /etc/svn-auth-file   #存放认证用户的用户名和密码</p>
<p># For any operations other than these, require an authenticated user.<br />
&lt;LimitExcept GET PROPFIND OPTIONS REPORT&gt;<br />
Require valid-user<br />
&lt;/LimitExcept&gt;</p>
<p>&lt;/Location&gt;</p>
<p>更详细的配置：http://www.subversion.org.cn/svnbook/1.4/svn.serverconfig.httpd.html</p>
<p><strong>4.获取代码</strong><br />
1).本地获取<br />
# svn checkout file:///var/svndir/repos/testproject   testproject<br />
或者<br />
# svn checkout file://localhost/var/svndir/repos/testproject   testproject<br />
注：本地获取的话是不需要输入用户名和密码的。<br />
2).远程获取<br />
# svn co svn://host.name/testproject  testproject<br />
注：如果设定了anon-access = none的话，执行这条命令后需要用户输入用户名和密码才可以。<br />
# svn co http://host.name/repos/testproject   testproject<br />
注：该方法是在使用apache的mod_dav_svn模块后</p>
<p>其实内容会在这里补充上去：<a href="http://goo.gl/TALLk" target="_blank">http://goo.gl/TALLk</a></p>
<p style="font-weight: bold;">&copy; 2011, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="安装并配置subversion服务" href="http://chenzhiwei.net/2011/04/install-and-config-svn/">http://chenzhiwei.net/2011/04/install-and-config-svn/</a></p><hr /><div  class="related_post_title">相关日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2011/05/svn-vs-git/" title="svn与git">svn与git</a></li><li><a href="http://chenzhiwei.net/2011/07/one-apache-hosts-two-site-with-different-port/" title="一个apache为两个不同端口的网站提供服务">一个apache为两个不同端口的网站提供服务</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2011/04/install-and-config-svn/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux Shell学习笔记（五）</title>
		<link>http://chenzhiwei.net/2010/10/linux-shell-study-notes-part-5/</link>
		<comments>http://chenzhiwei.net/2010/10/linux-shell-study-notes-part-5/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 06:36:07 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[软件应用]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://chenzhiwei.net/?p=30380</guid>
		<description><![CDATA[在这里的linux shell是做为shell程序来讲，不是shell语言，之前写的都是关于shell编程的。 shell是读取并解释命令的程序 shell是一个程序，充当界面和脚本解释器，允许用户输入命令以及间接地访问内核的服务。shell有很多种，常见的有Bash、Bourne Shell、C-Shell、FreeBSD Shell、Korn Shell、Pdksh、Tcsh、Zsh等，而目前常用的有Bash和FreeBSD Shell。一般Linux系统中的Shell是Bash，FreeBSD中是FreeBSD Shell，而商业Unix中是Korn Shell。如果你不知道自己正在使用的是哪个Shell，可以使用echo $SHELL来显示当前所使用的shell名称。 shell中的变量 假设创建一个名为KT的变量，并将值kitty赋给它：KT=kitty，此时KT只是一个shell变量。如果启动一个新的shell，则这个新的shell不能访问TK变量，因为KT变量还不是环境变量。执行export KT后，KT才会变成环境变量，unset KT表示复位变量，即删除变量。 用echo命令来显示变量的值，如显示普通字符：echo I love linux ，如果要显示变量的值，则需要使用$（美元符号）字符，后面跟用花括号括起来的变量名。例如：显示变量PATH的值可输入echo ${PATH}，在没有歧义的情况下还可以省略花括号，如：echo $PATH。 $符号会跟一个名称时，指的是该变量的值，如果没有$符号，则就是一个字符串。 shell中的引用和转义字符 如果想输出“ Today is a fine day; go and visit my house”句子时，需要这样写：echo Today is a fine day\; go and visit my house ，该语句使用了反斜线（\）元字符，意思是转义特殊字符。 如果想输出“ Today is (a fine day); go and visit [...]]]></description>
			<content:encoded><![CDATA[<p>在这里的linux shell是做为shell程序来讲，不是shell语言，之前写的都是关于shell编程的。</p>
<p><strong>shell是读取并解释命令的程序</strong></p>
<p>shell是一个程序，充当界面和脚本解释器，允许用户输入命令以及间接地访问内核的服务。shell有很多种，常见的有Bash、Bourne Shell、C-Shell、FreeBSD Shell、Korn Shell、Pdksh、Tcsh、Zsh等，而目前常用的有Bash和FreeBSD Shell。一般Linux系统中的Shell是Bash，FreeBSD中是FreeBSD Shell，而商业Unix中是Korn Shell。如果你不知道自己正在使用的是哪个Shell，可以使用<code>echo $SHELL</code>来显示当前所使用的shell名称。<span id="more-30380"></span></p>
<p><strong>shell中的变量</strong></p>
<p>假设创建一个名为KT的变量，并将值kitty赋给它：<code>KT=kitty</code>，此时KT只是一个shell变量。如果启动一个新的shell，则这个新的shell不能访问TK变量，因为KT变量还不是环境变量。执行<code>export KT</code>后，KT才会变成环境变量，<code>unset KT</code>表示复位变量，即删除变量。</p>
<p>用<strong>echo</strong>命令来显示变量的值，如显示普通字符：<code>echo I love linux</code> ，如果要显示变量的值，则需要使用<strong>$</strong>（美元符号）字符，后面跟用花括号括起来的变量名。例如：显示变量PATH的值可输入<code>echo ${PATH}</code>，在没有歧义的情况下还可以省略花括号，如：<code>echo $PATH</code>。</p>
<p>$符号会跟一个名称时，指的是该变量的值，如果没有$符号，则就是一个字符串。</p>
<p><strong>shell中的引用和转义字符</strong></p>
<p>如果想输出“ Today is a fine day; go and visit my house”句子时，需要这样写：<code>echo Today is a fine day\; go and visit my house</code> ，该语句使用了反斜线（\）元字符，意思是转义特殊字符。</p>
<p>如果想输出“ Today is (a fine day); go and visit my house” 时，则需要这样写：<code>echo Today is \(a fine day\)\; go and visit my house</code> ，虽然这条命令可以正确执行，但是易读性很差。这时单引号就派上用场了，我们可以直接这样写这条命令：<code>echo 'Today is a fine day; go and visit my house'</code> ，单引号内的内容原样输出。</p>
<p>如果想输出“My userid is <$USER>; my shell is <$SHELL>”时，可以这样写：<code>echo My userid is \<$USER\>\; my shell is \<$SHELL\></code>。但是这样写太复杂，这时，我们就可以使用双引号来重写命令：<code>echo  "My userid is <$USER>; my shell is <$SHELL>"</code>，双引号中的元字符除美元符号（$）、反斜线（\）和反引号（`）三个字符保留特殊含义外，其他字符均原样输出。</p>
<p><strong>shell中的别名：alias、unalias</strong></p>
<p>alias语法为：<code>alias [name=commands]</code>，等号两边没有空格。如：列出当前目录下所有以xyz开头的文件名：<code>ls xyz*</code>。使用<code>alias lx='ls xyz*'</code> 来为此命令定义别名lx，这样在命令行直接输入lx即可列出当前目录下的所有以xyz开头的文件。使用<code>unalias lx</code>来移除别名。</p>
<p>alias还可以重新定义现有的命令，如：<code>alias ls="ls -l"</code>，这样，每次直接输入ls就可以列出当前目录下文件的“长”列表，也就是详细信息。但有时候，我们希望运行的是原始命令而不是别名，这时我们可以临时挂起别名，在命令行输入<code>\ls</code>即可，<code>\ls</code>告诉shell运行的是实际命令而不是别名。</p>
<p>注：关于shell程序的用法还有很多，这只列出了常用的几个。</p>
<p style="font-weight: bold;">&copy; 2010, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="Linux Shell学习笔记（五）" href="http://chenzhiwei.net/2010/10/linux-shell-study-notes-part-5/">http://chenzhiwei.net/2010/10/linux-shell-study-notes-part-5/</a></p><hr /><div  class="related_post_title">相关日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2011/08/shell-io-redirection/" title="Shell I/O重定向">Shell I/O重定向</a></li><li><a href="http://chenzhiwei.net/2010/11/shell-script-study-notes-shell/" title="几个简单的shell脚本">几个简单的shell脚本</a></li><li><a href="http://chenzhiwei.net/2010/11/shell-script-study-notes-2/" title="shell 脚本学习之判断条件">shell 脚本学习之判断条件</a></li><li><a href="http://chenzhiwei.net/2010/11/shell-script-study-notes/" title="shell脚本学习">shell脚本学习</a></li><li><a href="http://chenzhiwei.net/2010/07/linux-shell-study-notes-part-4/" title="linux shell 学习笔记(四)">linux shell 学习笔记(四)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2010/10/linux-shell-study-notes-part-5/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Ubuntu+WinXP双系统修复grub2引导的方法</title>
		<link>http://chenzhiwei.net/2010/10/ubuntu-and-winxp-repair-grub2/</link>
		<comments>http://chenzhiwei.net/2010/10/ubuntu-and-winxp-repair-grub2/#comments</comments>
		<pubDate>Sat, 16 Oct 2010 07:40:33 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[软件应用]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://chenzhiwei.net/?p=30379</guid>
		<description><![CDATA[用Ubuntu+WinXP双系统很长时间了，昨天下午WinXP系统中毒了，杀毒之后居然启动不了WinXP系统了，无奈之下只好重新安装WinXP系统，在安装WinXP系统第二次重启时，屏幕上提示进入不了系统了“missing operating system”，很无语。然后我就用WinXP的安装盘进入DOS，在DOS命令行下输入”fdisk /mbr”，之后重新启动电脑完成了WinXP的安装。 WinXP系统安装好之后，又有新问题了，Ubuntu系统又进入不了了。今天上午，我在网上搜索了一下，找到了一篇文章：双系统修复ubuntu grub2引导的方法 ，我的做法如下： 1. 用Ubuntu10.04的LiveCD启动电脑，然后打开终端，在终端中输入以下代码： 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 30 31 ubuntu@ubuntu:~$ sudo -i #此命令用于得到root权限 root@ubuntu:~# fdisk -l #此命令列出电脑分区信息，以此来确实Ubuntu所在的分区 Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 [...]]]></description>
			<content:encoded><![CDATA[<p>用Ubuntu+WinXP双系统很长时间了，昨天下午WinXP系统中毒了，杀毒之后居然启动不了WinXP系统了，无奈之下只好重新安装WinXP系统，在安装WinXP系统第二次重启时，屏幕上提示进入不了系统了“missing operating system”，很无语。然后我就用WinXP的安装盘进入DOS，在DOS命令行下输入”fdisk /mbr”，之后重新启动电脑完成了WinXP的安装。<span id="more-30379"></span></p>
<p>WinXP系统安装好之后，又有新问题了，Ubuntu系统又进入不了了。今天上午，我在网上搜索了一下，找到了一篇文章：<a href="http://huanyue.javaeye.com/blog/582450" target="_blank">双系统修复ubuntu grub2引导的方法</a> ，我的做法如下：</p>
<p><strong>1. 用Ubuntu10.04的LiveCD启动电脑，然后打开终端，在终端中输入以下代码：</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
30
31
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">ubuntu@ubuntu:~$ sudo -i
#此命令用于得到root权限
root@ubuntu:~# fdisk -l
#此命令列出电脑分区信息，以此来确实Ubuntu所在的分区
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 34 sectors/track, 36053 cylinders
Units = cylinders of 8670 * 512 = 4439040 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x95919591
&nbsp;
Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        5433    23552038    7  HPFS/NTFS
/dev/sda2            5434       14168    37864377    f  W95 Ext'd (LBA)
/dev/sda3           14168       23386    39960576   83  Linux
/dev/sda4           23387       36053    54911445    7  HPFS/NTFS
/dev/sda5            5434       13937    36864823    7  HPFS/NTFS
/dev/sda6           13938       14168      999424   82  Linux swap / Solaris
root@ubuntu:~# mkdir /media/tmp
root@ubuntu:~# mount /dev/sda3 /media/tmp
#挂载Ubuntu所在分区
root@ubuntu:~# grub-install --root-directory=/media/tmp /dev/sda
#将grub安装到硬盘的mbr上
/usr/sbin/grub-setup: warn: Your embedding area is unusually small.  core.img won't fit in it..
/usr/sbin/grub-setup:  warn: Embedding is not possible.  GRUB can only be installed in this  setup by using blocklists.  However, blocklists are UNRELIABLE and its  use is discouraged..
/usr/sbin/grub-setup: error: if you really want blocklists, use --force.
root@ubuntu:~# grub-install --force --root-directory=/media/tmp /dev/sda
#按照提示加上--force参数，注：一般情况下是不用该参数的
/usr/sbin/grub-setup: warn: Your embedding area is unusually small.  core.img won't fit in it..
/usr/sbin/grub-setup: warn: Embedding is not possible.  GRUB can only be  installed in this setup by using blocklists.  However, blocklists are  UNRELIABLE and its use is discouraged..
Installation finished. No error reported.</pre></td></tr></table></div>

<p><strong>2. 做完以上操作后，重启电脑，这时就会出现grub2的引导界面了，进入ubuntu系统后，在终端输入以下命令：</strong></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;">sudo update-grub2</pre></td></tr></table></div>

<p>然后按照提示输入密码，到此问题就解决了。</p>
<p style="font-weight: bold;">&copy; 2010, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="Ubuntu+WinXP双系统修复grub2引导的方法" href="http://chenzhiwei.net/2010/10/ubuntu-and-winxp-repair-grub2/">http://chenzhiwei.net/2010/10/ubuntu-and-winxp-repair-grub2/</a></p><hr /><div  class="related_post_title">相关日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2010/10/install-lamp-on-ubuntu/" title="LAMP安装配置小记">LAMP安装配置小记</a></li><li><a href="http://chenzhiwei.net/2010/03/install-ubuntu-under-windows/" title="windows下硬盘安装ubuntu的方法">windows下硬盘安装ubuntu的方法</a></li><li><a href="http://chenzhiwei.net/2009/04/portable-unbuntu-under-windows/" title="运行在Windows下的Portable Ubuntu">运行在Windows下的Portable Ubuntu</a></li><li><a href="http://chenzhiwei.net/2009/03/how-to-use-ubuntu/" title="使用ubuntu linux手记">使用ubuntu linux手记</a></li><li><a href="http://chenzhiwei.net/2011/08/shell-io-redirection/" title="Shell I/O重定向">Shell I/O重定向</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2010/10/ubuntu-and-winxp-repair-grub2/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>LAMP安装配置小记</title>
		<link>http://chenzhiwei.net/2010/10/install-lamp-on-ubuntu/</link>
		<comments>http://chenzhiwei.net/2010/10/install-lamp-on-ubuntu/#comments</comments>
		<pubDate>Thu, 14 Oct 2010 13:15:19 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[软件应用]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://chenzhiwei.net/?p=30378</guid>
		<description><![CDATA[LAMP就是linux+apache+mysql+php，是一组常用来搭建动态网站或者服务器的开源软件，本身都是各自独立的程序，但是因为常被放在一起使用，拥有了越来越高的兼容度，共同组成了一个强大的Web应用程序平台。之前我在ubuntu上已经安装过很多次了，但都是在图形界面里安装，这次我直接在命令行里安装的，其实在图形界面与在命令行安装并没有太大的差别。 安装Apache+MySQL+PHP5 1 $sudo apt-get install apache2 mysql-server php5 php5-mysql 下面主要说说他们的配置文件： Apache配置文件：/etc/apache2/apache2.conf 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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 [...]]]></description>
			<content:encoded><![CDATA[<p>LAMP就是linux+apache+mysql+php，是一组常用来搭建动态网站或者服务器的开源软件，本身都是各自独立的程序，但是因为常被放在一起使用，拥有了越来越高的兼容度，共同组成了一个强大的Web应用程序平台。之前我在ubuntu上已经安装过很多次了，但都是在图形界面里安装，这次我直接在命令行里安装的，其实在图形界面与在命令行安装并没有太大的差别。<span id="more-30378"></span></p>
<p><strong>安装Apache+MySQL+PHP5</strong></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;">$sudo apt-get install apache2 mysql-server php5 php5-mysql</pre></td></tr></table></div>

<p>下面主要说说他们的配置文件：</p>
<p><strong>Apache配置文件：/etc/apache2/apache2.conf</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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">ServerTokens   OS
#告诉客户端服务器的版本与操作系统，如果不想让客户端知道太多信息可以将OS改为Minor
ServerRoot   &quot;/etc/apache2&quot;
#这是配置文件的最顶层目录，下面某些配置使用相对路径时，就是该目录的下层目录
PidFile    /var/run/apache2.pid
#存放pid文件，可方便Apache软件管理。
Timeout    120
#持续联机阶段如果等待超过120秒则中断本次联机
KeepAlive    On
#是否允许持续性联机，即一个TCP联机可以具有多个文件资料的传送要求
#例如，一个网页内含有多张图片时，那么一次联机就能将所有图片传送完
#而不必对每张图片都进行一次TCP连接
MaxKeepAliveRequests    500
#当KeepAlive设置为On时，这个数值代表该次联机能够传输的最大数据量，0表示不限制
KeepAliveTimeout    15
#在允许KeepAlive的前提下，该次联机在最后一次传输后等待延迟的秒数
Listen    80
#服务器端口号
ServerAdmin    linux@linux.os
#系统管理员电子邮箱，当网站出现问题时，错误信息的联系邮箱
ServerName    linux.os
#主机名称，若没指定，默认以hostname为依据
AddLanguage    zh-CN .zh-cn
AddCharset    GB2312 .GB2312 .gb2312
#AddDefaultCharset    UTF-8 //一般不用此项，而在网页头部宣告即可。
LanguagePriority    zh-CN zh-TW en ca ...
#语言处理优先级
DocumentRoot    &quot;/var/www&quot;
#服务器主网页所放位置的目录
&lt;Directory &quot;/var/www&quot;&gt;
    Options Indexes FollowSymLinks    #Indexes表示没有首页则列出当前目录所有文件
    AllowOverride  None
    Order allow,deny
    Allow from all
&lt;/Directory&gt;
#注：
#FollowSymLinks:让在此目录下的链接文件可以连接出此目录
#AllowOverride:表示是否允许额外配置文件&quot;.htaccess&quot;的重写，其值有以下几种
#    *All:全部权限均可被重写
#    *AuthConfi:仅有认证网页可重写（用户名和密码认证）
#    *Indexes:仅允许Indexes方面的重写
#    *Limits:允许用户利用Allow,Deny与Order管理可浏览的权限
#    *None:不可重写，即&quot;.htaccess&quot;文件无效
DirectoryIndex    index.html index.htm index.php
#默认首页文件</pre></td></tr></table></div>

<p>此外还有建立虚拟主机及对SSL的支持，这些内容就不再多说了，阅读一下配置文件就知道。以上这些写出来的配置也在配置文件里有很好的说明了，这里算是汉语版的简要说明。只要改动Apache的配置文件时，都需要重新启动Apache服务器。关于Apache服务器启动关闭的相关命令如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">root@linux:# /etc/init.d/apache2 start    #启动Apache服务器
root@linux:# /etc/init.d/apache2 stop    #关闭Apache服务器
root@linux:# /etc/init.d/apache2 restart    #重新启动Apache服务器</pre></td></tr></table></div>

<p><strong>PHP的配置文件：/etc/php5/apache2/php.ini</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
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php
#这两行的意思分别代表加载PHP模块和增加PHP附文件名为.php的文件处理方式
register_globals=Off
#一般都将其设置成Off，减少安全问题
log_errors=On
ignore_repeated_errors=On
ignore_repeated_source=On
#将PHP程序错误日志记录下来并忽略重复日志数据
display_errors=Off
display_startup_errors=Off
#当程序发生问题时，是否在浏览器中显示错误信息
#一般本地调试时开启，开放浏览时关闭</pre></td></tr></table></div>

<p>MySQL数据库的配置比较简单，不多说了。</p>
<p>这些配置文件的配置说明在配置文件中都已经存在了，懂点英文的话都能看明白，这里写出来只是为了自己查看记忆。</p>
<p style="font-weight: bold;">&copy; 2010, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="LAMP安装配置小记" href="http://chenzhiwei.net/2010/10/install-lamp-on-ubuntu/">http://chenzhiwei.net/2010/10/install-lamp-on-ubuntu/</a></p><hr /><div  class="related_post_title">相关日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2010/10/ubuntu-and-winxp-repair-grub2/" title="Ubuntu+WinXP双系统修复grub2引导的方法">Ubuntu+WinXP双系统修复grub2引导的方法</a></li><li><a href="http://chenzhiwei.net/2010/03/install-ubuntu-under-windows/" title="windows下硬盘安装ubuntu的方法">windows下硬盘安装ubuntu的方法</a></li><li><a href="http://chenzhiwei.net/2009/04/portable-unbuntu-under-windows/" title="运行在Windows下的Portable Ubuntu">运行在Windows下的Portable Ubuntu</a></li><li><a href="http://chenzhiwei.net/2009/03/how-to-use-ubuntu/" title="使用ubuntu linux手记">使用ubuntu linux手记</a></li><li><a href="http://chenzhiwei.net/2011/08/shell-io-redirection/" title="Shell I/O重定向">Shell I/O重定向</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2010/10/install-lamp-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>推荐使用7-Zip软件进行解压缩</title>
		<link>http://chenzhiwei.net/2010/06/recommend-to-use-7-zip-to-extract-and-compress/</link>
		<comments>http://chenzhiwei.net/2010/06/recommend-to-use-7-zip-to-extract-and-compress/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 12:04:56 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[软件应用]]></category>
		<category><![CDATA[7-zip]]></category>
		<category><![CDATA[压缩]]></category>
		<category><![CDATA[开源]]></category>

		<guid isPermaLink="false">http://chenzhiwei.net/?p=30254</guid>
		<description><![CDATA[提到解压缩，我想各位同学对Winrar不会陌生吧，在中国大陆的绝大多数电脑上都会安装这个解压缩软件。Winrar是一个共享(收费)软件，我们习惯了使用盗版的Winrar，所以可能会有一些人觉得.rar格式的压缩文件才是标准，其实这是错误的。如果你使用过Linux，你会发现在Linux下，很多.rar文件都不能在Linux下正常解压缩。作为一个开源软件的支持者，我对Winrar这种封闭的软件持鄙视态度，这也是我今天写这篇文章的目的。 也许你一直都很好奇，为什么从一些正规网站下载下来的压缩包都是.zip格式的，而我们常用的都是.rar格式的，现在我就给你说下原因。.zip才是压缩文件的标准，所有的操作系统都支持.zip压缩文件格式，但并不是所有的操作系统都支持.rar压缩文件格式。关于压缩文件的由来及.zip和.rar文件格式的说明请移步此处：《悲壮的.zip》。 看完《悲 壮的.zip》之后，你对压缩文件相关知识应该有一定了解了，下面我就简单介绍一下7-Zip软件，7-Zip软件基于 GNU 次要公共许可协议(Lesser General Public License) 之下发布，是一款完全免费的压缩解压软件。7-Zip软件支持现在大多数压缩文件格式，包括.rar，并且还有支持大多数操作系统，软件性能要比Winrar好，我电脑用Winrar同时压缩两个300M以上的图片目录就会出现假死现象，而用7-Zip软件就不会出现假死现象(这可能也和我用的是盗版软件有关)。在多次测试之后，我最终选择使用7-Zip软件作为我电脑的唯一解压缩软件。此外，还有人专门为7-Zip软件制作了主题，自己也可以制件主题，制作方法很简单，只要PS几张.ico图片就行了。 关于7-Zip的详细介绍：7-Zip 是一款号称有着现今最高压缩比的压缩软件，它不仅支持独有的 7z 文件格式，而且还支持各种其它压缩文件格式，其中包括 ZIP, RAR, CAB, GZIP, BZIP2和 TAR 等等。此软件压缩的压缩比要比普通 ZIP 文件高 30-50%，但是要以压缩时间为代价。而且此软件界面和各种操作（含自解压缩程序和右键菜单等等）都简洁扼要，可以看出软件作者追求的是简洁实用之风 格。 如果你已经使用了7-Zip软件，那么请继续支持这个开源软件，如果你没有使用7-Zip软件，那么你不妨安装一下试试该软件。我是强烈推荐使用这个开源解压缩软件，本人始终认为只要是软件就应该开放源代码，我们还有很多方式来进行软件商业化，那些封闭的软件早晚会被淘汰的。 关于7-Zip软件的使用方法，网上有很多说明，在此我就不多说了。有兴趣的同学可以围观7-Zip的中文官方站点。 可以从这里下载7-Zip中文版：http://sparanoid.com/lab/7z/ 也可以下载7-Zip汉化版：http://www.xiazaiba.com/html/1481.html 关于7-zip主题美化介绍：http://www.appinn.com/7-zip-theme-manager/ &#169; 2010, chenzhiwei.net. 版权所有. 本文永久链接：http://chenzhiwei.net/2010/06/recommend-to-use-7-zip-to-extract-and-compress/随机日志留个标记吧新版火狐浏览器3.5beta4可以下载试用必看的几部国外电影shell脚本学习shell 脚本学习之判断条件]]></description>
			<content:encoded><![CDATA[<p>提到解压缩，我想各位同学对Winrar不会陌生吧，在中国大陆的绝大多数电脑上都会安装这个解压缩软件。Winrar是一个共享(收费)软件，我们习惯了使用盗版的Winrar，所以可能会有一些人觉得.rar格式的压缩文件才是标准，其实这是错误的。如果你使用过Linux，你会发现在Linux下，很多.rar文件都不能在Linux下正常解压缩。作为一个开源软件的支持者，我对Winrar这种封闭的软件持鄙视态度，这也是我今天写这篇文章的目的。<span id="more-30254"></span></p>
<p>也许你一直都很好奇，为什么从一些正规网站下载下来的压缩包都是.zip格式的，而我们常用的都是.rar格式的，现在我就给你说下原因。.zip才是压缩文件的标准，所有的操作系统都支持.zip压缩文件格式，但并不是所有的操作系统都支持.rar压缩文件格式。关于压缩文件的由来及.zip和.rar文件格式的说明请移步此处：<a href="http://hi.baidu.com/flasherfffff/blog/item/212e48d7a76f21dfa144df01.html" target="_blank">《悲壮的.zip》</a>。</p>
<p>看完<a href="http://hi.baidu.com/flasherfffff/blog/item/212e48d7a76f21dfa144df01.html" target="_blank">《悲 壮的.zip》</a>之后，你对压缩文件相关知识应该有一定了解了，下面我就简单介绍一下7-Zip软件，7-Zip软件基于 GNU 次要公共许可协议(Lesser General Public License) 之下发布，是一款完全免费的压缩解压软件。7-Zip软件支持现在大多数压缩文件格式，包括.rar，并且还有支持大多数操作系统，软件性能要比Winrar好，我电脑用Winrar同时压缩两个300M以上的图片目录就会出现假死现象，而用7-Zip软件就不会出现假死现象(这可能也和我用的是盗版软件有关)。在多次测试之后，我最终选择使用7-Zip软件作为我电脑的唯一解压缩软件。此外，还有人专门为7-Zip软件制作了主题，自己也可以制件主题，制作方法很简单，只要PS几张.ico图片就行了。</p>
<p>关于7-Zip的详细介绍：7-Zip 是一款号称有着现今最高压缩比的压缩软件，它不仅支持独有的 7z 文件格式，而且还支持各种其它压缩文件格式，其中包括 ZIP,  RAR, CAB, GZIP, BZIP2和 TAR 等等。此软件压缩的压缩比要比普通 ZIP 文件高  30-50%，但是要以压缩时间为代价。而且此软件界面和各种操作（含自解压缩程序和右键菜单等等）都简洁扼要，可以看出软件作者追求的是简洁实用之风 格。</p>
<p>如果你已经使用了7-Zip软件，那么请继续支持这个开源软件，如果你没有使用7-Zip软件，那么你不妨安装一下试试该软件。我是强烈推荐使用这个开源解压缩软件，<span style="color: #ff0000;">本人始终认为只要是软件就应该开放源代码</span>，我们还有很多方式来进行软件商业化，那些封闭的软件早晚会被淘汰的。</p>
<p>关于7-Zip软件的使用方法，网上有很多说明，在此我就不多说了。有兴趣的同学可以围观<a href="http://7z.sparanoid.com/" target="_blank">7-Zip的中文官方站点</a>。</p>
<p>可以从这里下载7-Zip中文版：http://sparanoid.com/lab/7z/<br />
也可以下载7-Zip汉化版：http://www.xiazaiba.com/html/1481.html</p>
<p>关于7-zip主题美化介绍：http://www.appinn.com/7-zip-theme-manager/</p>
<p style="font-weight: bold;">&copy; 2010, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="推荐使用7-Zip软件进行解压缩" href="http://chenzhiwei.net/2010/06/recommend-to-use-7-zip-to-extract-and-compress/">http://chenzhiwei.net/2010/06/recommend-to-use-7-zip-to-extract-and-compress/</a></p><hr /><div  class="related_post_title">随机日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2009/04/cannot-modify-header-information/" title="Cannot modify header information的问题">Cannot modify header information的问题</a></li><li><a href="http://chenzhiwei.net/2010/12/suimozongjie-2010/" title="岁末总结2010">岁末总结2010</a></li><li><a href="http://chenzhiwei.net/2010/06/add-twitter-gadget-on-your-blog/" title="博客上添加twitter挂件的方法-超级简单">博客上添加twitter挂件的方法-超级简单</a></li><li><a href="http://chenzhiwei.net/2010/07/linux-shell-study-notes-part-1/" title="linux shell学习笔记(一)">linux shell学习笔记(一)</a></li><li><a href="http://chenzhiwei.net/2009/04/new-version-of-firefox-35-beta4/" title="新版火狐浏览器3.5beta4可以下载试用">新版火狐浏览器3.5beta4可以下载试用</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2010/06/recommend-to-use-7-zip-to-extract-and-compress/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Linux下的VI和VIM编辑器</title>
		<link>http://chenzhiwei.net/2010/05/vi-and-vim-under-linux/</link>
		<comments>http://chenzhiwei.net/2010/05/vi-and-vim-under-linux/#comments</comments>
		<pubDate>Mon, 17 May 2010 12:42:16 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[软件应用]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://chenzhiwei.net/?p=30195</guid>
		<description><![CDATA[vi和vim是我们在Linux中最常用的编辑器。vi或vim是Linux最基本的文本编辑工具，vi或vim虽然没有图形界面编辑器那样点鼠标的简单 操作，但vi编辑器在系统管理、服务器管理中，永远不是图形界面的编辑器能比的。以下是vi/vim中最常用的用法(在正常模式下)。 [ctrl]+[f] : 向前翻页(foreward)，和 [Page Down] 的用法一样。 [ctrl]+[b] : 向后翻页(backward)，和 [Page Up] 的用法一样。 0: 移动光标到当前行的第一个字母处。 $: 移动光标到当前行的最后一个字母处。 G: 移动光标到文档的最后一行。 gg: 移动光标到文档的第一行，和1G的功能一样。 n&#60;enter&#62;: n是个整数，向下移动光标n行。 /word: 从光标处向下搜索下一个字符串”word”。 ?word: 从光标处向上搜索前一个字符串”word”。 :n1,n2s/word1/word2/g: n1,n2是整数，用“word2”替换n1-n2行之间的字符串“word1”. :0,$s/word1/word2/g: 用”word2&#8243;替换文档中所有的字符串”word1&#8243;. x,X : 在一行字中，x为向后删除一个字符(相当于[Del]键)，X为向前删除一个字符(相当于[backspace]即退格键). dd : 删除光标所在的一整行。 ndd : n为数字。从光标位置开始，删除向下的n行。 yy : 复制光标所在的那一行。 nyy : n为数字。复制光标所在的向下n行。 p,P : p为将已复制的数字粘贴到光标的下一行，P则为贴在光标上一行。举例来说，当前光标在第20行，且已经复制了10行数据。则按下p后，那10行数据会贴在 原来的20行之后，即由21开始贴。但如果按下P，那么原来的20行会变成30行。 u : 复原前一个操作. [ctrl]+r [...]]]></description>
			<content:encoded><![CDATA[<p>vi和vim是我们在Linux中最常用的编辑器。vi或vim是Linux最基本的文本编辑工具，vi或vim虽然没有图形界面编辑器那样点鼠标的简单 操作，但vi编辑器在系统管理、服务器管理中，永远不是图形界面的编辑器能比的。以下是vi/vim中最常用的用法(在正常模式下)。<span id="more-30195"></span></p>
<blockquote>
<ol>
<li>[ctrl]+[f] : 向前翻页(foreward)，和 [Page Down] 的用法一样。</li>
<li>[ctrl]+[b] : 向后翻页(backward)，和 [Page Up] 的用法一样。</li>
<li>0: 移动光标到当前行的第一个字母处。</li>
<li>$: 移动光标到当前行的最后一个字母处。</li>
<li>G: 移动光标到文档的最后一行。</li>
<li>gg: 移动光标到文档的第一行，和1G的功能一样。</li>
<li>n&lt;enter&gt;: n是个整数，向下移动光标n行。</li>
<li>/word: 从光标处向下搜索下一个字符串”word”。</li>
<li>?word: 从光标处向上搜索前一个字符串”word”。</li>
<li>:n1,n2s/word1/word2/g: n1,n2是整数，用“word2”替换n1-n2行之间的字符串“word1”.</li>
<li>:0,$s/word1/word2/g: 用”word2&#8243;替换文档中所有的字符串”word1&#8243;.</li>
<li>x,X : 在一行字中，x为向后删除一个字符(相当于[Del]键)，X为向前删除一个字符(相当于[backspace]即退格键).</li>
<li>dd : 删除光标所在的一整行。</li>
<li>ndd : n为数字。从光标位置开始，删除向下的n行。</li>
<li>yy : 复制光标所在的那一行。</li>
<li>nyy : n为数字。复制光标所在的向下n行。</li>
<li>p,P :  p为将已复制的数字粘贴到光标的下一行，P则为贴在光标上一行。举例来说，当前光标在第20行，且已经复制了10行数据。则按下p后，那10行数据会贴在 原来的20行之后，即由21开始贴。但如果按下P，那么原来的20行会变成30行。</li>
<li>u : 复原前一个操作.</li>
<li>[ctrl]+r : 重做上一个操作.</li>
<li>. : 这是小数点。意思是重复前一个动作。如果重复删除、重复粘贴，按下小数点“.”就可以。</li>
<li>i,I :  插入：当前光标所在处插入输入文字，已存在的文字会向后退，其中i为“从当前光标所在处插入”，I为“在当前所在行的第一非空格符处开始插入”。</li>
<li>a,A : a为“从当前光标所在的下一处开始插入”，A为“从光标所在行的最后一个字符处开始插入”。</li>
<li>o,O : 英文字母o的大小写。o为“在当前光标所在的下一行插入新的一行”；O为“在当前光标所在处的上一行插入新的一行”。</li>
<li>r,R : 替换：r会替换光标所在的那一个字符；R会一直替换光标所在的文字，直到按下Esc键为止。</li>
<li>Esc : 退出编辑模式，回到一般模式中。</li>
<li>:w : 将编辑的数据写入硬盘文件中。</li>
<li>:w! : 强行写入。</li>
<li>:q : 离开vi。</li>
<li>:q! : 若曾修改过文件，又不想存储，使用！为强制离开而不存储文件。</li>
<li>:wq : 存储文件后离开，:wq! 强制存储文件并离开。</li>
</ol>
</blockquote>
<p>以上30条是vi/vim最常用的命令，随着对vi/vim的了解，你会知道的更多。</p>
<p>vi/vim还有块选择功能，以下为我机器的hosts文件，如果只想复制IP地址的话就能到块选择功能了。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">76.13.18.78       farm3.static.flickr.com
76.13.18.79       farm5.static.flickr.com
128.242.240.29    twitter.com
128.242.240.29    www.twitter.com
209.85.225.101    docs.google.com
74.125.127.100    writely.google.com</pre></td></tr></table></div>

<p>在普通模式下的块选择按键的意义：</p>
<blockquote><p>
v：字符选择，会将光标经过的地方反白选择<br />
V：行选择，会将光标经过的行反白选择<br />
[ctrl]+v：块选择，可以用长方形的方式来选择数据<br />
y：复制反白的地方<br />
d：删除反白的地方
</p></blockquote>
<p>以上这些按键功能可自己亲自动手操作一下，这样你就会更加明白。</p>
<p>下面是我的VIM配置文件.vimrc，这个配置文件能保证基本的文档编辑功能和书写C、C++及shell语言的缩进、关键字高亮及显示行号等功能。这个.vimrc文件是我从网上找的，然后自己又修改了其中的一部分，对于其中的一些规则我自己也不是十分了解，但是已经足够满足我的使用了。</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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">&quot;Get out of VI's compatible mode..
set nocompatible
&nbsp;
&quot;Sets how many lines of history VIM har to remember
set history=400
&nbsp;
&quot;Enable filetype plugin
filetype on
filetype plugin on
filetype indent on
&nbsp;
&quot;Set to auto read when a file is changed from the outside
set autoread
&nbsp;
&quot;Font
set guifont=Courier\ 9
&nbsp;
if has(&quot;syntax&quot;)
    syntax on
endif
&nbsp;
&quot;Enable syntax hl
syntax enable
&nbsp;
&quot;Highlight current
&quot;set cursorline
&nbsp;
&quot;Turn on WiLd menu
&quot;set wildmenu
&nbsp;
&quot;Always show current position
set ruler
&nbsp;
&quot;Show line number
set nu
&nbsp;
&quot;Set backspace
set backspace=eol,start,indent
&nbsp;
&quot;Bbackspace and cursor keys wrap to
set whichwrap+=&lt;,&gt;,h,l
&nbsp;
set incsearch
&nbsp;
&quot;Set magic on
set magic
&nbsp;
&quot;show matching bracets
set showmatch
&nbsp;
&quot;How many tenths of a second to blink
set mat=4
&nbsp;
&quot;Highlight search things
set hlsearch
&nbsp;
&quot;Text options
set expandtab
set shiftwidth=4
set tabstop=4
set smarttab
set lbr
&nbsp;
&quot;Auto indent
set ai
&nbsp;
&quot;Smart indet
set si
&nbsp;
&quot;C-style indenting
set cindent
&nbsp;
&quot;Wrap line
set wrap
&nbsp;
&quot;Chinese support
set encoding=utf-8
set fencs=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set ambiwidth=double
&nbsp;
&quot;Show C space errors
let c_space_errors=1
&nbsp;
&quot;IComplete Setting
autocmd Filetype cpp,c,java set omnifunc=cppcomplete#Complete</pre></td></tr></table></div>

<p style="font-weight: bold;">&copy; 2010, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="Linux下的VI和VIM编辑器" href="http://chenzhiwei.net/2010/05/vi-and-vim-under-linux/">http://chenzhiwei.net/2010/05/vi-and-vim-under-linux/</a></p><hr /><div  class="related_post_title">相关日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2011/08/shell-io-redirection/" title="Shell I/O重定向">Shell I/O重定向</a></li><li><a href="http://chenzhiwei.net/2011/07/one-apache-hosts-two-site-with-different-port/" title="一个apache为两个不同端口的网站提供服务">一个apache为两个不同端口的网站提供服务</a></li><li><a href="http://chenzhiwei.net/2011/05/what-is-haproxy/" title="haproxy是个什么东西">haproxy是个什么东西</a></li><li><a href="http://chenzhiwei.net/2011/03/linux-nfs-vsftp-samba/" title="Linux下的NFS,VSFTP,Samba的简单配置">Linux下的NFS,VSFTP,Samba的简单配置</a></li><li><a href="http://chenzhiwei.net/2010/12/detailed-explanation-of-hamming-code/" title="海明码详解">海明码详解</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2010/05/vi-and-vim-under-linux/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

