http://blog.miniasp.com/post/2012/07/30/CentOS-63-Minimal-Installation-and-Configuration-Notes.aspx
寫得超完善的
2012年7月31日 星期二
2012年7月30日 星期一
敗了一台WD My Book Essential 2TB
在Pxhome敗了一台WD My Book Essential 2TB (WDBACW0020HBK-SESN)
設定密碼後會有個虛擬光碟,要需入密碼才會有硬碟槽出現
沒有安裝光碟,程式都在硬碟內
插頭要自己換成台灣的頭(有內附)
目前用起來都還ok
btw...之前買過biostore的指紋隨身碟也是虛擬成光碟
那時還不知道有TrueCrypt
TrueCrypt可以免安裝
還不如用TrueCrypt加上一般隨身碟
指紋辨識率不高 , 最後都是打密碼@.@
而且國外有hacker破解過加密隨身碟的身份驗證軟體
有密碼跟沒密碼一樣
保險點還是自己多加密一次
設定密碼後會有個虛擬光碟,要需入密碼才會有硬碟槽出現
沒有安裝光碟,程式都在硬碟內
插頭要自己換成台灣的頭(有內附)
目前用起來都還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
換了電腦和網路線都一樣,換了分享器就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日 星期日
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就不熟了=.=
一直要的結果有問題,本來以為是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安裝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
如果不是安裝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
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)的關係。 用實線和空心箭頭來表示。
概括(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.
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.
(WAS ND) startNode.sh路徑
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/startNode.sh
log:
/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/logs/nodeagent/startServer.log
2012年7月20日 星期五
Hibernate Validator
http://www.hibernate.org/subprojects/validator.html
Hibernate Validator 4.x is the reference implementation for JSR 303 - Bean Validation
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.
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
應用程式伺服器 > 該伺服器名稱 > 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
p.s.設定開機啟動
[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
2012年7月15日 星期日
Eclipse開啟intellisense
Preferences --> Java --> Editor --> Content Assist
Auto activation triggers for Java:改為.abcdefghijklmnopqrstuvwxyz(,
Auto activation triggers for Java:改為.abcdefghijklmnopqrstuvwxyz(,
Adobe Flash CS6匯出HTML5
http://godpig.com/blog/?p=3326
真是太神奇了~~~
以為HTML 5出來FLASH就會死翹翹~~~@.@
Adobe不是省油的燈~~~
從Flash CS6看得出來,未來Flash會成為更全面的製作軟體,除了可以匯出成HTML5之外,還可以匯出成Android與iOS的APP
真是太神奇了~~~
以為HTML 5出來FLASH就會死翹翹~~~@.@
Adobe不是省油的燈~~~
2012年7月14日 星期六
eclipse增加highlight功能:eclipsecolorer
Eclipse更新網址
:
http://colorer.sf.net/eclipsecolorer/
官方網站:
http://colorer.sourceforge.net/eclipsecolorer/
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
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了
原本用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.
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.
64-bit HotSpot VM的UseCompressedOops
Java 6 Update 18之後的HotSpot VM版本會根據Java heap最大值的設定自動決定是否開啟-XX:+UseCompressedOops。Java heap的最大值大約在25 GB以下所得的性能最好。
2012年7月12日 星期四
2012年7月11日 星期三
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
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.htmlprivate 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")); }
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:
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月10日 星期二
2012年7月9日 星期一
2012年7月8日 星期日
ECMAScript 5 compatibility table
http://kangax.github.com/es5-compat-table/
ECMAScript 6 compatibility table:
http://kangax.github.com/es5-compat-table/es6/
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
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
2012年7月7日 星期六
Expecting a stackmap frame at branch target
不能用JDK 7
要調eclipse的compiler compliance level為1.6就正常
ref:
http://stackoverflow.com/questions/8958267/java-lang-verifyerror-expecting-a-stackmap-frame
https://productforums.google.com/forum/#!msg/apps/GCwVC-Vizpk/7KT5qna4pU4J
要調eclipse的compiler compliance level為1.6就正常
ref:
http://stackoverflow.com/questions/8958267/java-lang-verifyerror-expecting-a-stackmap-frame
https://productforums.google.com/forum/#!msg/apps/GCwVC-Vizpk/7KT5qna4pU4J
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;
from SYSIBMADM.snaptab abc
order by abc.rows_written desc fetch first 10 rows only;
2012年7月2日 星期一
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
用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
要選Other install media
訂閱:
文章 (Atom)