2009年7月26日 星期日

世界文化遺產~日本白川鄉合掌村

最近造訪了名列世界文化遺產之林的合掌村,這裡保存著當地傳統鄉村的建築—「合掌造」。



由於這裡的冬天十分寒冷,在一年當中有三個月是大雪紛飛,所以設計成人字型如同兩手合掌般的傾斜屋頂就是為了防止沉重的大雪壓垮屋頂,因此,稱之為「合掌造」傳統家屋。



「合掌造」傳統家屋的屋頂是以人手方式用茅草覆蓋而成,包括房屋結構部分都不使用一根釘。雖然頂覆茅草的「合掌造」傳統家屋堅固實用,對於火卻十分脆弱,因此,除了徹底落實「嚴禁煙火」的管制措施外,在這村落中到處可看到許多的消防栓和噴水槍設備。



由於登錄「世界文化遺產」而讓合掌村聲名大噪,使得原本隱密如世外桃源的山村需面對的觀光化的衝擊,雖然現有超過10間的民宿、旅館和多間的土產店、餐廳,還有收費供人參觀的老住宅等等,但是,合掌村的村民們卻在在傳統與現代間找到完美的平衡點。

Read more...

2009年5月13日 星期三

七星山踏青

七星山是台北市境內最高的山脈,主峰的高度是海拔1120公尺,其中七星山步道是國家公園內最熱門的登山步道之一,而在這步道兩旁有許多台灣原生的物種與解說牌,因此來登山步道除了可健身外,亦可吸取大自然的芬多精,真是一舉數得!

乾淨、清新與涼爽的七星山步道



可仰望七星山主峰的七星公園


可遠眺綠山、藍天與白雲

Read more...

2009年4月23日 星期四

How to Recover from Reduced Functionality Mode (RFM) in Vista

當你使用的Vista系統超過30天未完成啟動程序,而進入精簡功能模式(RFM)時,可以用以下指令來重新取得另外30天之初始限定期。

Microsoft allows you to install and use Windows Vista for evaluation without license or product key for up to 30 days. Within these 30 days, you must activate the Vista system with a valid product key. Else, if you forget to activate your computer, or you’re using illegal and pirated product key, Windows Vista will go into Reduced Functionality Mode (RFM), where you basically can no longer use the system for productivity works until you successfully activate Vista with a licensed product key.

Windows Activation

Activate Windows Now

Your activation period has expired and Windows is no longer working.
To use Windows you must activate this copy of Windows.

If you’re still not yet ready to activate your copy of Vista and want to further extend the activation period another 30 days, and also want to exit or recover from Reduced Functionality Mode so that you can continue using Vista without reinstalling, here’s a simple hack to crack the RFM. The trick is made possible by Microsoft which still allow users to use Internet Explorer in RFM (probably do so so that you will can buy a license online), which can be used to break out of Reduced Functionality mode by running an explorer interface to open an administrative level command prompt and run the commands required to reset your activation period and recover use of your computer and desktop.

This crack RFM trick is simplified from previous recover from RFM guide to make it easier to understand.

1. On the Windows Activation - Activate Windows Now screen shown above, click on Access your computer with reduced functionality option.

2. Once the Internet Explorer loads, click on File on menu bar and then select Open on the pull-down menu.

3. On the Open dialog window, type in C:\Windows\Explorer.exe and then click OK.

4.Click OK button on “IE needs to open a new window to open this webpage” confirmation prompt.

5.Click Run button on “File Download - Security Warning” dialog prompt.

6.Click on Run button on “File Download - Security Warning” warning dialog related to unknown and not verified publisher.

7. User shell will load, and the desktop, taskbar, start menu and etc will be restored.

8. The computer has recovered from Reduced Functionality for this session. To permanently stop RFM to happen again, Vista has to be rearmed.

9. Click on the Start button.

10. Type Cmd in Start Search box.

11. A program shortcut will show up in the Start panel search results. Right click on the shortcut and select Run as Administrator.

