2013年11月25日 星期一

在在Eclipse Editor中切換大小寫

Lower case: CTRL+SHIFT+Y

Upper case: CTRL+SHIFT+X

2013年11月5日 星期二

找出符合某些條件的檔案,加以刪除

找出/tmp下,建立時間超過30天,由dsas這個user所建,而且是SAS開頭的檔案,把它刪除掉。
find /tmp -type f -name 'SAS*' -user dsas -ctime +30 -print -exec rm -f '{}' \;

2013年9月17日 星期二

Changing SQL Server collation to case insensitive from case sensitive

Check if the database is case insensitive:
select 1 where 'sql' = 'SQL' ;
If it returns 1, it is a case insensitive database

Alter to case insensitive:
ALTER DATABASE MyDatabase COLLATE Chinese_Taiwan_Stroke_CI_AS

Alter to case sensitive:
ALTER DATABASE MyDatabase COLLATE Chinese_Taiwan_Stroke_CS_AS

http://stackoverflow.com/questions/3296428/changing-sql-server-collation-to-case-insensitive-from-case-sensitive

2013年8月25日 星期日

從別的Table複製資料及欄位到新Table

Oracle寫法
create table  Table_New as select * from  Table_Old

SQL Server寫法
select   *   into   Table_New    from   Table_Old

2013年3月11日 星期一

crontab

Crontab command:
crontab –e

Crontab syntax:
A crontab file has five fields for specifying day , date and time followed by the command to be run at that interval.

*     *   *  *   *  command to be executed

-     -    -   -  -

|     |     |   |    |

|     |     |   |    +----- day of week (0 - 6) (Sunday=0)

|     |     |   +------- month (1 - 12)

|     |     +--------- day of month (1 - 31)

|     +----------- hour (0 - 23)

+------------- min (0 - 59)

* in the value field above means all legal values as in braces for that column.
The value column can have a * or a list of elements separated by commas. An element is either a number in the ranges shown above or two numbers in the range separated by a hyphen (meaning an inclusive range).
Notes
A. ) Repeat pattern like /2 for every 2 minutes or /10 for every 10 minutes is not supported by all operating systems. If you try to use it and crontab complains it is probably not supported.

B.) The specification of days can be made in two fields: month day and weekday. If both are specified in an entry, they are cumulative meaning both of the entries will get executed .

Crontab Example:
A line in crontab file like below removes the tmp files from /home/someuser/tmp each day at 6:30 PM.

30     18     *     *     *         rm /home/someuser/tmp/*

http://www.adminschoice.com/crontab-quick-reference

2013年1月13日 星期日

刪除skype訊息記錄

主視窗上點選"檔案">>"隱私"
跳出之對話框右邊點選"顯示進階選項"
"保存即時訊息紀錄時間"
選擇"無紀錄"每次登出後即刪除記錄
按一下"刪除記錄"刪除在這之前的紀錄
在 通話記錄 欄內
可以刪除
可以刪除單一記錄
也可以刪除多筆或特定對象的記錄(用 Ctrl 按著)

2012年11月18日 星期日

Tomcat 6 SSL

1. 產生keystore
C:\SSS\tomcat-6.0.36-x64\ssl>keytool -genkey -alias tomcat -keyalg RSA -keystore C:/SSS/tomcat-6.0.36-x64/ssl/server.keystore -validity 365
輸入 keystore 密碼:
重新輸入新密碼:
您的名字與姓氏為何?
  [Unknown]:  sign flow
您的編制單位名稱為何?
  [Unknown]:  it
您的組織名稱為何?
  [Unknown]:  ccc
您所在的城市或地區名稱為何?
  [Unknown]:  taipei
您所在的州及省份名稱為何?
  [Unknown]:  taiwan
該單位的二字國碼為何
  [Unknown]:  tw
CN=sign flow, OU=it, O=ccc, L=taipei, ST=taiwan, C=tw 正確嗎?
  [否]:  y
輸入 <tomcat> 的主密碼
        (RETURN 如果和 keystore 密碼相同):
C:\SSS\tomcat-6.0.36-x64\ssl>dir
磁碟區 C 中的磁碟是 System
磁碟區序號:  FEAC-AB27
C:\SSS\tomcat-6.0.36-x64\ssl 的目錄
2012/11/19  下午 01:45    <DIR>          .
2012/11/19  下午 01:45    <DIR>          ..
2012/11/19  下午 01:45             1,337 server.keystore
               1 個檔案           1,337 位元組
               2 個目錄  30,926,913,536 位元組可用
2. 修改C:\SSS\tomcat-6.0.36-x64\conf\server.xml
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               keystoreFile="C:/SSS/tomcat-6.0.36-x64/ssl/server.keystore" keystorePass="changeit"
               clientAuth="false" sslProtocol="TLS" />
3. 重新啟動Tomcat,在網址列輸入https://localhost:8443
4. How to make IE8 trust a self-signed certificate in 20 irritating steps
http://stackoverflow.com/questions/681695/what-do-i-need-to-do-to-get-internet-explorer-8-to-accept-a-self-signed-certific

完整指令:
keytool -keystore server.jks -genkey -alias your.domain.name -keyalg RSA -dname "CN=%1,OU=IT,O=CMT,L=Taipei,S=Taiwan,C=TW" -keypass password -storepass password -validity 9999