<?php xml version="1.0" encoding="UTF-8"?> 
<feed xmlns="http://www.w3.org/2005/Atom">
<title type="html"><![CDATA[蘑菇小窝 - 每一天我们都在进步 - LAMP - Linux - PHP - Joomla - Mysql]]></title>
<subtitle type="html"><![CDATA[生活点滴，精彩瞬间 | php,linux,joomla,mysql,程序开发,shell编程]]></subtitle>
<id>http://www.eduicc.com</id> 
<link rel="alternate" type="text/html" href="http://www.eduicc.com" /> 
<link rel="self" type="application/atom+xml" href="http://www.eduicc.comatom.php" /> 
<generator uri="http://www.f2blog.com/" version="1.2 build 03.01">F2Blog</generator> 
<updated>2010-07-28 01:12:38</updated> 
<entry>
  <title type="html"><![CDATA[rsync 常见错误及解决方法（中文版）]]></title>
  <author>
	 <name>蘑菇</name>
	 <uri>http://www.eduicc.comread-40.html</uri>
	 <email>eduicc@163.com</email>
  </author>
  <category term="" scheme="http://www.eduicc.comcategory-6.html" label="Linux" /> 
  <updated>2010-07-28 01:12:38</updated>
  <published>2010-07-28 01:12:38</published>
  <content type='text'><![CDATA[<p><strong>编译错误<br /></strong>options.c:24:18: popt.h: No such file or directory<br />make: *** [options.o] Error 1<br /><strong>解决方法</strong><br />丢失popt.h，添加编译选项 --with-included-popt</p><p>-------------------------------------------------------------------------------------------------------------</p><p><strong>连接错误</strong><br />@ERROR: auth failed on module rsyncd_module<br />rsync error: error starting client-server protocol (code 5) at main.c(1383) [receiver=2.6.9]<br /><strong>解决方法</strong><br />检查日志文件/var/log/rsyncd.log，以获取更多帮助信息</p><p>------------------------------------------------------------------------------------------</p>]]></content>
  <link rel="alternate" type="text/html" href="http://www.eduicc.comread-40.html" /> 
  <id>http://www.eduicc.comread-40.html</id> 
</entry>	
<entry>
  <title type="html"><![CDATA[rsync 常见错误及解决办法]]></title>
  <author>
	 <name>蘑菇</name>
	 <uri>http://www.eduicc.comread-39.html</uri>
	 <email>eduicc@163.com</email>
  </author>
  <category term="" scheme="http://www.eduicc.comcategory-6.html" label="Linux" /> 
  <updated>2010-07-28 00:43:19</updated>
  <published>2010-07-28 00:43:19</published>
  <content type='text'><![CDATA[<p><a href="/read-40.html">查看中文版</a></p><p><strong>Make error</strong><br />options.c:24:18: popt.h: No such file or directory<br />make: *** [options.o] Error 1<br /><strong>Solution</strong><br />Missing popt.h Change configure to include --with-included-popt</p><p>-------------------------------------------------------------------------------------------------------------</p><p><strong>Connect Error<br /></strong>@ERROR: auth failed on module rsyncd_module<br />rsync error: error starting client-server protocol (code 5) at main.c(1383) [receiver=2.6.9]<br /><strong>Solution</strong><br />Check /var/log/rsyncd.log file for further details</p><p>--------------------</p>]]></content>
  <link rel="alternate" type="text/html" href="http://www.eduicc.comread-39.html" /> 
  <id>http://www.eduicc.comread-39.html</id> 
