- BRANCH_NAME='dev'
- SOURCE_DIR='/home/me/src'
- EXPORT_TO='/home/me/out'
- cd $SOURCE_DIR
- git diff --name-only $BRANCH_NAME > $EXPORT_TO/changes.txt
- git diff $BRANCH_NAME > $EXPORT_TO/changes.diff
2011/08/23
Git get diff file list and diff content from some branch
2011/08/12
Unix like shell - find_keywords
- #!/bin/sh
- if [ "xx$2" != "xx" ] && [ -e $2 ]; then
- echo finding $1 in $2
- if [ "xx$WINDIR" != "xx" ]; then
- grep -lr $1 $2 | sed 's~/~\\~g' | sed 's~^\\\(\w\)\\~\U\1:\\~g'
- else
- grep -lr $1 $2
- fi
- else
- echo first param must be search string
- echo second param must be full path
- fi
2011/08/10
CodeBlocks 中文化
下載mo檔:
codeblocks translation page
www.badongo.com - Click Here to Download codeblocks zh_TW
www.u-file.net - Click Here to Download codeblocks zh_TW
然後建一個目錄 C:\Program Files\CodeBlocks\share\CodeBlocks\locale\zh_TW
其中 C:\Program Files\CodeBlocks 是安裝路徑
然後把mo檔放到裏面去
Settings -> Environment -> View -> Internationalization
勾起來 -> 選 Chinese
然後重開CodeBlocks
搞定...
BTW...中文化以後, syntex highlight好像消失了...
所以還是把勾勾拿掉好了....sigh.....
codeblocks translation page
www.badongo.com - Click Here to Download codeblocks zh_TW
www.u-file.net - Click Here to Download codeblocks zh_TW
然後建一個目錄 C:\Program Files\CodeBlocks\share\CodeBlocks\locale\zh_TW
其中 C:\Program Files\CodeBlocks 是安裝路徑
然後把mo檔放到裏面去
Settings -> Environment -> View -> Internationalization
勾起來 -> 選 Chinese
然後重開CodeBlocks
搞定...
BTW...中文化以後, syntex highlight好像消失了...
所以還是把勾勾拿掉好了....sigh.....
2011/07/15
Compare a Copy of a Project
Usage:
compare-projects /home/me/project/ /home/me/old/project/ | grep -v OK > /home/me/compare_result 2>&1
Source: compare-projects
- #!/usr/bin/sh
- #
- # settings
- #
- md5=~/bin/md5files
- #
- # inputs
- # src: main project
- # dst: another project
- #
- src=$1
- dst=$2
- #
- # limit file size smaller than 1024k (pass to find)
- # md5 all files, and then replace the path to destination
- # finally compare the md5 "use md5sum -c"
- #
- $md5 $src -size -1024k | sed "s!${src}!${dst}!g" | md5sum -c 2>&1
Get All Files Recursively and Get MD5
- #!/usr/bin/sh
- #
- # find all files recursively, and enum them to get md5sum
- # args: pass all to find
- #
- for f in $(find $@ -type f);
- do
- md5sum $f
- done
訂閱:
文章 (Atom)