跳到主要內容

發表文章

Import SSL certificate into JAVA keystore

 General speaking, when you want to apply SSL to web server, you will have below files in hand: private key for SSL certificate sign request  signed SSL certificate Root CA certificate  Intermediate CA certificate (optional) For importing a trusted certificate into JAVA keystore, I think create a new keystore and replace the original one seems like a good practice.  I believe you will know how to import Root CA and intermediate CA as trustcacerts into keystore. However, if you only import the signed SSL certificate without the private key, then the entry will treat as "TrustCertEntry" instead of a "PrivateKeyEntry". The tomcat server will start and listen to 443 but will refuse to serve connection. Therefore we need to use openssl to combine the signed SSL certificate and private key as PKCS12 format. Then import the PKCS12 format entry into the keystore. openssl pkcs12 -export -in FQDN.crt -inkey private-ssl.key -certfile  FQDN...

automation testing

我覺得 想想自動化測試-開始(一) 的論點很不錯.... 原則 1: 針對重點業務,進行回歸的自動化測試 原則 2 :針對穩定的業務(或接口),在環境比較穩定的情況,前期投入腳本開發,有利於減少後期維護成本 原則 3 :自動化測試主要是為了保證主要功能完整可用,而不是為了多發現缺陷 原則 4 :自動化測試並不能減少測試的人力成本,而是為了加快測試反饋,提升測試質量 原則 5 :不要對錄制回放抱有幻想了,可視化也不是一個好的想法 原則 6: 開發參與自動化測試,讓開發和測試融合在一起 什麼都想做,就什麼都做不好。 確保主功能沒問題,就可以釋放出人力在其他事情上, 也可以控制意外的損害範圍… 千萬不要期待 automation 可以發現新問題…

Antec 450W Neo ECO II

最近發現電腦常會不規則的自己重開機, 想說是不是三年前買的全漢金鈦極 AU-400 又掛了。 因為之前也是類似的情況,後來送修換過一次,用了一年多還算正常。 想說這次不買全漢的了,上網找了一下,最後挑了 Antec 450W Neo ECO II,想試看看新的 DC to DC 技術,還有全日系電容是不是可以撐久一點。 結果一上機,連開都開不起來,我的主板 GA-Z97X-SOC 內建的 error code 顯示是停在 64 ,有過電,但是黑螢幕。正常的話應該是要聽到逼一聲,然後出現 BIOS 畫面。 但是很奇怪,如果拔掉第二顆硬碟的電源只留 SSD 就又可以正常開機。 原本想說是不是第二顆硬碟有問題,只不過今早起來發現換 SSD 硬碟偵測不到...換回舊的 AU-400 接兩顆硬碟卻又可以正常開機 (但還不確定重開機的問題是不是還會發生),感覺很像 Antec 這顆 power 的 SATA 供電不太正常的樣子,只好打包退貨了...浪費了我快一整個下午....=_=....

VMware vCenter 6.0 Appliance and Flash Read Cache

這幾天玩了 vCenter 6.0 的 deploy,跟以前版本比較不一樣的是沒有直接提供 linux base 的 vCenter Server Appliance,而是要先找一台 Windows VM,mount 上 vCenter Server Appliance 的 iso 然後再用 Firefox 打開 iso 裡的 html 去做 deploy 和 upgrade。 關鍵字就是,要先用 VM mount iso 還有要用 Firefox 開。 另外還有試玩了一下 VMware Fash Read Cache。 這跟之前把 SSD storage 拿來當 host swap cache 用途不一樣 要透過 vSphere web client > ESXi host > Manage > Settings > Virtual Flash > Flash Read Cache Resource Management 來打開。 之前拿去當 host swap cache 的 SSD 是不能再拿來當 Flash Read Cache 的,所以如果之前有把 SSD 設定成 host swap cache 要先刪掉,這樣 SSD 才可以被 Flash Read Cache 使用。 Flash Read Cache 是依照 VM 的 Disk 來設定的,所以如果VM的 Disk 是由很多個小 Disk 組成的,那麼就要一個一個  Disk 去設定 cache 的大小。 還有 VM Hardware Version 要10 以上,不然即使透過 web client 去設定 VM disk device 也不會看到有 Virtual Flash Read Cache 的選項。 Fash Read Cache 拿來當 vCenter Appliance 或者 read loading 比較重的 VM application 可能有些幫助, 我是覺得比以前只能拿來當 host swap cache 有用一點點啦.....

Putty Terminal Setting for CentOS

一樣的 shell 和 putty 設定,但是 Debian 或者 Ubuntu 的 command line 下, Home / End 鍵正常,但是 CentOS 卻不能使用。 原來 CentOS 可以裝 ncurses-term 這個 package,這樣 terminal 就可以使用 putty-256color 。 Putty > Connection > Data > Terminal-type string > putty-256color screenrc 裡面則是不要再手動設定 terminal,這樣 Home / End 鍵在 command line 就可以正常使用啦~ Update: fix-typo... no dash between 256 and color...

Artistic Automatic Code Formatter

可以自動重排 C / C++ / Java / C# 的工具   Artistic 目前喜歡的參數… (~/.astylerc) --style=linux --indent=force-tab --pad-header --pad-oper Sublime AStyleFormatter Plugin 預設值是 --style=google --indent 是看 sublime 的設定 indent 其實比較喜歡 space=4,可是 team 裡好像是用 tab 比較多。我只是不能忍受 space 和 tab 在同一個檔案裡混用… 對於 bracket style / pad-oper 和 pad-header 則是有莫名的強迫症傾向…