2013年1月11日 星期五

RTC 4.0.1 Quick Installation & Information

RationalTeamConcert + RationalQualityManager + RationalRequirementsComposer + JazzTeamServer = Collaborative Lifecycle Management

Install the server and applications

Installation component :

Jazz Team Server 4.0.1 : Jazz Team Server 提供基本服務,可讓應用程式群組一起運作,宛如單一邏輯伺服器般。請將授權金鑰安裝到 Jazz Team Server,以解除鎖定這些應用程式所提供的功能
品質管理 4.0.1 : 這個應用程式提供測試管理服務,包括:測試規劃、建立與執行。請將授權金鑰安裝到對應至這個應用程式的 Jazz Team Server,以存取其服務
需求管理 4.0.1 : 這個應用程式可在整個開發生命週期中,提供擷取、管理與追蹤需求等服務。請將授權金鑰安裝到對應至這個應用程式的 Jazz Team Server,以存取其服務
變更需求管理 4.0.1 : 這個應用程式提供作業與問題報告管理、原始碼管理、規劃,以及建置與部署自動化等服務。請將授權金鑰安裝到對應至這個應用程式的 Jazz Team Server,以存取其服務
Collaboration Lifecycle Management 產品試用碼4.0.1 : 您必須在同一伺服器上安裝此套件和 Jazz Team Server,以支援任何 Change and Configuration Management、Quality Management 及/或 Requirements Management 應用程式。
這個套件包含 Rational Team Concert、Rational Quality Manager 和 Rational Requirements Composer 的試用授權金鑰。您可以在設定 Jazz Team Server 的過程中,啟動試用授權碼,或是造訪 Jazz Team Server 的「授權碼管理」頁面來啟動它 IBM Installation Manager 1.6.0

套件群組名稱 : IBM Collaborative Lifecycle Management
安裝目錄 : D:\IBM\JazzTeamServer
共用資源目錄: d:\IBM\IMShared

Web 應用伺服器 : Tomcat 7.0
Web 應用程式佈署位置 : D:\IBM\JazzTeamServer\server\tomcat\webapps

應用程式環境根目錄定義值: (使用預設3.x/4.x應用程式定義根目錄值)
jts : Jazz Team Server
qm : 品質管理
admin : 生命週期專案管理
ccm : 變更與配置管理
rm : 需求管理

Set up the server

  1. 將 Web 瀏覽器指向下列位址:https://[fully qualified hostname]:9443/jts/setup
    UserName : ADMIN
    Password : ADMIN
  2. 選擇"自定設定"
    1. 配置公用 URI : https://[fully qualified hostname]:9443/jts
    2. 配置資料庫
      資料庫供應商:Derby
      連線類型:JDBC
      JDBC 密碼 : keep empty
      JDBC 位置 : conf/jts/derby/repositoryDB
  3. 配置電子郵件通知 : 己停用
  4. 登錄應用程式
    1. 應用程式 Instance URL user ID
      需求管理 /rm https://hc-bu1-buildx2.arimacomm.com.tw:9443/rm/scr rm_user
      品質管理 /qm https://hc-bu1-buildx2.arimacomm.com.tw:9443/qm/scr qm_user
      變更與配置管理 /ccm https://hc-bu1-buildx2.arimacomm.com.tw:9443/ccm/scr ccm_user
      生命週期專案管理 /admin https://hc-bu1-buildx2.arimacomm.com.tw:9443/admin/scr lpa_user
  5. 設定使用者登錄
    1. 使用者登錄類型 : 
  6. 配置資料倉儲
    1. 配置資料倉儲資料庫供應商和連線類型
      資料庫供應商:Derby
      連線類型:JDBC
    2. 配置資料倉儲資料庫連線內容
      JDBC 密碼 : empty
      JDBC 位置 : conf/jts/derby/warehouseDB
      資料庫網路伺服器埠 : 1527
      執行資料收集工作時的使用者資訊 :
       user_id : etl_user
       Password : etlpass
       email : etl_user@arimacomm.com.tw
  7. Installation Summary
    1. Jazz Team Server 設定

      資料庫配置 Derby


      內容現行值
      JDBC 連線儲存區大小128
      儲存庫資料鎖定 ID 跳過檢查旗標false
      JDBC 供應商DERBY
      DB 類型JDBC
      跳過資料庫版本的檢查false
      JDBC 位置conf/jts/derby/repositoryDB
      JDBC 連線維持時間上限3600000
      JDBC 連線儲存區等待時間3000

      公用 URL    https://hc-bu1-buildx2.arimacomm.com.tw:9443/jts
      電子郵件通知   已停用
      使用者登錄  偵測
      已登錄的應用程式
      應用程式名稱探索 URL
      /rmhttps://hc-bu1-buildx2.arimacomm.com.tw:9443/rm/scr
      /qmhttps://hc-bu1-buildx2.arimacomm.com.tw:9443/qm/scr
      /ccmhttps://hc-bu1-buildx2.arimacomm.com.tw:9443/ccm/scr
      /adminhttps://hc-bu1-buildx2.arimacomm.com.tw:9443/admin/scr
      資料倉儲配置 
      內容現行值
      DB 類型JDBC
      DB2z 資料倉儲資料庫名稱RIDW
      資料庫網路伺服器埠1527
      自動配置資料倉儲true
      自訂報告資料庫使用者RPTUSER
      JDBC 供應商DERBY
      跳過資料庫版本的檢查false
      JDBC 位置conf/jts/derby/warehouseDB
      JDBC 連線維持時間上限-1
      JDBC 連線儲存區等待時間3000
      JDBC 連線儲存區大小128
      自動更新資料庫統計資料true

