<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-10482704</id><updated>2026-07-24T14:03:07.105+08:00</updated><category term="linux"/><category term="軟體"/><category term="programming"/><category term="firefox"/><category term="網頁設計"/><category term="Google"/><category term="微軟"/><category term="輸入法"/><category term="資訊安全"/><category term="閱讀"/><category term="資訊"/><category term="wm"/><category term="jenkins"/><category term="todo"/><category term="xfce4"/><category term="xwindow"/><title type='text'>Linux 隨手記</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>414</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-10482704.post-866268259127435955</id><published>2018-05-17T14:07:00.000+08:00</published><updated>2018-05-18T10:00:50.286+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="微軟"/><title type='text'>[Windows] git-bash 底下的工具</title><content type='html'>因為工作轉到 Windows 平台上的關係，所以很多工具改到 Windows 上面運作，跟著在 TortoiseGit 底下使用 git-bash 來維護自己的專案原始碼。結果就是裝了前面提過的 auto-hotkey 使用熱鍵來提昇自己的平台操作速度；&lt;br /&gt;
&lt;br /&gt;
但除了 hotkey 之外，其實還有很多問題，像是我不喜歡我的視窗排列不能像 i3 那樣自動排好好的；也不喜歡 terminal 沒有 screen / tmux 之類的管理工具； terminal 反應速度也很慢之類的，vim 執行容易跑出亂碼 ... 這些問題都讓我很討厭&lt;br /&gt;
&lt;br /&gt;
不過還好在 git-bash 上面的工具尋找上面，找到了 &quot;使用 git-sdk 可以使用 pacman 安裝套件&quot; 的解決方案，所以在安裝完 git-sdk 之後，可以得到 pacman 的工具，跟著再使用 pacman -S tmux 就可以在 msys2 上面安裝 tmux ，然後就可以在 git-bash 底下看到&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2ZJcVNtzgUfUiFpY23qkRqOH9CKO7hyuYOlxLHyeue8oQ4JdisbIqoEMPiuHLOC5Gr1BO0r83yYS34075h-wqXsIMswdiW9_Ep4vI6Qi8YJI5-5irlU3gKzJSMKsBixn7cfv3qw/s1600/20180517140550.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;744&quot; data-original-width=&quot;1107&quot; height=&quot;268&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2ZJcVNtzgUfUiFpY23qkRqOH9CKO7hyuYOlxLHyeue8oQ4JdisbIqoEMPiuHLOC5Gr1BO0r83yYS34075h-wqXsIMswdiW9_Ep4vI6Qi8YJI5-5irlU3gKzJSMKsBixn7cfv3qw/s400/20180517140550.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
總算不用要開一個 terminal 就非要開一個視窗不可了 ...&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
不過還有其它要適應的就是 ...&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
# pacman -Ss 搜尋的關鍵字&lt;br /&gt;
# pacman -S 安裝的套件名稱&amp;nbsp;&lt;br /&gt;
# pacman -Ql 套件列表 &lt;br/&gt;
# pacman -R 移除的套件名稱 &lt;br/&gt;
&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
---&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
參考資料：&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
* pacman 的用法：https://github.com/msys2/msys2/wiki/Using-packages&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/866268259127435955/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/866268259127435955' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/866268259127435955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/866268259127435955'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2018/05/windows-git-bash.html' title='[Windows] git-bash 底下的工具'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2ZJcVNtzgUfUiFpY23qkRqOH9CKO7hyuYOlxLHyeue8oQ4JdisbIqoEMPiuHLOC5Gr1BO0r83yYS34075h-wqXsIMswdiW9_Ep4vI6Qi8YJI5-5irlU3gKzJSMKsBixn7cfv3qw/s72-c/20180517140550.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-5377860970485390504</id><published>2018-05-17T13:48:00.000+08:00</published><updated>2018-05-17T13:48:00.092+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type='text'>[Linux][RPI] 自動開機執行 fsck</title><content type='html'>我的 Raspberry Pi 上面執行 apt-get upgrade 的時候跑出來：&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion `info[15] == ((void *)0)&#39; failed!&lt;/blockquote&gt;
這樣的問題，結果 Google 之後得到結論是 SD card 可能有問題了？&lt;br /&gt;
當然，我不會這麼快就認為是 bad block 之類，回頭看 syslog 也沒有看到有類似的 warning 出現，要這樣推論是有點早。不過，問題一直都在，所以我們需要一個方法來嘗試解決這個問題。&lt;br /&gt;
&lt;br /&gt;
最先嘗試的當然是 fsck ，不過 fsck 要在開機的時候下， rootfs 都 mount 上來的時候才下根本來不及，所以我們需要開機就能自動 fsck 的方案。&lt;br /&gt;
&lt;br /&gt;
最終找到&lt;a href=&quot;https://raspberrypi.stackexchange.com/questions/61723/raspberry-pi-3-and-raspbian-jessie-how-to-run-fsck-at-boot&quot;&gt;這邊&lt;/a&gt;的回答，運用 mountall.conf 的設定，touch /forcefsck 跟在 /boot/cmdline.txt 裡面加入&amp;nbsp;fsck.mode=force 之後，在開機的時候就會自動執行 fsck。&lt;br /&gt;
&lt;br /&gt;
開完機後再下 sudo apt-get upgrade 更新，就沒有看到上面的問題了。看來真的是 fsck 的關係。&lt;br /&gt;
&lt;br /&gt;
如果是這樣，那 RPI 會有 fsck 的問題的話， fs 是不是不要用 ext4 比較好？？？&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
參考資料：&lt;br /&gt;
* github 上的回答:&amp;nbsp;https://github.com/Linuxbrew/brew/issues/266&lt;br /&gt;
*&amp;nbsp;https://raspberrypi.stackexchange.com/questions/61723/raspberry-pi-3-and-raspbian-jessie-how-to-run-fsck-at-boot</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/5377860970485390504/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/5377860970485390504' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/5377860970485390504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/5377860970485390504'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2018/05/linuxrpi-fsck.html' title='[Linux][RPI] 自動開機執行 fsck'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-7999636681890653653</id><published>2018-05-17T13:36:00.000+08:00</published><updated>2018-05-17T13:36:54.328+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="wm"/><title type='text'>[Linux][WM] Linux 上面的輕 WM -- i3</title><content type='html'>Linux 上面的 Window Manager 一直都比 MS Window 上的視窗要來的輕巧且多樣化。跟著而來的就是「不好設定」、「不好學習」等等問題。&lt;br /&gt;
&lt;br /&gt;
我在這邊要再介紹一款 Linux 上面 「更不好設定」「更需要學習」的 Window Manager -- i3.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://i3wm.org/screenshots/i3-8.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; src=&quot;https://i3wm.org/screenshots/i3-8.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;---&lt;br /&gt;
參考資料：&lt;br /&gt;
* i3wm http://forum.ubuntu.org.cn/viewtopic.php?t=400501&lt;br /&gt;
*&amp;nbsp;https://wiki.archlinux.org/index.php/i3_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/7999636681890653653/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/7999636681890653653' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/7999636681890653653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/7999636681890653653'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2018/05/linuxwm-linux-wm-i3.html' title='[Linux][WM] Linux 上面的輕 WM -- i3'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-8614365273389965654</id><published>2018-02-01T17:29:00.001+08:00</published><updated>2018-02-01T17:29:32.386+08:00</updated><title type='text'>[Linux] Private Key 不能登入的除錯方法與可能的問題點</title><content type='html'>最簡單的除錯方法是

&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;$ ssh HOST -v
&lt;/pre&gt;
&lt;br /&gt;
可能的問題點有：&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;File/Dir Permission # 目錄是 700, 檔案是 600&lt;/li&gt;
&lt;li&gt;Server 設定&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;pre&gt;RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile  .ssh/authorized_keys
&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/8614365273389965654/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/8614365273389965654' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/8614365273389965654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/8614365273389965654'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2018/02/linux-private-key.html' title='[Linux] Private Key 不能登入的除錯方法與可能的問題點'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-2244397000853854739</id><published>2017-06-21T09:37:00.001+08:00</published><updated>2017-06-21T09:37:32.081+08:00</updated><title type='text'>[Windows] 好用的小工具： AutoHotKey</title><content type='html'>做為一個 Linux 的愛好者，轉移到 Windows 上面的時候，往往難以適應 Windows 調整快捷鍵的方式，所以 google 了一下，結果發現很多人愛用的 &quot;Auto Hot key&quot;。不多說，就來給一個範例說明如何使用 Auto Hot key 來設定： 在 Windows 上面按下 CTRL&amp;nbsp;+ ALT&amp;nbsp;+ T 時會跑出 pietty&lt;br /&gt;
&lt;pre&gt;
; 一個〔Ctrl+Alt+F〕按鍵先後啟動FireFox和記事本
^!T::
  Run C:\Users\anton\Downloads\pietty0400b14\pietty0400b14.exe
  return
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
參考資料：&lt;br /&gt;
* &lt;a href=&quot;http://blog.xuite.net/kenjung0730/knowledge/20493767-AutoHotkey+%E6%95%99%E5%AD%B8%E8%88%87%E8%AA%AA%E6%98%8E&quot;&gt;Auto Hot Key 教學&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/2244397000853854739/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/2244397000853854739' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/2244397000853854739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/2244397000853854739'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2017/06/windows-autohotkey.html' title='[Windows] 好用的小工具： AutoHotKey'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-3577307727697198051</id><published>2017-06-09T10:24:00.000+08:00</published><updated>2017-06-09T10:24:19.279+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jenkins"/><category scheme="http://www.blogger.com/atom/ns#" term="軟體"/><title type='text'>[Software][Jenkins] 幹嘛一直重複 build code ？？</title><content type='html'>今年由於工作內容上的改變，花了很多時間在 jenkins 這套軟體的設定上面。其中最讓我覺得麻煩的，就是我的 jenkins 常常 SCM polling 完之後，發現 SVN 有變動的第一件事情，就是重複 build 前面一個 revision。&lt;br /&gt;
這讓我覺得很反感，一來是 build code 的時候多花了一份，二來是又會重複寄出通知給小組成員。&lt;br /&gt;
&lt;br /&gt;
所以那時我找不到解法的情況下，我的處理方式就是在 email 的邏輯上面進行調整，把邏輯改成如果 jenkins_api 抓不到 changeSet.items 的話，就不用特別寄信給小組成員，只需要寄信給我就好。&lt;br /&gt;
&lt;br /&gt;
跟著，昨天才找到真正的解法，原來 jenkins 會針對 $WORKSPACE 底下的變動再重 build，所以如果 build code 完畢又再發生變動， jenkins 就會在這次變動之前再 build 一次。&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
參考資料：&lt;br /&gt;
* &lt;a href=&quot;https://stackoverflow.com/questions/5871373/jenkins-ci-uses-wrong-svn-revision-for-build&quot;&gt;stackoverflow 上的解法&lt;/a&gt;&lt;br /&gt;
---&lt;br /&gt;
錯誤訊息：&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;WARNING: clock of the subversion server appears to be out of sync. This can result in inconsistent check out behavior.&lt;/code&gt;</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/3577307727697198051/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/3577307727697198051' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/3577307727697198051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/3577307727697198051'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2017/06/softwarejenkins-build-code.html' title='[Software][Jenkins] 幹嘛一直重複 build code ？？'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-2889145784944290572</id><published>2017-06-08T14:23:00.000+08:00</published><updated>2017-06-08T14:25:15.643+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="wm"/><category scheme="http://www.blogger.com/atom/ns#" term="xfce4"/><category scheme="http://www.blogger.com/atom/ns#" term="xwindow"/><title type='text'>[XWindow][XFCE4] 鍵盤快捷鍵不能用</title><content type='html'>昨天一早來辦公室，結果 keyboard shortcut 幾乎通通起不了作用。常用的 CTRL + ALT + T 去呼叫 gnome-terminal 完全沒反應。想說不知道是不是這兩天調 xfce4 調的太過火了，一時也不知道怎麼處理，索性就 dpkg -l|grep xfce4 叫出來，然後統統 reinstall 一番，之後居然好了？想說，應該不會那麼常發生吧？所以也沒打算再去理它。&amp;nbsp;
&lt;br /&gt;
&lt;br /&gt;
結果今天早上又發生了一次，總不能天天 reinstall 吧？所以就又跑去 google 了一下，結果找到一篇 &lt;a href=&quot;https://forum.xfce.org/viewtopic.php?id=7138&quot;&gt;XFCE4 Keyboard shortcut not working&lt;/a&gt; 的討論串，說這是老問題了，用下面這招可以撐一下：&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp;

