<?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; unix</title>
	<atom:link href="http://blog.aztaru.com/category/unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.aztaru.com</link>
	<description>聞こえる？言葉が宙に舞う 叶えた時に出会う</description>
	<lastBuildDate>Mon, 19 Jul 2010 02:33:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>

   <image>
    <title>更夜</title>
    <url>http://1.gravatar.com/avatar/37c2b15c99950508697223c975d46f09?s=48&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536</url>
    <link>http://blog.aztaru.com</link>
   </image>
		<item>
		<title>max_questions錯誤</title>
		<link>http://blog.aztaru.com/2007/04/13/max_questions%e9%8c%af%e8%aa%a4/</link>
		<comments>http://blog.aztaru.com/2007/04/13/max_questions%e9%8c%af%e8%aa%a4/#comments</comments>
		<pubDate>Fri, 13 Apr 2007 02:27:39 +0000</pubDate>
		<dc:creator>lachesis</dc:creator>
				<category><![CDATA[unix]]></category>
		<category><![CDATA[電腦]]></category>

		<guid isPermaLink="false">http://blog.azurmage.com/2007/04/13/max_questions%e9%8c%af%e8%aa%a4/</guid>
		<description><![CDATA[最近大概每隔一兩週blog就會出現 sql user max_questions 超過上限的錯誤爛掉，blog 架了這麼久最近才開始發生，一時沒想到去 google，就直接 DB 備份一下砍掉再 backup 回去，也就神奇的恢復了。(當時覺得神奇，事實上是應該的) 搞了兩三次以後，在公司又因為連線 port 限制的關係不能連上去 web hosting 修，都要忍耐一天服務中斷回家才能解決，終於乖乖想去找原因。(這麼冷的網站服務中斷一天還好吧orz)沒想到跟字面上差不多，照理說是要大熱門網站才會碰到這種錯誤啊，簡單說 max_questions 就是每小時內每個db user可以 select 的次數上限，由 mysql 管理者所設定。通常只會對 select 做這樣的限制，不過也有聽到討論說他的 web hosting 也限制 insert/update 的。據說現在不少package，例如 phpbb 都喜歡亂操query，使用者稍微多一點就會很容易超過這個上限。我可以想像，自從我看過一個網頁需要列出50筆資料時居然用迴圈 query 50 次的時候，大概就知道這些情形怎麼來的（囧）。而我這麼冷的網站哪來這麼多天殺的 query，大概是 spam block plugin 跟 bots 同心協力的合作結果吧&#8230;部落格觀察搞不好也參了一腳　(　´_ゝ｀) 那麼，除了像我之前的暴力解決法 （不良示範），當然也可以聯絡 web hosting 幫你 reset。（看到某論壇竟然有人請 web hosting 幫他每天固定 reset 一次。） 如果你有權限可以修改程式碼的話，以下會是真的能減少辛勞的作法。首先新增兩個都能存取目標 [...]]]></description>
			<content:encoded><![CDATA[<p>最近大概每隔一兩週blog就會出現 sql user max_questions 超過上限的錯誤爛掉，blog 架了這麼久最近才開始發生，一時沒想到去 google，就直接 DB 備份一下砍掉再 backup 回去，也就神奇的恢復了。(當時覺得神奇，事實上是應該的) 搞了兩三次以後，在公司又因為連線 port 限制的關係不能連上去 web hosting 修，都要忍耐一天服務中斷回家才能解決，終於乖乖想去找原因。(這麼冷的網站服務中斷一天還好吧orz)沒想到跟字面上差不多，照理說是要大熱門網站才會碰到這種錯誤啊，簡單說 max_questions 就是每小時內每個db user可以 select 的次數上限，由 mysql 管理者所設定。通常只會對 select 做這樣的限制，不過也有聽到討論說他的 web hosting 也限制 insert/update 的。據說現在不少package，例如 phpbb 都喜歡亂操query，使用者稍微多一點就會很容易超過這個上限。我可以想像，自從我看過一個網頁需要列出50筆資料時居然用迴圈 query 50 次的時候，大概就知道這些情形怎麼來的（囧）。而我這麼冷的網站哪來這麼多天殺的 query，大概是 spam block plugin 跟 bots 同心協力的合作結果吧&#8230;部落格觀察搞不好也參了一腳　(　´_ゝ｀)</p>
<p>那麼，除了像我之前的暴力解決法 （不良示範），當然也可以聯絡 web hosting 幫你 reset。（看到某論壇竟然有人請 web hosting 幫他每天固定 reset 一次。） 如果你有權限可以修改程式碼的話，以下會是真的能減少辛勞的作法。首先新增兩個都能存取目標 db 的 db user，密碼要設定成跟原來的 db user 一樣。在你使用的軟體的  db  設定的地方，通常是某個 config 檔， 讓程式隨機選一個 user 去連線，大致上就可以把 query 量平均分攤到這三個 user 去。php的寫法範例如下：</p>
<p><code>$db_user_array[] = "user_name1";<br />
$db_user_array[] = "user_name2";<br />
$db_user_array[] = "user_name3";<br />
$db_user =<br />
$db_user_array[rand(0, (sizeof($db_user_array) -1))];<br />
//define("db_user", "blahblah");<br />
define("db_user", $db_user);</code></p>
<p>參考來源：<a href="http://forum.powweb.com/showthread.php?s=&amp;threadid=23735">PowWeb Community Forums</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aztaru.com/2007/04/13/max_questions%e9%8c%af%e8%aa%a4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[備忘]校正時間</title>
		<link>http://blog.aztaru.com/2006/06/12/%e5%82%99%e5%bf%98%e6%a0%a1%e6%ad%a3%e6%99%82%e9%96%93/</link>
		<comments>http://blog.aztaru.com/2006/06/12/%e5%82%99%e5%bf%98%e6%a0%a1%e6%ad%a3%e6%99%82%e9%96%93/#comments</comments>
		<pubDate>Mon, 12 Jun 2006 07:34:32 +0000</pubDate>
		<dc:creator>lachesis</dc:creator>
				<category><![CDATA[unix]]></category>
		<category><![CDATA[電腦]]></category>

		<guid isPermaLink="false">http://blog.azurmage.com/?p=168</guid>
		<description><![CDATA[ntpdate time.stdtime.gov.tw [情報更新] ntpdate 現在改成 sntp -P no -r time.stdtime.gov.tw]]></description>
			<content:encoded><![CDATA[<p>ntpdate time.stdtime.gov.tw</p>
<p>[情報更新]<br />
ntpdate 現在改成 sntp -P no -r time.stdtime.gov.tw</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aztaru.com/2006/06/12/%e5%82%99%e5%bf%98%e6%a0%a1%e6%ad%a3%e6%99%82%e9%96%93/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[FreeBSD筆記]update ports</title>
		<link>http://blog.aztaru.com/2006/05/26/freebsd%e7%ad%86%e8%a8%98update-ports/</link>
		<comments>http://blog.aztaru.com/2006/05/26/freebsd%e7%ad%86%e8%a8%98update-ports/#comments</comments>
		<pubDate>Thu, 25 May 2006 17:18:28 +0000</pubDate>
		<dc:creator>lachesis</dc:creator>
				<category><![CDATA[unix]]></category>
		<category><![CDATA[電腦]]></category>

		<guid isPermaLink="false">http://blog.azurmage.com/?p=164</guid>
		<description><![CDATA[感謝 google 大神，您真是新時代的神明=v= 裝 subversion 卡住之餘查到 update ports 資訊的方法。有時發現 /usr/ports/xxx make install 安裝不順利，多半是要更新 ports 資訊了。 懶人法: # cvsup -g -L 2 -h cvsup.tw.freebsd.org /usr/share/examples/cvsup/ports-supfile 比較詳細的說明和正規方法請看FreeBSD Howto: 2.3 保持最新的Ports Tree。]]></description>
			<content:encoded><![CDATA[<p>感謝 google 大神，您真是新時代的神明=v=</p>
<p>裝 subversion 卡住之餘查到 update ports 資訊的方法。有時發現 /usr/ports/xxx make install 安裝不順利，多半是要更新 ports 資訊了。</p>
<p>懶人法:</p>
<pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">cvsup -g -L 2 -h cvsup.tw.freebsd.org /usr/share/examples/cvsup/ports-supfile</kbd></pre>
<p>比較詳細的說明和正規方法請看<a href="http://netlab.cse.yzu.edu.tw/~statue/freebsd/zh-tut/cvsup.html">FreeBSD Howto: 2.3 保持最新的Ports Tree。</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aztaru.com/2006/05/26/freebsd%e7%ad%86%e8%a8%98update-ports/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>diff 檔的用法</title>
		<link>http://blog.aztaru.com/2005/08/12/diff-%e6%aa%94%e7%9a%84%e7%94%a8%e6%b3%95/</link>
		<comments>http://blog.aztaru.com/2005/08/12/diff-%e6%aa%94%e7%9a%84%e7%94%a8%e6%b3%95/#comments</comments>
		<pubDate>Fri, 12 Aug 2005 09:03:51 +0000</pubDate>
		<dc:creator>lachesis</dc:creator>
				<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blog.azurmage.com/?p=134</guid>
		<description><![CDATA[打開diff檔看應該要放在哪個相對目錄下, 然後 ＄patch -p0 ＜mydiff_file.diff]]></description>
			<content:encoded><![CDATA[<p>打開diff檔看應該要放在哪個相對目錄下, 然後</p>
<p>＄patch -p0 ＜mydiff_file.diff</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aztaru.com/2005/08/12/diff-%e6%aa%94%e7%9a%84%e7%94%a8%e6%b3%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unicode/UTF8</title>
		<link>http://blog.aztaru.com/2005/01/24/unicodeutf8/</link>
		<comments>http://blog.aztaru.com/2005/01/24/unicodeutf8/#comments</comments>
		<pubDate>Mon, 24 Jan 2005 13:52:35 +0000</pubDate>
		<dc:creator>lachesis</dc:creator>
				<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blog.azurmage.com/?p=114</guid>
		<description><![CDATA[UTF-8 and Unicode FAQ for Unix/Linux http://www.cl.cam.ac.uk/~mgk25/unicode.html 可以查UTF-8碼: http://www.macchiato.com/unicode/charts.html]]></description>
			<content:encoded><![CDATA[<p>UTF-8 and Unicode FAQ for Unix/Linux<br />
<a href="http://www.cl.cam.ac.uk/~mgk25/unicode.html">http://www.cl.cam.ac.uk/~mgk25/unicode.html</a></p>
<p>可以查UTF-8碼:<br />
<a href="http://www.macchiato.com/unicode/charts.html">http://www.macchiato.com/unicode/charts.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aztaru.com/2005/01/24/unicodeutf8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[unix-notes]-常用指令的附加參數</title>
		<link>http://blog.aztaru.com/2003/10/14/unix-notes-2/</link>
		<comments>http://blog.aztaru.com/2003/10/14/unix-notes-2/#comments</comments>
		<pubDate>Tue, 14 Oct 2003 08:32:56 +0000</pubDate>
		<dc:creator>lachesis</dc:creator>
				<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blog.azurmage.com/?p=28</guid>
		<description><![CDATA[解壓縮：tar vzxf filename.tar 壓縮： tar cf betared.tar directory-to-tar 系統資源管理： ps aux [...待續，想到慢慢補...]]]></description>
			<content:encoded><![CDATA[<p>解壓縮：<tt>tar vzxf filename.tar </tt><br />
壓縮： <tt>tar cf betared.tar directory-to-tar </tt><br />
系統資源管理： <tt>ps aux</tt></p>
<p>[...待續，想到慢慢補...]</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aztaru.com/2003/10/14/unix-notes-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[unix-notes]-設定unix系統下的環境變數 PATH</title>
		<link>http://blog.aztaru.com/2003/10/14/unix-notes-unix-ttpathtt/</link>
		<comments>http://blog.aztaru.com/2003/10/14/unix-notes-unix-ttpathtt/#comments</comments>
		<pubDate>Tue, 14 Oct 2003 08:01:19 +0000</pubDate>
		<dc:creator>lachesis</dc:creator>
				<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blog.azurmage.com/?p=27</guid>
		<description><![CDATA[檢查目前設定： &#160;&#160;echo $PATH 使用shell為 csh tcsh，在 $home 目錄下 .login 檔 加入： &#160;&#160;setenv PATH /the/path/youwant:$PATH 使用shell為 bash ksh，在 .profile 加入： &#160;&#160;export PATH=$PATH:/the/path/youwant 注意 $PATH 參數內各目錄的順序就是搜尋順序，請依照需要使用。]]></description>
			<content:encoded><![CDATA[<p>檢查目前設定：<br />
&nbsp;&nbsp;<tt>echo $PATH </tt></p>
<p>使用shell為 csh tcsh，在 $home 目錄下<b> .login </b> 檔 加入：<br />
&nbsp;&nbsp;<tt>setenv PATH /the/path/youwant:$PATH </tt></p>
<p>使用shell為 bash ksh，在 <b> .profile </b> 加入：<br />
&nbsp;&nbsp;<tt>export PATH=$PATH:/the/path/youwant</tt></p>
<p>注意 <tt>$PATH </tt>參數內各目錄的順序就是搜尋順序，請依照需要使用。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aztaru.com/2003/10/14/unix-notes-unix-ttpathtt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[unix notes]-前言</title>
		<link>http://blog.aztaru.com/2003/10/13/unix-notes/</link>
		<comments>http://blog.aztaru.com/2003/10/13/unix-notes/#comments</comments>
		<pubDate>Mon, 13 Oct 2003 16:41:33 +0000</pubDate>
		<dc:creator>lachesis</dc:creator>
				<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blog.azurmage.com/?p=26</guid>
		<description><![CDATA[很久很久以前，大學的時候我第一次玩Linux，記得那時候普遍的套件是Slackware 3.0(還2.x)，是 RedHat 剛推出還不太 Red 的時代。那時的動機主要是想練習架bbs。雖然是裝Linux，不過李建達的FreeBSD黑皮書我可是也有買一本回來拜讀的，實在是本瞭解觀念的好書。(沒想到在CMU會認識到作者本人，呵呵)話說在我成功的把bbs，apache，還有當時採用暴力攔截法做的中文terminal+輸入法搞定之後，就把那塊硬碟遺忘了。當時學會不少東西，等到後來再度開始投身Linux陣營的時候，已經忘掉大半，恐怕連 ls 後面的參數都想不起來。後來發現，只要不是每天使用，隔一陣子之後有些常用功能就變成「我明明知道要怎麼做，可是到底怎麼做啊」的慘況。這就是做筆記的重要啦。有些東西只要設定一次，因此很容易忘記，但隨者系統重灌等等原因，第二次要操作而想不起來內心就會充滿了怨恨，外加懷疑自己上了年紀。其實以前我是有做筆記的，不過好像隨某顆硬碟消失了。這次，最好是最後一次！！順便造福人群。]]></description>
			<content:encoded><![CDATA[<p>很久很久以前，大學的時候我第一次玩Linux，記得那時候普遍的套件是Slackware 3.0(還2.x)，是 RedHat 剛推出還不太 Red 的時代。那時的動機主要是想練習架bbs。雖然是裝Linux，不過李建達的FreeBSD黑皮書我可是也有買一本回來拜讀的，實在是本瞭解觀念的好書。(沒想到在CMU會認識到作者本人，呵呵)話說在我成功的把bbs，apache，還有當時採用暴力攔截法做的中文terminal+輸入法搞定之後，就把那塊硬碟遺忘了。當時學會不少東西，等到後來再度開始投身Linux陣營的時候，已經忘掉大半，恐怕連 <b> ls </b> 後面的參數都想不起來。後來發現，只要不是每天使用，隔一陣子之後有些常用功能就變成「我明明知道要怎麼做，可是到底怎麼做啊」的慘況。這就是做筆記的重要啦。有些東西只要設定一次，因此很容易忘記，但隨者系統重灌等等原因，第二次要操作而想不起來內心就會充滿了怨恨，外加懷疑自己上了年紀。其實以前我是有做筆記的，不過好像隨某顆硬碟消失了。這次，最好是最後一次！！順便造福人群。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aztaru.com/2003/10/13/unix-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