12. In the Command Prompt window, type in the following command and then hit Enter:



slmgr.vbs -rearm


13. Restart computer.

Reference: nirvick.blogspot.com

Read more...

2009年4月16日 星期四

Spring Transaction

下面是在Spring 2 + Hibernate 3 + MySQL 5架構中使用無Transaction的設定檔(XML)



<bean id="individualMgnt" class="component.IndividualMgnt">
<property name="individualDao" ref="individualDao"/>
<property name="individualPartyDao" ref="individualPartyDao"/>
<property name="locationDao" ref="locationDao"/>
<property name="partyDao" ref="partyDao"/>
<property name="roleDao" ref="roleDao"/>
</bean>



下面是在Spring 2 + Hibernate 3 + MySQL 5架構中使用Spring Transaction的設定檔(XML)


<bean id="individualMgnt"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="target">
<bean class="component.IndividualMgnt">
<property name="individualDao" ref="individualDao"/>
<property name="individualPartyDao" ref="individualPartyDao"/>
<property name="locationDao" ref="locationDao"/>
<property name="partyDao" ref="partyDao"/>
<property name="roleDao" ref="roleDao"/>
</bean>
</property>
<property name="transactionAttributes">
<props>
<prop key="find*">
PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED, timeout_30, readOnly
</prop>
<prop key="add*">
PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED, timeout_-1, -MyException
</prop>
<prop key="remove*">
PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED, timeout_-1, -MyException
</prop>
</props>
</property>
</bean>

Read more...

2009年4月15日 星期三

好用的HTML轉碼小工具

經常在部落格中放置程式碼或是XML設定檔的人一定會發現,有些特殊字元要先行轉換成特殊編碼,瀏覽器才能正確顯示,這時就要感謝這CENTRICLE.COM網站,它提供了一個好用的小工具協助我們編寫HTML文件。

Read more...

2009年2月21日 星期六

在Spring 2 + Hibernate 3架構中以datasource方式使用Proxool 0.9 RC3的Connection Pool

下面是在Spring 2 + Hibernate 3 + MySQL 5架構中以datasource方式使用Proxool 0.9 RC3的Connection Pool的設定檔(XML)



<bean id="dataSource" class="org.logicalcobwebs.proxool.ProxoolDataSource">
<property name="alias"><value>mysql</value></property>
<property name="driver"><value>com.mysql.jdbc.Driver</value></property>
<property name="driverUrl"><value>jdbc:mysql://localhost:3306/extreme?user=root&amp;password=123456</value></property>
<property name="user"><value>root</value></property>
<property name="password"><value>tsaijs</value></property>
<property name="houseKeepingSleepTime"><value>5000</value></property>
<property name="houseKeepingTestSql"><value>SELECT CURRENT_DATE</value></property>
<property name="maximumConnectionCount"><value>20</value></property>
<property name="minimumConnectionCount"><value>1</value></property>
<property name="simultaneousBuildThrottle"><value>30</value></property>
<property name="trace"><value>true</value></property>
<property name="verbose"><value>true</value></property>
</bean>

Read more...

2008年12月18日 星期四

設定 IIS 6.0 的 HTTPS 服務

若要在用戶端電腦和伺服器之間使用安全的通訊通道來交換資訊時,就必須啟用 Secure Sockets Layer (SSL) 功能。本文將說明如何在 Internet Information Services (IIS) 6.0 中設定 SSL / HTTPS 服務。

1. 從 IIS 網站伺服器中產生憑証申請要求
在【目錄安全設定】選項中點擊【伺服器憑證】按鈕,【下一步】,【建立新憑證】,【現在準備憑證請求】,【下一步】,輸入【名稱】,輸入【單位】和【部門】,輸入【公用名稱】,選擇【國家】並且輸入【省】和【市縣】並【下一步】,【下一步】,【下一步】,【完成】,最後儲存在 C:\certraq.txt 。

