August 18, 2011

August 08, 2011

Erlang 筆記

pwd().

cd("dir").

如果檔名是math1.erl,compile的指令
c(math1).

檔案裡的module要跟檔名相同
-module(math1).

執行
math1:function(args).

August 04, 2011

gitolite + http mode + LDAP

gitolite 安裝
參考這邊,將 /var/www 改為想要放置 git repo 位置的目錄
cd /var/www/
mkdir gitolite-home
export GITOLITE_HTTP_HOME=/var/www/gitolite-home
PATH=$PATH:$GITOLITE_HTTP_HOME/bin
cd gitolite-home/
git clone git://github.com/sitaramc/gitolite gitolite-source
cd gitolite-source/
GHH=$GITOLITE_HTTP_HOME
mkdir -p $GHH/bin $GHH/share/gitolite/conf $GHH/share/gitolite/hooks
src/gl-system-install $GHH/bin $GHH/share/gitolite/conf $GHH/share/gitolite/hooks
vim /var/www/gitolite-home/share/gitolite/conf/example.gitolite.rc
gl-setup ADMIN的LDAP帳號
apache 設定
參考這邊,修改 auth 的部份為 LDAP
<LocationMatch "/git">
AuthType Basic
AuthName "Git"
Require valid-user

AuthBasicProvider ldap
AuthzLDAPAuthoritative off
AuthLDAPURL "ldap://server:389/dc=company,dc=local?sAMAccountName?sub?(objectclass=*)" NONE
AuthLDAPBindDN "cn=user,ou=team,ou=department,dc=company,dc=local"
AuthLDAPBindPassword secret
</LocationMatch>
設定gitolite
選擇以後要放設定檔的位置
  • git clone http://server/git/gitolite-admin
gitolite.conf 的設定說明,要新增 repo 或是要加入使用者設定都是在這個檔案修改,修改完成以後將 gitolite.conf 更新回 server
  • git add
  • git commit
  • git push origin master