2014/10/28

讓 mac 可以顯示 remote 端的 raspberry pi 的 linux 畫面



1. 安裝 XQuartz X11 server

2. 設定 sshd 的 config 讓它支援 xforwarding

Host *
    ForwardAgent yes
    ForwardX11 yes
    ForwardX11Trusted yes

3. 利過 ssh -Y (or -X) plateau@xxx.xx.xxx 連到遠端的主機上

ps. 設定 xterm 的字型大小可以用下面指令開啟 app

xterm -fa 'Monospace' -fs 12&


2014/10/11

讓 Git 使用起來更方便的一些 tips


(Full Moon.Taipei)

第一件事是讓 terminal 可以支援 git command 還有 branch name 的自動補齊,不用每次都要記落落長的分支名稱。

1. 下載 autocomplete 的 shell script

curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
 
2. 在 ~/.bash_profile 中加入下面的 script

if [ -f ~/.git-completion.bash ]; then
  . ~/.git-completion.bash
fi 
 
然後重新載入一下 .bash_profile 就可以了。
   
第二件事是讓 terminal 的 prompt 可以顯示目前是在哪個分支。
方法也很簡單,在 PS1 這個變數中,適當的位置加入 \$(__git_ps1) 就可以了。
像我的設法是:
 
export PS1='\[\e[36;1m\][\h]\[\e[33;1m\]\t \[\e[0m\]\[\e[32;1m\]\w \[\e[0m\]$(__git_ps1 "(%s)")\n$'
 
REF: 
1. http://code-worrier.com/blog/autocomplete-git/
2. http://code-worrier.com/blog/git-branch-in-bash-prompt/
 
 
 
 

中國 App 商業模式 -- 王泌

很有系統地介紹了中國近幾年比較大的幾十個 app,包含他們主要的商業模式,投資者,和特色在哪裡。對於想要了解中國 App (網路服務) 市場的人來說,會是個很好的入門書。雖然已經是兩三年前的資料了,這兩三年又有了很大的變化,但依然是個很好的起點。