Thursday, April 18, 2013
Monday, April 16, 2012
Git tip : Using Graphviz to display branch graph
Works, but not great :)
echo 'digraph "git" {' > enb.dot
git log --pretty='format: %h [label="%s"]' HEAD^^..HEAD | perl -p -e 's/([0-9a-f]{7})/"\1"/' >> enb.dot
#git log --pretty='format: %h [label="Subject:Testing%h"]' HEAD^^..HEAD | sed 's/[0-9a-f]\+/\"&\"/' >> enb.dot
git log --pretty='format: %h -> { %p }' HEAD^^..HEAD | sed 's/[0-9a-f]\+/\"&\"/g' >> enb.dot
#git log --pretty='format: %p -> { %h }' HEAD^^..HEAD | sed 's/[0-9a-f]\+/\"&\"/g' >> enb.dot ##reverse arrow
echo '}' >> enb.dot
dot -Tsvg enb.dot -o enb.svg
The Result:
Wednesday, April 11, 2012
Wednesday, February 08, 2012
解決 cvsimport commit message charset convert to UTF-8
前一陣子用git cvsimport 遇到 "Warning: commit message does not conform to UTF-8",原本的cvs的logmsg用的是big5,cvsimport又沒有參數可以設定charset,所以就自己手動修改了 cvsimport這個perl script (修改i18n.commitencoding不是我的選項)。
修改後的 cvsimport (我用的是cygwin版的git 1.7.5.1, cvsimport是存在C:\cygwin\lib\git-core)
2. 如果你是要建立一個 "bare" repository,搜尋 "qw(git init)" 並加入下面的code
修改後的 cvsimport (我用的是cygwin版的git 1.7.5.1, cvsimport是存在C:\cygwin\lib\git-core)
1. 在檔案的開頭部份增加lib 'Encode'
use IPC::Open2;
require Encode; ## add this line
#system(qw(git init); ##origin
system(qw(git init --bare --share)); ## replace by robin 20120208
3. logmsg轉碼,搜尋 "sub commit {" 並加入下面的 code
4. 執行cvsimport
Tada...
sub commit {
## +20120208 by robin for commit message utf-8
my $msg = $logmsg;
eval { $msg = Encode::decode('BIG5', $msg, 1) }; ## origin charset BIG-5, GBK
if ($@) {
die "Could not decode as 'big5':\n", $msg,
"\nPerhaps you need to set i18n.commitencoding\n";
}
eval { $msg = Encode::encode('UTF-8', $msg, 1) };
die "Could not encode as UTF-8:\n$msg\n" if $@;
$logmsg = $msg;
## patch2
my $fragment = substr $logmsg, 0, index($logmsg, 'Committed on the');
$logmsg = $fragment;
#print $logmsg;
#print $msg;
4. 執行cvsimport
$ mkdir aprj.git $ cd aprj.git $ git init --bare --share $ export CVSROOT=:pserver:robin@10.1.251.16:/aprj $ cvs login $ git cvsimport -p -x -v -d :pserver:robin@10.1.251.16:/aprj amodule
Monday, February 06, 2012
我的 Msysgit UTF-8 中文解決方案
1. git config
git config -e
[gui]
encoding = utf-8
[i18n]
commitencoding = utf-8
logoutputencoding = utf-8
2. bash profile
$ less ~/.profile
export TERM=ansi
export LESSCHARSET=utf-8
export GIT_PAGER=C:/cygwin/bin/less.exe
cd /g/EastPutWestPut/MyAsciiDocBook
3. vim setting
修改 {git home}/share/vim/vimrc,vimrc 最後加上
set fileencodings=utf-8
3.1 如果用vi開啟檔案顯示亂碼,在 vi 裡輸入:
:e! ++enc=utf-8
4.msys inputrc
{git home}\etc\inputrc 最後加上
set output-meta on
set convert-meta off
用cygwin建立的git repository在user clone時發生 'XXX' does not appear to be a git repository 的解法
如果使用 "git clone auser@10.1.1.1:/cygdrive/d/git-repos/aproj.git" 發生 'XXX' does not appear to be a git repository,請改用
git clone auser@10.1.1.1:D:/git-repos/aproj.git
也就是把 '/cygdrive/d/' 改成 'D:/'
Sunday, July 06, 2008
DB2 timestamp 資料格式與 Java 的 Date 互換 方式
DB2 timestamp 資料格式與 Java 的 Date 互換 方式
Timestamp start = new Timestamp(new Date().getTime() + 1);
start.setNanos(0);
Timestamp ts = (Timestamp)row.get("MNTDT");
if(ts != null) {
Date mdate = new Date(ts.getTime() + (ts.getNanos() / 1000000));
obj.setMntDt(mdate);
}
Timestamp start = new Timestamp(new Date().getTime() + 1);
start.setNanos(0);
Timestamp ts = (Timestamp)row.get("MNTDT");
if(ts != null) {
Date mdate = new Date(ts.getTime() + (ts.getNanos() / 1000000));
obj.setMntDt(mdate);
}
Friday, November 18, 2005
Websphere 除錯 JSP
Websphere Application Server 有提供一個 script 來大量編譯 JSP 檔案成 Java Class,如果 JSP 有錯誤的時候,可以拿來看看產出的 Java source,粉好用喔!!
/usr/WebSphere/AppServer/bin/JspBatchCompiler.sh -cell.name yourCell -node.name yourNode -server.name yourServer -enterpriseapp.name MyTestApp -filename /test/body.jsp -verbose true -keepgenerated true
IBM中国技术支持与下载 - 蓝色航标 - 如何在 WebSphere Application Server 5.0.x 中批量编译 JSP?
/usr/WebSphere/AppServer/bin/JspBatchCompiler.sh -cell.name yourCell -node.name yourNode -server.name yourServer -enterpriseapp.name MyTestApp -filename /test/body.jsp -verbose true -keepgenerated true
IBM中国技术支持与下载 - 蓝色航标 - 如何在 WebSphere Application Server 5.0.x 中批量编译 JSP?
Friday, July 22, 2005
Tuesday, February 15, 2005
Resolve cvs login error : server has insufficient rights
if you encounter cvs error on windows system that says :
Cannot login : Server has insufficient rights to validate user account
try to add the user in $CVSROOT/passwd file using the following command :
cvs -d :local:c:\cvsrepo\neb passwd -a robin
Adding user robin
New password: *****
Verify password: *****
Cannot login : Server has insufficient rights to validate user account
try to add the user in $CVSROOT/passwd file using the following command :
cvs -d :local:c:\cvsrepo\neb passwd -a robin
Adding user robin
New password: *****
Verify password: *****
Friday, February 04, 2005
關閉 Windows 2000 / XP 不常用的服務(Services)
Windows 2000 或 XP 使用久了之後,是不是覺得會越來越慢
甚至發生系統資源不足的現象,例如平常使用的程式無法開啟,IE開不起來,瀏覽網頁常常出問題,等等
如 果你有這樣的問題(如果你常不關機的話,應該有遇到過吧),雖然微軟宣稱 windows 2000以後的洗統資源會依應用程式的需求兒加大,但是,這樣的問題還是經常會發生,關閉不必要的服務,減少系統資源浪費,應該會讓你的日子好過些,下面 這個網站會教你如何關閉不必要的系統服務(你知道的,這種東西在M$的產品裡應該很常見 :-P )
http://www.blackviper.com/
windows xp sp2
http://www.blackviper.com/WinXP/servicecfg.htm
PDF的版本:
windows 2000 http://www.blackviper.com/WIN2K/Files/2000Services.zip
ps. 作者養了幾隻很可愛的貓喔 :)
甚至發生系統資源不足的現象,例如平常使用的程式無法開啟,IE開不起來,瀏覽網頁常常出問題,等等
如 果你有這樣的問題(如果你常不關機的話,應該有遇到過吧),雖然微軟宣稱 windows 2000以後的洗統資源會依應用程式的需求兒加大,但是,這樣的問題還是經常會發生,關閉不必要的服務,減少系統資源浪費,應該會讓你的日子好過些,下面 這個網站會教你如何關閉不必要的系統服務(你知道的,這種東西在M$的產品裡應該很常見 :-P )
http://www.blackviper.com/
windows xp sp2
http://www.blackviper.com/WinXP/servicecfg.htm
PDF的版本:
windows 2000 http://www.blackviper.com/WIN2K/Files/2000Services.zip
ps. 作者養了幾隻很可愛的貓喔 :)
Tuesday, February 01, 2005
Websphere 能安裝的 AP 總數計算方式
這是從 Websphere Journal 網路版本中節錄出來的,計算server中總共能裝多少AP
The total memory used is equal to the current heap size plus the Java interpreter. The size of the Java interpreter depends on the heap size. For example, a 256MB heap typically has approximately 64 MB additional from the interpreter, whereas a 128MB heap will have approximately 42 MB. Therefore, an application server with a maximum heap size of 256MB can grow to approximately 320MB of physical memory. A 128MB node agent will grow to approximately 170MB.
via: http://www.findarticles.com/p/articles/mi_m0QVB/is_6_3/ai_n6123202
| Total Physical Memory |
| 4096 MB |
| Other processes (operating system and
other processes) memory | OS + process 1 + process 2 ... | 400 MB |
| Deployment Manager Memory (if
co-resident) | DM Max heap + Java interpreter | 0 (DM not co-resident) |
| Node Agent Memory | NA Max heap + Java interpreter | 128 + 42 = 170 MB |
| Memory Available for Application
Servers | Total memory - other processes - node
agent memory | 4096MB - 400 - 170 = 3430MB |
| Single Application Server Memory | App Srv Max heap + Java interpreter | 256 + 64 = 320 MB |
| Maximum Number of Application Servers
| (Available memory/Single application
server memory) * margin for safety | (3430/320) * 0.8 = 8 application
server maximum |
The total memory used is equal to the current heap size plus the Java interpreter. The size of the Java interpreter depends on the heap size. For example, a 256MB heap typically has approximately 64 MB additional from the interpreter, whereas a 128MB heap will have approximately 42 MB. Therefore, an application server with a maximum heap size of 256MB can grow to approximately 320MB of physical memory. A 128MB node agent will grow to approximately 170MB.
via: http://www.findarticles.com/p/articles/mi_m0QVB/is_6_3/ai_n6123202
Subscribe to:
Posts (Atom)