2013年1月7日 星期一

Linux utility - Rsync

To handle two different source code control system, RTC & GIT, file transfer(synchronize):

rsync -avzl --delete --stats --exclude-from rsync_exclude.txt /floder1/ /folder2/

--delete deletes files that don't exist on the system being backed up.(Optional)


-a preserves the date and times, and permissions of the files (same as -rlptgoD).
With this option rsync will:
  Descend recursively into all directories (-r),
  copy symlinks as symlinks (-l),
  preserve file permissions (-p),
  preserve modification times (-t),
  preserve groups (-g),
  preserve file ownership (-o), and
  preserve devices as devices (-D).

-z compresses the data

-vv increases the verbosity of the reporting process

-e specifies remote shell to use

/folder1 and folder2 In the examples above, folder1 and 2 are placeholders for the directories to be synchronized. Folder1 is the original folder, and 2 is the new folder, or existing one to be brought in sync with the first. Replace them with the folders you'd like. A / was added after folder1 so that only the contents, rather than whole folder, would be moved into the second.

rsync_exclude.txt content
-------------------------------------
.jazz5
.jazzignore*


--------------------------------------

使用方式:
rsync [OPTION]... SRC [SRC]... [USER@]HOST:DEST
rsync [OPTION]... [USER@]HOST:SRC [DEST]
rsync [OPTION]... SRC [SRC]... DEST
rsync [OPTION]... [USER@]HOST::SRC [DEST]
rsync [OPTION]... SRC [SRC]... [USER@]HOST::DEST
rsync [OPTION]... rsync://[USER@]HOST[:PORT]/SRC [DEST]
rsync [OPTION]... SRC [SRC]... rsync://[USER@]HOST[:PORT]/DEST

參數說明:

-h , --help 顯示rsync求助資訊.
--version 顯示rsync版本.
-v , --verbose 複雜的輸出訊息.
-q , --quiet 安靜模式,幾乎沒有訊息產生.常用在以cron執行rsync.
-I, --ignore-times 通常rsync為了加快速度會忽略同樣檔案大小且同樣存取時間點的檔案.可以透過此參數關閉此快速檢查.
--size-only rsync只檢查檔案大小是否改變,不管時間存取點是否改變.通常用在mirror,且對方時間不太正確時.
-c, --checksum 在傳送之前透過128bit的md4檢查碼來檢查所有要傳送的檔案.(會拖慢速度.)
-a, --archive archive mode 權限保存模式,相當於 -rlptgoD 參數.
很快速的保存幾乎所有的權限設定,除了硬式連結(透過-H設定).
-r, --recursive 複製所有下層的資料(遞迴)
-R, --relative 使用相對路徑.
如: rsync foo/bar/foo.c remote:/tmp/ 在遠端產生/tmp/foo.c檔案
      rsync -R foo/bar/foo.c remote:/tmp/ 在遠端產生/tmp/foo/bar/foo.c 檔案
