2012年12月27日 星期四

XP/Vista/Win 7多人遠端登入

http://deepxw.blogspot.com/2009/04/universal-termsrvdll-patch.html

Support: Windows XP SP2 SP3; Vista SP1 SP2/Windows 7, 32bit(x86)/64bit(x64)

將事件記錄檔匯出至檔案

wevtutil epl System E:\test.evtx

ref:
http://technet.microsoft.com/zh-tw/library/cc749339(v=ws.10).aspx

2012年12月23日 星期日

Developing International Software (Windows)

http://msdn.microsoft.com/en-us/library/hh529131(v=vs.85).aspx

Code Page Support in Microsoft Windows
http://msdn.microsoft.com/en-us/library/cc194884.aspx

ANSI Code Page for Windows

http://www.mydigitallife.info/ansi-code-page-for-windows-system-locale-with-identifier-constants-and-strings/

URL Rewrite Module Configuration Reference

http://www.iis.net/learn/extensions/url-rewrite-module/url-rewrite-module-configuration-reference

JAVA使用的Unicode版本

https://svn.apache.org/repos/asf/lucene/dev/trunk/lucene/JRE_VERSION_MIGRATION.txt


 * Java 1.4, Unicode 3.0
 * Java 5, Unicode 4.0
 * Java 6, Unicode 4.0
 * Java 7, Unicode 6.0

ref:
http://stackoverflow.com/questions/6941229/how-to-identify-programmatically-in-java-which-unicode-version-supported


中文儲存在電腦裡是不是佔3 bytes?

http://phorum.study-area.org/index.php?topic=51268.0

UTF-8 的字碼長度是不固定的,由一至四不等,通常英文字母 (ascii characters) 是 1 byte,拉丁及東歐字母等是 2 bytes,其他多字節文字(包括中文)是 3 bytes,其餘罕有的字符是 4 bytes。

http://www.ptt.cc/bbs/C_and_CPP/M.1289044618.A.B94.html
2.中文儲存在電腦裡是不是佔3 bytes?

答:不一定,如果是BIG5編碼,就是2 bytes

  如果是UTF-8編碼,可能是2 bytes或3 bytes

  如果是UTF-16,則是2 bytes


http://en.wikipedia.org/wiki/Unicode_in_Microsoft_Windows
Windows used the UTF-16LE encoding scheme internally, in NTFS file system

ref:
http://en.wikipedia.org/wiki/UTF-8
http://www.ptt.cc/man/Web_Design/D5B9/D6D7/M.1144158540.A.A6E.html
http://ithelp.ithome.com.tw/question/10021627?tag=rt.rq

Character encoding - Wikipedia, the free encyclopedia

http://en.wikipedia.org/wiki/Character_encoding


  • With US-ASCII, code unit is 7 bits.
  • With UTF-8, code unit is 8 bits.
  • With EBCDIC, code unit is 8 bits.
  • With UTF-16, code unit is 16 bits.
  • With UTF-32, code unit is 32 bits.

IIS自簽憑證有效期限不只一年

IIS7
http://blogs.iis.net/thomad/archive/2010/04/16/setting-up-ssl-made-easy.aspx

IIS6
http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=17275

http://serverfault.com/questions/361792/iis-7-5-creating-self-signed-certificates-with-validation-date-of-more-than-a-ye

2012年12月8日 星期六

Events and Errors - Failover Clustering

http://technet.microsoft.com/en-us/library/cc753362(v=ws.10).aspx

Server 2003 cluster 節點之間是否可以跨網段

http://social.technet.microsoft.com/Forums/zh-TW/winserverzhcht/thread/4bf52044-edfa-46f3-a157-e8529368c987
http://blogs.msdn.com/b/clustering/archive/2009/02/23/9441604.aspx

跨網段的Cluster在Server 2003是不可行的 , 在Server 2008開始才支援

keyword: PlumbAllCrossSubnetRoutes

LocalSystem Account (Windows)

http://msdn.microsoft.com/zh-tw/library/windows/desktop/ms684190(v=vs.85).aspx

SQL Server 2012:在AlwaysOn可用性群組上,請勿使用Windows容錯移轉管理員來執行容錯移轉

http://sharedderrick.blogspot.tw/2012/06/sql-server-2012alwaysonwindows.html

容錯移轉管理員Failover Cluster Manager

you must use failover cluster management to add storage

在Microsoft iSCSI Software Target 3.3 出現必須使用容錯移轉叢集管理員add storage
雖然並沒有將Microsoft iSCSI Software Target 3.3和iscsi initiator放在一起
但還是不要將Microsoft iSCSI Software Target 3.3安裝在MSFC(Microsoft Failover Cluster)環境上

※DO NOT install Microsoft iSCSI Software Target on Microsoft failover cluster environment 
even if Microsoft iSCSI Software Target don't install in the same computer that runs the iSCSI Initiator.If you do it,it may cause your failover cluster crash. 

List of Failover Cluster Packages Updated After the Release of Windows Server 2008 R2 Service Pack 1 (SP1)

http://social.technet.microsoft.com/wiki/contents/articles/3153.list-of-failover-cluster-packages-updated-after-the-release-of-windows-server-2008-r2-service-pack-1-sp1.aspx

List of Cluster Hotfixes for Windows Server 2008 R2

http://social.technet.microsoft.com/wiki/contents/articles/2008.list-of-cluster-hotfixes-for-windows-server-2008-r2.aspx
•2687741 — A hotfix that improves the performance of the "AlwaysOn Availability Group" feature in SQL Server 2012 is available for Windows Server 2008 R2

2012年12月6日 星期四

Exceptions for Symantec Endpoint Protection on Hyper-V

http://www.symantec.com/business/support/index?page=content&id=TECH133846 http://support.microsoft.com/kb/961804

Hyper-V Cmdlets in Windows PowerShell

http://technet.microsoft.com/en-us/library/hh848559.aspx

Hyper-V 的伺服器遠端存取權

http://technet.microsoft.com/zh-tw/library/ee849854(v=ws.10).aspx
如果您已將管理 Hyper-V 的伺服器遠端存取權,授與任何不是 Administrators 群組或 Distributed COM Users 群組成員的使用者帳戶,請開啟登錄並瀏覽至 HKLM\Software\Microsoft\OLE\ 機碼。新增您從來源伺服器記錄的 MachineLaunchRestriction 值。

2012年12月3日 星期一

下載 Microsoft 私用雲端評估軟體

http://technet.microsoft.com/zh-tw/evalcenter/hh505660.aspx


System Center 2012 Private Cloud RTM
https://www.microsoft.com/betaexperience/pd/SCDC2012RTM/zhtw/default.aspx

System Requirements for System Center 2012 - Virtual Machine Manager

http://technet.microsoft.com/en-us/library/gg610592.aspx

Deploying System Center 2012 - Virtual Machine Manager

http://technet.microsoft.com/library/gg610669.aspx

XenServer Tech Specs

http://www.citrix.com/products/xenserver/how-it-works/specifications.html

  • 64-bit x86 server-class system
  • Intel® VT or AMD-V™ required for support of Windows guests

files that comprise a virtual machine include

http://social.technet.microsoft.com/wiki/contents/articles/349.hyper-v-how-to-find-vm-files.aspx

The files that comprise a virtual machine include:
  • .XML files
    • These files contain the virtual machine configuration details. There is one of these for each virtual machine and each snapshot of a virtual machine. They are always named with theGUID used to internally identify the virtual machine or snapshot in question.
  • .BIN files
    • This file contains the memory of a virtual machine or snapshot that is in a saved state.
  • .VSV files
    • This file contains the saved state from the devices associated with the virtual machine.
  • .VHD files
    • These are the virtual hard disk files for the virtual machine
  • .AVHD files
    • These are the differencing disk files used for virtual machine snapshots 

About Virtual Machines and Guest Operating Systems for Hyper-V

http://technet.microsoft.com/en-us/library/cc794868(v=ws.10).aspx

Server Core模式下開啟遠端桌面

cscript C:\Windows\System32\Scregedit.wsf /ar 0

http://technet.microsoft.com/en-us/library/ee441255(v=ws.10).aspx
This enables the Remote Desktop for Administration mode to accept connections.

2012年12月2日 星期日

kernel enlightenment

Google到Windows Server 2008和Windows Vista with SP1之後的Windows有支援kernel enlightenment
因此Hyper-V不需要安裝Integration Services
但是微軟的文件只有Guest OS是Windows 8和Windows 2012才不用安裝Integration Services
http://technet.microsoft.com/en-us/library/hh831531.aspx
自己在VM環境不管用Hyver-V還是XenServer跑Windows 2008 R2都滿順的
也有可能是因為Windows Server 2008內建的相關服務和驅動程是不是最新版本,所以需要再次安裝Integration Services(整合服務)