&lt;code&gt;rm -fr ~/.cache/sessions/*&lt;/code&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;Log out 切去 tty1 清完 cache 再重啟了 gdm ，登入回來就恢復正常了。
嗯 ... 這招好過 reinstall 吧？？&lt;br /&gt;
---&lt;br /&gt;
參考資料：&lt;br /&gt;
* &lt;a href=&quot;https://forum.xfce.org/viewtopic.php?id=7138&quot;&gt;XFCE4 Keyboard shortcut not working&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/2889145784944290572/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/2889145784944290572' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/2889145784944290572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/2889145784944290572'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2017/06/xwindowxfce4.html' title='[XWindow][XFCE4] 鍵盤快捷鍵不能用'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>台灣基隆市台北</georss:featurename><georss:point>25.0329694 121.56541770000001</georss:point><georss:box>24.5725269 120.91997070000001 25.493411899999998 122.21086470000002</georss:box></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-5982046098917684051</id><published>2012-10-31T10:36:00.001+08:00</published><updated>2016-05-31T09:05:45.015+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="軟體"/><title type='text'>[Linux] Git Repository 用 http 加上 mysql auth，再加上 gitweb</title><content type='html'>話說 svn 很好用，不過現在大家都用上 git 來處理自已的 code 了，所以我也想再更新一下之前寫的文章「&lt;a href=&quot;http://antontw.blogspot.tw/2008/11/linux-svn-http-mysql-auth.html&quot;&gt;SVN 跑 http 加上 MySQL auth&lt;/a&gt;」，這邊是用 svn 在 http 上面跑的，因為 auth 是在 mysql 上面做，所以可以很自由的 新增/刪除/修改 username,password 甚至是 group，接下來我們就是要沿用這段，讓 git 也可以在 http 上面跑，同時使用 mysql 的授權，再用 gitweb 這個套件就可以很方便的在 web 上面實現瀏覽、和 git 的 source code 管理。&lt;br /&gt;
&lt;br /&gt;
ubuntu 底下，先來安裝套件：(LAMP 就不贅述了)&lt;br /&gt;
&lt;pre&gt;sudo apt-get install gitweb libapache2-mod-auth-mysql
&lt;/pre&gt;
&lt;br /&gt;
這是我的 /etc/apache/conf.d/gitweb 設定：&lt;br /&gt;
&lt;pre&gt;Alias /git /home/git
Alias /gitweb /usr/share/gitweb

&lt;directory gitweb=&quot;&quot; share=&quot;&quot; usr=&quot;&quot;&gt;
  Options FollowSymLinks +ExecCGI
  AddHandler cgi-script .cgi
&lt;/directory&gt;
&lt;location gitweb=&quot;&quot;&gt;
    AuthBasicAuthoritative Off
    AuthMYSQL on
    AuthMySQL_Authoritative on
    AuthMySQL_DB auth
    Auth_MySQL_Host localhost
    Auth_MySQL_User admin
    Auth_MySQL_Password 12345678
    AuthMySQL_Password_Table clients
    AuthMySQL_Username_Field username
    AuthMySQL_Password_Field password
    AuthMySQL_Empty_Passwords off
    AuthUserFile /dev/null
    AuthMySQL_Encryption_Types Crypt_DES
    AuthType Basic
    AuthName &quot;Restricted ZONE&quot;
    Require valid-user
&lt;/location&gt;
&lt;location admin=&quot;&quot;&gt;
    AuthBasicAuthoritative Off
    AuthMYSQL on
    AuthMySQL_Authoritative on
    AuthMySQL_DB auth
    Auth_MySQL_Host localhost
    Auth_MySQL_User admin
    Auth_MySQL_Password 12345678
    AuthMySQL_Password_Table clients
    AuthMySQL_Username_Field username
    AuthMySQL_Password_Field password
    AuthMySQL_Empty_Passwords off
    AuthUserFile /dev/null
    AuthMySQL_Encryption_Types Crypt_DES
    # Standard auth stuff
    AuthType Basic
    AuthName &quot;Restricted ZONE&quot;
    Require valid-user
&lt;/location&gt;
&lt;location git=&quot;&quot;&gt;
    DAV on
    AuthBasicAuthoritative Off
    AuthMYSQL on
    AuthMySQL_Authoritative on
    AuthMySQL_DB auth
    Auth_MySQL_Host localhost
    Auth_MySQL_User admin
    Auth_MySQL_Password 12345678
    AuthMySQL_Password_Table clients
    AuthMySQL_Username_Field username
    AuthMySQL_Password_Field password
    AuthMySQL_Empty_Passwords off
    AuthUserFile /dev/null
    AuthMySQL_Encryption_Types Crypt_DES
    AuthType Basic
    AuthName &quot;Restricted ZONE&quot;
    Require valid-user
&lt;/location&gt;&lt;/pre&gt;
上面都做完了，別人訪問你的 web 的時候，就會使用上 mysql auth 了。不過這邊 database 還沒建好，所以連進去應該會看到 Server Error 500 。
接著是 mysql 的 database auth 的內容：
&lt;br /&gt;
&lt;pre&gt;DROP TABLE IF EXISTS `clients`;
CREATE TABLE `clients` (
  `username` varchar(25) NOT NULL DEFAULT &#39;&#39;,
  `password` varchar(25) NOT NULL DEFAULT &#39;&#39;,
  `groups` varchar(25) NOT NULL DEFAULT &#39;&#39;,
  `email` varchar(256) NOT NULL DEFAULT &#39;&#39;,
  PRIMARY KEY (`username`),
  KEY `groups` (`groups`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `clients` VALUES (&#39;admin&#39;,&#39;djifjijigjgdi&#39;,&#39;admin&#39;,&#39;&#39;);
&lt;/pre&gt;
admin 預設我用上 test1234 ，所以你要修改的話就自已下 encrypt(&quot;abcd1234&quot;) 之類的來修改。
要換用 sha1 / mysql password 或其它加密方式，請記得跟上面 apache 的 conf 一起修改。

這邊下完我們已經可以使用 mysql 的帳密來訪問網頁了，不過還有一點點事情要做：
1. git repository 只能用 gitweb 訪問。要直接 git access 的話，需要再在 git 的 repository 那邊下：
&lt;br /&gt;
&lt;pre&gt; git update-server-info &lt;/pre&gt;
2. mysql 的帳密需要一個管理介面 (所以我留下了 /admin 的 location)
3. gitweb 預設的 theme 很醜 (修改 /etc/gitweb.conf 把 static 改成別的)

真的很懶，不想再打字了，所以我把整包放在&lt;a href=&quot;http://dl.dropbox.com/u/1117561/linux/gitweb.tgz&quot;&gt;這裡&lt;/a&gt;。
需要請自便，稍後我也會把 /admin 的部份再丟上來，那個部份現在還不完整。
--&lt;br /&gt;
參考資料&lt;br /&gt;
*&amp;nbsp;&lt;a href=&quot;http://antontw.blogspot.tw/2008/11/linux-svn-http-mysql-auth.html&quot;&gt;SVN 跑 http 加上 MySQL auth&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/5982046098917684051/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/5982046098917684051' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/5982046098917684051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/5982046098917684051'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2012/10/linux-git-repository-http-mysql-auth.html' title='[Linux] Git Repository 用 http 加上 mysql auth，再加上 gitweb'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-3368167300910131995</id><published>2012-10-17T15:11:00.003+08:00</published><updated>2012-10-17T15:11:51.984+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="微軟"/><category scheme="http://www.blogger.com/atom/ns#" term="軟體"/><title type='text'>[軟體] VirtualBox 在 Windows 上面有夠慢</title><content type='html'>從 &lt;a href=&quot;http://scottiestech.info/2010/12/31/fix-slow-windows-networking-problems-when-virtualbox-is-installed/&quot;&gt;Fix Slow Windows Networking Problems When VirtualBox is Installed&lt;/a&gt;&amp;nbsp;看到的說明，看起來是 VirtualBox 的 Host Only 的 Driver 有問題的樣子，所以在 Windows 7 裡面，如果開了 Host Only 的部份，會因為這點讓整個 Guest OS 都跑很慢，所以在網路卡設定的地方把 Host Only 停用就可以讓 Guest OS 的速度回來了。&lt;br /&gt;
&lt;br /&gt;
如果堅持要用 Host Only 就沒辦法用這招了。</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/3368167300910131995/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/3368167300910131995' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/3368167300910131995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/3368167300910131995'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2012/10/virtualbox-windows.html' title='[軟體] VirtualBox 在 Windows 上面有夠慢'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-5526811989824820490</id><published>2012-09-17T18:02:00.004+08:00</published><updated>2012-09-17T18:03:56.005+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="firefox"/><category scheme="http://www.blogger.com/atom/ns#" term="Google"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="軟體"/><title type='text'>[Ubuntu][Linux] 底下安裝 Java VM (JRE) 的流程</title><content type='html'>話說最近需要在 Chrome 底下看遠端 CAM 的網頁，但是不會安裝 for Ubuntu Linux 的 JRE ，所以又跑去拜大神，問大神有沒有安裝的方法和步驟。(尤其是很久沒有用 firefox 了，所以連 plugin dir 在哪裡都不敢肯定。)&lt;br /&gt;
&lt;br /&gt;
這邊使用的版本是 Google Chrome 21.0.1180.89&lt;br /&gt;
對照 Mozilla firefox 的版本是 Firefox 15.0.1&lt;br /&gt;
&lt;br /&gt;
主要參考資料是&amp;nbsp;&lt;a href=&quot;http://www.liberiangeek.net/2012/04/install-oracle-java-runtime-jre-7-in-ubuntu-12-04-precise-pangolin/&quot;&gt;這邊&lt;/a&gt;&amp;nbsp;提到的方法，翻成中文是：&lt;br /&gt;
1. 移除 openjdk*&lt;br /&gt;
&lt;pre style=&quot;background-color: #e5e5e5; color: #333333; font-family: consolas, &#39;Courier New&#39;, courier, monospace; font-size: 14px; line-height: 25px; margin: 0em; padding: 0px; width: 564px;&quot;&gt;sudo apt-get purge openjdk*&lt;/pre&gt;
2. 去 &lt;a href=&quot;http://www.oracle.com/technetwork/java/javase/downloads/jre-7u3-download-1501631.html&quot;&gt;Oracle 官網&lt;/a&gt; 下載 JRE&lt;br /&gt;
3. 解開 jre 裡面的內容到&amp;nbsp;&lt;span style=&quot;background-color: #f3f3f3; color: green; font-family: consolas, &#39;Courier New&#39;, courier, monospace; font-size: 14px; line-height: 25px;&quot;&gt;/usr/lib/jvm/jre1.7.0&lt;/span&gt;&amp;nbsp;底下&lt;br /&gt;
4. 更新 alternative 的連結&lt;br /&gt;
&lt;pre style=&quot;background-color: #f3f3f3; color: #333333; font-family: consolas, &#39;Courier New&#39;, courier, monospace; font-size: 14px; line-height: 25px; margin: 0em; padding: 0px; width: 568px;&quot;&gt;sudo update-alternatives &lt;span style=&quot;color: green; margin: 0px; padding: 0px;&quot;&gt;--install /usr/bin/java java /usr/lib/jvm/jre1.7.0/bin/java 0&lt;/span&gt;&lt;/pre&gt;
5. 重新製作 plugin 的連結&lt;br /&gt;
&lt;pre style=&quot;background-color: #f3f3f3; color: #333333; font-family: consolas, &#39;Courier New&#39;, courier, monospace; font-size: 14px; line-height: 25px; margin: 0em; padding: 0px; width: 568px;&quot;&gt;sudo update-alternatives &lt;span style=&quot;color: green; margin: 0px; padding: 0px;&quot;&gt;
ln -s /usr/lib/jvm/jre1.7.0/lib/i386/libnpjp2.so ~/.mozilla/plugins/&lt;/span&gt;&lt;/pre&gt;
當然 google-chrome 的 plugin 目錄是在&amp;nbsp;/opt/google/chrome 所以 chrome 的使用者要調整為：&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #f3f3f3; color: #333333; font-family: consolas, &#39;Courier New&#39;, courier, monospace; font-size: 14px; line-height: 25px; margin: 0em; padding: 0px; width: 568px;&quot;&gt;sudo update-alternatives &lt;span style=&quot;color: green; margin: 0px; padding: 0px;&quot;&gt;
ln -s /usr/lib/jvm/jre1.7.0/lib/i386/libnpjp2.so /opt/google/chrome&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
這樣就瀏覽器重啟之後， JRE 就可以生效了。&lt;br /&gt;
--&lt;br /&gt;
參考資料：&lt;br /&gt;
* &lt;a href=&quot;http://www.liberiangeek.net/2012/04/install-oracle-java-runtime-jre-7-in-ubuntu-12-04-precise-pangolin/&quot;&gt;Ubuntu 12.04 底下安裝 Oracle JRE&lt;/a&gt;&lt;br /&gt;
* &lt;a href=&quot;http://www.java.com/en/download/testjava.jsp&quot;&gt;驗證 JRE 是否正常工作的網址&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/5526811989824820490/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/5526811989824820490' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/5526811989824820490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/5526811989824820490'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2012/09/ubuntulinux-java-vm-jre.html' title='[Ubuntu][Linux] 底下安裝 Java VM (JRE) 的流程'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-7055567721087859742</id><published>2012-07-23T10:17:00.001+08:00</published><updated>2012-07-23T10:19:17.547+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="軟體"/><category scheme="http://www.blogger.com/atom/ns#" term="輸入法"/><title type='text'>[Linux] Gnome 3 Gnome Terminal 找不到輸入法</title><content type='html'>這幾天在玩 gnome shell 時，發現 gnome shell 安裝完，&quot;大概&quot;是 gnome3 昇級 gtk3 的關係，所以 gtk immodule 有動到了，結果 gnome-terminal 開出來，右鍵的輸入法選單都是空的。&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkdgF2S4LmZbFiijrARhfCHPvg784PDS9ODa6j2qUmR-WC-gPxlAqVZWSMVPqHwuDJadYHuBiGJxDhixVbqLSM_onTYJQsTHzcmUQVqjR1JfT8kFdO7-0JVPwB4ZK0VLrfhZqkfQ/s1600/gtk_immodule_empty.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;351&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkdgF2S4LmZbFiijrARhfCHPvg784PDS9ODa6j2qUmR-WC-gPxlAqVZWSMVPqHwuDJadYHuBiGJxDhixVbqLSM_onTYJQsTHzcmUQVqjR1JfT8kFdO7-0JVPwB4ZK0VLrfhZqkfQ/s400/gtk_immodule_empty.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;空白的輸入法選單&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
這個問題解法很簡單：&lt;br /&gt;
1. 新增一個檔案到 /etc/gtk-3.0/gtk.immodules ，內容是&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&quot;/usr/lib/i386-linux-gnu/gtk-3.0/3.0.0/immodules/im-xim.so&quot;&lt;br /&gt;
&quot;xim&quot; &quot;X Input Method&quot; &quot;gtk30&quot; &quot;/usr/share/locale&quot; &quot;ja:zh&quot;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&quot;/usr/lib/i386-linux-gnu/gtk-3.0/3.0.0/immodules/im-ibus.so&quot;&lt;br /&gt;
&quot;ibus&quot; &quot;iBus&quot; &quot;gtk30&quot; &quot;/usr/share/locale&quot; &quot;ja:zh&quot;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&quot;/usr/lib/i386-linux-gnu/gtk-3.0/3.0.0/immodules/im-gcin.so&quot;&lt;br /&gt;
&quot;gcin&quot; &quot;GCIN&quot; &quot;gtk30&quot; &quot;/usr/share/locale&quot; &quot;ja:zh&quot;&lt;/blockquote&gt;
2. 登出&lt;br /&gt;
3. 再登入&lt;br /&gt;
&lt;br /&gt;
這樣就可以看到正常一點的輸入法選單了：&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2dcD2mHQpKDQr3bYT5RLxyJ83bE3ubFyg0lzi1qJORUUWi4UPz5Dgb2W6gdcIC2hGKNkNfy0DVq2MAe1YlkEsYu81eAgsFlOL0U6TU8aKJCIKFm8CFsOdxunxl2UFfKmeED_kAw/s1600/gtk_immodule.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;173&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2dcD2mHQpKDQr3bYT5RLxyJ83bE3ubFyg0lzi1qJORUUWi4UPz5Dgb2W6gdcIC2hGKNkNfy0DVq2MAe1YlkEsYu81eAgsFlOL0U6TU8aKJCIKFm8CFsOdxunxl2UFfKmeED_kAw/s400/gtk_immodule.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;修正完的輸入法選單&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
--&lt;br /&gt;
* gtk.immodules 檔案內容須以空白相隔，如果不符合格式會出錯。可以參考我的&lt;a href=&quot;https://dl.dropbox.com/u/1117561/linux/gtk.immodules&quot;&gt;設定檔&lt;/a&gt;。</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/7055567721087859742/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/7055567721087859742' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/7055567721087859742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/7055567721087859742'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2012/07/linux-gnome-3-gnome-terminal.html' title='[Linux] Gnome 3 Gnome Terminal 找不到輸入法'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkdgF2S4LmZbFiijrARhfCHPvg784PDS9ODa6j2qUmR-WC-gPxlAqVZWSMVPqHwuDJadYHuBiGJxDhixVbqLSM_onTYJQsTHzcmUQVqjR1JfT8kFdO7-0JVPwB4ZK0VLrfhZqkfQ/s72-c/gtk_immodule_empty.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-6575820193794265660</id><published>2012-07-22T01:33:00.000+08:00</published><updated>2012-09-18T21:16:14.403+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="輸入法"/><title type='text'>[Linux] 在 Ubuntu 12.04 上面開始使用 Gnome Shell</title><content type='html'>在開始使用 Ubuntu 12.04 之後總是覺得 Unity 的介面少了點什麼。直到遇上 Gnome 3 + Gnome &amp;nbsp;Shell 之後才知道，原來 WM 的介面可以使用起來這麼方便有效率，而且也很重要的一點就是，可以更快更方便的修改。&lt;br /&gt;
&lt;br /&gt;
一樣有面板，也一樣是預設用使用 nautilus 作為檔案總管。但是一切就從使用的習慣上開始不一樣。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDmjWXah2q5O9Bctj2IAVVytmfbZZ8lf9_SNco1xH96Zoc63AMvb49RdodC_zc05LyaW1gY9pfv0MUZjP2JJPuCTnWd1oUt5jrLiZqR-KyJfrI6TRO49i4M_WX3ASVoKZKvhB55w/s1600/%E8%9E%A2%E5%B9%95%E6%93%B7%E5%9C%96%E5%AD%98%E7%82%BA+2012-07-22+01:01:48.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;250&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDmjWXah2q5O9Bctj2IAVVytmfbZZ8lf9_SNco1xH96Zoc63AMvb49RdodC_zc05LyaW1gY9pfv0MUZjP2JJPuCTnWd1oUt5jrLiZqR-KyJfrI6TRO49i4M_WX3ASVoKZKvhB55w/s400/%E8%9E%A2%E5%B9%95%E6%93%B7%E5%9C%96%E5%AD%98%E7%82%BA+2012-07-22+01:01:48.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
和 unity 一樣呼叫了面板之後，系統會對當前正在使用的應用程式進行縮圖，效率比 unity 快上很多；左手邊就是常駐工具列 (dock) ，中間是我剛剛提到的應用程式的縮圖，右邊則是工作區的縮圖。面板上可以看到氣象套件提供的資訊，還有電力資訊，工作區資訊。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDupIJNrigIrLpPbmrNdWpf4lVdjrkwwUbXyGO1IO4XP58bTrH4n5NUugTbQtUzcjZT4cT0pHAx_Wp1re5vqMyCgdLqNxn6D2yXuxCOVI830Cv-CNT4OtFMvY3ezVidXCBHvKWDA/s1600/dock.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;250&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDupIJNrigIrLpPbmrNdWpf4lVdjrkwwUbXyGO1IO4XP58bTrH4n5NUugTbQtUzcjZT4cT0pHAx_Wp1re5vqMyCgdLqNxn6D2yXuxCOVI830Cv-CNT4OtFMvY3ezVidXCBHvKWDA/s400/dock.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Unity 看起來就像是 Gnome Shell 的過渡時期的應用套件。可以很明顯地看得出來 Ubuntu 想把自已朝向 mobile device 或著保守的說是更向 touch panel 應用上前進。所以多了很多功能是配合 touch panel 在使用的。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYIrWHiZkmoGyiRdQz_Ybtw8I45G1GdRn40-Z8hXLlsjXbT_494csB9Jk9xFhK3qfihCVarD8SD2VegXgL78NbG-41cisEEB5Oc9c2B63IRrXLHv2Zh8-gKoj7cyQYeTgdMas6ZQ/s1600/tasklet.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;250&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYIrWHiZkmoGyiRdQz_Ybtw8I45G1GdRn40-Z8hXLlsjXbT_494csB9Jk9xFhK3qfihCVarD8SD2VegXgL78NbG-41cisEEB5Oc9c2B63IRrXLHv2Zh8-gKoj7cyQYeTgdMas6ZQ/s400/tasklet.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
--&lt;br /&gt;
參考資料及備忘：&lt;br /&gt;
*&amp;nbsp;&lt;a href=&quot;http://www.ubuntusoft.com/ubuntu-12-04-%E6%94%B9%E9%80%A0%E6%8C%87%E5%8D%97.html&quot;&gt;ubuntu-12-04-改造指南&lt;/a&gt;&amp;nbsp;(安裝 Gnome 3 / Gnome Shell 的方法)&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;sudo add-apt-repository ppa:gnome3-team/gnome3
sudo add-apt-repository ppa:ricotz/testing&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;sudo apt-get update
sudo apt-get install gnome-shell # 安装Gnome-shell 桌面
sudo apt-get install gnome-shell-extensions # 安装extensions
sudo apt-get install gnome-tweak-tool # 安装配置工具&lt;/pre&gt;
&lt;br /&gt;
*&amp;nbsp;&lt;a href=&quot;http://www.techdrivein.com/2011/10/7-best-gnome-shell-extensions-install.html&quot;&gt;7-best-gnome-shell-extensions-install&lt;/a&gt;&amp;nbsp;(安裝 Gnome Shell Extension)&lt;br /&gt;
* Gnome Shell Extension Weather 請務必安裝&lt;a href=&quot;https://code.launchpad.net/~xeked/+archive/gnome&quot;&gt;這個版本&lt;/a&gt;的&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;sudo add-apt-repository ppa:xeked/gnome&lt;/pre&gt;
&lt;pre&gt;
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0B5C004838624188
sudo apt-get update
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
* gnome-shell-extension-weather 的 zh_TW mo 檔可以替換成這個&lt;a href=&quot;http://dl.dropbox.com/u/1117561/linux/gnome-shell-extension-weather/zh_TW.mo&quot;&gt;檔案&lt;/a&gt;，&lt;br /&gt;
只要下載完執行&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
sudo cp gnome-shell-extension-weather.mo /usr/share/locale/zh_TW/LC_MESSAGES/
&lt;/pre&gt;
&lt;br /&gt;
就可以完成安裝作業。(沒辦法，原本沒有繁體中文的翻譯，又看不慣沒有中文，只好自已動手翻一下，還好並不多。)&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/6575820193794265660/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/6575820193794265660' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/6575820193794265660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/6575820193794265660'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2012/07/linux-ubuntu-1204-gnome-shell.html' title='[Linux] 在 Ubuntu 12.04 上面開始使用 Gnome Shell'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDmjWXah2q5O9Bctj2IAVVytmfbZZ8lf9_SNco1xH96Zoc63AMvb49RdodC_zc05LyaW1gY9pfv0MUZjP2JJPuCTnWd1oUt5jrLiZqR-KyJfrI6TRO49i4M_WX3ASVoKZKvhB55w/s72-c/%E8%9E%A2%E5%B9%95%E6%93%B7%E5%9C%96%E5%AD%98%E7%82%BA+2012-07-22+01:01:48.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-2520130571661151211</id><published>2012-07-11T13:46:00.003+08:00</published><updated>2012-07-11T13:59:39.948+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type='text'>[Linux] 控制你的 Ubuntu 在 40% 的時候進行充電，充到 80% 就停止</title><content type='html'>之前寫過&amp;nbsp;&lt;a href=&quot;http://antontw.blogspot.tw/2012/05/linux-ubuntu-1204-ipad2.html&quot;&gt;iPad 在 Ubuntu 12.04 上充電&lt;/a&gt;&amp;nbsp;的文章，那時就很想問一個問題是：&lt;br /&gt;
如何讓 ipad 只充電到 50% 或 80% 這樣？(&lt;a href=&quot;http://software.sopili.net/post/li-ion-battery/&quot;&gt;據說&lt;/a&gt;這樣電池壽命比較長？)&lt;br /&gt;
&lt;br /&gt;
這個需求可以透過 &lt;a href=&quot;http://askubuntu.com/questions/34452/how-can-i-limit-battery-charging-to-80-capacity&quot;&gt;Ask Ubuntu 上面&lt;/a&gt;&amp;nbsp;提供的方法得到解決，亦即安裝&amp;nbsp;&lt;span style=&quot;background-color: #e0e0e0; color: #222222; font-family: &#39;Ubuntu Mono&#39;, &#39;Ubuntu Beta Mono A&#39;, Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: 14px; line-height: 17px; text-align: left;&quot;&gt;tp-smapi-dkms&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;套件再自行設定&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #e0e0e0; border: 0px; color: #333333; font-family: &#39;Ubuntu Mono&#39;, &#39;Ubuntu Beta Mono A&#39;, Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: 14px; line-height: 17px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; text-align: left; vertical-align: baseline; width: auto;&quot;&gt;echo 40 &amp;gt; /sys/devices/platform/smapi/BAT0/start_charge_thresh
echo 80 &amp;gt; /sys/devices/platform/smapi/BAT0/stop_charge_thresh&lt;/pre&gt;
&lt;br /&gt;
就可以控制你的 Ubuntu 在 40% 的時候進行充電，充到 80% 就停止。&lt;br /&gt;
&lt;br /&gt;
[20120711 更新]: 這個方法只有 think pad 可以用。&lt;br /&gt;
--&lt;br /&gt;
參考文章：&lt;br /&gt;
*&amp;nbsp;&lt;a href=&quot;http://askubuntu.com/questions/34452/how-can-i-limit-battery-charging-to-80-capacity&quot;&gt;http://askubuntu.com/questions/34452/how-can-i-limit-battery-charging-to-80-capacity&lt;/a&gt;&amp;nbsp;如何只充到 80% ？&lt;br /&gt;
*&amp;nbsp;&lt;a href=&quot;http://antontw.blogspot.tw/2012/05/linux-ubuntu-1204-ipad2.html&quot;&gt;http://antontw.blogspot.tw/2012/05/linux-ubuntu-1204-ipad2.html&lt;/a&gt;&amp;nbsp;ipad2 在 ubuntu 上的充電方法&lt;br /&gt;
*&amp;nbsp;&lt;a href=&quot;http://www.macuknow.com/node/1289&quot;&gt;http://www.macuknow.com/node/1289&lt;/a&gt;&amp;nbsp;電池該如何充？</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/2520130571661151211/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/2520130571661151211' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/2520130571661151211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/2520130571661151211'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2012/07/ipad-ubuntu-12.html' title='[Linux] 控制你的 Ubuntu 在 40% 的時候進行充電，充到 80% 就停止'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-602569239329081991</id><published>2012-06-15T00:31:00.001+08:00</published><updated>2012-06-15T00:31:49.158+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="軟體"/><title type='text'>[Linux][軟體] SSL handshake failed: SSL disabled due to library version mismatch</title><content type='html'>根據&amp;nbsp;&lt;a href=&quot;http://www.codeproject.com/Questions/261463/How-can-i-rectify-SSL-handshake-failed-Secure-conn&quot;&gt;這邊&lt;/a&gt;&amp;nbsp;的說法，遇到 svn 顯示&amp;nbsp;SSL handshake failed: SSL disabled due to library version mismatch 的時候，其實可以先用：&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
svn checkout --config-option servers:global:neon-debug-mask=511 $URL&lt;/blockquote&gt;
來確認你的問題點在哪裡。&lt;br /&gt;
&lt;br /&gt;
像我的問題點看起來很明顯是 libneon 的版本的問題，所以暫時還沒有解法 (好像可以先用 library path 的方式來處理，但是會有很多沿生的相依問題吧？)&lt;br /&gt;
&lt;br /&gt;
所以暫時先不動好了，看看之後有沒有新的 svn server 給我玩再來處理好了。&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
參考資料&lt;br /&gt;
&lt;a href=&quot;http://www.codeproject.com/Questions/261463/How-can-i-rectify-SSL-handshake-failed-Secure-conn&quot;&gt;http://www.codeproject.com/Questions/261463/How-can-i-rectify-SSL-handshake-failed-Secure-conn&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/602569239329081991/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/602569239329081991' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/602569239329081991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/602569239329081991'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2012/06/linux-ssl-handshake-failed-ssl-disabled.html' title='[Linux][軟體] SSL handshake failed: SSL disabled due to library version mismatch'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-4140827516746593187</id><published>2012-06-05T13:07:00.001+08:00</published><updated>2012-06-05T13:07:36.149+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="todo"/><title type='text'>[Linux] Grub-reboot not working</title><content type='html'>很久很久以前，寫過 一篇文章 提到 &lt;a href=&quot;http://antontw.blogspot.tw/2007/06/linux-grub-reboot.html&quot;&gt;grub-reboot 不能用&lt;/a&gt;的問題，最近玩 Ubuntu 12 玩比較多，但工作上仍時常需要切換到 Windows 去，所以需要使用到 grub-reboot 的功能。結果一用之下竟然不能用，所以又去 Google 了一下，發現原來 Grub-Reboot 是需要先設成 default=saved 的。(參考&lt;a href=&quot;http://wiki.debian.org/GrubReboot&quot;&gt;這篇文章&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
不過奇怪的是，我設完了之後，做過 update-grub 也還是不能用。&lt;br /&gt;
所以按 grub 的情況下去看 shell script 的動作，結果找到，原來 grub-reboot 是很簡單的去下：&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
grub-editenv list&lt;br /&gt;grub-editenv set saved_entry=3&lt;/blockquote&gt;
這樣開完機之後就會跳到 entry 3 去跑了。&lt;br /&gt;
&lt;br /&gt;
唔 ... 只做這樣的動作，我的 grub 會聽話耶 ... 所以是 grub-reboot 這支 shell script 的問題啊？&lt;br /&gt;
暫且寫下這篇記錄這個問題，稍後有時候再回頭來看 shell script 怎麼了。&lt;br /&gt;
--&lt;br /&gt;
參考資料：&lt;br /&gt;
*&amp;nbsp;&lt;a href=&quot;http://wiki.debian.org/GrubReboot&quot;&gt;http://wiki.debian.org/GrubReboot&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/4140827516746593187/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/4140827516746593187' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/4140827516746593187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/4140827516746593187'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2012/06/linux-grub-reboot-not-working.html' title='[Linux] Grub-reboot not working'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-1961140718817298288</id><published>2012-06-05T12:04:00.000+08:00</published><updated>2012-06-05T12:05:05.032+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="軟體"/><title type='text'>[Linux] 嫌 GCC 跑得慢嗎？想找人幫忙嗎？</title><content type='html'>一直都嫌 GCC 一台電腦跑起來很慢，所以想找別台機器一起來幫忙 build code 才不會那麼慢，果然 google 大神一下就給了答案，在&amp;nbsp;&lt;a href=&quot;http://wayne0225.blogspot.tw/2009/01/icescream-compiler.html&quot;&gt;維尼熊的天空&lt;/a&gt;&amp;nbsp;找到一篇 icescream 可以參考使用的文章。不過因為時間久遠，Ubuntu / Debian 都變化了不少，所以有些 Config 不大一樣了，這篇特別標記一下：&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Etr8c2PcJQ-QCNGRHpMHIBy3PTl4NYLfT33XpVtXYPRBfhCODE65CSb4zCWkI6Eifnu0UhyphenhyphenZ-ebqOEdSdREMcyJgOJdIfovsop_ethMUANQw3o8JHx8SMBnd-KAHyXDHsPvcjQ/s1600/%E8%9E%A2%E5%B9%95%E6%93%B7%E5%9C%96%E5%AD%98%E7%82%BA+2012-06-05+12:00:32.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;156&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Etr8c2PcJQ-QCNGRHpMHIBy3PTl4NYLfT33XpVtXYPRBfhCODE65CSb4zCWkI6Eifnu0UhyphenhyphenZ-ebqOEdSdREMcyJgOJdIfovsop_ethMUANQw3o8JHx8SMBnd-KAHyXDHsPvcjQ/s400/%E8%9E%A2%E5%B9%95%E6%93%B7%E5%9C%96%E5%AD%98%E7%82%BA+2012-06-05+12:00:32.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Scheduler 要改在 /etc/default/icecc 裡面設定了，然後再&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
export PATH=/usr/lib/icecc/bin:$PATH&lt;/blockquote&gt;
在 make -j6 的時候就可以開始使用分散式的 build procedure。&lt;br /&gt;
--&lt;br /&gt;
參考資料：&lt;br /&gt;
*&amp;nbsp;&lt;a href=&quot;http://wayne0225.blogspot.tw/2009/01/icescream-compiler.html&quot;&gt;http://wayne0225.blogspot.tw/2009/01/icescream-compiler.html&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/1961140718817298288/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/1961140718817298288' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/1961140718817298288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/1961140718817298288'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2012/06/linux-gcc.html' title='[Linux] 嫌 GCC 跑得慢嗎？想找人幫忙嗎？'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Etr8c2PcJQ-QCNGRHpMHIBy3PTl4NYLfT33XpVtXYPRBfhCODE65CSb4zCWkI6Eifnu0UhyphenhyphenZ-ebqOEdSdREMcyJgOJdIfovsop_ethMUANQw3o8JHx8SMBnd-KAHyXDHsPvcjQ/s72-c/%E8%9E%A2%E5%B9%95%E6%93%B7%E5%9C%96%E5%AD%98%E7%82%BA+2012-06-05+12:00:32.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-4602905553660663000</id><published>2012-05-12T00:59:00.001+08:00</published><updated>2012-07-10T13:16:23.768+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="軟體"/><title type='text'>[Linux] Ubuntu 12.04 上給 iPad2 充電</title><content type='html'>iPad 在 Windows 上面充電可以參考&amp;nbsp;&lt;a href=&quot;http://272586.blogspot.com/2011/08/asus-ai-changeripad2.html&quot;&gt;這邊&lt;/a&gt;&amp;nbsp;或 &lt;a href=&quot;http://www.aniki520.com/ipad2file/0714skill/charge.html&quot;&gt;這邊&lt;/a&gt;&amp;nbsp;，但是如果要在 Linux 上面充電，要花一點工夫。還好天天拜 Google 大神不是拜假的，Google 一下就可以找得到資料，這篇 &amp;nbsp;&lt;a href=&quot;http://korenkov.info/ipad-ipad2-charge-ubuntu&quot;&gt;iPad iPad2 Charge on Ubuntu&lt;/a&gt;&amp;nbsp;就有提到，怎麼在 Ubuntu 上面給 iPad 充電的方法：&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14px; line-height: 22px; margin-bottom: 18px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;margin: 0px; padding: 0px; text-decoration: underline;&quot;&gt;&lt;strong style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;font-size: medium; margin: 0px; padding: 0px;&quot;&gt;Installation for iPad&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14px; line-height: 22px; margin-bottom: 18px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: helvetica, arial, freesans, clean, sans-serif; line-height: 19px; margin: 0px; padding: 0px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;CodeRay&quot; style=&quot;background-color: #232323; border-bottom-color: black; border-bottom-style: solid; border-bottom-width: 1px; border-image: initial; border-left-color: black; border-left-style: solid; border-left-width: 1px; border-right-color: black; border-right-style: solid; border-right-width: 1px; border-top-color: black; border-top-style: solid; border-top-width: 1px; color: #e6e0db; font-family: &#39;Courier New&#39;, Terminal, monospace; font-size: 12px; line-height: 14px; margin-bottom: 20px; margin-left: 0px; margin-right: 0px; margin-top: 12px; overflow-x: auto; overflow-y: auto; padding-bottom: 3px; padding-left: 5px; padding-right: 5px; padding-top: 3px; text-align: justify;&quot;&gt;
&lt;div class=&quot;code&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;pre style=&quot;padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev
wget --no-check-certificate https://github.com/downloads/mkorenkov/ipad_charge/ipad_charge_1.0.tar.gz
tar -xzf ipad_charge_1.0.tar.gz
cd ./ipad_charge_1.0
make
sudo make install&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14px; line-height: 22px; margin-bottom: 18px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
&lt;strong style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; text-decoration: underline;&quot;&gt;&lt;span style=&quot;font-size: medium; margin: 0px; padding: 0px;&quot;&gt;Installation for iPad2&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14px; line-height: 22px; margin-bottom: 18px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: helvetica, arial, freesans, clean, sans-serif; line-height: 19px; margin: 0px; padding: 0px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;CodeRay&quot; style=&quot;background-color: #232323; border-bottom-color: black; border-bottom-style: solid; border-bottom-width: 1px; border-image: initial; border-left-color: black; border-left-style: solid; border-left-width: 1px; border-right-color: black; border-right-style: solid; border-right-width: 1px; border-top-color: black; border-top-style: solid; border-top-width: 1px; color: #e6e0db; font-family: &#39;Courier New&#39;, Terminal, monospace; font-size: 12px; line-height: 14px; margin-bottom: 20px; margin-left: 0px; margin-right: 0px; margin-top: 12px; overflow-x: auto; overflow-y: auto; padding-bottom: 3px; padding-left: 5px; padding-right: 5px; padding-top: 3px; text-align: justify;&quot;&gt;
&lt;div class=&quot;code&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;pre style=&quot;padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev
wget --no-check-certificate https://github.com/downloads/mkorenkov/ipad_charge/ipad2_charge_1.0.tar.gz
tar -xzf ipad2_charge_1.0.tar.gz
cd ./ipad2_charge/
make
sudo make install&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
不過它上面寫的 udev 的 rules 不知道是過期了，還是怎樣，在 Ubuntu 12.04 上面不能正常工作，所以我又花了點工夫把 udev 的 rules 再改了一下，可以在這邊下載：&lt;br /&gt;
&lt;br /&gt;
http://dl.dropbox.com/u/1117561/linux/95-ipad_charge.rules&lt;br /&gt;
&lt;br /&gt;
加到你的&amp;nbsp;/etc/udev/rules.d/ 再重跑 /etc/init.d/udev 就可以正常為 iPad2 充電了。&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
更新：&lt;br /&gt;
* 20120612 發現 iphone 在 ubuntu 上面的充電截圖，現在看起來專業多了：&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjahb57XPu4TB-bq5j-y9FIqdwETWWlcCVdSjhTCDbcd5NNrZuOfUE3GTNty_9nU2_5U_plZfC4ej-9JuZh7r2hP4vCPrbyDvtUvdIeC68_wH6H-Urhi7w0eoGmSVqN2gUvgYvrDQ/s1600/iphone_charging.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;277&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjahb57XPu4TB-bq5j-y9FIqdwETWWlcCVdSjhTCDbcd5NNrZuOfUE3GTNty_9nU2_5U_plZfC4ej-9JuZh7r2hP4vCPrbyDvtUvdIeC68_wH6H-Urhi7w0eoGmSVqN2gUvgYvrDQ/s400/iphone_charging.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
更新：&lt;br /&gt;
* 20120710 新增 iphone 3GS 的 usb id。&lt;br /&gt;
--&lt;br /&gt;
*&amp;nbsp;&lt;a href=&quot;http://272586.blogspot.com/2011/08/asus-ai-changeripad2.html&quot;&gt;iPad 在 Windows 上面充電&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/4602905553660663000/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/4602905553660663000' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/4602905553660663000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/4602905553660663000'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2012/05/linux-ubuntu-1204-ipad2.html' title='[Linux] Ubuntu 12.04 上給 iPad2 充電'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjahb57XPu4TB-bq5j-y9FIqdwETWWlcCVdSjhTCDbcd5NNrZuOfUE3GTNty_9nU2_5U_plZfC4ej-9JuZh7r2hP4vCPrbyDvtUvdIeC68_wH6H-Urhi7w0eoGmSVqN2gUvgYvrDQ/s72-c/iphone_charging.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-186079607914108837</id><published>2012-05-09T10:54:00.002+08:00</published><updated>2012-06-05T12:04:31.640+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="軟體"/><title type='text'>[軟體] MediaWiki 使用 phpmailer 實現用 gmail 寄信</title><content type='html'>這個標題還真拗口，簡單的說：&lt;br /&gt;
&lt;br /&gt;
1. MediaWiki 很好用，可惜裡面 Email 的功能只能用傳統的 sendmail, php mail, smtp 功能。&lt;br /&gt;
2. phpmailer 很好用，可以用 gmail 的 smtp / ssl 寄信所以我們讓它 include 在裡面。&lt;br /&gt;
3. 最後再上一個 patch 修改 include/MailUser.php 就可以。&lt;br /&gt;
&lt;br /&gt;
Patch 我放在&lt;br /&gt;
&lt;a href=&quot;http://dl.dropbox.com/u/1117561/linux/UserMail.phpmailer.r115116.patch&quot;&gt;http://dl.dropbox.com/u/1117561/linux/UserMail.phpmailer.r115116.patch&lt;/a&gt;&lt;br /&gt;
--&lt;br /&gt;
參考資料：&lt;br /&gt;
&lt;a href=&quot;http://www.gossamer-threads.com/lists/wiki/mediawiki/131400&quot;&gt;http://www.gossamer-threads.com/lists/wiki/mediawiki/131400&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/186079607914108837/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/186079607914108837' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/186079607914108837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/186079607914108837'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2012/05/mediawiki-phpmailer-gmail.html' title='[軟體] MediaWiki 使用 phpmailer 實現用 gmail 寄信'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-1444756440940362418</id><published>2012-05-03T02:33:00.002+08:00</published><updated>2012-06-05T12:04:42.469+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="軟體"/><title type='text'>[Linux] Ubuntu 12.04 上的正妺輪播桌面</title><content type='html'>之前寫過 Ubuntu 上用 command line 更換桌面的方法，然後配合 shell script 就會把正妺時計一樣的效果弄到自已的桌面上。&lt;br /&gt;
&lt;br /&gt;
當然會有效率和網路頻寬的問題，所以後來又做了一點修改，不過因為種種緣故，所以很久沒有更新自已的網䏯。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1itjQePmPcasXkh-lyWgQfIbw1E3T1PnnEvsXfKAuMwx_KTgrE1T4dFZpSPUQSNBn1pRH-3Y4o3eAu_UF4KsqeMHwOL9FuByE32i5TjzWpSRDcQI3nZxjm5nCL3r9QfepINTp4w/s1600/%E8%9E%A2%E5%B9%95%E6%93%B7%E5%9C%96%E5%AD%98%E7%82%BA+2012-05-03+02:33:06.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;250&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1itjQePmPcasXkh-lyWgQfIbw1E3T1PnnEvsXfKAuMwx_KTgrE1T4dFZpSPUQSNBn1pRH-3Y4o3eAu_UF4KsqeMHwOL9FuByE32i5TjzWpSRDcQI3nZxjm5nCL3r9QfepINTp4w/s400/%E8%9E%A2%E5%B9%95%E6%93%B7%E5%9C%96%E5%AD%98%E7%82%BA+2012-05-03+02:33:06.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
ChangeLog:&lt;br /&gt;
* 改用&amp;nbsp;http://www.bijint.com/ 的圖片來源&lt;br /&gt;
* 預設抓圖後存放到 $HOME/Public/clock 目錄底下，下次再輪到這張圖就不會去網路上抓了，這樣如果有不想看到的圖，也可以用這樣的方式替換掉。&lt;br /&gt;
&lt;br /&gt;
Script 位址：&lt;a href=&quot;http://dl.dropbox.com/u/1117561/linux/clock.sh&quot;&gt;http://dl.dropbox.com/u/1117561/linux/clock.sh&lt;/a&gt;&lt;br /&gt;
--&lt;br /&gt;
參考文章：&lt;br /&gt;
*&amp;nbsp;&lt;a href=&quot;http://antontw.blogspot.com/2010/12/programminglinux-ubuntu.html&quot;&gt;http://antontw.blogspot.com/2010/12/programminglinux-ubuntu.html&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/1444756440940362418/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/1444756440940362418' title='4 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/1444756440940362418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/1444756440940362418'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2012/05/linux-ubuntu-1204.html' title='[Linux] Ubuntu 12.04 上的正妺輪播桌面'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1itjQePmPcasXkh-lyWgQfIbw1E3T1PnnEvsXfKAuMwx_KTgrE1T4dFZpSPUQSNBn1pRH-3Y4o3eAu_UF4KsqeMHwOL9FuByE32i5TjzWpSRDcQI3nZxjm5nCL3r9QfepINTp4w/s72-c/%E8%9E%A2%E5%B9%95%E6%93%B7%E5%9C%96%E5%AD%98%E7%82%BA+2012-05-03+02:33:06.png" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-6227189799830718062</id><published>2012-05-03T02:12:00.004+08:00</published><updated>2012-05-03T02:17:47.063+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="軟體"/><title type='text'>[Linux] Ubuntu 12.04 上使用 PPStream</title><content type='html'>Ubuntu 12.04 改了不少東西，PPStream 預設安裝完畢是不能播的，還好這是 Linux 系統，所以可以透過 shell script 簡單先包一層在外面，再來觀察到底是丟給了 mplayer 什麼參數。&lt;br /&gt;
&lt;br /&gt;
經過觀察，在我的平台上面要修改給 mplyaer 的參數，把 -wid 拿掉才能播放。&lt;br /&gt;
如果有需要改 video output 或 audio output 的情況，大抵上都會一整個陷入煩人的狀態。&lt;br /&gt;
&lt;br /&gt;
我嘗試了半天，只找到修改 /opt/pps/bin/mplayer 的方式讓 PPStream 暫時可以運作，不過整體情況仍然沒有很好，只是堪用而已。&lt;br /&gt;
&lt;br /&gt;
因為我是包一層 shell script 在外面，然後 PPStream 呼叫 mplayer 可以動作，但是又留下一堆這層殼的屍體在那邊，所以需要再多花一點資源 ... (嘆)&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-3zTGRFsRQyBBOrkGpekkk6SO4bfO2ccQ41FBjEa6IaQTiymPjl4BiQNC-EeY1ymahE8tSO149iyll9oTe-WCXE38d7IpuY-l8d8BMCzzeQPIJt9vSwq_ao95FatrJ90F1-cjYg/s1600/%E8%9E%A2%E5%B9%95%E6%93%B7%E5%9C%96%E5%AD%98%E7%82%BA+2012-05-03+01:59:09.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;250&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-3zTGRFsRQyBBOrkGpekkk6SO4bfO2ccQ41FBjEa6IaQTiymPjl4BiQNC-EeY1ymahE8tSO149iyll9oTe-WCXE38d7IpuY-l8d8BMCzzeQPIJt9vSwq_ao95FatrJ90F1-cjYg/s400/%E8%9E%A2%E5%B9%95%E6%93%B7%E5%9C%96%E5%AD%98%E7%82%BA+2012-05-03+01:59:09.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
暫時的處理方法是：&lt;br /&gt;
1. 下載這個 script: &lt;a href=&quot;http://dl.dropbox.com/u/1117561/linux/mplayer.sh&quot;&gt;mplayer.sh&lt;/a&gt;&lt;br /&gt;
2. mv mplayer.sh /opt/pps/bin/mplayer&lt;br /&gt;
3. chmod +x /opt/pps/bin/mplayer&lt;br /&gt;
&lt;br /&gt;
方法不好，不過先將就著用吧，如果有更好的處理請跟我說。&lt;br /&gt;
--&lt;br /&gt;
參考文章：&lt;br /&gt;
*&amp;nbsp;&lt;a href=&quot;http://antontw.blogspot.com/2010/11/ubuntu-pps-for-linux-pps-for-linux.html&quot;&gt;http://antontw.blogspot.com/2010/11/ubuntu-pps-for-linux-pps-for-linux.html&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/6227189799830718062/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/6227189799830718062' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/6227189799830718062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/6227189799830718062'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2012/05/linux-ubuntu-1204-ppstream.html' title='[Linux] Ubuntu 12.04 上使用 PPStream'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-3zTGRFsRQyBBOrkGpekkk6SO4bfO2ccQ41FBjEa6IaQTiymPjl4BiQNC-EeY1ymahE8tSO149iyll9oTe-WCXE38d7IpuY-l8d8BMCzzeQPIJt9vSwq_ao95FatrJ90F1-cjYg/s72-c/%E8%9E%A2%E5%B9%95%E6%93%B7%E5%9C%96%E5%AD%98%E7%82%BA+2012-05-03+01:59:09.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-4925123107803373554</id><published>2011-12-21T18:18:00.001+08:00</published><updated>2011-12-21T18:23:09.729+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="軟體"/><title type='text'>[Linux] Linux 上的 GPIO / I2C 實作筆記之二 概念重提</title><content type='html'>&lt;b&gt;前言&lt;/b&gt;&lt;br /&gt;
Linux 上的 GPIO / I2C 其實是很有趣的一個東西，可以用 GPIO 控制的方法去和硬體做溝通。和硬體的溝通比軟體有趣的地方在於馬上就「具現化」在你眼前，所以感覺實在多了，而且也有很多想像的空間。不過，I2C 在 Linux 上的實踐方法其實有兩種： GPIO 拉 I2C 的 protocol 跟 adapter driver 的方式。 I2C 靠 adapter driver 運作的方式我還不會，所以我會談的，都只有用 GPIO 實做 I2C protocol 的方式，這樣的做法其實很多變數在裡面，用到最後會不好整理，不好維護，結果也不夠穩定。不過優點就是在還不了解 linux i2c adapter driver 這一層的時候，不用花多少時間，光靠別的平台的 source code 仿照寫法，就可以開發完成，所以應該可以說是快速開發的方法。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;準備材料&lt;/b&gt;&lt;br /&gt;
在開始工作之前，我們要先了解 GPIO/I2C 的需求：&lt;br /&gt;
a. SDA / SCL 兩根 GPIO 的腳位在哪裡。&lt;br /&gt;
b. 和 I2C 裝置交談的具體內容 意即是 I2C 裝置的 datasheet&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;I2C 的交談內容大要&lt;/b&gt;&lt;br /&gt;
如果把 I2C 簡單化，那麼 I2C 就像是在吟詩一樣，把平當作不動，仄當作腳位拉高再拉低，就會有 平平仄仄仄平平，仄仄平平平仄仄 像這種鬼東西出來。那誰看得懂呢？所以我們先跳過吧。&lt;br /&gt;
&lt;br /&gt;
把 &lt;b&gt;鬼東西&lt;/b&gt; 跳過之後，I2C 的交談內容大致上會是這樣的內容：&lt;br /&gt;
[S][Device ID][A][Data][A][Data][N][P]&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRf1llxEjnPm0cNh33XruT5YkGsrgKkiw0f79-qvI92YaVys_HoNvvnFiSZA057rGdbl6xGPIHGt7GtJ6vFDXOkqPLstjNHE1YQqvhb5oK1lXfrCpV0zLiXO2V2xfv-ig32vrNFQ/s1600/600px-I2C_data_transfer.svg.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;66&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRf1llxEjnPm0cNh33XruT5YkGsrgKkiw0f79-qvI92YaVys_HoNvvnFiSZA057rGdbl6xGPIHGt7GtJ6vFDXOkqPLstjNHE1YQqvhb5oK1lXfrCpV0zLiXO2V2xfv-ig32vrNFQ/s400/600px-I2C_data_transfer.svg.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
[S] 代表的意思是 Start ，就是按 I2C protocol 拉一個 Start 。&lt;br /&gt;
[Device ID] 就是按 DataSheet 裡頭的說明，拉 Device ID 的值出來。&lt;br /&gt;
[A] 就是按 I2C protocol 拉一個 Ack。&lt;br /&gt;
[Data] 看 DataSheet 裡面需要送什麼 Data (一開始的 command byte 通常就一個 byte 而已)&lt;br /&gt;
[N] 就是按 I2C protocol 拉一個 NAK。&lt;br /&gt;
[P] 就是按 I2C protocol 拉一個 Stop。&lt;br /&gt;
&lt;br /&gt;
所以其實很簡單吧？ &lt;strike&gt;(鬼才相信很簡單，一開始要實作的時候看到這種拉高拉低的，我就開始頭昏眼花了)&lt;/strike&gt;&lt;br /&gt;
&lt;br /&gt;
因為 I2C 的特性是用一個 Device ID (也就是 Slave Address)，做為識別，在同一個 Data Bus 上面進行溝通。因為每一個 Slave Device 的 ID 不一樣，所以在溝通的時候不會發生混亂，可以分時進行。但是每一個 I2C 裝置的交談內容都不大一樣，所以在實作的時候，需要參考各家產品的 data sheet 來進行實作。&lt;br /&gt;
&lt;br /&gt;
在實作的時候因為每個裝置的需要，大致上會有一些名詞：&lt;br /&gt;
&lt;br /&gt;
Config 設定&lt;br /&gt;
Polarity 極性&lt;br /&gt;
Input 輸入&lt;br /&gt;
Output 輸出&lt;br /&gt;
Read 讀取&lt;br /&gt;
Write 寫入&lt;br /&gt;
Register 註冊位址&lt;br /&gt;
Command / Control Byte 命令位元&lt;br /&gt;
Data Byte 資料位元&lt;br /&gt;
&lt;br /&gt;
你暈了嗎？其實也都還在 [S][Device ID][A][Data][A][Data][N][P] 這個格式裡頭打轉。&lt;br /&gt;
執行的順序用人話來說明，大概會是：&lt;br /&gt;
&lt;br /&gt;
1. Config (Initial 這個裝置)&lt;br /&gt;
2. Register (說明你要執行或讀寫哪個位址)&lt;br /&gt;
3. Control Byte (送出命令)&lt;br /&gt;
4. Write Data (寫入資料) 或 Read Data (讀取資料)&lt;br /&gt;
&lt;br /&gt;
別睡，別睡，下文就要開始舉例說明，如何參考一份 datasheet 來開始在 Linux Kernel 上面實作 GPIO / I2C 了：&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
圈重點：&lt;br /&gt;
* 所以在溝通的時候，時間差(timer)和延遲(delay)很重要，務必在一開始看 datasheet 的時候就先把時間差先圈出來。&lt;br /&gt;
&lt;br /&gt;
參考資料：&lt;br /&gt;
* &lt;a href=&quot;http://antontw.blogspot.com/2011/06/linux-linux-gpio-i2c.html&quot;&gt;[Linux] Linux 上的 GPIO / I2C 實作筆記之一&lt;/a&gt; http://antontw.blogspot.com/2011/06/linux-linux-gpio-i2c.html&lt;br /&gt;
* 拉平仄 S, P, A, N 什麼鬼的可以參考這裡 &lt;a href=&quot;http://en.wikipedia.org/wiki/I%C2%B2C&quot;&gt;I2C 的協定內容&lt;/a&gt; http://en.wikipedia.org/wiki/I%C2%B2C</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/4925123107803373554/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/4925123107803373554' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/4925123107803373554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/4925123107803373554'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2011/12/linux-linux-gpio-i2c.html' title='[Linux] Linux 上的 GPIO / I2C 實作筆記之二 概念重提'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRf1llxEjnPm0cNh33XruT5YkGsrgKkiw0f79-qvI92YaVys_HoNvvnFiSZA057rGdbl6xGPIHGt7GtJ6vFDXOkqPLstjNHE1YQqvhb5oK1lXfrCpV0zLiXO2V2xfv-ig32vrNFQ/s72-c/600px-I2C_data_transfer.svg.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>300台灣新竹市</georss:featurename><georss:point>24.8039455 120.96468660000005</georss:point><georss:box>24.731721500000003 120.88716910000005 24.8761695 121.04220410000005</georss:box></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-6000204899730013043</id><published>2011-12-14T17:49:00.004+08:00</published><updated>2011-12-20T02:06:20.656+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="軟體"/><title type='text'>[軟體][Linux] SMS 之路 (一) 發送簡訊</title><content type='html'>&lt;b&gt;前言&lt;/b&gt;&lt;br /&gt;
最近很忙，所以很久沒寫網誌了，剛剛遇到一點問題，所以想想還是回頭來寫一下筆記。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;問題&lt;/b&gt;&lt;br /&gt;
* Linux 底下如何發送簡訊？&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;環境配置&lt;/b&gt;&lt;br /&gt;
* Linux 的開發環境&lt;br /&gt;
* 一張 2G/3G 網卡&lt;br /&gt;
* 一張可以正常的 SIM 卡&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;執行動作&lt;/b&gt;&lt;br /&gt;
* 打開 Linux (不管你是用 vbox/vmware 還是實機的 Linux)&lt;br /&gt;
* 把網卡大力插進去&lt;br /&gt;
&lt;br /&gt;
接著應該會在裝置底下看到網卡浮出來：&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_eA2ydiM5CV_zBnZ0xh0kzml8i9zKmo6fI2fz8U2KtezOjkR9q97juOIKBJlYU2E4rTaVNDqL7W7tURNI6Ddsa2IkM4NnvuaYH-xRjKftSv19vP2bWk4v-COU8Fm37c4JipfAbQ/s1600/device.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;31&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_eA2ydiM5CV_zBnZ0xh0kzml8i9zKmo6fI2fz8U2KtezOjkR9q97juOIKBJlYU2E4rTaVNDqL7W7tURNI6Ddsa2IkM4NnvuaYH-xRjKftSv19vP2bWk4v-COU8Fm37c4JipfAbQ/s320/device.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
它有可能長這個樣子，如果你跟我一樣用比較舊的 Kernel ，或著跑到 ttyACM0 如果你的 kernel 很清楚的認為它是 modem 的裝置。&lt;br /&gt;
&lt;br /&gt;
接著就要開始玩弄它了，因為 kernel 把它當成是 serial 的裝置，所以你需要一個 terminal 連接它才能開始跟它溝通。&lt;br /&gt;
&lt;br /&gt;
那麼，我會建議使用：&lt;br /&gt;
* putty (linux 版) 初學者建議&lt;br /&gt;
* minicom (console 工具) 如果你嫌 GUI 很麻煩的話，建議用這個&lt;br /&gt;
&lt;br /&gt;
putty 選裝置 /dev/ttyUSB3 + serial + baurate (可能是 115200 之類的)&lt;br /&gt;
minicom -s 選 serial protocol 調整 device 跟 baurate&lt;br /&gt;
&lt;br /&gt;
接著下來要和 3G網卡/modem 溝通，時間很夠就先把網卡的 AT Command List 看過一遍。&lt;br /&gt;
這樣可以發中文簡訊到某人的手機裡：&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxrbi798NNXmAMffEQkGgB7RLBs8WknRTsRFggExC49xOqrFsnHBqZxqFKCsaAI1wc-58c32a1yKLWC77r1F_AkFrSp2-axr9TX6saIET19hWjIZYLL426bxGvhQtnjSmBdMJbKQ/s1600/image.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;82&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxrbi798NNXmAMffEQkGgB7RLBs8WknRTsRFggExC49xOqrFsnHBqZxqFKCsaAI1wc-58c32a1yKLWC77r1F_AkFrSp2-axr9TX6saIET19hWjIZYLL426bxGvhQtnjSmBdMJbKQ/s320/image.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
這樣可以發一堆數字到某人的手機裡：&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPFwIvYcEuedkZ3zd80dfpFYaz-DaQibtiLwCANVmOVMWx5t1ufGc1KegIY7H5YFu56IDT4NDCYNNcg251rCsWosYbiz6zKwpwDsiqR61VYB0bBq1kKIE5w_i-fUSr11p20fCShg/s1600/image+%25281%2529.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;51&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPFwIvYcEuedkZ3zd80dfpFYaz-DaQibtiLwCANVmOVMWx5t1ufGc1KegIY7H5YFu56IDT4NDCYNNcg251rCsWosYbiz6zKwpwDsiqR61VYB0bBq1kKIE5w_i-fUSr11p20fCShg/s320/image+%25281%2529.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;...&lt;/b&gt;&lt;br /&gt;
要罵我了嗎？好啦，讓我解釋一下：&lt;br /&gt;
AT Command 是和 modem 溝通的指令集，所以下這些 command 可以讓 modem 知道你想做什麼事情。&lt;br /&gt;
AT+CMGF=0 代表你想送簡訊的模式是 PDU mode 這個 mode 底下的簡訊是編碼過的，裡頭會帶上 SMS 訊息中心的電話號碼，跟你的訊息本文，還有接受者的電話號碼。&lt;br /&gt;
AT+CMGS=22 代表你的訊息本文長度是 22，下面接的那一串就是編碼過後的樣子。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;...&lt;/b&gt;&lt;br /&gt;
嗯，應該還會再罵我一次，因為這樣還是不知道怎麼做 PDU 的編碼。&lt;br /&gt;
可以參考一下 &lt;a href=&quot;http://www.dreamfabric.com/sms&quot;&gt;http://www.dreamfabric.com/sms&lt;/a&gt; 上面有說明 SMS PDU 的編碼格式。&lt;br /&gt;
&lt;br /&gt;
如果你跟我一樣很懶得去看，那這裡也有&lt;a href=&quot;http://stud.usv.ro/~amurariu/SMS%20and%20PDU%20format.htm&quot;&gt;編碼器&lt;/a&gt;。&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
參考網址：&lt;br /&gt;
* &lt;a href=&quot;http://fred-zone.blogspot.com/2010/04/blog-post.html&quot;&gt;Fred Shell scirpt 發送簡訊&lt;/a&gt; http://fred-zone.blogspot.com/2010/04/blog-post.html&lt;br /&gt;
* &lt;a href=&quot;http://www.dreamfabric.com/sms/&quot;&gt;PDU 編碼參考&lt;/a&gt;http://www.dreamfabric.com/sms/&lt;br /&gt;
* &lt;a href=&quot;http://www.developershome.com/sms/howToReceiveSMSUsingPC.asp&quot;&gt;SMS Tutorial&lt;/a&gt; http://www.developershome.com/sms/howToReceiveSMSUsingPC.asp&lt;br /&gt;
* &lt;a href=&quot;http://en.wikipedia.org/wiki/UTF-16&quot;&gt;SMS 中文編碼&lt;/a&gt; http://en.wikipedia.org/wiki/UTF-16&lt;br /&gt;
* &lt;a href=&quot;http://www.smssolutions.net/tutorials/gsm/sendsmsat/&quot;&gt;AT Command 發送 SMS 的方法&lt;/a&gt; http://www.smssolutions.net/tutorials/gsm/sendsmsat/</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/6000204899730013043/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/6000204899730013043' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/6000204899730013043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/6000204899730013043'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2011/12/linux-sms.html' title='[軟體][Linux] SMS 之路 (一) 發送簡訊'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_eA2ydiM5CV_zBnZ0xh0kzml8i9zKmo6fI2fz8U2KtezOjkR9q97juOIKBJlYU2E4rTaVNDqL7W7tURNI6Ddsa2IkM4NnvuaYH-xRjKftSv19vP2bWk4v-COU8Fm37c4JipfAbQ/s72-c/device.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>300台灣新竹市</georss:featurename><georss:point>24.8039455 120.96468660000005</georss:point><georss:box>24.731721500000003 120.88716910000005 24.8761695 121.04220410000005</georss:box></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-2252354701249836854</id><published>2011-09-30T20:56:00.002+08:00</published><updated>2011-09-30T21:04:28.162+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="軟體"/><title type='text'>[Linux] vmware-workstation 移除</title><content type='html'>話說這星期突然間有客戶要我安裝 vmware ，只好去找了 vmware-workstation 下來安裝，結果跑起來慢的要死，遠遠不如 virtualbox ，所以最後客戶讓我直接裝在本機的 Windows 上面，至於這個 Ubuntu 底下的 vmware 就只好移除了，這才想到，對厚，這個 vmware 是用 script 安裝的，那移除的時候怎麼辦？&lt;br /&gt;&lt;br /&gt;找了一下才在 Ubuntu Forum 上面看到，原來有一支 vmware-installer 是處理這些事的，可以下：&lt;br /&gt;&lt;code&gt; vmware-installer --uninstall-product vmware-workstation &lt;/code&gt; 來移除曾經安裝的 vmware。&lt;br /&gt;&lt;br /&gt;vmware-workstation 可以替換成： {vmware-workstation | vmware-player | vmware-vix}&lt;br /&gt;--&lt;br /&gt;參考資料：&lt;br /&gt;&lt;a href=&quot;http://ubuntuforums.org/showthread.php?t=737779&quot;&gt;Ubuntu Forum&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/2252354701249836854/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/2252354701249836854' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/2252354701249836854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/2252354701249836854'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2011/09/linux-vmware-workstation.html' title='[Linux] vmware-workstation 移除'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-9204501190149264279</id><published>2011-08-24T09:25:00.002+08:00</published><updated>2011-08-24T09:30:23.795+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="軟體"/><title type='text'>[軟體] Xmind 不能在 Command Line 底下打開 map 檔</title><content type='html'>這個其實不是什麼大問題，但是想要高調把這個問題的解決方案講出來。&lt;br /&gt;&lt;br /&gt;解法在&lt;a href=&quot;http://code.google.com/p/xmind3/issues/detail?id=200&quot;&gt;這邊&lt;/a&gt;找到的，&lt;br /&gt;簡單的說就是：&lt;br /&gt;&lt;br /&gt;寫一個 shell script 的 wrapper ，然後去呼叫 xmind-bin 以 -p 參數帶 map file 就可以。&lt;br /&gt;所以這個 shell script 會長這樣：&lt;br /&gt;&lt;code&gt; #!/bin/bash&lt;br /&gt;&lt;br /&gt;/usr/local/xmind/xmind-bin -p &quot;$@&quot;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;也可以在&lt;a href=&quot;http://dl.dropbox.com/u/1117561/script/xmind&quot;&gt;這邊&lt;/a&gt; 下載。(因為是 shell script ，所以你也可以看一下內容長怎樣，如果有疑慮的話。&lt;br /&gt;&lt;br /&gt;--&lt;br /&gt;資料來源：&lt;br /&gt;&lt;a href=&quot;http://code.google.com/p/xmind3/issues/detail?id=200&quot;&gt;Xmind 的討論區&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/9204501190149264279/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/9204501190149264279' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/9204501190149264279'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/9204501190149264279'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2011/08/xmind-command-line-map.html' title='[軟體] Xmind 不能在 Command Line 底下打開 map 檔'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10482704.post-8738913550937393007</id><published>2011-08-18T14:58:00.004+08:00</published><updated>2011-08-18T15:32:05.796+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊"/><title type='text'>[Linux] 哇！我的無線網路速度怎麼這麼慢？</title><content type='html'>常常聽到人家問說，我的網路速度怎麼這麼慢？然後我就會回答說，用 speedtest 或者 中研院測速網站 來做測試網路速度，大柢上就可以分辨得出來是真的網路速度很慢，還是其實是你的電腦處理在拖慢最後呈現的速度。&lt;br /&gt;&lt;br /&gt;不過這個測試不能分辨是不是無線網路分享器跑到了極限，抑或著是無線網路選擇模式 b, g, n 的極限。所以這篇文章主要目的，在說明常見的無線網路模式 b/g/n 是怎麼回事，在 Linux 上面要如何查詢及調整。&lt;br /&gt;&lt;br /&gt;&lt;b&gt;我的無線網路分享器可以跑什麼模式？&lt;/b&gt;&lt;br /&gt;打開你的瀏覽器，連線到你的 ap router 應該可以找到類似下面的設定畫面：&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz8zJUYpxEVoBHX4HBSW4N7CDfc06W1ti_dyrTs-vWqEhPchhWmhukH-dEkW9S1vqFxMJQY6Ra-OMBA6XQXA6cBYR1B96rVtvjMAzRus1k5fhGnKMk1vLjFAhJVPTKCWZ0JTTWrQ/s1600/Screenshot-Wireless+AP+-+Google+Chrome-30.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz8zJUYpxEVoBHX4HBSW4N7CDfc06W1ti_dyrTs-vWqEhPchhWmhukH-dEkW9S1vqFxMJQY6Ra-OMBA6XQXA6cBYR1B96rVtvjMAzRus1k5fhGnKMk1vLjFAhJVPTKCWZ0JTTWrQ/s320/Screenshot-Wireless+AP+-+Google+Chrome-30.png&quot; height=&quot;186&quot; width=&quot;320&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/div&gt;上圖就說明了，AP Router 設定是 11 B/G/N 都可以使用的模式。(這樣我們就只需要調查 筆電 或 PC 上面使用的無線網卡是什麼模式，就可以知道，我們無線網路速度可以跑多快。)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;我的筆電/PC上的無線網路跑什麼模式？&lt;/b&gt;&lt;br /&gt;這個問題其實也很簡單，在 gnome 上面我們可以點無線網路的圖示，再點選連線資訊，就會出現下圖：&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcseU07zA5mHd8PAQajinnqAz5GZCVr5EVgHNU9LXx0k5R2y4QaD5Q_d6WnfA-aC8J-OrgKvbhTRkhKngP631a1ICHzHljX5YXv0L3FfTJODBHtXEh9tL38kjLVIoVfBEu2w6rsg/s1600/Screenshot.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcseU07zA5mHd8PAQajinnqAz5GZCVr5EVgHNU9LXx0k5R2y4QaD5Q_d6WnfA-aC8J-OrgKvbhTRkhKngP631a1ICHzHljX5YXv0L3FfTJODBHtXEh9tL38kjLVIoVfBEu2w6rsg/s320/Screenshot.png&quot; height=&quot;320&quot; width=&quot;303&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/div&gt;上圖直接說明了你的無線網路理論上可以跑多快，按 &lt;a href=&quot;http://zh.wikipedia.org/wiki/WLAN&quot; title=&quot;維基百科&quot;&gt;維基百科：無線網路&lt;/a&gt; 這個條目的說明：&lt;br /&gt;&lt;style type=&quot;text/css&quot;&gt;&lt;br /&gt;.list table { border:1px solid #000 }&lt;br /&gt;.list table td { border:1px solid #000 }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table class=&quot;list&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;分類&lt;/th&gt;&lt;th&gt;速度(Mbps) &lt;/th&gt;&lt;th&gt;頻段(Mhz)&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;11a&lt;/td&gt;&lt;td&gt;54&lt;/td&gt;&lt;td&gt;5G&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;11b&lt;/td&gt;&lt;td&gt;11&lt;/td&gt;&lt;td&gt;2.4G&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;11g&lt;/td&gt;&lt;td&gt;54&lt;/td&gt;&lt;td&gt;2.4&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;11n&lt;/td&gt;&lt;td&gt; n &lt;/td&gt;&lt;td&gt;2.4&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;確認過自已使用的無線網路模式之後，我們就可以開始測試網路的速度了，這邊採用的是 linux 上很常使用的 iperf 測速工具。&lt;br /&gt;&lt;br /&gt;操作方式是：在固定一端跑 iperf 的 server mode ，在另一頭跑 iperf 的 client mode ，這樣就可以由 client 餵資料給 server 從而達成測速的目的。&lt;br /&gt;&lt;br /&gt;server mode 的指令：&lt;br /&gt;&lt;code&gt; iperf -s &lt;/code&gt;&lt;br /&gt;如果是 Windows 請下：&lt;br /&gt;&lt;code&gt; iperf.exe -s &lt;/code&gt;&lt;br /&gt;(Windows 版本可&lt;a href=&quot;https://nocweboldcst.ucf.edu/files/iperf.exe&quot;&gt;點我下載&lt;/a&gt;， Linux 版本請由 apt-get 或其它套件管理工具下載安裝)&lt;br /&gt;&lt;br /&gt;client mode 的指令:&lt;br /&gt;&lt;code&gt; iperf -c server_ip &lt;/code&gt;&lt;br /&gt;相關選項可以參考&lt;a href=&quot;http://benjr.tw/node/369&quot;&gt;這邊&lt;/a&gt;，它寫得很詳細，我就只列出我會用的選項：&lt;br /&gt;&lt;code&gt; -c # server ip&lt;br /&gt;-t # timeout&lt;br /&gt;-w # window size&lt;br /&gt;-l # read/write buffer&lt;br /&gt;-P # concurrent thread number&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHbxsSbymfJ1LuQAhQqc-gQERD4SbTAOzQ4vyPeZzfjEjEH_cODOtnxvHAIkM8NIPIPN0K5OpNJnBkl3k5bbCHTtHXzgsSxQhTeMMMMkL-M1MUnidzHJH1ck-OvA2a7TQfWbYadA/s1600/Screenshot-Terminal.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 210px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHbxsSbymfJ1LuQAhQqc-gQERD4SbTAOzQ4vyPeZzfjEjEH_cODOtnxvHAIkM8NIPIPN0K5OpNJnBkl3k5bbCHTtHXzgsSxQhTeMMMMkL-M1MUnidzHJH1ck-OvA2a7TQfWbYadA/s320/Screenshot-Terminal.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5642094995787241986&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;--&lt;br /&gt;參考資料：&lt;br /&gt;* &lt;a href=&quot;http://5i01.com/topicdetail.php?f=110&amp;amp;t=494185&quot;&gt;Mobile 01 上面關於 11n 的討論&lt;/a&gt;:&lt;br /&gt;&lt;blockquote&gt;一個符合 802.11n 的產品，假設採用 OFDM 調變、兩個發射和兩個接收串流（稱為 2×2 配置）、20MHz 通道寬度，可以達到 144 Mbps 的典型流量；或者採用 OFDM 調變、4×4 配置、40 MHz 通道寬度，（目前理論上）可以達到最大 600 Mbps 流量。今天大多數 802.11n 產品所實現的是這兩個極端之間的某種傳輸速度：如採用 OFDM、2×2 配置和 40 MHz 通道寬度的 300 Mbps，或只將 MIMO 配置改為 3×3 時的 450 Mbps。&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;* &lt;a href=&quot;http://www.sapido.com.tw/CH/faq/solution-176.htm&quot;&gt;11n 的加密模式限用 AES 加密，因而使用 TKIP 或混合模式都有可能讓 b/g/n 的混合模式只能跑到 g 而已&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;* &lt;a href=&quot;http://benjr.tw/node/369&quot;&gt;Linux - 網路效能測試工具 &quot;iperf&quot;&lt;/a&gt;&lt;br /&gt;* &lt;a href=&quot;https://publishing.ucf.edu/sites/itr/cst/Pages/IPerf.aspx&quot;&gt; Windows 上使用 iperf 測速工具 &lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://antontw.blogspot.com/feeds/8738913550937393007/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/10482704/8738913550937393007' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/8738913550937393007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10482704/posts/default/8738913550937393007'/><link rel='alternate' type='text/html' href='http://antontw.blogspot.com/2011/08/linux.html' title='[Linux] 哇！我的無線網路速度怎麼這麼慢？'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz8zJUYpxEVoBHX4HBSW4N7CDfc06W1ti_dyrTs-vWqEhPchhWmhukH-dEkW9S1vqFxMJQY6Ra-OMBA6XQXA6cBYR1B96rVtvjMAzRus1k5fhGnKMk1vLjFAhJVPTKCWZ0JTTWrQ/s72-c/Screenshot-Wireless+AP+-+Google+Chrome-30.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>