-R, --no-relative 不使用相對路徑.
-b, --backup 目的地端先前已經存在的檔案在傳輸或刪除前會被備份.
     --backup-dir=DIR 設定備份的資料夾.
     --suffix=SUFFIX 指定備份的檔案名稱字尾形式(預設為~).
-K, --keep-dirlinks 接收方將連結到資料夾的檔案視為資料夾處理
-l, --links 複製所有的連結
-H, --hard-links 保留硬式連結
-p, --perms 保留檔案權限
-o, --owner 保留檔案擁有者(root only)
-g, --group 保留檔案群組
-D, --devices 保留device資訊(root only)
-t, --times 保留時間點
-n, --dry-run 不實際執行傳送,只顯示將會有的傳輸動作
-S, --sparse 嘗試去處理稀疏的檔案,讓這些檔案在目的端佔去較少的磁碟空間.
-W, --whole-file 複製所有的檔案,不額外作檢查.
--no-whole-file 關閉 --whole-file 參數
-x, --one-file-system 不要跨越檔案系統分界(只在一個檔案系統處理)
-B, --block-size=SIZE 強制透過rsync程式去比對修復block-sizeforce
-e --rsh=COMMAND 定義所使用的remote shell
--rsync-path=PATH 定義rsync在遠端機器存放資料的路徑
--existing 只比對更新目的端已經存在的檔案
--ignore-existing 忽略目的端已經存在的檔案(也就是不更新)
--delete 刪除傳送端已經不存在,而目的端存在的檔案
--delete-excluded 除了把傳送端已經不存在,而目的端存在的檔案刪除之外,也刪除 --exclude 參數所包含的檔案.
--delete-after rsync預設會在檔案傳送前進行相關刪除動作確保接收端有足夠的檔案空間,但可以透過 --delete-after 讓刪除動作在檔案傳送後再行刪除.
--ignore-errors 忽略任何錯誤既使是I/O error 也進行 --delete 刪除動作.
--max-delete=NUM 定義rsync不要刪除超過 NUM 個檔案.
--partial rsync若遇到傳輸過程中斷時,會把那些已經傳輸的檔案刪除.在某種狀況下保留那些部分傳送的檔案是令人高興的.你可以透過 --partial 參數達到這個目的.
--partial-dir=DIR 在 --partial 參數啟動時,你還可以定義rsync把那些部分傳送的檔案寫入定義的資料夾,而非直接寫入目的端.需要注意的是,此資料夾不應該被其他使用者可以寫入.(如:/tmp)
--force 當目的端資料夾被傳送端非資料夾名稱覆蓋時,強制rsync刪除資料夾,即使該資料夾不是空的.
--numeric-ids 不將傳送端檔案的uid及gid值,與目的端的使用者/群組進行配對.若傳送端並沒有uid及gid的對應名稱(如:原帳號群組被刪除的遺留檔案),或目的端沒有相對應的帳號/群組,保留數字型態的uid/gid
--timeout=TIMEOUT 設定 I/O 逾時的時間(秒). 超過這個秒數而沒有資料傳送,rsync將會結束.預設為0,也就是沒有定義逾時時間.
-T, --temp-dir=DIR 定義rsync在接收端產生暫時性的複製檔案時使用資料夾暫存.預設是直接在接收端資料夾直接產生暫存檔案.
--compare-dest=DIR 定義rsync在目的端建立資料夾來比對傳送過來的檔案.
--link-dest=DIR 與 --compare-dest 相同,但同時會針對無法改變的檔案建立硬式連結.
-z, --compress 壓縮模式,當資料在傳送到目的端進行檔案壓縮.
-P -P參數和 --partial --progress 相同.只是為了把參數簡單化.
-C, --cvs-exclude 排除那些通常不希望傳送的檔案.定義的方式與CVS傳送相同:
RCS SCCS CVS CVS.adm RCSLOG cvslog.* tags TAGS .make .state .nse_depinfo *~ #* .#* ,* _$* *$ *.old *.bak *.BAK *.orig *.rej .del-* *.a *.olb *.o *.obj *.so *.exe *.Z *.elc *.ln core .svn/ 符合以上條件的都會被忽略而不傳送.
--exclude=PATTER 符合PATTERN(規則表示式)樣式的檔案不進行傳送
--exclude-from=FILE 和--exclude參數相同,不過是把不進行傳送的檔案事先寫入某一檔案.執行時,透過此參數讓rsync讀取.(; #開頭的行列或空白行會被rsync忽略)
--include=PATTERN 定義rsync不要排除符合pattern樣式的檔案.
--include-from=FILE 和--include參數相同,只不過把要包含的檔案寫到某一檔案.
--files-from=FILE 把要傳送的檔案名稱都精確的寫入某一檔案,讓rsync讀取.
如: rsync -a --files-from=/tmp/foo /usr remote:/backup
-0 --from0 定義檔案所要讀取的檔案是null字元結尾.
--version 顯示版本訊息.
--daemon 定義rsync以daemon型態執行.
--no-detach 當以daemon型態執行時,不要進行分裂且變成背景程序.
--address=ADDRESS 定義所要連結(bind)的ip位址或是host名稱(daemon限定)
--config=FILE 定義所要讀取的設定檔rsyncd.conf位置(daemon限定) 預設值為 /usr/local/etc/rsyncd.conf
--port=PORT 定義rsyncd(daemon)要執行的port(預設為tcp 873)
--blocking-io 使用blocking I/O連結遠端的shell,如rsh , remsh
--no-blocking-io 使用non-blocking連結遠端的shell,如ssh (預設值)
--stats 顯示檔案傳送時的資訊狀態
--progress 顯示傳送的進度.(給檔案傳送時,怕無聊的人用的..)
--log-format=FORMAT 定義log的格式(在rsyncd.conf設定)
--password-file=FILE 從檔案讀取與遠端rsync伺服器連結的密碼
--bwlimit=KBPS 定義傳輸頻寬的大小(KBytes/秒)
--write-batch=FILE 把紀錄資料寫入一個檔案(給其他相同環境且相同需求的機器使用)
--read-batch=FILE 透過讀取紀錄檔案來進行傳輸.(檔案由 --write-batch 參數產生)
--checksum-seed=NUM 定義檔案 checksum-seed 的大小(byte)
-4 --ipv4 使用IPv4協定
-6 --ipv6 使用IPv6協定

2012年11月6日 星期二

Python - about *, **, *args, **kwargs


* : use to pass list/tuple as positional argument to a function
ex. def func(a, b, c)
         print a, b, c
      l = [1,2,3]
      func(*l)
      1,2,3


** : use to pass dictionary as named argument to a function
ex. def func(a, b, c)
         print a, b, c
     d ={a:1, b:2, c:3}
      func(**l)
      1,2,3

*args : use to define a function to receive a arbitary arguments as list
ex. def func(a, *args)
         print a, args
      func(1, 2, 3, 4, 5)
      1, (2, 3, 4, 5)


*args : use to define a function to receive a arbitary arguments as dictionary
ex. def func(a, **kwargs)
         print a, args
      func(1, b=2, c=3, d=4, e=5)
      1, ('b':2, 'c':3,'d':4, 'e':5)

This is just my simple note, more in details refer to this very good post : http://agiliq.com/blog/2012/06/understanding-args-and-kwargs/

2012年10月16日 星期二

GAE - Use Django Framework - from scratch 2

Continue GAE - Using Django Framework - from scratch 1

Use View to say 'Hello World!'

  1. Modify urls.py, add a line to urlpatterns, like below:
    urlpatterns = patterns('',
        url(r'^$', 'views.sayhello')
    )
  2. Add a new python module views.py under project root, and with following content :
    from django.http import HttpResponse
    def sayhello(request):
        return HttpResponse("Hello world !")

Add Hello App of Django and handle by template

  1. Under project root, gdjtest, run : manage.py startapp hello
  2. Modify urls.py, add a line to urlpatterns, like below:
    urlpatterns = patterns('',
        url(r'^$', 'views.sayhello')
        url(r'^hello/(?P[a-zA-Z0-9_.-]+)/$', 'hello.views.sayhello')
    )
  3. New a folder under project root, named 'templates', for template files storage, and modify setting.py for template storage setting as below:
    TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__), 'templates') )
  4. New a html template file under folder templates, named hello.html and add line inside html >body< block : 
    Hello {{name}}!
  5. New a python module, views.py, under the new app, hello, folder, and add code as below:
    from django.shortcuts import render_to_response
        def sayhello(request, name):
        return render_to_response('hello.html', {'name':name})
  6. Test : use browser to access 'http://localhost:8080/hello/sunnylin/', and you will get response :
    Hello sunnylin!

