<?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>Hung-Yi Chen&#039;s Blog &#187; FreeBSD相關</title>
	<atom:link href="http://blog.hychen.org/category/freebsd%e7%9b%b8%e9%97%9c/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hychen.org</link>
	<description></description>
	<lastBuildDate>Tue, 17 May 2011 05:14:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>X11 Forwarding on FreeBSD&#8230;</title>
		<link>http://blog.hychen.org/2011/03/02/53/</link>
		<comments>http://blog.hychen.org/2011/03/02/53/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 09:02:19 +0000</pubDate>
		<dc:creator>gaod</dc:creator>
				<category><![CDATA[FreeBSD相關]]></category>

		<guid isPermaLink="false">http://blog.hychen.org/?p=53</guid>
		<description><![CDATA[今天因某長官有需求，想透過 X11 Forwarding 操作一台 FreeBSD 上的 ddd。 但是卻告訴我執行後會出現 Error: Can&#8217;t open display: 試了一下，的確如此。本來以為只是單純的 $DISPLAY 變數沒設或設錯了，後來轉念一想，這東西應該是 login 後就會自動被 assign！！ （對不起，我從來沒想要用 X11 Forwarding 來玩 X application&#8230;..:$） 稍微追了一下，現在解決了:p 為了避免有後人遇到相同問題，這裡簡單隨手記一下剛剛做的幾件事情&#8230; 1. 裝 /usr/ports/x11/xauth 2. /etc/ssh/ssh_config：加上 ForwardAgent yes 及 ForwardX11 yes 及 XAuthLocation /usr/local/bin/xauth 3. /etc/ssh/sshd_config：加上 X11Forwarding yes 及 X11UseLocalhost yes]]></description>
			<content:encoded><![CDATA[<p>今天因某長官有需求，想透過 X11 Forwarding 操作一台 FreeBSD 上的 ddd。</p>
<p>但是卻告訴我執行後會出現 Error: Can&#8217;t open display:</p>
<p>試了一下，的確如此。本來以為只是單純的 $DISPLAY 變數沒設或設錯了，後來轉念一想，這東西應該是 login 後就會自動被 assign！！</p>
<p>（對不起，我從來沒想要用 X11 Forwarding 來玩 X application&#8230;..:$）</p>
<p>稍微追了一下，現在解決了:p</p>
<p>為了避免有後人遇到相同問題，這裡簡單隨手記一下剛剛做的幾件事情&#8230;</p>
<p>1. 裝 /usr/ports/x11/xauth<br />
2. /etc/ssh/ssh_config：加上 ForwardAgent yes 及 ForwardX11 yes 及 XAuthLocation /usr/local/bin/xauth<br />
3. /etc/ssh/sshd_config：加上 X11Forwarding yes 及 X11UseLocalhost yes</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hychen.org/2011/03/02/53/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build a git project on hudson &amp; some git plug-in bugs&#8230;</title>
		<link>http://blog.hychen.org/2010/07/02/41/</link>
		<comments>http://blog.hychen.org/2010/07/02/41/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 06:43:59 +0000</pubDate>
		<dc:creator>gaod</dc:creator>
				<category><![CDATA[FreeBSD相關]]></category>
		<category><![CDATA[Linux相關]]></category>
		<category><![CDATA[軟體相關]]></category>
		<category><![CDATA[電腦相關]]></category>

		<guid isPermaLink="false">http://blog.hychen.org/?p=41</guid>
		<description><![CDATA[最近在處理 daily build system，要把某些 project 透過 hudson 建置成無人值守的自動化編譯系統。 不過在 git plug-in 上吃鱉&#8230;.。 簡單描述一下我的狀況及解決辦法： 我在 github 上開了個 android project，想要設定 hudson 自動檢查 github 上的 code 是否有變更，有變動的話就抓回來編一份丟給 QA 去測試。 而這個 project 有兩個 branch，分別是 master 跟 bugfix。 為了清楚明瞭，在 hudson 上開了兩個不同的 project，一個專門 build master branch，另一個則專門 build bugfix branch。 這時候怪事來了&#8230;.bugfix 的 SCM polling check log 看起來似乎抓到了 master 的 commit，而 master 的 [...]]]></description>
			<content:encoded><![CDATA[<p>最近在處理 daily build system，要把某些 project 透過 hudson 建置成無人值守的自動化編譯系統。</p>
<p>不過在 git plug-in 上吃鱉&#8230;.。</p>
<p>簡單描述一下我的狀況及解決辦法：</p>
<p>我在 github 上開了個 android project，想要設定 hudson 自動檢查 github 上的 code 是否有變更，有變動的話就抓回來編一份丟給 QA 去測試。</p>
<p>而這個 project 有兩個 branch，分別是 master 跟 bugfix。</p>
<p>為了清楚明瞭，在 hudson 上開了兩個不同的 project，一個專門 build master branch，另一個則專門 build bugfix branch。</p>
<p>這時候怪事來了&#8230;.bugfix 的 SCM polling check log 看起來似乎抓到了 master 的 commit，而 master 的 polling check log 好像也抓到了 bugfix 的 commit。</p>
<p>本來以為是其他開發人員不小心把兩個 branch 做了 merge，不過仔細一看卻又不像這麼一回事。</p>
<p>稍微思考了一下，決定從 hudson 的 build log 下手。</p>
<p>結果發現了這種東西&#8230;.</p>
<blockquote><p>[workspace] $ c:\cygwin\bin\git.exe fetch -t git@github.com:gaod/android.git +refs/heads/bugfix:refs/remotes/origin/bugfix<br />
[workspace] $ c:\cygwin\bin\git.exe ls-tree HEAD<br />
[workspace] $ c:\cygwin\bin\git.exe log &#8211;all &#8211;pretty=format:&#8217;%H#%ct&#8217; origin/bugfix</p></blockquote>
<p>等等，為什麼是 git log &#8211;all 呢？！</p>
<p>抓到兇手！git log &#8211;all 會去抓整個 project 的所有 branch commit log 啊！那難怪一直出現奇怪現象&#8230;</p>
<p>（不過奇怪的是，我搜尋了一下，似乎沒看到有人遇到這問題？）</p>
<p>解法就是，自己去抓 git plug-in 回來修掉這部分，拿掉做 git log 時傳入的 &#8211;all 參數，果然就好了！</p>
<p>下面附上 hudson 上這個 github 的 project 的 project 設定檔（好繞口:p）</p>
<blockquote><p>URL of repository：git@github.com:gaod/android.git<br />
Name of repository：origin<br />
Refspec：+refs/heads/bugfix:refs/remotes/origin/bugfix<br />
Branch Specifier：origin/bugfix</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.hychen.org/2010/07/02/41/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FreeBSD mount iso file</title>
		<link>http://blog.hychen.org/2010/05/16/38/</link>
		<comments>http://blog.hychen.org/2010/05/16/38/#comments</comments>
		<pubDate>Sun, 16 May 2010 15:27:39 +0000</pubDate>
		<dc:creator>gaod</dc:creator>
				<category><![CDATA[FreeBSD相關]]></category>
		<category><![CDATA[軟體相關]]></category>
		<category><![CDATA[電腦相關]]></category>

		<guid isPermaLink="false">http://blog.hychen.org/?p=38</guid>
		<description><![CDATA[在 FreeBSD 上掛載 iso 檔其實很簡單&#8230; 掛載： mdconfig -a -t vnode -f xxx.iso -u 0 mount -t cd9660 /dev/md0 /mnt 卸載： umount /mnt mdconfig -d -u 0]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste">
<div id="_mcePaste">在 FreeBSD 上掛載 iso 檔其實很簡單&#8230;</div>
<div></div>
<div>掛載：</div>
<div>mdconfig -a -t vnode -f xxx.iso -u 0</div>
<div id="_mcePaste">mount -t cd9660 /dev/md0 /mnt</div>
<div id="_mcePaste">卸載：</div>
<div id="_mcePaste">umount /mnt</div>
<div id="_mcePaste">mdconfig -d -u 0</div>
<div></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.hychen.org/2010/05/16/38/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CVS 轉換到 Git</title>
		<link>http://blog.hychen.org/2010/05/15/30/</link>
		<comments>http://blog.hychen.org/2010/05/15/30/#comments</comments>
		<pubDate>Fri, 14 May 2010 21:15:27 +0000</pubDate>
		<dc:creator>gaod</dc:creator>
				<category><![CDATA[FreeBSD相關]]></category>
		<category><![CDATA[Linux相關]]></category>
		<category><![CDATA[軟體相關]]></category>
		<category><![CDATA[電腦相關]]></category>

		<guid isPermaLink="false">http://blog.hychen.org/?p=30</guid>
		<description><![CDATA[下面是用某公司內部神秘專案 KKK 做例子的示範，將整個專案內容從 cvs 搬移到 github 上，不過也適用於其他 git hosting/server 由於 code 中 big5 與 utf-8 混雜，但是 comment log 又都是 big5，導致沒辦法直接用 git cvsimport 來處理（git cvsimport 無法處理這種混亂的編碼狀況） 原先 Izero 長輩提供的做法是 cvs to svn，svn to git，切成兩段來做。但是太麻煩了，這樣還得架 svn server 才能處理。 這邊提供一個經過測試後可行的簡單完美做法&#8230; 有幾件事情當然得先做 1. 註冊 github 帳號 2. 在要 access github 上資訊的電腦做 ssh2 key，把 public key 上傳到 github 3. 在 github [...]]]></description>
			<content:encoded><![CDATA[<p>下面是用某公司內部神秘專案 KKK 做例子的示範，將整個專案內容從 cvs 搬移到 github 上，不過也適用於其他 git hosting/server</p>
<p>由於 code 中 big5 與 utf-8 混雜，但是 comment log 又都是 big5，導致沒辦法直接用 git cvsimport 來處理（git cvsimport 無法處理這種混亂的編碼狀況）</p>
<p>原先 Izero 長輩提供的做法是 cvs to svn，svn to git，切成兩段來做。但是太麻煩了，這樣還得架 svn server 才能處理。</p>
<p>這邊提供一個經過測試後可行的簡單完美做法&#8230;</p>
<p>有幾件事情當然得先做<br />
1. 註冊 github 帳號<br />
2. 在要 access github 上資訊的電腦做 ssh2 key，把 public key 上傳到 github<br />
3. 在 github 開個專案</p>
<p>確認已經可以存取 github 上的專案內容後<br />
1. 取得 cvs server 上的 CVSROOT &amp; KKK repository，解開丟到 /home/cvsroot 後切換到 /home/cvsroot<br />
2. 裝 cvs2svn(<a href="http://cvs2svn.tigris.org/" target="_top">cvs2svn</a>)，待會兒將透過 cvs2svn 中的 cvs2git 這個工具來做轉移<br />
3. cvs2git &#8211;blobfile /tmp/cvs2git.blob &#8211;dumpfile /tmp/cvs2git.dump &#8211;fallback-encoding=utf-8 &#8211;encoding=big5 KKK &#8211;username gaod<br />
(用 cvs 上的 gaod 身分把 KKK 專案在 cvs 上的東西 dump 到 /tmp/cvs2git.{blog,dump}。cvs 上程式碼編碼是 big5 &amp; utf-8 混雜，comment log 則是 big5)<br />
4. cd /tmp;git init KKK;cd KKK<br />
(先 git init 建目錄後切換過去建出來的 KKK)<br />
5. cat /tmp/cvs2git.{blob,dump} | git fast-import &#8211;force<br />
(把 cvs 上的東西倒進去剛剛 git init 出來的目錄)<br />
6. git remote add origin <a href="mailto:git@github.com">git@github.com:gaod/KKK.git</a><br />
7. git push &#8211;force<br />
(force push 到 remote)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hychen.org/2010/05/15/30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SVN repository remote dump</title>
		<link>http://blog.hychen.org/2010/04/28/27/</link>
		<comments>http://blog.hychen.org/2010/04/28/27/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 10:10:21 +0000</pubDate>
		<dc:creator>gaod</dc:creator>
				<category><![CDATA[FreeBSD相關]]></category>
		<category><![CDATA[Linux相關]]></category>
		<category><![CDATA[電腦相關]]></category>

		<guid isPermaLink="false">http://blog.hychen.org/?p=27</guid>
		<description><![CDATA[早上 JoeHorn 告訴我，OpenSVN 要收了，所以原本 host 在 OpenSVN 上的 Maple-itoc project 顯然得趕快換地方了。雖然 OpenSVN 公告說五月一日開始會提供 repository dump，不過既然都要搬家了，自己 dump 一下當作練習也是不錯。 Survey 了一下，大部份的文章都是教學用 svnsync 來處理，不過我發現另一個工具也是很好用：rsvndump。 差別在於，svnsync 可以直接 mirror 整個 repository，而 rsvndump 則是 dump 成一個檔案。 svnsync 我的做法： 1.  cd ${SVNHOME}; svnadmin create Maple-itoc # 到 svn server 的 repos 目錄 2. 修改 ${SVNHOME}/Maple-itoc/hooks/pre-revprop-change，我是懶得設，直接丟個空白檔案然後 chmod +x 3. svnsync init file:///${SVNHOME}/Maple-itoc https://opensvn.csie.org/MapleBBSitoc [...]]]></description>
			<content:encoded><![CDATA[<p>早上 <a href="http://www.joehorn.idv.tw/" target="_blank">JoeHorn </a>告訴我，<a href="https://opensvn.csie.org" target="_blank">OpenSVN</a> 要收了，所以原本 host 在 <a href="https://opensvn.csie.org" target="_blank">OpenSVN</a> 上的 Maple-itoc project 顯然得趕快換地方了。雖然 <a href="https://opensvn.csie.org" target="_blank">OpenSVN</a> 公告說五月一日開始會提供 repository dump，不過既然都要搬家了，自己 dump 一下當作練習也是不錯。</p>
<p>Survey 了一下，大部份的文章都是教學用 svnsync 來處理，不過我發現另一個工具也是很好用：rsvndump。</p>
<p>差別在於，svnsync 可以直接 mirror 整個 repository，而 rsvndump 則是 dump 成一個檔案。</p>
<p>svnsync 我的做法：</p>
<p>1.  cd ${SVNHOME}; svnadmin create Maple-itoc</p>
<p># 到 svn server 的 repos 目錄</p>
<p>2. 修改 ${SVNHOME}/Maple-itoc/hooks/pre-revprop-change，我是懶得設，直接丟個空白檔案然後 chmod +x</p>
<p>3. svnsync init file:///${SVNHOME}/Maple-itoc <a href="https://opensvn.csie.org/MapleBBSitoc">https://opensvn.csie.org/MapleBBSitoc</a></p>
<p># 初始化 dest repos，可以用 svnsync init help 看詳細參數，這裡都是匿名存取所以不需帳號密碼</p>
<p>4. svnsync sync <a href="file:///${SVNHOME}/Maple-itoc">file:///${SVNHOME}/Maple-itoc</a></p>
<p># 開始 sync&#8230;.</p>
<div>rsvndump 的話，我的做法是：</div>
<div>1. rsvndump http://OpenSVN.csie.org/MapleBBSitoc &gt; Maple-itoc.dump</div>
<div># 把整個 remote repos dump 出來存到 Maple-itoc.dump</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.hychen.org/2010/04/28/27/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一些 Subversion reference</title>
		<link>http://blog.hychen.org/2007/04/04/10/</link>
		<comments>http://blog.hychen.org/2007/04/04/10/#comments</comments>
		<pubDate>Wed, 04 Apr 2007 00:15:38 +0000</pubDate>
		<dc:creator>gaod</dc:creator>
				<category><![CDATA[FreeBSD相關]]></category>
		<category><![CDATA[Linux相關]]></category>
		<category><![CDATA[電腦相關]]></category>

		<guid isPermaLink="false">http://blog.hychen.org/?p=15</guid>
		<description><![CDATA[HomePage http://subversion.tigris.org/ Book http://svnbook.red-bean.com/ Chinese ver http://freebsd.sinica.edu.tw/~plasma/svnbook/book.html (失效很久了，真可惜當時沒有先 mi 下來:~) cvs2svn http://cvs2svn.tigris.org/ viewcvs http://viewcvs.sourceforge.net/ QuiteGuide http://in2.wiki.ptt.cc/-SubversionQuickStart http://www.me.ccu.edu.tw/svninfo/svnbook.html]]></description>
			<content:encoded><![CDATA[<p>HomePage</p>
<p>http://subversion.tigris.org/</p>
<p>Book</p>
<p>http://svnbook.red-bean.com/</p>
<p>Chinese ver<br />
http://freebsd.sinica.edu.tw/~plasma/svnbook/book.html (失效很久了，真可惜當時沒有先 mi 下來:~)</p>
<p>cvs2svn</p>
<p>http://cvs2svn.tigris.org/</p>
<p>viewcvs</p>
<p>http://viewcvs.sourceforge.net/</p>
<p>QuiteGuide</p>
<p>http://in2.wiki.ptt.cc/-SubversionQuickStart</p>
<p>http://www.me.ccu.edu.tw/svninfo/svnbook.html</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hychen.org/2007/04/04/10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>find 的用法</title>
		<link>http://blog.hychen.org/2007/04/04/8/</link>
		<comments>http://blog.hychen.org/2007/04/04/8/#comments</comments>
		<pubDate>Wed, 04 Apr 2007 00:05:47 +0000</pubDate>
		<dc:creator>gaod</dc:creator>
				<category><![CDATA[FreeBSD相關]]></category>
		<category><![CDATA[Linux相關]]></category>
		<category><![CDATA[電腦相關]]></category>

		<guid isPermaLink="false">http://blog.hychen.org/?p=13</guid>
		<description><![CDATA[Syntax: find pathname-list expression -name filename -perm octnum -print -type t/f/c/b t:目錄 f:檔案 c:字元特殊檔 b:區域特殊檔 -exec rm -rf &#8220;{}&#8221; \; 把pathname-list裡所有file通通砍掉 -size n +n (大於n) -n (小於n) -mtime n (幾天內被修改過) example: find ~ -name &#8220;*.c&#8221; -print find / -size 0 -exec rm &#8220;{}&#8221; \; find / -perm 4755 -print find ~ -type d -print 實例: [...]]]></description>
			<content:encoded><![CDATA[<p>Syntax: find pathname-list expression</p>
<p>-name filename<br />
-perm octnum<br />
-print<br />
-type t/f/c/b t:目錄 f:檔案 c:字元特殊檔 b:區域特殊檔<br />
-exec rm -rf &#8220;{}&#8221; \;<br />
把pathname-list裡所有file通通砍掉<br />
-size n<br />
+n (大於n)<br />
-n (小於n)</p>
<p>-mtime n (幾天內被修改過)</p>
<p>example:<br />
find ~ -name &#8220;*.c&#8221; -print<br />
find / -size 0 -exec rm &#8220;{}&#8221; \;<br />
find / -perm 4755 -print<br />
find ~ -type d -print</p>
<p>實例:<br />
找到大於10mb的檔案並刪除之<br />
find . -type f -size +10000 -exec rm &#8220;{}&#8221; \;</p>
<p>找到所有包含 blahblah 字串的檔案<br />
find . -type f -exec grep -l blahblah &#8220;{}&#8221; \;</p>
<p>列出所在目錄下所有檔案<br />
find . -type f -print</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hychen.org/2007/04/04/8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable Soft-Updates</title>
		<link>http://blog.hychen.org/2007/04/04/6/</link>
		<comments>http://blog.hychen.org/2007/04/04/6/#comments</comments>
		<pubDate>Tue, 03 Apr 2007 22:46:02 +0000</pubDate>
		<dc:creator>gaod</dc:creator>
				<category><![CDATA[FreeBSD相關]]></category>
		<category><![CDATA[電腦相關]]></category>

		<guid isPermaLink="false">http://blog.hychen.org/?p=6</guid>
		<description><![CDATA[tunefs -n enable + 掛載區 怕忘記所以寫起來:~]]></description>
			<content:encoded><![CDATA[<p>tunefs -n enable + 掛載區</p>
<p>怕忘記所以寫起來:~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hychen.org/2007/04/04/6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

