<?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; linux</title>
	<atom:link href="http://www.kuaixiang.net/category/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.kuaixiang.net</link>
	<description>记录生活点滴-分享美好回忆！</description>
	<lastBuildDate>Wed, 28 Jul 2010 07:15:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>pure-ftpd日志记录设置</title>
		<link>http://www.kuaixiang.net/pure-ftpd-logging-settings</link>
		<comments>http://www.kuaixiang.net/pure-ftpd-logging-settings#comments</comments>
		<pubDate>Wed, 31 Mar 2010 02:08:06 +0000</pubDate>
		<dc:creator>嘟嘟鱼</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[pure-ftpd]]></category>
		<category><![CDATA[日志]]></category>

		<guid isPermaLink="false">http://www.kuaixiang.net/?p=11911</guid>
		<description><![CDATA[刚帮一个用户查看ftp操作日志，发现没有记录，就帮他设置了下,他用的是pure-ftpd，保存下方法: 1)建立文件/var/log/pureftpd.log 2)修改/etc/syslog.conf 1&#62;在这行的cron.none后面添加 ;ftp.none 使ftp的日志... ]]></description>
			<content:encoded><![CDATA[<p>刚帮一个用户查看ftp操作日志，发现没有记录，就帮他设置了下,他用的是pure-ftpd，保存下方法:</p>
<p><strong>1)建立文件/var/log/pureftpd.log</strong></p>
<p><strong>2)修改/etc/syslog.conf</strong></p>
<p><strong>1&gt;</strong>在这行的cron.none后面添加 <strong>;ftp.none</strong> 使ftp的日志信息成私有<br />
*.info;mail.none;authpriv.none;cron.none              /var/log/messages<br />
为<br />
*.info;mail.none;authpriv.none;cron.none<strong>;ftp.none</strong>              /var/log/messages</p>
<p><strong>2&gt;</strong>在/etc/syslog.conf文件最后加上</p>
<p>#pureftp日志<br />
ftp.*        <span style="font-size: medium;"><strong>-</strong></span>/var/log/pureftpd.log</p>
<p>注意: 不要去掉/var前面的<span style="font-size: medium;"><strong>-</strong></span>号,否则日志会在/var/log/messages与/var/log/purefpd.log里各记录一份. 添加了<span style="font-size: medium;"><strong>-</strong></span>号,就只会记录在/var/log/purefptd.log内</p>
<p>3)<strong>使/etc/syslog.conf生效</strong><br />
[root@www log]# <strong>killall -HUP syslogd</strong></p>
<p>到现在设置完毕,重启下pure-ftpd,现在在客户端登陆ftp试下</p>
<h3  class="related_post_title">您可能也对这些文章感兴趣</h3><ul class="related_post"><li><a href="http://www.kuaixiang.net/finally-through-a-network-of-xinjiang" title="新疆终于通网了">新疆终于通网了</a></li><li><a href="http://www.kuaixiang.net/comsenz-2009-annual-meeting" title="comsenz2009年会">comsenz2009年会</a></li><li><a href="http://www.kuaixiang.net/ascii-code-table" title="ASCII码表">ASCII码表</a></li><li><a href="http://www.kuaixiang.net/71" title="影视剧的100个俗套">影视剧的100个俗套</a></li><li><a href="http://www.kuaixiang.net/zhuafan-failure" title="今天的抓饭做的很失败">今天的抓饭做的很失败</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.kuaixiang.net/pure-ftpd-logging-settings/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>socks5代理服务器的配置</title>
		<link>http://www.kuaixiang.net/socks5-proxy-serveru002639s-configuration</link>
		<comments>http://www.kuaixiang.net/socks5-proxy-serveru002639s-configuration#comments</comments>
		<pubDate>Mon, 08 Mar 2010 03:16:56 +0000</pubDate>
		<dc:creator>嘟嘟鱼</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[socks5]]></category>
		<category><![CDATA[代理服务器]]></category>

		<guid isPermaLink="false">http://www.kuaixiang.net/?p=11902</guid>
		<description><![CDATA[　　1。先在北大天网搜索一下socks5的安装包，发现一大堆，最新版本是socks5-v1.0r11.tar.gz，于是下载到我的RH9的服务器上。 　　2。解压缩软件包 　　#tar xvfz socks5-v1.0r11.tar.gz 　　3.开始编译 　... ]]></description>
			<content:encoded><![CDATA[<p>　　1。先在北大天网搜索一下socks5的安装包，发现一大堆，最新版本是socks5-v1.0r11.tar.gz，于是下载到我的RH9的服务器上。<br />
　　2。解压缩软件包<br />
　　#tar xvfz socks5-v1.0r11.tar.gz<br />
　　3.开始编译<br />
　　#cd socks5-v1.0r11<br />
　　#./configure --with-threads<br />
　　#make<br />
　　#make install<br />
　　4.建立/etc/socks5.conf,其实在软件包里已经有现成的examples<br />
　　#cd examples<br />
　　#cp socks5.conf.singlehomed /etc/socks5.conf (我们挑选一个最简单的配置文件)<br />
　　默认配置就是<br />
　　# A Socks5 Config file for a normal, single homed server<br />
　　permit - - - - - -<br />
　　这个配置文件是允许任何人都可以使用这个socks5代理，并不需要验证<span id="more-11902"></span><br />
　　如果想限制只是某个IP段(192.168.0.0/255.255.255.0)可以访问，可以改成<br />
　　permit - - 192.168.0. - - -<br />
　　或者只允许某个IP(192.168.0.10)可以访问使用，可以改成<br />
　　permit - - 192.168.0.10 - - -<br />
　　5.ok 运行一下socks5 -t 启动socks5服务，然后用QQ测试一下代理是否生效，记住默认端口是1080<br />
　　反正我是在FTP软件和QQ上试了 都没问题。<br />
　　6.如果要停止socks5，只要运行stopsocks -KILL就行，socks5就会停止！<br />
　　7.使用非默认端口：如果你想让socks5服务启动的时候不启动默认监听端口1080，比如为1234，我们可以运行如下命令<br />
　　socks5 -b 1234 -t 当然你关掉这个服务，就必须用下面的命令 stopsocks -p 1234 -KILL<br />
　　8.我们来深入配置一下socks5.conf,使socks5使用用户验证机制<br />
　　要使用用户验证，首先要建立/etc/socks5.pwsswd文件<br />
　　内容为：（userA代表用户名。passwdA代表用户userA的密码）<br />
　　#/etc/socks5.passwd<br />
　　userA passwdA<br />
　　userB passwdB<br />
　　userC passwdC<br />
　　然后修改/etc/socks5.conf<br />
　　添加下列语句<br />
　　auth - - u<br />
　　或者把：<br />
　　auth - - -改成auth - - u<br />
　　添加：<br />
　　把默认permit - - - - - - 改成permit u - 192.168.0. - - -<br />
　　即允许来自192.168.0.0/255.255.255.0网段的任何经过用户认证的连接<br />
　　如果你不想把密码文件存在默认的/etc/socks5.passwd里。想存在自定义的文件，比如/etc/<a href="http://www.quickshare.com.cn/tag/qq"  class="alinks_links" onclick="return alinks_click(this);" title="qq&#30456;&#20851;&#25991;&#31456;"  rel="external">qq</a>.passwd<br />
　　那就得修改/etc/socks5.conf.添加一项参数<br />
　　set SOCKS5_PWDFILE /etc/qq.passwd<br />
　　ok！重启一下服务，这时如果不输入正确的用户名和密码是使用不了socks5代理服务器的，输入正确的用户名和密码便可使用。<br />
　　以上说的参数，大家可以结合使用，比如限制某个IP段使用socks5服务，而且要使用用户名验证<br />
　　另外针对/etc/socks5.conf还有一些参数，大家就自己去研究吧<br />
　　set SOCKS5_BINDINFC 192.168.0.8:1080<br />
　　忽略ident请求。当客户机没有运行identd时，使用SOCKS5_NOIDENT将降低超时值<br />
　　set SOCKS5_NOIDENT<br />
　　指定连接停顿最长时间。超过最大值后，socks5断开连接<br />
　　set SOCKS5_TIMEOUT 15<br />
　　socks5将接受SOCKS V4 协议的请求,默认不接受<br />
　　set SOCKS5_V4SUPPORT<br />
　　指定同时存在的最大子进程数,Socks5预设为64<br />
　　set SOCKS5_MAXCHILD 4</p>
<h3  class="related_post_title">您可能也对这些文章感兴趣</h3><ul class="related_post"><li><a href="http://www.kuaixiang.net/ecms4-7" title="真水无香 帝国网站管理系统v4.7测试版发布">真水无香 帝国网站管理系统v4.7测试版发布</a></li><li><a href="http://www.kuaixiang.net/win7-icon-after-wmp12-landscaping-solutions-to-problems" title="win7图标美化之后wmp12出现问题的解决方案">win7图标美化之后wmp12出现问题的解决方案</a></li><li><a href="http://www.kuaixiang.net/cd-rom-does-not-work" title="发现电脑光驱坏了">发现电脑光驱坏了</a></li><li><a href="http://www.kuaixiang.net/64" title="[Delphi]从注册表中读出 NOD32 的用户名与密码">[Delphi]从注册表中读出 NOD32 的用户名与密码</a></li><li><a href="http://www.kuaixiang.net/womens-day-message-to-wife-30-must-sms" title="妇女节短信：哄老婆的30条必备短信">妇女节短信：哄老婆的30条必备短信</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.kuaixiang.net/socks5-proxy-serveru002639s-configuration/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CentOS 5.4 发布</title>
		<link>http://www.kuaixiang.net/centos-5-4-released</link>
		<comments>http://www.kuaixiang.net/centos-5-4-released#comments</comments>
		<pubDate>Wed, 21 Oct 2009 05:49:47 +0000</pubDate>
		<dc:creator>嘟嘟鱼</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[centos]]></category>

		<guid isPermaLink="false">http://www.quickshare.com.cn/?p=11806</guid>
		<description><![CDATA[CentOS Linux 是一个依 GPL 规范,及利用 RedHat Enterprise Linux (RHEL) 的源代码 (source code) 来重新编译 (compile) 的 Linux 版本. CentOS 提供和 RHEL 的 Binary 档案几乎百分之百兼容性,相同的版本 (Release) 和维护 (M... ]]></description>
			<content:encoded><![CDATA[<p><strong>CentOS Linux 是一个依 GPL 规范,及利用 RedHat Enterprise Linux (RHEL) 的源代码 (source code) 来重新编译 (compile) 的 Linux 版本.</strong><br />
CentOS 提供和 RHEL 的 Binary 档案几乎百分之百兼容性,相同的版本 (Release) 和维护 (Maintainence) 更新时间.和 RedHat Enterprise Linux (RHEL) 不同的是,CentOS 依 GPL 的规范,移除了 RedHat 品牌及图片.</p>
<p><strong>下载:</strong><a href="http://mirror.centos.org/centos/5.4/isos/" target="_blank">CentOS 5.4</a></p>
<p>更新暂时未知</p>
<h3  class="related_post_title">您可能也对这些文章感兴趣</h3><ul class="related_post"><li><a href="http://www.kuaixiang.net/lamp-peizhi-for-centos5" title="L.A.M.P环境配置方法 for CentOS 5.0">L.A.M.P环境配置方法 for CentOS 5.0</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.kuaixiang.net/centos-5-4-released/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux批量重命名文件</title>
		<link>http://www.kuaixiang.net/linux-batch-rename-files</link>
		<comments>http://www.kuaixiang.net/linux-batch-rename-files#comments</comments>
		<pubDate>Mon, 11 May 2009 02:14:11 +0000</pubDate>
		<dc:creator>嘟嘟鱼</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[批量重命名]]></category>

		<guid isPermaLink="false">http://www.quickshare.com.cn/?p=11625</guid>
		<description><![CDATA[今天一个用户装的论坛把表前缀写成别的了，要改回cdb开头，于是乎就需要批量修改文件名，上网搜索了下Linux批量重命名文件，发现小蜗牛的一篇文章很实用，就收藏了。 目的：批量重命名... ]]></description>
			<content:encoded><![CDATA[<p>今天一个用户装的论坛把表前缀写成别的了，要改回cdb开头，于是乎就需要批量修改文件名，上网搜索了下<a href="http://www.kuaixiang.net/linux-batch-rename-files">Linux批量重命名文件</a>，发现<a href="http://snailwarrior.blog.51cto.com/680306/139706" target="_blank">小蜗牛的一篇文章</a>很实用，就收藏了。</p>
<div><span style="color: #ff0000;">目的：</span><span style="color: #0000ff;">批量重命名一些文件，这些文件有共同特征，比如具有相同的字母，或者没有共同特征，想统一重命名，修改它们相同位置上的字符等等。</span></div>
<div></div>
<div><span style="color: #000000;">机器马大侠给了个新提示rename 就可以实现，一试用果然更爽，表示感谢。</span></div>
<div><span style="color: #000000;">以下命令实现的结果是把cdb替换成abc</span></div>
<div><span style="color: #000000;">rename cdb abc cdb*</span></div>
<div> </div>
<div><strong>1、我想把它们的名字的第一个1个字母变为"q"，其它的不变</strong></div>
<div><strong></strong> </div>
<div>[root@pps mailqueue]# for i in `ls`; do mv -f $i `echo $i | sed 's/^./q/'`; done</div>
<div> </div>
<div>----------------------------------------<br />
或者写个脚本，显得更加清晰：</div>
<div>for file in `ls`<br />
do<br />
  newfile =`echo $i | sed 's/^./q/'`<br />
　mv $file $newfile<br />
done<br />
----------------------------------------</div>
<div> </div>
<div><strong>2、修改前面5个字母为zhaozh</strong></div>
<div><strong></strong> </div>
<div>[root@pps mailqueue]# for i in `ls`; do mv -f $i `echo $i | sed 's/^...../zhaozh/'`; done</div>
<div> </div>
<div><strong>3、修改后面5个字母为snail</strong></div>
<div> </div>
<div>[root@pps mailqueue]# for i in `ls`; do mv -f $i `echo $i | sed 's/.....$/snail/'`; done</div>
<div> </div>
<div><strong>4、在前面添加 _hoho_</strong></div>
<div><strong></strong> </div>
<div>[root@pps mailqueue]# for i in `ls`; do mv -f $i `echo "_hoho_"$i`; done</div>
<div> </div>
<div><strong>5、所有的小写字母变大写字母</strong></div>
<div> </div>
<div>[root@pps mailqueue]# for i in `ls`; do mv -f $i `echo $i | tr a-z A-Z`; done</div>
<div><span style="color: #228b22;"><strong>唉，举了5个例子，说到底就是用“for 循环 + 组合命令处理”的思路来实现文件批量重命名滴。</strong></span></div>
<h3  class="related_post_title">您可能也对这些文章感兴趣</h3><ul class="related_post"><li><a href="http://www.kuaixiang.net/php-load-linux-under-way-mbstring" title="linux下php加载mbstring的方法">linux下php加载mbstring的方法</a></li><li><a href="http://www.kuaixiang.net/statistics-document-the-number-of-linux" title="linux 统计文件个数">linux 统计文件个数</a></li><li><a href="http://www.kuaixiang.net/argument-list-too-long-solution" title="Argument list too long 的解决办法">Argument list too long 的解决办法</a></li><li><a href="http://www.kuaixiang.net/linux-compression-format-commonly-used-under-the-method-of-compression-and-decompression" title="Linux下常用压缩格式的压缩与解压方法">Linux下常用压缩格式的压缩与解压方法</a></li><li><a href="http://www.kuaixiang.net/linux-the-correct-pronunciation" title="“Linux”正确读音！">“Linux”正确读音！</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.kuaixiang.net/linux-batch-rename-files/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>linux下php加载mbstring的方法</title>
		<link>http://www.kuaixiang.net/php-load-linux-under-way-mbstring</link>
		<comments>http://www.kuaixiang.net/php-load-linux-under-way-mbstring#comments</comments>
		<pubDate>Fri, 09 Jan 2009 06:31:03 +0000</pubDate>
		<dc:creator>嘟嘟鱼</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[mbstring]]></category>
		<category><![CDATA[pdo_mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.quickshare.com.cn/?p=11468</guid>
		<description><![CDATA[最近服务器上有人需要用到mbstring，还有pdo_mysql，问的人越来越多了，总结下编译方法吧。 环境php5.2.4, 不支持mbstring扩展 假如php的源码包在/usr/local/src/php-5.2.4 php安装目录是/usr/local/php # cd /usr/lo... ]]></description>
			<content:encoded><![CDATA[<p>最近服务器上有人需要用到mbstring，还有pdo_mysql，问的人越来越多了，总结下编译方法吧。<br />
环境php5.2.4, 不支持mbstring扩展<br />
假如php的源码包在/usr/local/src/php-5.2.4<br />
php安装目录是/usr/local/php</p>
<p># cd /usr/local/src/php-5.2.4/ext/mbstring/<br />
# rpm -qa|egrep "autoconf|gcc"                        这个是检测这些组件是否安装，没有安装请执行下面这句，否则会报错<br />
# yum -y install autoconf gcc gcc-c++<br />
# phpize<br />
# ./configure --with-php-config=/usr/local/bin/php-config<br />
# make<br />
# make install</p>
<p>执行完毕后在php.ini里增加extension=mbstring.so</p>
<p>重启web服务器, 看一下phpinfo, 应该支持mbstring了, 完毕!</p>
<p>pdo_mysql 加载方法同上把mbstring替换成pdo_mysql即可</p>
<h3  class="related_post_title">您可能也对这些文章感兴趣</h3><ul class="related_post"><li><a href="http://www.kuaixiang.net/lamp-peizhi-for-centos5" title="L.A.M.P环境配置方法 for CentOS 5.0">L.A.M.P环境配置方法 for CentOS 5.0</a></li><li><a href="http://www.kuaixiang.net/to-choose-u0026quotnextu0026quot-programming-language" title="选择学习“下一个”程序语言">选择学习“下一个”程序语言</a></li><li><a href="http://www.kuaixiang.net/linux-batch-rename-files" title="Linux批量重命名文件">Linux批量重命名文件</a></li><li><a href="http://www.kuaixiang.net/use-php-to-download-css-file-picture" title="利用PHP下载CSS文件中的图片">利用PHP下载CSS文件中的图片</a></li><li><a href="http://www.kuaixiang.net/statistics-document-the-number-of-linux" title="linux 统计文件个数">linux 统计文件个数</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.kuaixiang.net/php-load-linux-under-way-mbstring/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>crontab 格式</title>
		<link>http://www.kuaixiang.net/crontab-format</link>
		<comments>http://www.kuaixiang.net/crontab-format#comments</comments>
		<pubDate>Fri, 19 Dec 2008 07:39:58 +0000</pubDate>
		<dc:creator>嘟嘟鱼</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[crontab]]></category>

		<guid isPermaLink="false">http://www.quickshare.com.cn/?p=11444</guid>
		<description><![CDATA[第1列分钟1～59 第2列小时1～23（0表示子夜） 第3列日1～31 第4列月1～12 第5列星期0～6（0表示星期天） 第6列要运行的命令 下面是crontab的格式： 分 时 日 月 星期 要运行的命令 这里有crontab文件... ]]></description>
			<content:encoded><![CDATA[<div class="postentry">
<p>第1列分钟1～59<br />
第2列小时1～23（0表示子夜）<br />
第3列日1～31<br />
第4列月1～12<br />
第5列星期0～6（0表示星期天）<br />
第6列要运行的命令</p>
<p>下面是crontab的格式：<br />
分 时 日 月 星期 要运行的命令</p>
<p>这里有crontab文件条目的一些例子：</p>
<p>30 21 * * * /usr/local/apache/bin/apachectl restart<br />
上面的例子表示每晚的21:30重启apache。</p>
<p>45 4 1,10,22 * * /usr/local/apache/bin/apachectl restart<br />
上面的例子表示每月1、10、22日的4 : 45重启apache。</p>
<p>10 1 * * 6,0 /usr/local/apache/bin/apachectl restart<br />
上面的例子表示每周六、周日的1 : 10重启apache。</p>
<p>0,30 18-23 * * * /usr/local/apache/bin/apachectl restart<br />
上面的例子表示在每天18 : 00至23 : 00之间每隔30分钟重启apache。</p>
<p>0 23 * * 6 /usr/local/apache/bin/apachectl restart<br />
上面的例子表示每星期六的11 : 00 pm重启apache。</p>
<p>* */1 * * * /usr/local/apache/bin/apachectl restart<br />
每一小时重启apache</p>
<p>* 23-7/1 * * * /usr/local/apache/bin/apachectl restart<br />
晚上11点到早上7点之间，每隔一小时重启apache</p>
<p>0 11 4 * mon-wed /usr/local/apache/bin/apachectl restart<br />
每月的4号与每周一到周三的11点重启apache</p>
<p>0 4 1 jan * /usr/local/apache/bin/apachectl restart<br />
一月一号的4点重启apache</p></div>
<h3  class="related_post_title">您可能也对这些文章感兴趣</h3><ul class="related_post"><li><a href="http://www.kuaixiang.net/18jinbujin" title="《18禁不禁》在线观看 (已更新至19集)">《18禁不禁》在线观看 (已更新至19集)</a></li><li><a href="http://www.kuaixiang.net/close-vista-uac" title="TweakUAC: 关闭UAC或禁用UAC提示窗口">TweakUAC: 关闭UAC或禁用UAC提示窗口</a></li><li><a href="http://www.kuaixiang.net/how-do-i-clear-the-list-of-custom-notification" title="如何清除自定义通知列表">如何清除自定义通知列表</a></li><li><a href="http://www.kuaixiang.net/a-senior-hr-interview-to-the-fresh-graduates-of-the-proposed" title="一个资深HR给应届毕业生的面试建议">一个资深HR给应届毕业生的面试建议</a></li><li><a href="http://www.kuaixiang.net/comsenz-2009-annual-meeting" title="comsenz2009年会">comsenz2009年会</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.kuaixiang.net/crontab-format/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决mysql服务的两个基本问题</title>
		<link>http://www.kuaixiang.net/mysql-services-to-address-two-basic-issues</link>
		<comments>http://www.kuaixiang.net/mysql-services-to-address-two-basic-issues#comments</comments>
		<pubDate>Sun, 05 Oct 2008 12:06:10 +0000</pubDate>
		<dc:creator>嘟嘟鱼</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.quickshare.com.cn/?p=11098</guid>
		<description><![CDATA[使用mysql基本基本上会遇到主要的两个问题. 1.第一次起动mysql是没有问题的.对mysql做了一些操作,特别是删除mysql中一些不要的帐号后,重新起动mysql会遇到这样的问题 #/etc/init.d/mysqld restart stopping m... ]]></description>
			<content:encoded><![CDATA[<p>使用mysql基本基本上会遇到主要的两个问题.<br />
1.第一次起动mysql是没有问题的.对mysql做了一些操作,特别是删除mysql中一些不要的帐号后,重新起动mysql会遇到这样的问题<br />
#/etc/init.d/mysqld restart<br />
stopping mysql     [ok]<br />
Timeout error occurred trying to start MySQL Daemon.  [failure] </p>
<p> 但是这个时候mysql实际上已经起动了,因为用netstat -ln命令去看3306端口已经起动.使用mysql -u root -p password也能连接到数据库.<br />
这实际上是mysql-3.x的一个bug(具体可以去看mysql的bugzilla和redhat的bugzilla).<br />
是什么原因导致连接超时呢?<br />
我们不妨先看看/etc/init.d/mysqld起动脚本是如何工作的,注意下面的一段<br />
<span id="more-11098"></span><br />
# If you've removed anonymous users, this line must be changed to<br />
# use a user that is allowed to ping mysqld.<br />
ping="/usr/bin/mysqladmin -uUNKNOWN_MYSQL_USER ping"<br />
# Spin for a maximum of ten seconds waiting for the server to come up<br />
        if [ $ret -eq 0 ]; then<br />
            for x in 1 2 3 4 5 6 7 8 9 10; do<br />
            if [ -n "`$ping 2&gt; /dev/null`" ]; then<br />
                    break;<br />
            else<br />
                    sleep 1;<br />
            fi<br />
            done</p>
<p>            if !([ -n "`$ping 2&gt; /dev/null`" ]); then<br />
                    echo "Timeout error occurred trying to start MySQL<br />
Daemon."                    action $"Starting $prog: " /bin/false<br />
            else<br />
                    action $"Starting $prog: " /bin/true<br />
            fi<br />
        else<br />
            action $"Starting $prog: " /bin/false<br />
        fi<br />
        [ $ret -eq 0 ] &amp;&amp; touch /var/lock/subsys/mysqld<br />
        return $ret </p>
<p>我们看到,脚本判断mysql是否起动,使用的是mysqladmin ping命令.</p>
<p>而这个命令想要正确执行是需要能够登录mysql的.现在一些默认帐号已经删除,而且其它帐号已经设置了密码(默认没有设置密码).于是它没有办法连接到mysql.</p>
<p>不妨使用下面的命令测试一下<br />
#mysqladmin -u root -ppassword ping<br />
mysql alive </p>
<p>当你提供了帐号和密码时,它的ping命令就可以正确执行了.<br />
这个bug在mysql新出的mysql4.x可以解决.<br />
但是RH9到FC3一直使用的是mysql3.x(不过mysql官方好象才推出mysql4.1,FC需要考虑问题性).<br />
于是我用了下面的办法临时解决.<br />
a)建立一个帐号,不设置密码,不给任何权限.<br />
b)修改/etc/init.d/mysqld</p>
<p>下面我给出具体操作</p>
<p>#mysql -u root -p passwd<br />
mysql&gt;GRANT select ON test.* TO <a href="mailto:daemon@localhost">daemon@localhost</a></p>
<p>mysql&gt;revoke select on test.* from <a href="mailto:daemon@localhost">daemon@localhost</a> </p>
<p>打开/etc/init.d/mysqld<br />
把下面这行<br />
ping="/usr/bin/mysqladmin -uUNKNOWN_MYSQL_USER ping" <br />
修改为<br />
ping="/usr/bin/mysqladmin -udaemon ping" <br />
保存,退出.</p>
<p>重新起动mysql</p>
<p>#/etc/init.d/mysqld restart<br />
Stopping MySQL:                                            [  OK  ]<br />
Starting MySQL:                                            [  OK  ]</p>
<p>如果你的第二行仍然是failure的话.再执行下面的命令<br />
#/etc/init.d/mysqld start<br />
这时应该式ok了.<br />
如果这样可以ok的话.<br />
那么你需要修改/etc/init.d/mysqld,<br />
在restart函数的start后面再加一个start就可了.</p>
<p>2.即使刚安装的mysql再起动后,去看日志,给给出下面的这些信息<br />
Cannot initialize InnoDB as 'innodb_data_file_path' is not set.<br />
If you do not want to use transactional InnoDB tables, add a line<br />
skip-innodb<br />
to the [mysqld] section of init parameters in your my.cnf<br />
or my.ini. If you want to use InnoDB tables, add to the [mysqld]<br />
section, for example,<br />
innodb_data_file_path = ibdata1:10M:autoextend<br />
But to get good performance you should adjust for your hardware<br />
the InnoDB startup options listed in section 2 at<br />
<a href="http://www.innodb.com/ibman.html">http://www.innodb.com/ibman.html</a> <br />
这是因为默认的数据库起动脚本需要加载innodb数据库,但是mysql在做初始话时并没有初始化时,并没有加载这样的数据库.</p>
<p>因此这里有两种解决办法:使用和不使用innodb.<br />
我们先看不使用innodb的办法.<br />
其实这个方法就是跳过innodb的方法.<br />
在/etc/my.cnf文件的mysqld区域增加一行<br />
skip-innodb就可以了.<br />
如果我们需要使用innodb呢?<br />
那么可在/etc/my.cnf文件的mysqld区域增加下面几行<br />
innodb_data_home_dir = /var/lib/mysql/<br />
innodb_data_file_path = ibdata1:10M:autoextend<br />
innodb_log_group_home_dir = /var/lib/mysql/<br />
innodb_log_arch_dir = /var/lib/mysql/<br />
set-variable = innodb_buffer_pool_size=16M<br />
set-variable = innodb_additional_mem_pool_size=2M<br />
set-variable = innodb_log_file_size=5M<br />
set-variable = innodb_log_buffer_size=8M<br />
innodb_flush_log_at_trx_commit=1<br />
set-variable = innodb_lock_wait_timeout=50<br />
 保存,退出.重启起动mysql,再去看日志.<br />
应该不会再提示有关innodb的问题了.</p>
<h3  class="related_post_title">您可能也对这些文章感兴趣</h3><ul class="related_post"><li><a href="http://www.kuaixiang.net/phpmyadmin-how-to-import-large-sql-file" title="phpmyadmin如何导入大的SQL文件">phpmyadmin如何导入大的SQL文件</a></li><li><a href="http://www.kuaixiang.net/mysql-how-to-solve-the-garbage-problem-of-chinese-data" title="如何解决MYSQL数据中文乱码问题">如何解决MYSQL数据中文乱码问题</a></li><li><a href="http://www.kuaixiang.net/mysql-beginners-guide" title="MYSQL初学者使用指南">MYSQL初学者使用指南</a></li><li><a href="http://www.kuaixiang.net/windowsxp-php-apache-mysql-zend-configuration" title="Windows XP + Apache 2.2.4 + PHP 5.2.0 + MySQL 5.0.27 + Zend Optimizer 3.2.0环境配置方法">Windows XP + Apache 2.2.4 + PHP 5.2.0 + MySQL 5.0.27 + Zend Optimizer 3.2.0环境配置方法</a></li><li><a href="http://www.kuaixiang.net/lamp-peizhi-for-centos5" title="L.A.M.P环境配置方法 for CentOS 5.0">L.A.M.P环境配置方法 for CentOS 5.0</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.kuaixiang.net/mysql-services-to-address-two-basic-issues/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>linux 统计文件个数</title>
		<link>http://www.kuaixiang.net/statistics-document-the-number-of-linux</link>
		<comments>http://www.kuaixiang.net/statistics-document-the-number-of-linux#comments</comments>
		<pubDate>Sun, 28 Sep 2008 15:13:03 +0000</pubDate>
		<dc:creator>嘟嘟鱼</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[统计]]></category>

		<guid isPermaLink="false">http://www.quickshare.com.cn/?p=11082</guid>
		<description><![CDATA[查看某文件夹下文件的个数 ls -l &#124;grep "^-"&#124;wc -l 或 find ./company -type f &#124; wc -l 查看某文件夹下文件的个数，包括子文件夹里的。 ls -lR&#124;grep "^-"&#124;wc -l 查看某文件夹下文件夹的个数，... ]]></description>
			<content:encoded><![CDATA[<p>查看某文件夹下文件的个数<br />
ls -l |grep "^-"|wc -l<br />
或<br />
find ./company -type f | wc -l<br />
查看某文件夹下文件的个数，包括子文件夹里的。<br />
ls -lR|grep "^-"|wc -l<br />
查看某文件夹下文件夹的个数，包括子文件夹里的。<br />
ls -lR|grep "^d"|wc -l<br />
说明：<br />
ls -l<br />
长列表输出该目录下文件信息(注意这里的文件，不同于一般的文件，可能是目录、链接、设备文件等)<br />
grep "^-"<br />
这里将长列表输出信息过滤一部分，只保留一般文件，如果只保留目录就是 ^d<br />
wc -l<br />
统计输出信息的行数，因为已经过滤得只剩一般文件了，所以统计结果就是一般文件信息的行数，又由于<br />
一行信息对应一个文件，所以也就是文件的个数。</p>
<h3  class="related_post_title">您可能也对这些文章感兴趣</h3><ul class="related_post"><li><a href="http://www.kuaixiang.net/linux-batch-rename-files" title="Linux批量重命名文件">Linux批量重命名文件</a></li><li><a href="http://www.kuaixiang.net/php-load-linux-under-way-mbstring" title="linux下php加载mbstring的方法">linux下php加载mbstring的方法</a></li><li><a href="http://www.kuaixiang.net/argument-list-too-long-solution" title="Argument list too long 的解决办法">Argument list too long 的解决办法</a></li><li><a href="http://www.kuaixiang.net/linux-compression-format-commonly-used-under-the-method-of-compression-and-decompression" title="Linux下常用压缩格式的压缩与解压方法">Linux下常用压缩格式的压缩与解压方法</a></li><li><a href="http://www.kuaixiang.net/linux-the-correct-pronunciation" title="“Linux”正确读音！">“Linux”正确读音！</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.kuaixiang.net/statistics-document-the-number-of-linux/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Argument list too long 的解决办法</title>
		<link>http://www.kuaixiang.net/argument-list-too-long-solution</link>
		<comments>http://www.kuaixiang.net/argument-list-too-long-solution#comments</comments>
		<pubDate>Mon, 23 Jun 2008 09:08:57 +0000</pubDate>
		<dc:creator>嘟嘟鱼</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[rm]]></category>

		<guid isPermaLink="false">http://www.quickshare.com.cn/?p=10915</guid>
		<description><![CDATA[    今天一个用户空间超了，他空间使用情况老是统计不对，很是郁闷，登录服务器查看他用的是ecshop的程序，templates/caches 这个文件夹就占了130多m，这里全是缓存文件，问了下ecshop的技术支... ]]></description>
			<content:encoded><![CDATA[<p>    今天一个用户空间超了，他空间使用情况老是统计不对，很是郁闷，登录服务器查看他用的是ecshop的程序，templates/caches 这个文件夹就占了130多m，这里全是缓存文件，问了下ecshop的技术支持说下个版本会改进此问题，直接进templates/caches 运行rm -rf * 提示<strong>-bash: /bin/rm: Argument list too long </strong>，看提示是里面文件太多了，mv也不行，问了下系统部的同事要了个脚本执行了一下就删除了，代码如下：</p>
<blockquote><p>#!/bin/bash</p>
<p># 设定需要删除的文件夹<br />
RM_DIR='/data/files'</p>
<p>cd $RM_DIR<br />
for I in `ls`<br />
do<br />
 rm -f $I<br />
done</p></blockquote>
<p>第二种解决方法:find所有文件,然后送给rm删除.<br />
find /var/spool/mqueue -type f -exec rm {} ;</p>
<p>2009年4月3日新增一种方法：</p>
<p>find PATH -name *.mp3 -exec rm {} \;</p>
<p>如：解决方法：find  ./cache  -name ‘*’ -exec rm {} \; 等到执行完毕之后，再进入cache，执行一个rm –rf *即可。此方法来自：<a href="http://www.storyday.com" target="_blank">生活点滴</a></p>
<h3  class="related_post_title">您可能也对这些文章感兴趣</h3><ul class="related_post"><li><a href="http://www.kuaixiang.net/linux-batch-rename-files" title="Linux批量重命名文件">Linux批量重命名文件</a></li><li><a href="http://www.kuaixiang.net/php-load-linux-under-way-mbstring" title="linux下php加载mbstring的方法">linux下php加载mbstring的方法</a></li><li><a href="http://www.kuaixiang.net/statistics-document-the-number-of-linux" title="linux 统计文件个数">linux 统计文件个数</a></li><li><a href="http://www.kuaixiang.net/linux-compression-format-commonly-used-under-the-method-of-compression-and-decompression" title="Linux下常用压缩格式的压缩与解压方法">Linux下常用压缩格式的压缩与解压方法</a></li><li><a href="http://www.kuaixiang.net/linux-the-correct-pronunciation" title="“Linux”正确读音！">“Linux”正确读音！</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.kuaixiang.net/argument-list-too-long-solution/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>成功在ubuntu上运行傲游最新版</title>
		<link>http://www.kuaixiang.net/success-in-ubuntu-proud-to-run-on-the-latest-version-of-tour</link>
		<comments>http://www.kuaixiang.net/success-in-ubuntu-proud-to-run-on-the-latest-version-of-tour#comments</comments>
		<pubDate>Sat, 07 Jun 2008 08:25:56 +0000</pubDate>
		<dc:creator>嘟嘟鱼</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[傲游]]></category>

		<guid isPermaLink="false">http://www.quickshare.com.cn/?p=10903</guid>
		<description><![CDATA[虽然整个过程有的朋友会觉得毫无意义，但是配置过程有很多值得学习的地方，希望大家能参考一下。 由于设置很复杂，给大家提供几个重点以供参考。。。环境:vista SP1 + ubuntu8.04双系统.全部... ]]></description>
			<content:encoded><![CDATA[<p>虽然整个过程有的朋友会觉得毫无意义，但是配置过程有很多值得学习的地方，希望大家能参考一下。<br />
由于设置很复杂，给大家提供几个重点以供参考。。。环境:<a href="http://www.quickshare.com.cn/tag/vista"  class="alinks_links" onclick="return alinks_click(this);" title="Vista"  rel="external">vista</a> SP1 + ubuntu8.04双系统.全部打上最新补丁。<br />
第一步，安装wine<br />
在ubuntu上，安装wine.<br />
注意，一定要最新版,0.9.61以上，旧版不行。<span id="more-10903"></span><br />
<img src="http://www.kuaixiang.net/attachments/2008/06/1625566uz.png" alt="" height="311" /></p>
<p>这个东西是一个能让<a href="http://www.quickshare.com.cn/tag/linux"  class="alinks_links" onclick="return alinks_click(this);" title="linux&#30456;&#20851;&#25991;&#31456;"  rel="external">linux</a>和MACOS运行windows程序的中间层，不是虚拟机。<br />
剽悍的玩意！装好就可以直接双击exe运行了。。。<br />
wine1.0RC应该也可以，没有测试，<br />
不过根据wine每月都更新的风格，这个东西只会每月更强悍，肯定比旧版本稳定。<br />
安装wine的方法很多。<a href="http://www.g.cn/"  class="alinks_links" onclick="return alinks_click(this);" title=""  rel="external">google</a>一下,铺天盖地。<br />
注意要运行wine的傻瓜设置包，默认wine装上后，是毛病多多的。主要解决中文乱码和<br />
速度慢的问题。以及装一些必要的支持。<br />
最后记得运行 sudo apt-get install cabextract rar unrar<br />
装上解压的工具，不然下一步走不动.</p>
<p>第二步,安装IE6<br />
这里使用ies4linux来安装IE6.新版已经可以安装IE7内核了。<br />
至于安装方法，还是那句话，google一下，铺天盖地。<br />
注意安装的时候用命令行安装，别用图形界面，99.999%崩溃。。。<br />
注意，一定要把语言设置成CN.使用命令行安装。<br />
具体命令，运行ie4slinux --help查看帮助。<br />
一定要安装flash9插件支持，默认是安装的。<br />
最后，拷贝缺少的DLL文件<br />
从<a href="http://www.quickshare.com.cn/tag/vista"  class="alinks_links" onclick="return alinks_click(this);" title="vista&#30456;&#20851;&#25991;&#31456;"  rel="external">vista</a>的system32目录里复制mfc42.dll、msvcp60.dll到<br />
~/.ies4linux/ie6/drive_c/windows/system32下<br />
这里要注意，安装wine后，也会产生一个~/.wine/drive_c/windows/system32目录，<br />
这个是wine的中间层环境。而~/.ies4linux/ie6/drive_c/windows/system32目录是安<br />
装ies4linux后产生了另外一个中间环境，用来支持IE6的。这两个假的"windows"不同<br />
，也是运行傲游的关键.</p>
<p>第三步,安装傲游.<br />
这里，先说明一个问题，刚此提到的两个不同的"windows"中间环境，wine产生的那个<br />
，是不带IE6支持的环境，而ies4linux产生的这个，是带IE6支持的!!大家都知道傲游<br />
是基于IE内核的，没有IE，傲游铁定不能运行。于是，我们需要把遨游安装在<br />
ies4linux产生的环境中!切忌！<br />
安装方法，先运行IE6,然后用IE6的"文件"-"打开"菜单命令，来找到傲游的安装文件进<br />
行安装。这样就可以让把马桶装到带IE6支持的中间环境中了。其实也可以使用命令来<br />
达到同样的目的，过程是：<br />
先运行:env WINEPREFIX="/home/你的主文件夹/.ies4linux/ie6" 来告诉系统我要使用<br />
ies4linux产生的中间环境来运行。<br />
然后运行:wine "c:傲游安装文件.exe" (这里的C:指的是.ies4linux环境中的C盘)<br />
安装过程中，安装程序会自动去傲游网站下载几个文件。。这点很怪异。。。正常<br />
windows环境下安装，是不会有这个动作的。。。。难道???<br />
不用管，等他装完。</p>
<p>第四步,配置傲游程序<br />
这时候铁定是不能运行的。因为缺少几个dll.至于缺少什么，可以用命令行运行一下安<br />
装好的傲游，根据错误提示，把缺少的dll从vista中拷贝到<br />
~/.ies4linux/ie6/drive_c/windows/system32目录中就可以了。<br />
如果缺少的dll系统里面没有,那就google一下，铺天盖地!<br />
运行傲游的方法:<br />
首先 env WINEPREFIX="/home/你的主文件夹/.ies4linux/ie6" 设定环境<br />
然后 wine "c:Maxthon2Maxthon.exe"</p>
<p>第五步,配置中间层版本<br />
当按照第四步的方法，找到所有缺少的dll,并拷贝<br />
~/.ies4linux/ie6/drive_c/windows/system32中以后，傲游就可以运行了，不过运行<br />
后会弹出提示错误对话框(windows的。哈哈，接近了)。<br />
不能用！主要是因为ies4linux模拟出的中间层环境没有经过配置,默认是模拟的win98!<br />
我倒！！傲游2不能在win98下运行...。<br />
这里是最关键的一步！看好了。<br />
打开wine的配置窗口(wine的使用和配置，google去),添加傲游安装好后的可执行文件<br />
，然后设定兼容性为"winxp"或以上版本也行。<br />
然后，在"Drives"选项卡中，将第一个c:盘的映射路径改成"/home/你的主文件<br />
夹/.ies4linux/ie6/drive_c",保存。原来映射的是wine产生的中间层，现在，我们改<br />
成了ies4linux产生的中间层。这是我们就可以用wine的配置工具，来配置我们<br />
ies4linux中间层了。只有这样才能把ies4linux中间层强行从win98变成vista!!</p>
<p>配置如图:</p>
<p><img src="http://www.kuaixiang.net/attachments/2008/06/162556frr.png" alt="" /></p>
<p><strong>大功搞成!用第四步中的命令，启动傲游....成功了！</strong><br />
不过，这样模拟出来的傲游，虽然运行速度很快，也可以正常浏览网页，不过会偶尔出<br />
一些小毛病。。。。哎，毕竟能用了,早晚有一天，傲游可以在linux下完美运行的。<br />
hoho...傲游可是我不能舍弃winodws的唯一动力哦。。。还有一个奇怪的地方,在<br />
ubuntu下安装的傲游，窗体标题上竟然多出来几个字:"傲游(Maxthon)2.1 特别版"....<br />
非常奇怪..</p>
<p>根据网友的资料。在ubuntu环境下，可以用wine运行的程序越来越多。包括:<br />
office2007<br />
QQ2008<br />
RTX<br />
迅雷<br />
电驴<br />
photoshop CS3<br />
Dreamweaver CS3<br />
flash8<br />
是不是很有诱惑力.....</p>
<p><strong>我们的口号：google一下，铺天盖地，baidu一下，大海捞针。</strong></p>
<h3  class="related_post_title">您可能也对这些文章感兴趣</h3><ul class="related_post"><li><a href="http://www.kuaixiang.net/ubuntu-8_10-download" title="Ubuntu 8.10 正式版开始下载">Ubuntu 8.10 正式版开始下载</a></li><li><a href="http://www.kuaixiang.net/wubi-with-only-five-steps-to-install-ubuntu-804" title="用 Wubi 安装 Ubuntu 8.04 只需五步">用 Wubi 安装 Ubuntu 8.04 只需五步</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.kuaixiang.net/success-in-ubuntu-proud-to-run-on-the-latest-version-of-tour/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