Reference :

2012年10月15日 星期一

GAE - Use Django Framework - from scrach 1

Pre-requsite

  1. Install eclipse 3.8 Platform Runtime Binary
    http://download.eclipse.org/eclipse/downloads/drops/R-3.8-201206081200/
  2. Install Aptana Studio 3 eclipse plugin : http://download.aptana.com/studio3/plugin/install
  3. Install Google App Engine
  4. Install Python 2.7.2, 
  5. Install Django 1.3, don't install 1.4.x that still not supported by GAE untill now.
  6. Download Django-nonrel engine (djangoappengin)
  7. Add %python2.7_home%\Scripts to path (that we need to access dango-admin.py)
Create a new test project
  1. Under eclipse workspace directory run : django-admin.py startproject gdjtest
  2. New a 'PyDev Google App Engine Project' from eclipse, named 'gdjtest'
  3. New a GEA configuration file under project root : app.yaml, with content as below
    application: gdjtest
    version: 1
    runtime: python27
    api_version: 1
    threadsafe: yes

    libraries:
    - name: django
    version: 1.3

    - url: /.*
    script: djangoappengine.main.application
  4. Copy djangoappengin from django-nonrel to project root directory
  5. Start up GAE Django server : project submenu:[Run As][PyDev:Google App Run]
  6. Use browser to test : http://localhost:8080/
  7. If success, got the page response as below :

    It worked!

    Congratulations on your first Django-powered page.

    Of course, you haven't actually done any work yet. Here's what to do next:
    • If you plan to use a database, edit the DATABASES setting in settings/settings.py.
    • Start your first app by running python settings/manage.py startapp [appname].
    You're seeing this message because you have DEBUG = True in your Django settings file and you haven't configured any URLs. Get to work!