2. 準備 OpenSSL 工作環境
把 OpenSSL v0.9.8i (編譯後的 Win32 版本)安裝至系統中,在 bin 目錄下建立目錄 demoCA,在 demoCA 下建立 private 和 newcerts 目錄,並新建 index.txt,如果沒有 serial 檔案,則到OpenSSL 網站上下載 openssl 的源檔案,解壓後,到 apps\demoCA 下,拷貝 serial 檔案過來,兩個目錄兩個檔案都放到新建的 demoCA 下。

3. 使用 OpenSSL 建立專有憑證中心的私有金鑰與簽證檔



C:\OpenSSL\bin>openssl req -x509 -newkey rsa:1024 -keyout cakey.pem -out cacert.pem -days 3650 -config openssl.cfg
WARNING: can't open config file: openssl.cnf
Loading 'screen' into random state - done
Generating a 1024 bit RSA private key
...............++++++
..++++++
writing new private key to 'cakey.pem'
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
-----
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]:TW
State or Province Name (full name) [Some-State]:TAIWAN
Locality Name (eg, city) []:TAIPEI
Organization Name (eg, company) [Internet Widgits Pty Ltd]:COMPANY
Organizational Unit Name (eg, section) []:UNIT
Common Name (eg, YOUR name) []:NAME
Email Address []:email@hinet.net


這時候會產生 CA 的私有金鑰 (cakey.pem) 與 CA 的簽證檔 (cacert.pem) 兩檔案,再將 cakey.pem 拷貝到 \demoCA\private 目錄下,把 cacert.pem 拷貝到 \demoCA 目錄下。

4. 使用 CA 簽證檔 (cacert.pem) 為 IIS 的憑証申請要求 (certreq.txt) 簽發憑証


C:\OpenSSL\bin>openssl ca -in certreq.txt -out server.pem -config openssl.cfg
WARNING: can't open config file: openssl.cnf
Using configuration from openssl.cfg
Loading 'screen' into random state - done
Enter pass phrase for ./demoCA/private/cakey.pem:
Check that the request matches the signature
Signature ok
Certificate Details:
Serial Number: 286 (0x11e)
Validity
Not Before: Dec 9 05:24:00 2008 GMT
Not After : Dec 9 05:24:00 2009 GMT
Subject:
countryName = TW
stateOrProvinceName = TAIWAN
organizationName = COMPANY
organizationalUnitName = UNIT
commonName = NAME
emailAddress = email@hinet.net
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
Netscape Comment:
OpenSSL Generated Certificate
X509v3 Subject Key Identifier:
94:C0:17:C7:CC:5B:9F:E7:80:08:CF:7B:38:F7:65:3D:EF:8F:41:13
X509v3 Authority Key Identifier:
keyid:5C:E3:71:BC:C1:22:87:24:58:E4:D0:07:65:3C:5B:39:B5:63:0C:23

Certificate is to be certified until Dec 9 05:24:00 2009 GMT (365 days)
Sign the certificate? [y/n]:y

1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated

C:\OpenSSL\bin>



5. 把剛剛產生的 server.pem 轉換成 x509 格式


openssl x509 -in server.pem -out server.cer


然後將 server.cer 搬移至 C 碟的根目錄下 (C:\server.cer)。

6. 在 IIS 上安裝憑證 (server.cer)
在有憑證要求的網站上按一下滑鼠右鍵,點擊【內容】,點擊【目錄安全設定】索引標籤,點擊【伺服器憑證】按鈕,點擊【下一步】,點選【處理擱置要求及安裝憑證】,再點擊【下一步】,輸入CA回應之「憑證授權的檔案」的路徑與名稱,選取C碟的憑證即可 (C:\server.cer),點擊【下一步】,輸入網站使用的SSL連接埠,可採預設值443即可,【下一步】,【完成】,【確定】。

Read more...

  © Blogger template Spain by Ourblogtemplates.com 2008

Back to TOP