March 29, 2008
在 NAT 內的電腦 (暫名為 A) 上下指令:
autossh -R :1234:localhost:22 my.server.com
autossh will automatically reconnect
-R :1234:localhost:22 意思是連到 my.server.com,在 my.server.com 上頭開 port 1234 回連到 A。
my.server.com 上頭 sshd_config 必須要設定 GatewayPorts clientspecified or yes
然後在外頭的 linux 電腦連到:
ssh -p 1234 my.server.com
這樣就可以連回 A 了。如此這般就算沒有 VPN 也可以在家工作。
Filed under: sysadmin |
Comments (0)
March 24, 2008
像 subversion (svn) 這類集中式的 scm 一定要有網路連線才能 commit ,這是很討厭的一件事情,尤其是很多人都會用 notebook 工作,不見得需要長時間連結網路,或者是並沒興趣修改 svn 上的版本。這時候像老牌的 monotone 或是現在的 git 以及 Mercurial 這種分散式的版本管理系統就很好用。這陣子在改一個 project,他已經有 svn 在 googlecode 上,看來已經很久沒人 maintain. 我當然還不需要 svn write 權限,但是我仍然希望在自己 local 端有版本管理,這樣我如果幹了什麼蠢事才救得回來。
此時 git-svn 這種工具就真的很好用。基本使用方式是
# Clone a repo (like git clone):
git-svn clone http://svn.foo.org/project/trunk
# Enter the newly cloned directory:
[…]
Filed under: scm |
Comments (0)