Subversion Post Commit Hook

1. Create post-commit hook
[codesyntax lang=”bash” lines=”no” container=”pre” tab_width=”4″]

$ cd /data/svndata/hooks
$ cp post-commit.tmpl post-commit
$ chown kim:kim post-commit
$ chmod a+x post-commit
$ vi post-commit

[/codesyntax]
2. Hook with Shell

[codesyntax lang=”bash” lines=”no” container=”pre” tab_width=”4″]

#!/bin/sh
export LANG=zh_CN.UTF-8
SVN=/usr/local/svn/bin/svn
WEB=/data/public_html
$SVN update $WEB --username kim --password mypass
chown -R nobody:nobody $WEB

[/codesyntax]
3. Hook with PHP
[codesyntax lang=”bash” lines=”no” container=”pre” tab_width=”4″]

#!/bin/bash
REPOS="$1"
REV="$2"
export LANG=zh_CN.UTF-8
changed=$(svnlook changed -r $REV $REPOS)
log=$(svnlook log -r $REV $REPOS)
/usr/local/webserver/php/bin/php-cgi -q /data/vhosts/shell/svn_post_commit.php "$changed" &

[/codesyntax]
[codesyntax lang=”bash” lines=”no” container=”pre” tab_width=”4″]

$ vi /data/vhosts/shell/svn_post_commit.php

[/codesyntax]

[codesyntax lang=”php” lines=”no” container=”pre” tab_width=”4″]

$changed = '/data/vhosts/myproj';
$cmd = "svn up $changed;";
@exec($cmd);
exit;

[/codesyntax]

Posted in SVN | Tagged | 2 Comments

Daily Schedule

From monday to monday :

7:30 morning reading
8:00 breakfast
9:00 planning, news, bloging
10:25 relax
10:30 working
12:00 lunch, nap
13:30 working
16:00 tea time
18:00 dinner, late news
18:30 working
21:00 free time
0:00 reading
1:30 good night

Posted in My Live | Tagged | Leave a comment

Git Essence

CVCS (Centralized Version Control Systems) like SVN, CVS etc.



DVCS (Distributed Version Control System) like Git, Bazaar etc.



Git Status: modified, staged, committed

Posted in Git | Tagged | 2 Comments

Install Git on Windows

1. Install msysgit
http://code.google.com/p/msysgit/

2. Configurations
[codesyntax lang=”bash”]

$ git config --global user.name "kim"
$ git config --global user.email xqpmjh@gmail.com

[/codesyntax]

3. Public-Key for Github
[codesyntax lang=”bash”]

$ ssh-keygen -t rsa -C "xqpmjh@gmail.com"

[/codesyntax]
Copy the content of \.ssh\id_rsa.pub to GitHub -> SSH Public Key -> “Add another public key”

4. Test your connection
[codesyntax lang=”bash”]

$ ssh git@github.com
ERROR: Hi tekkub! You’ve successfully authenticated, but GitHub does not provide shell access
Connection to github.com closed.

[/codesyntax]

5. Create your project – trickle’s Repository
[codesyntax lang=”bash”]

$ cd d:/www
$ mkdir trickle
$ cd trickle
$ git init

[/codesyntax]

6. Adding new files
[codesyntax lang=”bash”]

$ touch README
$ vi README
$ git add README
$ git commit -m 'My readme for git project';

[/codesyntax]

7. Push your commits to master branch
[codesyntax lang=”bash”]

$ git remote add origin git@github.com:xqpmjh/Trickle.git
$ git push origin master

[/codesyntax]

8. Checkout your project
[codesyntax lang=”bash”]

$ cd d:/www/test
$ git clone git://github.com/xqpmjh/Trickle.git

[/codesyntax]

9. Pulling from master branch
[codesyntax lang=”bash”]

$ git pull -v --progress "origin" master

[/codesyntax]

Posted in Git | Tagged | Leave a comment

Being a Controller

I like it, yes, being a controller.

I like this kind of feeling, controlling everything.


Share everything I can share.

Learn everything I can learn.

Handle everything I can handle.


Spend 110% time than others.

Make 110% effort than others.

Take 110% works than others.

Posted in My Live | Tagged | 6 Comments