Error Debugging

  1. App server startup fail : No URLMap entries found in application configuration
    app.yaml loss handlers section
    handlers:
    - url: /.*
    script: djangoappengine.main.application
  2. ImportError: No module named django.conf
    app.yaml lose django libraries
    libraries:
    - name: django
    version: 1.3
  3. ImportError: No module named gdjtest.urls
    Modify settings.py, find line ROOT_URLCONF = 'gdjtest.urls' and change to ROOT_URLCONF = 'urls'

Complete app.yaml for Django on GAE:

application: optionwatch
version: 1
runtime: python27
api_version: 1
threadsafe: yes

builtins:
- remote_api: on

inbound_services:
- warmup

libraries:
- name: django
version: 1.3
- name: lxml
version: latest

handlers:
- url: /_ah/queue/deferred
script: djangoappengine.deferred.handler.application
login: admin

- url: /_ah/stats/.*
script: djangoappengine.appstats.application

- url: /media/admin
static_dir: django/contrib/admin/media
expiration: '0'

- url: /.*
script: djangoappengine.main.application


2012年10月12日 星期五

GAE - Python Development Test 2 - Using Django Framework

Pre-request:

  1. Python2.7 is installed
  2. Google App Engine SDK is install (Here version 1.7.2 is used)
  3. Add the google_appengine folder(ex. d:\Google\google_appengine)to your PATH
  4. Django 1.3 is installed (Don't use 1.4.x, the latest version of Dgango, because GAE support 1.3 only on the time of this post)
  5. Add python scripts to PATH, that should include django-admin.py (ex. d:\dev\python2.7\Scripts)
PS. This post is tested under Windows environment.

Create GAE project with Django (1.3 supported, currently) enabled:

  1. Create a new Google App Engine project:
    menu[File:New:Project...] => dialog:tree[PyDev-PyDev Google App Engine Project]:button[next] => dialog:label[Project Nam:text["gtest"]:button[next] => dialog:label[Google App Engine Directory]:button[Browser] => file_browser[D:\Dev\Google\google_appengine] :dialog:button[OK]:button[Next] => label[What's the application id ...]:text["gtest"]:label[From which template ...]:list[Empty Project]:button[Finish]
  2. Download Django-norel related zip file, and extract them,  for Django enabled on GAE, that did use non-RDB (bigtable) as backend database)
    1. django-nonrel : Django-nonrel is an attempt at fixing the problems and simplifying NoSQL development by adding support for NoSQL DBs to Django's ORM.
    2. djangoappengine : Contains all App Engine backends for Django-nonrel (database, email, etc.).
    3. djangotoolbox : A sandbox for Django-nonrel extra features.
    4. django-autoload : django-autoload is a reuseable django app which allows for correct initialization of your django project.
    5. django-dbindexer : Simplify your NoSQL model code and get advanced SQL-like features on non-relational databases.
    6. django-testapp
  3. Copy folders to project root directory from all above :
    1. Copy django-nonrel/django to %project%/django
    2. Copy djangotoolbox/djangotoolbox to %project%/djangotoolbox
    3. Copy django-autoload/autoload to %project%/autoload
    4. Copy django-dbindexer/dbindexer to /dbindexer
    5. Copy djangoappengine to /djangoappengine link
    6. Copy django-testapp/*.py & *.yaml to %project%/
    7. Copy django-testapp/template to %project/template
  4. Test run testapp in GAE and with Django enabled
    right click on project:menu[Run As][1.PyDev:Google App Run]
    console message:
    INFO 2012-10-12 07:00:33,980 dev_appserver_multiprocess.py:655] Running application dev~ctst on port 8080: http://localhost:8080
    INFO 2012-10-12 07:00:33,980 dev_appserver_multiprocess.py:657] Admin console is available at: http://localhost:8080/_ah/admin
  5. Start up browser and access http://localhost:8080, and can get first line message :

    It works!

    Your Django-nonrel installation is working fine. Now go and build something useful with it. :

2012年10月9日 星期二

GAE - Python Development Test 1 - Webapp Hello World

  1. Create a new Google App Engine project:
    menu[File:New:Project...] => dialog:tree[PyDev-PyDev Google App Engine Project]:button[next] => dialog:label[Project Nam:text["gtest"]:button[next] => dialog:label[Google App Engine Directory]:button[Browser]  => file_browser[D:\Dev\Google\google_appengine] :dialog:button[OK]:button[Next] => label[What's the application id ...]:text["gtest"]:label[From which template ...]:list[Hello Webapp World]:button[Finish]
  2. Test Run :
    click mouse on project named, gtest:right click:menu[Run As:PyDev : Google App Run]
  3. Modify app.yaml to use python2.7
    runtime: python => runtime: python27
    add : threadsafe: no (Note. if set threadsafe: yes will cause error, still don't know how to code for threadsafe)
  4. Test from browser:
    open browser with url : http://localhost:8080/  ==> Get result on page:"Hello, webapp World!"
  5. Setup project propertity:
    1. [project test]:right click => properities => Resource : label: [Text Encoding]: list select:Other[UTF-8]

Ref : 雲端運算-Google-App-Engine-GAE-程式開發入門-for-Python