註:enlightenment是指Guest OS的Kernel可以知道自己在虛擬化的環境中執行,具備感知虛擬化環境的能力

10+ tips for getting the best performance out of your SQL Server data types | TechRepublic

http://www.techrepublic.com/blog/10things/10-tips-for-getting-the-best-performance-out-of-your-sql-server-data-types/381

Get Password Expiration Date in SQL Server 2008

http://www.sqlservercurry.com/2010/12/get-password-expiration-date-in-sql.html

enforces password expiration (強制執行密碼逾期)

http://msdn.microsoft.com/en-us/library/ms161959.aspx

Creating UFT-8 database

http://www.manydesigns.com/en/portofino/portofino3/3_1_x/installation-guide/creating-the-database

啟動、停止、暫停、繼續、重新啟動 Database Engine、SQL Server Agent 或 SQL Server Browser 服務

http://msdn.microsoft.com/zh-tw/library/hh403394.aspx

create a login in SQL Server 2012 by using SQL Server Management Studio or Transact-SQL

http://technet.microsoft.com/en-us/library/aa337562.aspx#Security

Appendix A: Failover Cluster Requirements

http://technet.microsoft.com/en-us/library/dd197454(WS.10).aspx#BKMK_Account_Infrastructure

User UPN logon和User SamAccountName logon

UPN並不會隨著帳戶被搬移到其他網域而改變,比如原本是rex@AAA.COM,之後這個使用者被搬移到樹系中的另一個網域BBB.COM內,其UPN仍然是rex@AAA.COM,仍然可以使用rex@AAA.COM登入


http://technet.microsoft.com/en-us/library/dd861342.aspx
User UPN logon
User SamAccountName logon

http://technet.microsoft.com/zh-tw/library/dd861342.aspx
使用者 UPN 登入
使用者 UPN 登入

http://technet.microsoft.com/zh-cn/library/dd861342.aspx
用户 UPN 登录
用户 SamAccountName 登录


ping本機出現unable to contact ip driver general failure

加入網域後,用domain admin帳號登入,ping 127.0.0.1出現已下訊息 (用本機登入不會)
unable to contact ip driver general failure
因為虛擬機複製不變更SID(安全性識別碼)在網域環境下會有問題

解決方式 :
cd到C:\Windows\System32\Sysprep
執行Sysprep
選擇OOBE,勾選Generalize (一般化)

※執行後電腦名稱Hostname會被改掉,需重新加入domain,Windows需重新啟用※

ref:
http://rexitblog.blogspot.tw/2012/11/differencing-virtual-disk.html
http://technet.microsoft.com/zh-tw/library/cc721940(v=ws.10).aspx
http://mrynlin.blogspot.tw/2011/01/windows-7-sysprep.html

nltest /dsgetdc: /force

http://technet.microsoft.com/en-us/library/ee624051(WS.10).aspx

nltest /dsgetdc: /force

           DC: \\DC1.corp.contoso.com
      Address: \\2002:836b:2:1:0:5efe:10.0.0.1
     Dom Guid: e8bae90e-02c4-4489-8abd-e63353fed05a
     Dom Name: corp.contoso.com
  Forest Name: corp.contoso.com
 Dc Site Name: Default-First-Site-Name
        Flags: PDC GC DS LDAP KDC TIMESERV GTIMESERV WRITABLE DNS_DC DNS_DOMAIN
DNS_FOREST FULL_SECRET WS
The command completed successfully

windows cannot access the specified device path or file

加入domain後
用domain admin帳號登入開啟Server Manager出現此問題 (本機admin不會)

解決方式:關閉windows的UAC (User Account Control 使用者帳戶控制)
                 重新開機後,UAC 就會被關閉


【windows 2008 R2英文版關閉UAC】

2012年11月28日 星期三

加入網域後使用本機帳號登入

.\Administrator

Windows版WebSphere 8.5內建的JDK fullversion


32位元版本 WebSphere SDK
C:\Program Files (x86)\IBM\WebSphere\AppServer\java\bin>java -fullversion
java full version "JRE 1.6.0 IBM Windows 32 build pwi3260_26sr2ifx-20120419_02 (
SR2)"

64位元版本 WebSphere SDK
C:\Program Files (x86)\IBM\WebSphere\AppServer\java\bin>java -fullversion
java full version "JRE 1.6.0 IBM Windows AMD 64 build pwa6460_26sr2ifx-20120419_
02 (SR2)"

2012年11月27日 星期二

查WebSphere肚子內IBM JDK詳細的版號

On Windows : run %WAS_HOME%\java\bin\java -fullversion (e.g) c:\WebSphere\AppServer\java\bin\java -fullversion

On Unix : run $WAS_HOME/java/bin/java -fullversion (e.g) /opt/WebSphere/AppServer/java/bin/java -fullversion


資料來源:
http://webspherehelp.blogspot.tw/2009/07/how-to-find-version-of-websphere-java.html


