Thursday 8 May 2008

Add shortcut arrow icons back!

Here's the reg file that you can just run it and restart your computer. After reboot, you will be able to see shorcut arrow back.

http://poyenliu.googlepages.com/IsShortcut.reg

Saturday 8 March 2008

Spring + Hibernate

There are some packages that will be missing if you just copy sample code from the book "Manning.Spring.in.Action.2nd.Edition" when working with hibernate template

NoClassDefFoundError: javax/transaction/TransactionManager
you need jta.jar from springframework folder "lib/j2ee"

NoClassDefFoundError:org.hibernate.cfg.AnnotationConfiguration

value hibernate.dialect property is from http://www.hibernate.org/hib_docs/v3/api/org/hibernate/dialect/package-summary.html
depends on the database you are using, find the proper one. I am using PostgreSQL, so the value will be "org.hibernate.dialect.PostgreSQLDialect"



Basically to run hibernate in spring framework
the jars listed below are the necessary ones

my spring framework folder is C:\spring-framework-2.5.1-with-dependencies\
I will use springfolder for now

  • NoClassDefFoundError: javax/transaction/TransactionManager
  • springfolder\lib\j2ee\jta.jar
  • NoClassDefFoundError: org/hibernate/cfg/AnnotationConfiguration
  • springfolder\lib\hibernate\hibernate-annotations.jar
  • NoClassDefFoundError: org/dom4j/DocumentException
  • springfolder\lib\hibernate\hibernate3.jar
  • NoClassDefFoundError:org/hibernate/annotations/common/reflection/ReflectionManager
  • springfolder\lib\hibernate\hibernate-commons-annotations.jar
  • NoClassDefFoundError:javax/persistence/JoinTable
  • springfolder\lib\j2ee\persistence.jar
  • NoClassDefFoundError: org/apache/commons/collections/LRUMap
  • springfolder\lib\jakarta-commons\commons-collections.jar

Setting PostgreSQL to SSL Enabled

Follow the steps below to set your PostgreSQL database to SSL enabled.

At the very begining, we have to determine the operating system that we are using, I don't know how to do in Linux or Unix because the OS I'm using is Windows.


1. Download Win32 OpenSSL program from Shining Light Productions

2. Install the exe file by clicking next, next ... next, done ( very basic way to install a program)

3. Open command prompt (cmd.exe) and go to your Win32 OpenSSL installed folder (in default, C:\OpenSSL\bin)

4. type "openssl req -new -text -out server.req" and press enter

Loading 'screen' into random state - done
Generating a 1024 bit RSA private key
.................................................................................++++++.............................++++++
writing new private key to 'privkey.pem'
Enter PEM pass phrase: "ENTER PASSWORD" (example, "changeit")
Verifying - Enter PEM pass phrase:"REENTER PASSWORD" (example, "changeit")
-----You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]: Just Press Enter (leave it empty)
State or Province Name (full name) [Some-State]:(leave it empty)
Locality Name (eg, city) []:(leave it empty)
Organization Name (eg, company) [Internet Widgits Pty Ltd]:(leave it empty)
Organizational Unit Name (eg, section) []:(leave it empty)
Common Name (eg, YOUR name) []: your host name (lanf-blog.blogspot.com)
Email Address []:Just Press Enter (leave it empty)

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:(leave it empty)
An optional company name []:(leave it empty)

5. now that if you go back to openSSL instaled folder c:\openSSL\bin\ you will see "privkey.pem" and "server.req"

6. go back to command prompt and enter "openssl rsa -in privkey.pem -out server.key"
Enter pass phrase for privkey.pem: enter the password you entered from previous step (example, "changeit")
writing RSA key

7. now that you'll see "server.key" in your bin folder

8. Delete privkey.pem. (We delete this is because it's not needed anymore, if we leave it there, we then have to type our password everytime we restart our computer <-- not tested, I just deleted) 9. go back to command prompt and enter "openssl req -x509 -in server.req -text -key server.key -out server.crt" to create server.crt certificate

10. copy server.crt and server.key to your PostgreSQL data folder (int default, "C:\Program Files\PostgreSQL\8.2\data"

11. at the same folder mentioned from previous step, search for "#ssl" and change "#ssl = off" to "ssl = on" (delete "#" and change "off" to "on")

12. stop and start PostgreSQL server

13. done


to test if it's properly modified, we then open pgAdmin III (exists when installed PostgreSQL server in windows environment) and check the database property "Encryption" to see if the value is "SSL encrypted".



Some references
Mandarin SSL setting tutorial
Win32 OpenSSL Official Site
The PostgreSQL JDBC Interface reference
Other SSl setting tutorial (not used but kind of provides other details)

Wednesday 30 January 2008

Installing and Running Tomcat

  1. go to http://tomcat.apache.org/ and go to the download page of the version 4.1.36
  2. download the Binary distribution (Full distributions for JDK 1.2 or later) zip file
  3. unzip to c:\jakarta-tomacat-4.1.31
  4. set environmental path with variable "JAVA_HOME" and value "the java sdk path"

run "startup" to run tomcat
run "shutdown" to close tomcat

reference installation note:

Wednesday 2 January 2008

autorun.inf 病毒解決方法

這是我在網路上找到的方法來殺除kavo.exe 病毒 也是清除autorun.inf的辦法

將kavo.exe病毒完整消滅?簡單又快速的方法 Kavo_killer 3.1 by 張書維
http://tw.myblog.yahoo.com/shu-wei/article?mid=2



程式下載位置 (放置自已的googlepage空間)版本是3.1 2008/01/02 更新的唷
http://poyenliu.googlepages.com/kavo_killer_3.1.exe