</entry>	
<entry>
  <title type="html"><![CDATA[用php实现一个双向队列]]></title>
  <author>
	 <name>蘑菇</name>
	 <uri>http://www.eduicc.comread-38.html</uri>
	 <email>eduicc@163.com</email>
  </author>
  <category term="" scheme="http://www.eduicc.comcategory-4.html" label="php" /> 
  <updated>2010-07-23 00:54:59</updated>
  <published>2010-07-23 00:54:59</published>
  <content type='text'><![CDATA[代码实现：<br />&lt;coolcode lang=&quot;php&quot;download=&quot;deque.php&quot;&gt; &lt;?php<br />	class deque<br />	{<br />		public $queue  = array();<br />		public $length = 0;<br /><br />		public function frontAdd($node){<br />			array_unshift($this-&gt;queue,$node);<br />			$this-&gt;countqueue();<br />		}<br /><br />		public function frontRemove(){<br />			$node = array_shift($this-&gt;queue);<br />			$this-&gt;countqueue();<br />			return $node;<br />		}<br /><br />		public function rearAdd($node){<br />			array_push($this-&gt;queue,$node);<br />			$this-&gt;countqueue();<br />		}<br /><br />		public function rearRemove(){<br />			$nod]]></content>
  <link rel="alternate" type="text/html" href="http://www.eduicc.comread-38.html" /> 
  <id>http://www.eduicc.comread-38.html</id> 
</entry>	
<entry>
  <title type="html"><![CDATA[Joomla 用户密码的生成原理]]></title>
  <author>
	 <name>蘑菇</name>
	 <uri>http://www.eduicc.comread-36.html</uri>
	 <email>eduicc@163.com</email>
  </author>
  <category term="" scheme="http://www.eduicc.comcategory-5.html" label="Joomla" /> 
  <updated>2010-07-22 01:09:27</updated>
  <published>2010-07-22 01:09:27</published>
  <content type='text'><![CDATA[在网上看了许多有关Joomla用户密码的问题，有好多人对此有些疑问，也有些人说Joomla的密码不是md5加密的。这里，我想大概说一下Joomla用户密码的生成过程。<br /><br />当然，Joomla对密码的加密方式有很多种，有ssha、md5、base64等等，但是因为我们很少触及这些设置，所以大多数还是在使用默认的<span style="font-weight: bold;">md5加密</span>方式。<br /><br />有些人会问：为什么同样的密码每次加密后的结果都不一样呢？原因就是因为Joomla在加密的时候添加了一个随机key。由于这个key是随机的，所以每次加密后的结果也会不一样。<br /><br /><span style="font-weight: bold;">举例说明：</span><br /><br />我的Joomla的明文密码是<span style="font-weight: bold;"> 123456</span>，加密后的结果是<br /><br /><span style="font-weight: bold;"><span class="Code">6fa7069f6c2b4a7abc376669113acab8:cW2r7QqdGQrp2Rw9sbxCxN85nSek6tlV</span></span><br />我们看到，加密后的字符串不是普通的md5格式，它被&ldquo;:&rdquo;分成了两段，这也是致使有些人怀疑它不是md5的原因。其实后面的这段是key，在每次添加新用户或修改密码时，这一串是随机生成的，而前边的密码才是md5加密后的密码，加密方法为：<br /><br /><span class="Code">md5(明文密码.key)</span><br />如上面的密码应该为 <span style="font-weight: bold;"><br /></span><br /><span class="Code"><span style="font-weight: bold;">6fa706</span></span>]]></content>
  <link rel="alternate" type="text/html" href="http://www.eduicc.comread-36.html" /> 
  <id>http://www.eduicc.comread-36.html</id> 
</entry>	
<entry>
  <title type="html"><![CDATA[从Mysql EXPLAIN探寻数据库查询优化]]></title>
  <author>
	 <name>蘑菇</name>
	 <uri>http://www.eduicc.comread-35.html</uri>
	 <email>eduicc@163.com</email>
  </author>
  <category term="" scheme="http://www.eduicc.comcategory-2.html" label="MySql" /> 
  <updated>2010-07-20 16:37:20</updated>
  <published>2010-07-20 16:37:20</published>
  <content type='text'><![CDATA[<span style="font-weight: bold;">一. EXPLAIN 语法</span><br /><div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Green;">EXPLAIN</span><span style="color: Gray;"> </span><span style="color: Blue;">tbl_name</span><span style="color: Gray;">|</span><span style="color: Green;">SELECT</span><span style="color: Gray;"> </span><span style="color: Blue;">select_options</span></li></ol></div><br />EXPLAIN tbl_name和DESCRIBE tbl_name的作用是一样的，用于显示表结构等信息。<br /><br />当我们在select语句前加上EXPLAIN后，Mysql将告诉我们它是如何处理select语句的，提供表之间的联结方式、使用索引等有关信息。<br /><br /><span style="font-weight: bold;">二. 测试环境简单介绍</span><br />为了节省创建表的时间，我用了joomla的文章表做测试，因为要演示优化过程，所以我事先删除了表里除主键之外的所有索引。<br />这里用到了三个表：<br /><br />&lt;coolcode lang=&quot;mysql&quot; linenum=&quot;off&quot;&gt; mysql&gt; explain jos_content;<br />+------------------+------------------+------+-----+---------------------+----------------+<br />| Fi]]></content>
  <link rel="alternate" type="text/html" href="http://www.eduicc.comread-35.html" /> 
  <id>http://www.eduicc.comread-35.html</id> 
</entry>	
<entry>
  <title type="html"><![CDATA[从Joomla浅谈工厂方法(Factory - Method)模式]]></title>
  <author>
	 <name>蘑菇</name>
	 <uri>http://www.eduicc.comread-34.html</uri>
	 <email>eduicc@163.com</email>
  </author>
  <category term="" scheme="http://www.eduicc.comcategory-5.html" label="Joomla" /> 
  <updated>2010-07-12 20:59:26</updated>
  <published>2010-07-12 20:59:26</published>
  <content type='text'><![CDATA[<p>在平时的代码工作中，你是否会遇到过这种情形，或者说有类似的感觉：在刚开始拿到一个项目时，会大概地理一下思路，想一下程序的简单架构，在反复的思考确认这是一种最好的设计模式的时候，你开始动工了，各种功能在这样的结构下也很快搭建了起来。但是项目最初的策划却总是不合我们的心意，于是我们再来修改功能模块，修改流程，使它更加趋于完美。这个时候，我们就要修改我们的代码，可能会添加一些功能，可能会改进一些程序，一开始你可能还对这些工作安排的非常妥当，还对这些代码的位置了如指掌，但是随着项目功能越来越完善，代码堆积也越来越多，你可能已经记不清类似的功能函数被重写了多少次，最后，一个看似完美的产品，却总是漏洞百出，可能大病不犯，小病不断，在修复这些bug的过程中，你开始厌倦了。</p><p>于是，我想，有必要来介绍一下工厂方法这种设计模式，使我们在做代码部署工作时，能更加妥当；在做功能完善的工作时，能更加得心应手。</p><p>我们先不去讲解什么是工厂方法模式，我们先从最简单的代码入手，来看一些代码优化的工作。</p><p>１、我们以session的操作为例，这样既可以帮助我们了解这个模式，也可以顺便让我们了解一下如何用其他方法存储session</p>]]></content>
  <link rel="alternate" type="text/html" href="http://www.eduicc.comread-34.html" /> 
  <id>http://www.eduicc.comread-34.html</id> 
</entry>	
<entry>
  <title type="html"><![CDATA[CentOS 安装 Sphinx 全文检索]]></title>
  <author>
	 <name>蘑菇</name>
	 <uri>http://www.eduicc.comread-33.html</uri>
	 <email>eduicc@163.com</email>
  </author>
  <category term="" scheme="http://www.eduicc.comcategory-6.html" label="Linux" /> 
  <updated>2010-07-09 23:21:17</updated>
  <published>2010-07-09 23:21:17</published>
  <content type='text'><![CDATA[1. 下载Sphinx最新版 <a href="http://www.sphinxsearch.com/downloads.html" target="_blank">http://www.sphinxsearch.com/downloads.html</a><br /><br />2. 安装<br /><span class="linuxcmd"># tar -zxvf sphinx-0.9.9.tar.gz<br /># cd sphinx-0.9.9/<br /># ./configure --prefix=/usr/local/sphinx --with-mysql-includes=/usr/local/mysql/include/mysql/ --with-mysql-libs=/usr/local/mysql/lib/mysql --with-iconv<br /># make &amp;&amp; make install</span><br /><br />3. 配置<br /><span class="linuxcmd"># cd /usr/local/sphinx/etc<br /># cp sphinx-min.conf.dist joomla.conf<br /># vi joomla.conf</span><br /><br /><span class="linuxcmd"><span class="Comment">#<br /># Minimal Sphinx configuration sample (clean, simple, functional)<br />#<br /></span><br />source joomla_src <br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&</span>]]></content>
  <link rel="alternate" type="text/html" href="http://www.eduicc.comread-33.html" /> 
  <id>http://www.eduicc.comread-33.html</id> 
</entry>	
<entry>
  <title type="html"><![CDATA[mysql root密码丢失的解决办法]]></title>
  <author>
	 <name>蘑菇</name>
	 <uri>http://www.eduicc.comread-31.html</uri>
	 <email>eduicc@163.com</email>
  </author>
  <category term="" scheme="http://www.eduicc.comcategory-2.html" label="MySql" /> 
  <updated>2010-07-06 15:42:43</updated>
  <published>2010-07-06 15:42:43</published>
  <content type='text'><![CDATA[我曾经也遇到过这种情况，一个误操作，把mysql的root密码修改了。我们可以按以下步骤解决：<br /><br /><span style="font-weight: bold;">1. 停掉mysql服务。</span><br /><div class="hl-surround"><div class="hl-main"><span style="color: Blue;">sudo</span><span style="color: Gray;"> /</span><span style="color: Blue;">etc</span><span style="color: Gray;">/</span><span style="color: Blue;">init</span><span style="color: Gray;">.</span><span style="color: Blue;">d</span><span style="color: Gray;">/</span><span style="color: Blue;">mysql</span><span style="color: Gray;"> </span><span style="color: Blue;">stop</span></div></div><br /><br /><span style="font-weight: bold;">2. 启动mysql服务，带--skip-grant-tables参数。</span><br /><div class="hl-surround"><div class="hl-main"><span style="color: Blue;">sudo</span><span style="color: Gray;"> /</span><span style="color: Blue;">usr</span><span style="color: Gray;">/</span><span style="color: Blue;">local</span><span style="color: Gray;">/</span><span style="color: Blue;">mysql</span><span style="color: Gray;">/</span><span style="color: Blue;">bin</span><span style="color: Gray;">/</span><span style="color: Blue;">mysqld_safe</span><span style="color: Gray;"> --</span><span style="color: Blue;">skip</span><span style="color: Gray;">-</span><span style="color: Blue;">grant</span><span style="color: Gray;">-</span><span style="color: Blue;">tables</span><span style="color: Gray;"> &amp;</span></div></div><br />这样我们就可以跳过mysql的授权表<br /><br /><span style="font-weight: bold;">3. 修改root密码</span><br />&lt;coolcode lang=&quot;mysql&quot;linenum=&quot;off&quot;&gt; mysql &gt; use mysql;<br />mysql &gt; update user set password=password(]]></content>
  <link rel="alternate" type="text/html" href="http://www.eduicc.comread-31.html" /> 
  <id>http://www.eduicc.comread-31.html</id> 
</entry>	
<entry>
  <title type="html"><![CDATA[Ubuntu 安装 python-mysqldb]]></title>
  <author>
	 <name>蘑菇</name>
	 <uri>http://www.eduicc.comread-30.html</uri>
	 <email>eduicc@163.com</email>
  </author>
  <category term="" scheme="http://www.eduicc.comcategory-6.html" label="Linux" /> 
  <updated>2010-07-01 09:47:04</updated>
  <published>2010-07-01 09:47:04</published>
  <content type='text'><![CDATA[首先下载<a href="http://sourceforge.net/projects/mysql-python" target="_blank">MySQLdb</a>库，然后进行安装。<br /><br /><span class="linuxcmd">./setup.py build</span><br /><span style="font-weight: bold;">Error:</span><br /><span class="linuxcmd">sh: mysql_config: not found<br />Traceback (most recent call last):<br />&nbsp; File &quot;./setup.py&quot;, line 15, in &lt;module&gt;<br />&nbsp;&nbsp;&nbsp; metadata, options = get_config()<br />&nbsp; File &quot;/home/liubing/Downloads/MySQL-python-1.2.3/setup_posix.py&quot;, line 43, in get_config<br />&nbsp;&nbsp;&nbsp; libs = mysql_config(&quot;libs_r&quot;)<br />&nbsp; File &quot;/home/liubing/Downloads/MySQL-python-1.2.3/setup_posix.py&quot;, line 24, in mysql_config<br />&nbsp;&nbsp;&n</span>]]></content>
  <link rel="alternate" type="text/html" href="http://www.eduicc.comread-30.html" /> 
  <id>http://www.eduicc.comread-30.html</id> 
</entry>	
<entry>
  <title type="html"><![CDATA[shell脚本创建trac项目]]></title>
  <author>
	 <name>蘑菇</name>
	 <uri>http://www.eduicc.comread-29.html</uri>
	 <email>eduicc@163.com</email>
  </author>
  <category term="" scheme="http://www.eduicc.comcategory-3.html" label="Shell编程" /> 
  <updated>2010-06-18 10:54:33</updated>
  <published>2010-06-18 10:54:33</published>
  <content type='text'><![CDATA[<p>服务器环境：[192.168.1.3] Ubuntu 9.10 + Apache2 + svn + trac<br /><br />由于apache的配置非常简单灵活，所以公司在建项目时可能会因为创建者不一样而形式不一样的习惯，比如配置文件存放的位置，虚拟目录设置路径等，所以写个脚本来规范一下，方便后续的项目维护。<br /><span class="linuxcmd">#!/bin/sh<br /><span class="Comment"># Check if user is root</span><br />if [ $(id -u) != &quot;0&quot; ]; then<br />echo &quot;Error: You must be root to run this script!&quot;<br />exit 1<br />fi<br /><br /><span class="Comment"># Check project parameters</span><br />if [ &quot;-$1&quot; = &quot;-&quot; ]; then<br />echo &quot;Error: You need input project name!\nType: sudo trac-init newproject&quot;<br />exit 1<br />fi<br /><br />if [ ! -d &quot;/home/flow/websites/$1.flow&quot; ]; </span></p>]]></content>
  <link rel="alternate" type="text/html" href="http://www.eduicc.comread-29.html" /> 
  <id>http://www.eduicc.comread-29.html</id> 
</entry>	
</feed>