ref:
查看Websphere版本
http://it.rex.tw/2015/12/websphere.html
  • For Unix and Linux: WAS_PATH /bin/versionInfo.sh
  • For Windows: WAS_PATH \bin\versionInfo.bat
  • 2012年11月20日 星期二

    Hyper-V Snapshot上限

    50個

    Virtual Server:64個
    VMWare ESX Server:沒有限制,只要硬碟夠大

    2012年11月19日 星期一

    Hyper-V防毒軟體要排除vmms.exe和vmswp.exe

    Host OS如果有裝防毒要排除
    避免誤判mms.exe和vmswp.exe

    Hyper-V R2硬體極限

    單一伺服器支援512個邏輯處理器及384個虛擬機器
    單一虛擬機器可以使用64個邏輯處理器及1TB記憶體

    2012年11月18日 星期日

    透過cli開啟Windows防火牆TCP 3389

    netsh firewall set portopening tcp 3389

    Java JDBC connection pool library benchmark

    http://jolbox.com/index.html?page=http://jolbox.com/benchmarks.html

    下載官方版的Windows 8 ISO檔

    http://go.microsoft.com/fwlink/?LinkID=262204
    透過上面網址下載Windows8-Setup.exe
    執行後再選【透過建立媒體來安裝】

    ref:
    http://support.microsoft.com/kb/2780408/zh-tw

    XenServer和HyperV的VM Clone

    XenServer可以直接在XenCenter用Copy VM
    Hyper-V要先Export再Import
    但是Export再Import的速度也滿快的

    2012/12/2 Update:
    Export再Import真的不太好用@.@
    只有要錢VMM可以Clone(再製)虛擬機

    iscsicpl (GUI介面開啟iSCSI啟動器)


    iscsicpl =>GUI
    iscsicli =>Command Line

    SQL Server 2012 的線上叢書

    http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=ZH-TW&k=k%28SQL11.PORTAL.F1%29;k%28SQL11.PORTAL.DEVREF.F1%29;k%28SQL11.PORTAL.INSTALLATION.F1%29&rd=true

    產生僅供測試用途的 X.509 憑證

    http://msdn.microsoft.com/zh-tw/library/bfsktky3(v=vs.80).aspx

    憑證建立工具 (Makecert.exe)

    2012年11月17日 星期六

    Select-String Cmdlet(找檔案中的字串)

    http://technet.microsoft.com/en-us/library/ee176956.aspx

    Unix=>grep
    Windows=>findstr

    WSUS伺服器

    建置WSUS伺服器不需要AD環境,但是為了利用群組原則來控管Client的自動更新設定
    建議使用AD環境

    differencing virtual disk

    http://technet.microsoft.com/en-us/library/cc720381(v=ws.10).aspx

    先新增差異虛擬硬碟
    在新增一個虛擬機器,該VM使用現有的虛擬硬碟(剛剛建立的差異虛擬硬碟)
    因兩個硬碟的安全性識別碼(SID)一樣,必須使用SYSPREP.EXE變更SID
    執行SYSPREP.EXE需勾選一般化(G)才會變更SID
    SYSPREP.EXE位於%Systemroot%\System32\sysprep資料夾內
    如:c:\windows\system32
    不變更SID在網域環境下會有問題

    ref:
    http://www.dotblogs.com.tw/dotjason/archive/2009/09/29/10823.aspx

    2012年11月12日 星期一

    Hyper-V主機板BIOS需啟用

    (一)
    Intel VT或AMD-V

    (二) DEP 硬體資料執行防止
    Intel XD或AMD NX

    Windows Server Dunp File

    % systemroot% memory.dmp

    捲軸

    AWT:
    java.awt.Scrollbar

    Swing:
    javax.swing.JScrollBar
    javax.swing.JSlider
    javax.swing.JSpinner

    2012年11月11日 星期日

    Show line numbers

    Window → Preferences... → General → Editors → Test Editors → Show line numbers

    Eclipse更改程式碼字型大小

    Window-> Perferences-> General-> Appearance-> Colors and Fonts-> Java-> Java Editor Text Font

    Eclipse包jar

    File->Export

    因為第一次包完後都是用換單支class
    常常忘記在哪@.@
    還是寫下來

    Windows command syntax highlighting

    http://www.kickstarter.com/projects/20258791/wish

    2012年11月4日 星期日

    (SQL Server) 複製Table


    use 資料庫
    select * into 新表格 from 原始表格
    //如果要清空新表格資料,要增加下面這行
    truncate table  新表格

    (SQL Server) truncate table(清空資料)

    不會將刪除記錄的操作寫入Transaction log

    2012年10月23日 星期二

    PowerGUI (免費的PowerShell GUI 開發工具)

    http://powergui.org

    ref:
    The Will Will Web | 介紹好用工具:PowerGUI 與 PowerShell v2 Snippets

    Toad Data Modeler (Data Modeling and Database Design)

    http://www.quest.com/toad-data-modeler/

    免費版最多儲存25個的實例
    不支援反向工程和資料流圖形(Data Flow Diagrams)

    2.x免費版只支援SQL Server 2005的資料類型(不支援2008/2012新增的資料類型)

    2012年10月14日 星期日

    w32tm /tz (查看目前系統時區)


    PS C:\Users\Rex> w32tm /tz
    時區: 目前:TIME_ZONE_ID_UNKNOWN Bias: -480min (UTC=LocalTime+Bias)
      [Standard Name:"台北標準時間" Bias:0min Date:(未指定)]
      [Daylight Name:"台北日光節約時間" Bias:-60min Date:(未指定)]

    get-command (查看可用命令)

    get-command -syntax =>包含參數
    get-command a* =>所有name為a開頭的



    PS C:\Users\Rex> get-command Get-Proce*

    CommandType     Name                                                Definition
    -----------     ----                                                ----------
    Cmdlet          Get-Process                                         Get-Process [[-Name] ] [-ComputerName ...


    PS C:\Users\Rex> get-command Get-Proce* -syntax
    Get-Process [[-Name] ] [-ComputerName ] [-Module] [-FileVersionInfo] [-Verbose] [-Debug] [-ErrorAct
    ion ] [-WarningAction ] [-ErrorVariable ] [-WarningVariable ] [-Out
    Variable ] [-OutBuffer ]
    Get-Process -Id [-ComputerName ] [-Module] [-FileVersionInfo] [-Verbose] [-Debug] [-ErrorAction tionPreference>] [-WarningAction ] [-ErrorVariable ] [-WarningVariable ] [-OutVariabl
    e ] [-OutBuffer ]
    Get-Process [-ComputerName ] [-Module] [-FileVersionInfo] -InputObject [-Verbose] [-Debug] [-Erro
    rAction ] [-WarningAction ] [-ErrorVariable ] [-WarningVariable ] [
    -OutVariable ] [-OutBuffer ]...



    Get-Process (查看執行緒)

    http://technet.microsoft.com/zh-tw/library/dd347630.aspx

    輸出到檔案:
    Get-Process > D:\process.txt

    PS C:\Users\Rex> get-process -id 0

    Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName
    -------  ------    -----      ----- -----   ------     -- -----------
          0       0        0         24     0               0 Idle


    PS C:\Users\Rex> get-process -name firefox*

    Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName
    -------  ------    -----      ----- -----   ------     -- -----------
        297      43    72088     113252   401     1.70   6828 firefox

    註:會和Windows工作管理員(taskmgr)看到的PID一致
    停止: stop-process -id 8888
             stop-process -name firefox
             taskkill /IM mytest.exe /F

    Ubuntu 12.04安裝ownCloud 4

    rex@ubuntu:~$ wget http://download.opensuse.org/repositories/isv:ownCloud:ownCloud2012/xUbuntu_12.04/Release.key

    rex@ubuntu:~$ sudo apt-key add Release.key

    rex@ubuntu:~$ echo 'deb http://download.opensuse.org/repositories/isv:ownCloud:ownCloud2012/xUbuntu_12.04//'\| sudo tee /etc/apt/sources.list.d/owncloud.list

    rex@ubuntu:~$ sudo apt-get update

    rex@ubuntu:~$ sudo apt-get install ownCloud

     =======

    rex@ubuntu:~$ sudo vi /etc/php5/apache2/php.ini

    rex@ubuntu:~$ sudo service apache2 restart

    修改php.ini的memory_limit、post_max_size和upload_max_filesize
    存檔後重啟Apache
    ownCloud登入頁面 http://IP/owncloud/

     =======

    設定完成後,使用者可登入http://IP/owncloud/ 上傳檔案
    可以使用WebDAV client軟體透過以下url連到ownCloud
    (該url也登入ownCloud在左下角的Settings->Personal找到)
    http://IP/owncloud/files/webdav.php

    Windows WebDAV Client軟體:
    http://www.netdrive.net

    各作業系統WebDAV連線設定:
    http://owncloud.org/support/webdav/

     =======
    Ubuntu 正體中文站:
    http://www.ubuntu-tw.org/

    ownCloud官網:
    http://owncloud.org/

    wiki關於WebDAV說明:
    http://en.wikipedia.org/wiki/WebDAV



    2012年10月13日 星期六

    使用dcpromo開啟網域服務精靈

    dcprpmo /adv

    註:adv表示進階模式安裝,未加此參數也可在GUI勾選

    2012年10月11日 星期四

    秀出CentOS/XenServer版本


    cat /etc/redhat-release
    
    fedora:
    cat /etc/fedora-release
    
    通用:
    cat /etc/*release

    秀出kernel資訊:
    uname -a -m -p

    2012年10月6日 星期六

    在Windows下將FTP掛載成磁碟機:NetDrive

    http://www.netdrive.net/

    1.中文檔名亂碼可調整NetDrive中Advanced設定的Encodine
    2.家用是免費的(商業使用授權費1台pc為29美金)
    3.也支援Webdav
    4.可設定成開機啟動
    5.支援sftp(在Advanced設定)
    6.可設定proxy
    7.掛載後磁碟機名稱NetDrive @ yourftphostname,建議用複製貼上再刪掉本機檔案,不要用剪下貼上
    8.Android可以用AndFTP,iPhone/iPad可以使用FTP Sprite連到FTP伺服器抓檔,兩款client軟體都支援sftp
    9.把ftp server架在VM中,備份VM檔就好,或用rsync備份,也不用2-bay NAS去做RAID,省錢做法,
    10.可以開啟vsftpd或openssh的chroot(OpenSSH要OpenSSH 4.8p1之後才有),限定使用者只能在自己的目錄,並關掉SSH Shell、SSH Tunnel、X11 Forwarding,OpenSSH設定可以參考Will保哥的文章
    11.在Windows 7(64 bits)和Windows 2008 R2(64 bits)安裝使用都OK,官方所列支援的作業系統有Windows XP,VISTA,7,2003/2008 (32/64bit)

    MongoDB Configuration File Options

    http://docs.mongodb.org/manual/reference/configuration-options/

    MongoDB連線驗證機制

    ./mongod -- auth

    如果admin.system.users中沒有任何使用者,加了auth參數也不會生效

    32-bit MongoDB processes are limited to about 2 gb of data

    http://blog.mongodb.org/post/137788967/32-bit-limitations

    MongoDB設定系統日誌

    [root@localhost]# ./mongod -logpath=/data/db/log/serverlog.log -logappend
    all output going to: /data/db/log/serverlog.log

    2012年9月19日 星期三

    for /d %%B in (%SystemRoot%\*) do echo %%B

    for /d %%B in (%SystemRoot%\*) do echo %%B
    執行環境:Windows 2008 R2

    C:\Rex>for / %B in (C:\Windows\ *) do echo %B

    C:\Rex>echo C:\Windows\
    C:\Windows\

    C:\Rex>forTest

    C:\Rex>for / %B in (C:\Windows\*) do echo %B

    C:\Rex>echo C:\Windows\AppCompat
    C:\Windows\AppCompat

    C:\Rex>echo C:\Windows\AppPatch
    C:\Windows\AppPatch

    C:\Rex>echo C:\Windows\assembly
    C:\Windows\assembly

    C:\Rex>echo C:\Windows\Boot
    C:\Windows\Boot

    C:\Rex>echo C:\Windows\Branding
    C:\Windows\Branding

    C:\Rex>echo C:\Windows\Cursors
    C:\Windows\Cursors

    C:\Rex>echo C:\Windows\debug
    C:\Windows\debug

    C:\Rex>echo C:\Windows\diagnostics
    C:\Windows\diagnostics

    C:\Rex>echo C:\Windows\DigitalLocker
    C:\Windows\DigitalLocker

    C:\Rex>echo C:\Windows\Downloaded Program Files
    C:\Windows\Downloaded Program Files

    C:\Rex>echo C:\Windows\en-US
    C:\Windows\en-US

    C:\Rex>echo C:\Windows\Fonts
    C:\Windows\Fonts

    C:\Rex>echo C:\Windows\Globalization
    C:\Windows\Globalization

    C:\Rex>echo C:\Windows\Help
    C:\Windows\Help

    C:\Rex>echo C:\Windows\IME
    C:\Windows\IME

    C:\Rex>echo C:\Windows\inf
    C:\Windows\inf

    C:\Rex>echo C:\Windows\L2Schemas
    C:\Windows\L2Schemas

    C:\Rex>echo C:\Windows\LiveKernelReports
    C:\Windows\LiveKernelReports

    C:\Rex>echo C:\Windows\Logs
    C:\Windows\Logs

    C:\Rex>echo C:\Windows\Media
    C:\Windows\Media

    C:\Rex>echo C:\Windows\Microsoft.NET
    C:\Windows\Microsoft.NET

    C:\Rex>echo C:\Windows\ModemLogs
    C:\Windows\ModemLogs

    C:\Rex>echo C:\Windows\Offline Web Pages
    C:\Windows\Offline Web Pages

    C:\Rex>echo C:\Windows\Panther
    C:\Windows\Panther

    C:\Rex>echo C:\Windows\PLA
    C:\Windows\PLA

    C:\Rex>echo C:\Windows\PolicyDefinitions
    C:\Windows\PolicyDefinitions

    C:\Rex>echo C:\Windows\Registration
    C:\Windows\Registration

    C:\Rex>echo C:\Windows\RemotePackages
    C:\Windows\RemotePackages

    C:\Rex>echo C:\Windows\rescache
    C:\Windows\rescache

    C:\Rex>echo C:\Windows\Resources
    C:\Windows\Resources

    C:\Rex>echo C:\Windows\SchCache
    C:\Windows\SchCache

    C:\Rex>echo C:\Windows\schemas
    C:\Windows\schemas

    C:\Rex>echo C:\Windows\security
    C:\Windows\security

    C:\Rex>echo C:\Windows\ServiceProfiles
    C:\Windows\ServiceProfiles

    C:\Rex>echo C:\Windows\servicing
    C:\Windows\servicing

    C:\Rex>echo C:\Windows\Setup
    C:\Windows\Setup

    C:\Rex>echo C:\Windows\SoftwareDistribution
    C:\Windows\SoftwareDistribution

    C:\Rex>echo C:\Windows\Speech
    C:\Windows\Speech

    C:\Rex>echo C:\Windows\SysMsiCache
    C:\Windows\SysMsiCache

    C:\Rex>echo C:\Windows\system
    C:\Windows\system

    C:\Rex>echo C:\Windows\System32
    C:\Windows\System32

    C:\Rex>echo C:\Windows\SysWOW64
    C:\Windows\SysWOW64

    C:\Rex>echo C:\Windows\TAPI
    C:\Windows\TAPI

    C:\Rex>echo C:\Windows\Tasks
    C:\Windows\Tasks

    C:\Rex>echo C:\Windows\Temp
    C:\Windows\Temp

    C:\Rex>echo C:\Windows\tracing
    C:\Windows\tracing

    C:\Rex>echo C:\Windows\Vss
    C:\Windows\Vss

    C:\Rex>echo C:\Windows\Web
    C:\Windows\Web

    C:\Rex>echo C:\Windows\winsxs
    C:\Windows\winsxs

    2012年9月15日 星期六

    (find) 找目錄下副檔名是txt的檔案



    [UserC@localhost test]$ find . -name "*.txt" -print
    ./test2.txt
    ./test.txt
    [UserC@localhost test]$ find . -type d -name "*.txt" -print
    ./test2.txt =>它是資料夾

    [UserC@localhost test]$ find . -type f -name "*.txt" -print
    ./test.txt


    (find+xargs)找出檔案權限是775的資料夾和檔案,並將權限改成700

    目錄下所有檔案權限改成775
    [UserC@localhost test]$ find . -type f -print0 | xargs -0 chmod 775

    目錄下所有目錄權限改成775
    [UserC@localhost test]$ find . -type d -print0 | xargs -0 chmod 775

    找出檔案權限是755的資料夾和檔案,並將權限改成700

    [UserC@localhost test]$ find . -perm -775 -print | xargs chmod 700
    [UserC@localhost test]$ ls -al
    total 16
    drwx------. 3 UserC UserC 4096 Sep 15 14:02 .
    drwx------. 5 UserC UserC 4096 Sep 15 13:52 ..
    -rwx------. 1 UserC UserC    2 Sep 15 13:51 777.sh
    drwx------. 2 UserC UserC 4096 Sep 15 14:02 testdir

    (find) 找目錄下是755的檔案



    [UserC@localhost ~]$ ls -al
    total 40
    drwx------. 4 UserC UserC 4096 Sep 15 13:47 .
    drwxr-xr-x. 7 root  root  4096 Sep 15 13:46 ..
    -rw-r--r--. 1 UserC UserC    4 Sep 15 13:47 644.txt
    -rwxr-xr-x. 1 UserC UserC    4 Sep 15 13:47 755.txt
    -rw-r--r--. 1 UserC UserC   18 May 11 02:31 .bash_logout
    -rw-r--r--. 1 UserC UserC  176 May 11 02:31 .bash_profile
    -rw-r--r--. 1 UserC UserC  124 May 11 02:31 .bashrc
    drwxr-xr-x. 2 UserC UserC 4096 Nov 12  2010 .gnome2
    drwxr-xr-x. 4 UserC UserC 4096 Sep 13 22:20 .mozilla
    -rw-------. 1 UserC UserC  694 Sep 15 13:47 .viminfo
    [UserC@localhost ~]$ find . -type f -perm 755 -exec ls -l {} \;
    -rwxr-xr-x. 1 UserC UserC 4 Sep 15 13:47 ./755.txt
    [UserC@localhost ~]$  find . -type f -perm 644 -exec ls -l {} \;
    -rw-r--r--. 1 UserC UserC 4 Sep 15 13:47 ./644.txt
    -rw-r--r--. 1 UserC UserC 18 May 11 02:31 ./.bash_logout
    -rw-r--r--. 1 UserC UserC 176 May 11 02:31 ./.bash_profile
    -rw-r--r--. 1 UserC UserC 124 May 11 02:31 ./.bashrc
    [UserC@localhost ~]$


    2012年8月18日 星期六

    WindowBuilder Pro

    https://developers.google.com/java-dev-tools/download-wbpro

    Eclipse 3.7 (Indigo)
    http://dl.google.com/eclipse/inst/d2wbpro/latest/3.7


    Eclipse 3.7 (Indigo)下載
    http://www.eclipse.org/downloads/packages/release/indigo/sr2


    2012年8月13日 星期一

    db2開機啟動


    db2iauto -on db2inst1

    2012年8月6日 星期一

    XenServer在GuestOS使用XenCenter連到HostOS

    試了一下是ok的
    所以可以遠端桌面到GuestOS使用XenCenter管理XenServer

    2012年7月30日 星期一

    敗了一台WD My Book Essential 2TB

    在Pxhome敗了一台WD My Book Essential 2TB (WDBACW0020HBK-SESN)
    設定密碼後會有個虛擬光碟,要需入密碼才會有硬碟槽出現
    沒有安裝光碟,程式都在硬碟內
    插頭要自己換成台灣的頭(有內附)
    目前用起來都還ok
    btw...
    之前買過biostore的指紋隨身碟也是虛擬成光碟
    那時還不知道有TrueCrypt
    TrueCrypt可以免安裝
    還不如用TrueCrypt加上一般隨身碟

    指紋辨識率不高 , 最後都是打密碼@.@
    而且國外有hacker破解過加密隨身碟的身份驗證軟體
    有密碼跟沒密碼一樣
    保險點還是自己多加密一次

    終於把RB750GL修好了

    reset成原廠出廠狀態後,pppoe到Hinet後一直無法連到外部網站
    換了電腦和網路線都一樣,換了分享器就ok , 推斷是RB750GL設定問題
    後來發現RouterOS有內建ping工具,用RouterOS內建的ping可以對外
    ping了tw.yahoo.com和168.95.1.1都ok
    後來用Files內的備份檔還原就ok了
    那個應該試賣家初始的設定檔
    因為有還原後介面就有中文說明
    還發現原來
    RouterOS的PPPoE Server可以防止ARP攻擊
    怪不得國內ISP喜歡用PPPoE...@.@
    把電腦的npk檔拖曳到WinBox的Files就可以上傳
    買來一直沒深入研究=.=
    只是想限流
    ,只知道換admin的password和Queues設定限流,殘念
    這次多學到幾招...>"<
    為啥會去還原成出廠值呢??
    因為我想把所有電腦(含VM)都躲在Private IP內
    之前不管是實體還是VM都是透過PPPoE去跟Hinet要IP
    有次寫程式發現Jetty的Console有百度的bot...=.=
    我不是有把8080擋了??
    應該是因為有開JAVA連網路的關係吧??
    換成Private IP後再重灌Win 7,再重新設定一些組態

    system routerboard print
    查看現在RouterOS版本

    system routerboard upgrade
    升級新版
    routerboard.npk

    2012年7月29日 星期日

    Google Testing Blog

    http://googletesting.blogspot.com

    ref:
    http://sdet.org/?p=82

    Amazon.com: How Google Tests Software (9780321803023): James A. Whittaker, Jason Arbon, Jeff Carollo: Books

    XMLHttpRequest同步(Synchronous) 與非同步(Asynchronous)

    我們系統中有用XMLHttpRequest去問使用者送上的資料是true或是false
    一直要的結果有問題,本來以為是IE Cache的問題
    加了setRequestHeader("If-Modified-Since","0")和setRequestHeader("Cache-Control","no-cache")還是有問題
    最後在Controller程式加了log確定XMLHttpRequest都有把每筆的request送上來
    更神奇的是我在Javascript的
    check function加了alert結果就正確
    但是加sleep或是賦值...等之類的還是有問題~~~@.@
    看了還幾次程式流程應該寫法不會有問題~~~
    結果把open的
    Asynchronous改成Synchronous就ok了
    我跟AJAX真的不熟
    應該是跟他爸爸Javascript就不熟了=.=

    2012年7月28日 星期六

    CentOS利用text mode setup utility打開80和443 port


    #iptables -L
    #LANG=C
    #setup

    REF:
    http://linux-dindin.blogspot.tw/2009/10/centosfirewall.html

    CentOS安裝pppoe連線軟體

    yum install rp-pppoe

    如果不是安裝GUI要自己裝

    安裝完後設定連線帳號密碼
    pppoe-setup
    ref:
    http://linux.vbird.org/linux_server/0130internet_connect.php#connect_adsl

    如果用
    Virtualbox,Network設定成Bridge Adapter

    如果要設定noip
    參考
    http://www.no-ip.com/support/guides/update_clients/setting_up_linux_update_client.html

    CentOS重新啟動網路

    /etc/init.d/network restart

    REF:
    http://linux.vbird.org/linux_server/0130internet_connect.php

    2012年7月24日 星期二

    XMLHttpRequest中IE cache問題解法


    req.setRequestHeader("If-Modified-Since","0"); //只要是以前的日期就可以
    req.setRequestHeader("Cache-Control","no-cache");

    2012年7月21日 星期六

    Relational Algebra中的complete set



    五個基本運算子Restriction、Project、Union、Product、Difference 所成的集合稱為完整集合

    此五種基本運算子無法由其他運算子所導出

    REF:
    http://goldensun.get.com.tw/exam/answer/94kp/PDF/K16.pdf

    (類別圖)Generalization關係具有繼承的意思

    http://zh.wikipedia.org/wiki/%E9%A1%9E%E5%88%A5%E5%9C%96#.E6.A6.82.E6.8B.AC

    概括(Generalization),是指類別與類別之間的共通性,通常會具有繼承(inherit)的關係。 用實線和空心箭頭來表示。

    Sequence Diagram的Interaction Frame運算子

    http://en.wiktionary.org/wiki/Appendix:Glossary_of_Unified_Modeling_Language


    alt - multiple alternatives each with a Guard. Only one alternative can be true.
    opt - single alternative with a guard condition.
    par - each fragment is run in parallel.
    loop - the fragment iterates according to a guard condition.
    region - only one Thread can enter the fragment at a time.
    neg - an invalid interaction.
    ref - an interact defined in another diagram.
    sd - inclusion of a complete Sequence diagram in the fragment.

    Lock Granularity

    Lock Granularity(顆粒度)用以表示被鎖定資料之多寡
    顆粒度越大
    Concurrency(並行度)越低

    Write Ahead Log

    http://www.postgresql.org/docs/8.1/static/runtime-config-wal.html
    http://en.wikipedia.org/wiki/Write-ahead_logging

    修改項目前,先寫必要資訊到交易日誌中

    (類別圖) 控制類別Control Classes

    控制類別(Control Classes): 處理容易變動的企業規則及企業邏輯 在系統中扮演協調角色的類別。例如:控制選課流程的註冊。

    (WAS ND) startNode.sh路徑

    /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/startNode.sh log: /opt/IBM/WebSphere/AppServer/profiles/Dmgr01/logs/nodeagent/startServer.log

    (WAS ND)Managing application servers

    http://pic.dhe.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.doc%2Finfo%2Fae%2Fae%2Ftrun_svr_start.html

    2012年7月20日 星期五

    JavaServer Pages Standard Tag Library

    http://www.oracle.com/technetwork/java/index-jsp-135995.html

    http://tomcat.apache.org/taglibs/site/tutorial.html

    IE10 User Agent String Update

    http://blogs.msdn.com/b/ie/archive/2012/07/12/ie10-user-agent-string-update.aspx

    Hibernate Validator

    http://www.hibernate.org/subprojects/validator.html

    Hibernate Validator 4.x is the reference implementation for JSR 303 - Bean Validation

    DISABLE_JAVADUMP

    http://pic.dhe.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/trun_processdef.html

    In the administrative console, click
    Servers > Application servers > server_name > Java and Process Management > Process Definition > Custom Properties > New
    In the Name field enter
    DISABLE_JAVADUMP and in the Value field, enter true to prevent the application server from creating javacore dumps.

    SRVE0190E

    好像從WAS 6開始都要設定該參數
    應用程式伺服器 > 該伺服器名稱 > Web 儲存器 > 自訂內容 >
    新增: com.ibm.ws.webcontainer.invokefilterscompatibility = true
    Cluster架構要清空Dmgr下的temp目錄和節點server下的temp目錄
    非Cluster架構清空server下的temp目錄
    重啟server

    ref:
    http://ultrapan.blogspot.tw/2011/12/was61-struts2-error-404-srve0190e.html
    http://jackhe.iteye.com/blog/745719

    另個解法:
    設定servlet-mapping在web.xml

    2012年7月17日 星期二

    CentOS 6.2設定postgresql 筆記


    [root@localhost ~]# /etc/init.d/postgresql start

    /var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first.
                                                               [FAILED]

    [root@localhost ~]# service postgresql initdb
    Initializing database:                                     [  OK  ]

    設定參數檔
    [root@localhost data]# vi /var/lib/pgsql/data/postgresql.conf

    設定登入權限檔
    [root@localhost data]# vi /var/lib/pgsql/data/pg_hba.conf

    設定完再啟動
    [root@localhost ~]# /etc/init.d/postgresql start
    Starting postgresql service:                               [  OK  ]


    p.s.設定開機啟動
    chkconfig postgresql on

    Converting from other Databases to PostgreSQL

    http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL

    2012年7月15日 星期日

    Eclipse開啟intellisense

    Preferences --> Java --> Editor --> Content Assist

    Auto activation triggers for Java:改為.abcdefghijklmnopqrstuvwxyz(,

    Google Java Developer Tools

    https://developers.google.com/java-dev-tools/

    Guava: Google's core Java libraries

    http://code.google.com/p/guava-libraries/

    ref:
    Xtext
    http://www.eclipse.org/Xtext/

    Xtend
    http://www.eclipse.org/xtend/

    jQuery Selectors

    http://refcardz.dzone.com/refcardz/jquery-selectors#refcard-download-social-buttons-display

    Adobe Flash CS6匯出HTML5

    http://godpig.com/blog/?p=3326

     從Flash CS6看得出來,未來Flash會成為更全面的製作軟體,除了可以匯出成HTML5之外,還可以匯出成Android與iOS的APP 

    真是太神奇了~~~
    以為HTML 5出來FLASH就會死翹翹~~~@.@
    Adobe不是省油的燈~~~

    2012年7月14日 星期六

    Eclipse顯示行號(linenumber)

    General->Editors->Text Editors
    設定show line numbers

    eclipse增加highlight功能:eclipsecolorer

    Eclipse更新網址 :
    http://colorer.sf.net/eclipsecolorer/

    官方網站:
    http://colorer.sourceforge.net/eclipsecolorer/

    Run-Jetty-Run加DCEVM改程式免重啟

    Run Jetty Run:
    http://code.google.com/p/run-jetty-run/
    DCEVM:
    http://ssw.jku.at/dcevm/

    Run-Jetty-Run plug-in目前是由國內的TonyQ接手開發
    DCEVM是奧地利的Thomas Wuerthinger開發
    (現在好像是Oracle工程師 https://labs.oracle.com/people/wuerthinger)
    小弟我也是聽了TonyQ的演講才知道有這兩個好物
    如果您的系統有用到xerces.jar,因為會和Jetty衝到,需要把您系統的xerces.jar移除掉
    否則AP啟動時會有以下錯誤訊息 java.lang.AbstractMethodError: org.apache.xerces.dom.DeferredDocumentImpl.set DocumentURI(Ljava/lang/String;)V
    找到一篇文章說也可以在JVM啟動時加以下參數(我沒試過)
    -Djavax.xml.parsers.DocumentBuilderFactory= com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
    ( http://blog.chenlb.com/2010/11/abstract-method-error-xerces.html )
    另外asm、cglib也要換成新的版本 ( http://tinyurl.com/7kntkdh )
    目前試的結果要用Debug As啟動才能hot-deploy
    google一下好像這種hotswap的技術好像只能用在JVM啟動時是debug mode?
    試了一下JAVA和JSP修改都不用重啟就可以看到結果
    如果Eclipse是搭配Tomcat去跑,Publishing要設定成Never publishing automatically
    另外,我本來把DCEVM裝在JDK 7失敗,改用JDK 6就OK,沒在試其他JDK 7
    DCEVM官方並不建議用在Production
    除了DCEVM外,有些人是用JRebel
    DCEVM是從VM層下手,JRebel是從ClassLoader下手,理論上DCEVM效能會比較好
    小弟我也沒用過JRebel,無法實際比較
    一點心得分享

    P.S.如果對DCEVM的運作原理了解更多,可以看以下討論串
    http://old.nabble.com/Enhanced-Class-Redefinition-JEP-td32152317.html

    java.lang.IncompatibleClassChangeError: net/sf/cglib/core/DebuggingClassWriter

    Initialization of bean failed; nested exception is java.lang.IncompatibleClassChangeError: net/sf/cglib/core/DebuggingClassWriter

    原本用cglib-3.0.jar
    換成cglib-2.2.2.jar就OK了

    Bytecode Outline plugin

    http://asm.ow2.org/eclipse/index.html

    Bytecode Outline plugin shows disassembled bytecode of current Java editor or class file, allows bytecode compare for Java/class files and shows ASMifier code for current bytecode.



    The Bytecode Outline plugin can be installed from the Eclipse Update Manager with the ObjectWeb Eclipse Update Site http://download.forge.objectweb.org/eclipse-update/
    Alternatively, the plugin can be downloaded from the ObjectWeb Forge site, and manually installed in the Eclipse plugins directory.

    JSPG0289E

    錯誤訊息: JSPG0289E: XML 前文 (UTF-8) 所指定的頁面編碼與 jsp-property-group (utf-8) 所指定者不同

    Page-encoding specified in XML prolog (UTF-8) is different from that specified in page directive(utf-8)

    解決方式:
    聽說是WAS 7後會強制JSP中指定的編碼要和HTML指定的編碼要一致(包含大小寫)
    改成一致就會ok

    64-bit HotSpot VM的UseCompressedOops

    Java 6 Update 18之後的HotSpot VM版本會根據Java heap最大值設定自動決定是否開啟-XX:+UseCompressedOops。Java heap最大值大約在25 GB以下所得的性能最好

    2012年7月12日 星期四

    db2move筆記

    1.export和import可以不同db2版本
    2.不用重新CREATE INDEX
    3.要重新CREATE SEQUENCE
    4.
    重新CREATE VIEW

    2012年7月11日 星期三

    Java SE 6 Javadoc and Source

    http://javasourcecode.org/html/open-source/jdk/jdk-6u23/

    BufferedWriter default buffer size

    http://developer.classpath.org/doc/java/io/BufferedWriter.html
    default buffer size of 8192 chars.


    http://developer.classpath.org/doc/java/io/BufferedWriter-source.html
    private static final int DEFAULT_BUFFER_SIZE = 8192;
    
    
      91:   public BufferedWriter (Writer out)
      92:   {
      93:     this (out, DEFAULT_BUFFER_SIZE);
      94:   }
    
    
     104:   public BufferedWriter (Writer out, int size)
     105:   {
     106:     super(out.lock);
     107:     this.out = out;
     108:     this.buffer = new char[size];
     109:     this.count = 0;
     110:   }
    
    
    
    http://javasourcecode.org/html/open-source/jdk/jdk-6u23/java/io/BufferedWriter.java.html
    private static int defaultCharBufferSize = 8192;
    
    
        public BufferedWriter(Writer out) {
        this(out, defaultCharBufferSize);
        }
    
    
        public BufferedWriter(Writer out, int sz) {
        super(out);
        if (sz <= 0)
            throw new IllegalArgumentException("Buffer size <= 0");
        this.out = out;
        cb = new char[sz];
        nChars = sz;
        nextChar = 0;
    
        lineSeparator = (String) java.security.AccessController.doPrivileged(
                   new sun.security.action.GetPropertyAction("line.separator"));
        }
    
    



    GNU Classpath Documentation

    http://developer.classpath.org/doc/

    Tuning Java I/O Performance

    http://java.sun.com/developer/technicalArticles/Programming/PerfTuning/


    For a 1 MB input file, the execution times in seconds of the programs are:
     intro1    6.9
     intro2    0.9
     intro3    0.4
    
    
    

    Buffering

    Approaches 2 and 3 use the technique of buffering, where large chunks of a file are read from disk, and then accessed a byte or character at a time. Buffering is a basic and important technique for speeding I/O, and several Java classes support buffering (BufferedInputStream for bytes, BufferedReader for characters).
    
    
    
    
    
    
    int len = (int)(new File(args[0]).length());byte buf[] = new byte[len];
    This approach is convenient, in that a file can be treated as an array of 
    bytes. But there's an obvious problem of possibly not having enough memory to 
    read in a very large file. 

    2012年7月9日 星期一

    Project Serengeti

    rapid deployment of an Apache Hadoop cluster (VMware vSphere)
    http://serengeti.cloudfoundry.com

    jQuery in Action Source code

    http://www.manning.com/bibeault2/

    2012年7月8日 星期日

    AmaterasERD

    http://amateras.sourceforge.jp/cgi-bin/fswiki_en/wiki.cgi?page=AmaterasERD

    AmaterasUML

    http://amateras.sourceforge.jp/cgi-bin/fswiki_en/wiki.cgi?page=AmaterasUML

    Clustering in GlassFish Version 3.1

    http://glassfish.java.net/public/clustering31.html

    ECMAScript 5 compatibility table

    http://kangax.github.com/es5-compat-table/

    ECMAScript 6 compatibility table:
    http://kangax.github.com/es5-compat-table/es6/

    JDOQL

    JDOQL是JDO資料庫查詢語言標準

    javax.jdo.Query
    Query類別是JDO中專門用來查詢的類別,可由PersistenceManager的newQuery方法產生

    利用Query的execute方法進行查詢

    Query的setResult方法,可限定欲取得的屬性以字串方式傳入

    Query的setFilter方法,將原本在WHERE語法後的篩選字串轉入,再呼叫execute方法

    Query的declareParameters方法,訂定參數的資料型態

    Query的setOrdering方法,可指定查詢結果的排序方式,ascending是升幕,descending為降

    ref:
    http://db.apache.org/jdo/api20/apidocs/javax/jdo/Query.html

    Google Plugin for Eclipse


    Eclipse 4.2 (Juno)
    http://dl.google.com/eclipse/plugin/4.2

    Eclipse 3.7 (Indigo)
    http://dl.google.com/eclipse/plugin/3.7

    Eclipse 3.6 (Helios)
    http://dl.google.com/eclipse/plugin/3.6

    Eclipse 3.5 (Galileo)
    http://dl.google.com/eclipse/plugin/3.5

    ref:

    https://developers.google.com/eclipse/docs/download?hl=zh-TW

    ADT (Android Development Tools plugin)安裝網址

    https://dl-ssl.google.com/android/eclipse/

    2012年7月5日 星期四

    2012年7月4日 星期三

    top 10 most active and update tables in db2 udb database

    http://database.ittoolbox.com/groups/technical-functional/db2-l/how-to-grep-top-10-most-active-and-update-tables-in-db2-udb-database-4100480


    select substr(abc.tabname,1,40) as TABNAME,abc.rows_written as rowswritten
    from SYSIBMADM.snaptab abc
    order by abc.rows_written desc fetch first 10 rows only; 

    2012年7月2日 星期一

    日誌空間大小

    db2日誌空間大小由3個參數控制:logprimary、logsecond、logfilsiz
    誌空間的最大限制是 ( logprimary + logsecond) * logfilsiz *4Klogprimary + logsecond不能超過255誌空間大小不能超過256 GB

    2012年7月1日 星期日

    XenServer 6.0.2 免費版安裝心得

    沒有限制東限制西
    用500GB的硬碟14G RAM的機器安裝都抓得到並可以使用
    也有Live Migration
    管理端工具XenCenter在安裝光碟下的client_install資料夾可以找到
    雖然是免費的,但是還是得安裝授權(license.xslic),否則好像只能用30天

    免費License一年起算點是申請日(不是安裝日)

    2013/03/05 Update
    試了2 TB和3 TB組LVM是ok的,只是470 GB不見了??待研究


    REF:
    http://www.runpc.com.tw/content/content.aspx?id=105335
    http://blog.chinaunix.net/uid-10019351-id-3044753.html
    http://fawzi.wordpress.com/2011/04/16/vsphere-vs-hyper-v-vs-xenserver/
    http://blog.tenyi.com/2011/07/xenserver.html

    XenServer 6.0.2安裝CentOS 6.2 GUI

    不要選CentOS 6.0的Template (XenServer 6.0.2沒有CentOS 6.2的Template)
    要選Other install media

    2012年6月30日 星期六

    Todo - PostgreSQL wiki

    http://wiki.postgresql.org/wiki/Todo

    Frequently Asked Questions About the Java HotSpot VM

    http://www.oracle.com/technetwork/java/hotspotfaq-138619.html#gc_oom

    32-Bit VS 64-Bit JVM


    How To Choose 32-Bit or 64-Bit JVM
    http://www.techpaste.com/2012/02/choose-32-bit-64-bit-jvm/

    Default JVM settings GC, JIT and Java Heap Sizes -Xms & -Xmx on different operating systems
    http://www.techpaste.com/2012/02/default-jvm-settings-gc-jit-java-heap-sizes-xms-xmx-operating-systems/

    Is a JVM's Maximum Heap Size really 1.7 GB?
    http://pauldone.blogspot.tw/2008/08/is-jvms-maximum-heap-size-really-17-gb.html

    REF:
    java - Benefits/drawbacks to running 64-bit JVM on 64-bit Linux server? - Stack Overflow
    http://stackoverflow.com/questions/559433/benefits-drawbacks-to-running-64-bit-jvm-on-64-bit-linux-server

    Opensource Licenses by Name

    http://www.opensource.org/licenses/alphabetical

    WAS 7之後支援compressed reference

    http://www.ibm.com/developerworks/cn/websphere/library/techarticles/0809_alcott/0809_alcott.html

    WebSphere Application Server V7 中的新特性

    IBM 的 Java SE 6 中的另一个改进是在 64 位 WebSphere Application Server JVM 中使用
    压缩引用 (compressed reference)(或指针压缩)。与以前的 32 位 JVM 相比,使用压缩引用可以非常显著地减少 64 位 JVM 的进程内存占用空间。在 IBM 推出 Java SE 6 实现以前,64 位堆的大小为等效的 32 位堆的 1.7 至 2 倍的情况并不鲜见。


    IBM JVM:
     -Xcompressedrefs

    Oracle JVM:
    -XX:+UseCompressedOops

    Use -Xcompressedrefs in any of these situations:

    • When your Java applications does not need more than a 25 GB Java heap.
    • When your application uses a lot of native memory and needs the JVM to run in a small footprint.

    REF:
    http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/index.jsp?topic=%2Fcom.ibm.java.doc.diagnostics.60%2Fdiag%2Funderstanding%2Fmm_compressed_references.html

    http://www.slideserve.com/adamdaniel/improving-64-bit-java-performance-using-compressed-references

    16款為Web開發者推薦的Chrome實用外掛

    http://inspire.twgg.org/c/programming/dev-tools/16-of-chrome-for-web-developers-recommend-practical-plug-in.html

    Javascript 物件導向式程式設計基礎講解

    http://inspire.twgg.org/c/programming/javascript/javascript-based-object-oriented-programming-explained.html

    2012年6月27日 星期三

    Mozilla Developer Network

    https://developer.mozilla.org

    Java Servlet Technology

    http://www.oracle.com/technetwork/java/javaee/servlet/index.html

    JavaServer Pages Technology

    http://www.oracle.com/technetwork/java/javaee/jsp/index.html

    Java SE Technologies - Database

    http://www.oracle.com/technetwork/java/javase/tech/index-jsp-136101.html

    Java Technology Case Studies

    http://java.sun.com/reference/casestudies/index.html

    Oracle Technology Network for Java Developers

    http://www.oracle.com/technetwork/java/index.html

    MySQL Documentation: MySQL Reference Manuals

    http://dev.mysql.com/doc/

    WebSphere Application Server BETA Information Centers

    http://pic.dhe.ibm.com/infocenter/wasinfo/beta/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/rweb_webxf.html

    Windows Internet Explorer API reference

    http://msdn.microsoft.com/en-us/library/ie/hh828809(v=vs.85).aspx

    Document Object Model Core



    2012年6月21日 星期四

    Regex Tester

    http://regexpal.com

    State Diagram的狀態移轉

    http://www.developer.com/design/article.php/2238131/State-Diagram-in-UML.htm

    Transition: An arrow indicating the Object to transition from one state to the other. The actual trigger event and action causing the transition are written beside the arrow, separated by a slash. Transitions that occur because the state completed an activity are called "triggerless" transitions.

    事件產生後且條件滿足 => 執行Action讓狀態移轉

    2012年6月13日 星期三

    else if有return值就變成if

    剛剛發現else if有return值編譯器好像會自動改成if
    如果沒有return值decompile還是else if
    試了兩個版本的Sun JDK都一樣

    2012年4月15日 星期日

    ibmdefaultbp

    db2預設的bufferpool,預設的pagesize是4K

    DB2預設的Codeset

    V9.5之前:不指定是根據系統的Locale
    V9.5之後(含V9.5):UTF-8

    p.s.1.UTF-8的Codepage是1208;BIG5的Codepage是950
    p.s.2.Database建立後無法更改Codeset
    p.s.3.Group分為single-byte ("S")、 double-byte ("D")和neutral ("N"),同Group的Codepage可以互相轉換。S及D可以轉為N;N不一定能轉成S及D。1208屬於N組;950是D組。

    DB2 Tablespace 大小限制

    V8:pagesize 32K => 256 GB
    V9:pagesize 32K => 16 TB

    2012年4月14日 星期六

    WebLogic 預設的Socket Reader

    3個
    1個執行輪詢功能,另2個用於處理請求
    Cluster架構可能會用到更多Socket Reader
    利用ThreadPoolPercentSocketReaders屬性控制

    2012年4月13日 星期五

    Jmap -dump

    C:\Users\Java>Jmap -dump:format=b,file=f1.dat 5364
    Dumping heap to C:\Users\Rex\f1.txt ...
    Heap dump file created

    -----
    5364是pid
    可以用jps查到
    用jhat去分析
    或用eclipse mat去分析

    WebLogic 10.3.1 升級到 Spring 2.5.6出錯

    WebLogic的RegistryDocumentBuilderFactory和JAVA的xml.parsers.DocumentBuilderFactory發生衝突

    解決方式:
    移掉wstx-asl-3.2.0.jar和xml-apis-1.0.b2.jar

    p.s.wls 10.3支援Spring 2.5.x
          wls 10.0支援Spring 2.0.x
          wls 9.2支援支援Spring 1.2.8、2.0.x、2.5.x

    2012年4月7日 星期六

    String的getBytes()

    原來沒指定引數是使用OS的CodePage去Encoding
    我們又沒有在log4j設定檔設定log編碼,怪不得我們的LOG沒辦法顯示難字
    log4j的設定檔可以在append區塊加入encoding為UTF-8
    用Notepad++打開LOG時編碼要選UTF-8

    p.s.1.
    可以使用-Dfile.encoding=UTF8設定JVM的encoding
    可以使用Charset.defaultCharset()去取得JVM的charset

    p.s.2.作業系統查看Code Page指令:
    Linux:locale
    Windows:chcp

    ref:
    http://www.360doc.com/content/08/1015/09/61497_1765862.shtml

    http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html#getBytes%28%29

    public byte[] getBytes()
    Encodes this String into a sequence of bytes using the platform's default charset, storing the result into a new byte array.



    The behavior of this method when this string cannot be encoded in the default charset is unspecified. The CharsetEncoder class should be used when more control over the encoding process is required.



    Returns:

    The resultant byte array

    Since:

    JDK1.1

    Tuning GlassFish for Production (The Aquarium)

    https://blogs.oracle.com/theaquarium/entry/tuning_glassfish_for_production

    2012年4月4日 星期三

    Application code page not determined, using ANSI codepage 950

    db2set DB2CODEPAGE=1208
    db2move dbname import

    2012年3月28日 星期三

    2012年3月18日 星期日

    java.lang.AbstractMethodError: org.apache.xerces.dom.DeferredDocumentImpl.

    java.lang.AbstractMethodError: org.apache.xerces.dom.DeferredDocumentImpl. setDocumentURI(Ljava/lang/String;)V


    http://docs.oracle.com/cd/E19501-01/819-7012/gcqyc/index.html


    砍掉xerces.jar就好了


    D:\jetty-6.1.26\lib\jsp-2.0\xercesImpl-2.6.2.jar
    \eclipse\plugins\org.apache.xerces_2.9.0.v201101211617.jar

    Run-Jetty-Run plug-in

    http://code.google.com/p/run-jetty-run/
    http://www.ptt.cc/bbs/Eclipse/M.1305776388.A.6CC.html


    去聽TonyQ演講介紹的
    他還分享一個好物DCEVM
    對Spring開發者來說方便許多
    改程式不用重開server才生效
    只是提到怎會有人在Server重開要10分鐘的環境工作??
    殘念...=.=...就混口飯吃...>"<
    Server重開要10分鐘的環境已經很幸福了
    更慘的是寫程式不到半小時,跑行政流程一個下午
    還要補些有的沒的程式說明文件
    誰會去看程式說明文件=.=,還不是直接看程式
    好個ISO...@.@

    2012年2月10日 星期五

    Maximum possible heap size and maximum recommended heap size (32-bit Java)

    http://publib.boulder.ibm.com/infocenter/javasdk/tools/index.jsp?topic=%2Fcom.ibm.java.doc.igaa%2F_1vg00014884d287-11c3fb28dae-7ff6_1001.html

    Platform Additional options Maximum heap size Recommended heap size limit Additional notes
    AIX None 3.25 GB 2.5 GB Maximum heap size is not required to be, but should ideally be, a multiple of 256 MB
    Linux None 2 GB 1.5 GB
    Hugemem Kernel 3 GB 2.5 GB
    Windows None 1.8 GB 1.5 GB
    /3GB 1.8 GB 1.8 GB

    2012年2月5日 星期日

    微軟免費資安軟體

    免費防毒軟體Microsoft Security Essentials(正版客戶才能使用):
    http://windows.microsoft.com/zh-TW/windows/products/security-essentials


    免費間諜軟體防護軟體Windows  Defender(正版客戶才能使用,盜版只移除「嚴重」威脅):
    http://www.microsoft.com/downloads/zh-tw/details.aspx?familyid=435bfce7-da2b-4a6a-afa4-f7f14e605a0d&displaylang=zh-tw
    p.s.Vista後內建在Windows,可到控制台,將檢視方式修改成圖示就可以看到


    免費間諜軟體防護軟體Windows Defender Offline版:
    http://windows.microsoft.com/en-US/windows/what-is-windows-defender-offline
    p.s.避免惡意程式開機就已經執行,可透過CD/DVD或USB開機執行掃描,類似的工具有Avira AntiVir Rescue SystemKaspersky Rescue DiskeScan Rescue Disk


    免費掃描電腦並移除病毒、間諜軟體和其他惡意軟體Microsoft Safety Scanner:
    http://www.microsoft.com/security/scanner/zh-tw/default.aspx
    p.s.自己覺得算是集大成的微軟免費工具軟體,可以掃毒和掃惡意程式,只是每次使用都要
    再下載安裝一次(更新定義檔,且此軟體不提供即時防護,可取代提供持續防護的防毒軟
    體程式),定期用Microsoft Safety Scanner和USB/CD開機工具程式掃描自己的電腦,用IE再搭配SmartScreenMcAfee SiteAdvisor,並定期Windows Update,防火牆不用的port就關掉,用來路不明的軟體或養小動物在VM環境使用,電腦重要資料存放在TrueCrypt加密空間,會對電腦防護比較安全些,當然極機密資料的電腦連網卡和USB/CD/DVD都封了吧!再加SmartCard登入,有些hacker會破解身分驗證軟體跳過身分驗證程序直接取得讀取資料的權限,那...那...那...就用兩套驗證機制,一套被破解還有另一關...@.@

    ref:
    http://www.microsoft.com/taiwan/security/Business-Ready-Security/Security-Chronicles/microsofts-new-windows-defender-tool-runs-outside-windows.aspx

    http://www.techsupportalert.com/content/best-free-microsoft-downloads.htm

    2012年2月3日 星期五

    『起始資料堆大小』(-Xms50m) 和『資料堆大小上限』 (-Xmx256m)

    如果WebSphere空白預設是 -Xms50m -Xmx256m (V8)
    修改後重啟server1,用ps -ef | grep server1可確認修改結果是否生效
    ref:
    兩個最重要的 GC 調校參數,分別是起始資料堆大小及資料堆大小上限。起始資料堆大小是指,JVM 啟動時,Java 資料堆一開始可以分配到的記憶體數目。i5/OS 的起始資料堆大小預設為 4 MB,新的 IBM WebSphere Application Server (WAS) 6.1 預設為 50 MB。
    資料堆大小上限是指,Java 資料堆可成長到多大。i5/OS 的資料堆大小上限預設為 2 GB,WAS 6.1 預設為 256 MB。以下幾種方法可變更資料堆大小上限:Xmx 參數、GCHMAX,或從 WAS 管理主控台,進入前述起始資料堆大小頁面。

    V5R4 隨附的 IBM Technology for Java 實作是 32 位元 Java,最多可處理 4 GB 的記憶體,由於部分要保留給作業系統及 JVM 實作使用,因此資料堆大小上限為 3328 MB (3.25 GB)。應用程式如使用原生程式碼、共享類別快取或記憶體對映檔,可能還需要額外的非 Java 資料堆記憶體,因此 Java 資料堆大小上限會降低。大部分 WAS 應用程式的實際限制約為 2500 MB。

    檢查 Java 或 WAS 的效能時,一定要檢查記憶體是否足以提供給 JVM,包括資料堆大小上限所需的記憶體,以及 JVM、Just In Time (JIT) 編譯器及其他原生程式碼所使用的額外記憶體。額外記憶體需求大小不等,可大致估為資料堆大小上限的四分之一。例如,若資料堆大小上限為 1 GB,則記憶體儲存區中至少要預留 1.25 GB 的記憶體。

    (AIX lastlog file) /etc/security/lastlog

    http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.files%2Fdoc%2Faixfiles%2Flastlog.htm

    CentOS 6安裝nawk

    http://pkgs.org/centos-6-rhel-6/epel-i386/nawk-20110810-2.el6.i686.rpm.html
    下載:
    http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm

    2012年2月1日 星期三

    Windows 7 向使用者顯示有關上次登入及登入失敗的資訊

    %SystemRoot%\system32\gpedit.msc /s


    ref:
    http://www.mobydisk.com/techres/securing_remote_desktop.html

    Windows 7 移除Administrators的遠端桌面權限


    移掉Administrators群組後,要記得將遠端桌面登入的帳號加入Remote Desktop Users群組

    keyword:
    allow logon through terminal services windows 7

    ref:
    http://www.mobydisk.com/techres/securing_remote_desktop.html

    WebSphere large-page support

    http://support.sas.com/documentation/configuration/serverinstallations/websphere/InstallInstructions913ws60.html

    Add the -Xlp Java option to the WebSphere generic JVM options. Perform these steps:

    1. In the WebSphere administrative console, select Servers Application servers -> . In this menu sequence, corresponds to the name of the WebSphere server that you are configuring.
    2. Select Java and Process Management -> Process Definition -> Java Virtual Machine.
    3. In the Generic JVM Argument field, add -Xlp. -Xlp enables large-page upport in Java.

    2012年1月30日 星期一

    (DB2錯誤訊息) EXP0022W

    EXP0022W  Index has no statistics.  The index "SYSIBM  "."SQL120118172349760" has not had runstats run on it.  This can lead to poor cardinality and predicate filtering estimates.


    http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=%2Fcom.ibm.db2.luw.admin.explain.doc%2Fdoc%2Fr0021347.html
    runstats 指令 (可以從 CLP 提示輸入) 可以提供不同的統計值層次,如下列語法中所示:
    基本統計值

    表格:
    RUNSTATS ON TABLE 表格名稱
    索引:
    RUNSTATS ON TABLE 表格名稱 FOR INDEXES ALL
    表格及索引:
    RUNSTATS ON TABLE 表格名稱 AND INDEXES ALL
    加強統計值

    表格:
    RUNSTATS ON TABLE 表格名稱 WITH DISTRIBUTION
    索引:
    RUNSTATS ON TABLE 表格名稱 FOR DETAILED INDEXES ALL
    表格及索引:
    RUNSTATS ON TABLE 表格名稱 WITH DISTRIBUTION AND DETAILED INDEXES ALL
    註: 在上述每一個指令中,表格名稱必須與綱目名稱一樣完整。

    (DB2,列出該Table所有的index) describe indexes FOR table

    db2 => describe indexes FOR table MyTableName

    索引                           索引               唯一         號碼      索引                       索引
    綱目                           名稱               規則         直欄      類型              分割
    ------------------------------- ------------------- -------------- -------------- --------------------------- --------------
    MyDBsCHEMA                        IDX_NO                   D                           1 RELATIONAL DATA                                                                 -
    SYSIBM                          SQL120118172349760  P                           4 RELATIONAL DATA                                                                 -

        已選取 2 個記錄。