2013年2月27日 星期三

Mac: How to enter filename directly in the File Open dialog

最近在使用sublime text 2 當我的編輯器,不過遇到最大的問題就是在打開檔案時,除了搜尋外,沒辦法直接輸入檔案路徑直接開啟檔案

後來測試以下,只找到下列組合技來開啟檔案

 

1.open file:   cmd+O

 

2.In file Open dialog: 開啟Goto folder

    cmd+shift+G:

3.直接貼上檔案路徑開啟檔案

2013年2月22日 星期五

2011 late MBP 無法寫入內建的SD card 問題 (read only)

最近買了一張32 GB SDHC card 來給2011 later MBP 做備份,但一直發現他都是指能唯讀,無法寫入,本來是懷疑

SD card本身的問題,但奇怪的是只要使用外接的讀卡機就一切正常讀取,後來發現其實只要把SD card上面的防寫

開關,切換到兩者中間,如下圖照片所視,就可以正常顯示寫入模式,看來是內建的讀卡機偵測寫入模式有問題,誤判了

Sd

2013年2月18日 星期一

ICD-10 testing

 ICD 10 testing 是我從下列的webinar文章上看到的名詞,想說怎麼都沒聽過這個名詞,在網路上查了一下,原來跟是國際衛生組織訂的規劃,想不到在美國資訊界也已經有相對應的規範在推行,反觀在台灣我好像還沒看到任何相關的討論在資訊界進行

 Test Data Strategies for ICD-10 Testing

ICD-10

Webinar: 新創字,意指透過網路進行的專題討論或演講

Webinar一字來自seminar,原意為學院中的討論課程,而透過網路舉行的專題討論或演講則稱為 webinar
可以說是,Web-based seminar 的簡寫

2013年2月7日 星期四

Fabric: 以python 寫的大量deployment tool

原始網站:http://docs.fabfile.org/en/1.5/

屬於python 一個module,安裝時可以透過easy_install 安裝

 

安裝

#easy_install fabric

 

####Example 1

#使用時,只要編寫一個檔案名稱叫做fabfile.py

#######################

from fabric.api import run

def host_type():

   run('uname -a')

######################

 

使用時,在console上使用命令列,fabric即會把你把指令送到要執行的server 位置

#fab -H xxx.xxx.xx   host_type

 

 

####Example 2

夠過env 執行指令在不同的環境上

##指令執行如下

#! fab sit rpm_query

#!fab dev rpm_query

 

### Example 3

#可以將要送出的command 直接使用 -- 'cat /etc/*-release'送出即可

fab -H 192.168.1.1  -- 'cat /etc/*-release'

##fabfile.py

from fabric.api import run,env

## disable ssh known hosts env.disable_known_hosts=True

env.user = 'root'

## For differrent environment

def sit(): wf=WFServer(DIR='/root/dbinst.pdg') print wf.get_all_ip_list() env.hosts=wf.get_all_ip_list()

def dev(): env.hosts=['xxx.xxx.xxx.xxx] def staging(): env.hosts=['xxx.xxx.xxx.xxx']

def host_type(): run('uname -a')

def rpm_query(): run('rpm -qa --queryformat "%{NAME} %{EPOCH}:%{VERSION} %{RELEASE} %{ARCH}\n" 2>/dev/null | sed -e \'s/(none)/0/g\'')

 

### Example 4:

如果要給於變數,使用方法為

意思是把variable 當parameter 傳入build 這個method

#!fab build:[variable]
 或指定變數名稱
#!fab build:name=value

進階篇

如果想在所有目錄執行fab command ,請修改下列的範例

把檔案存到 vim ~/.fabricrc

<code>

# Copy this file to ~/ and rename it .fabricrc
# See http://docs.fabfile.org/en/1.3.3/usage/fab.html
# and http://docs.fabfile.org/en/1.3.3/usage/env.html for more documentation.
 
# The location of the fabfile so fab can find it anywhere (fabfiles are usually
# stored in the relation to a "project").
fabfile=~/bin/goodold-bin/fabric/fabfile.py
 
# The directory where projects are stored. Defaults to $PROJECTS_DIR if set in
# your bash profile or "~/Projects" if nothing is set.
# projects_dir=~/Sites
 
# Set TLD used in project directory name. Set to empty if you don't use a TLD
# in the directory name. Defaults to your username.
# local_tld=
 
# Local MYSQL info. Used in tasks where this can't be parsed from the project.
# local_db_user=root
# local_db_password=pass

 

</code>

 

 

Reference:

http://awaseroot.wordpress.com/category/fabric/

http://www.pythonforbeginners.com/systems-programming/how-to-use-fabric-in-python/

 

 

 

Nginx 配置ssl 遇到的 Error 107

錯誤訊息:


SSL 連線錯誤

無法透過加密通訊協定連線至伺服器,伺服器可能發生問題,或是您未具備伺服器要求的用戶端授權憑證。
錯誤 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL 通訊協定錯誤。
 
今天在使用nginx當ssl proxy server時,遇到了如上的錯誤,上網查了一下,問題似乎都跟我的不一致,後來看到一篇有人說他本來的配置可以使用,後來他只是單純的把htttps 跟http的配置上下兌換後,就把問題解決了,臨機一動就像到,難不成真的是因為nginx config檔案的問題,看了一下,我在server name的後面真的少了一個分號 ; 但其動nginx 時卻沒任何警告,就想說死馬當活馬醫,想不到問題還真的就是如此單純

2013年2月1日 星期五

umount error 16的處理方式

umount 參考網頁:http://linux-wiki.cn/wiki/zh-tw/Umount

 

 

問題:

# umount -f xxxxx
unmount error 16 = Device or resource busy
Refer to the umount.cifs(8) manual page (man 8 umount.cifs)
unmount error 16 = Device or resource busy
Refer to the umount.cifs(8) manual page (man 8 umount.cifs)

 

解法:lazy umount

 

#umount -l xxxx

How to restore a deleted onenote page

復原不小心誤刪的onenote