2013年5月16日 星期四

SQLite

於OSX 10.8.3打開終端機即可開始使用SQLite
$ sqlite3 ~/demo.db  -- 於Home下執行SQLite、建立DB

sqlite> create table employee
   ...> (emp_no,
   ...>  emp_name,
   ...>  dept_no,
   ...>  mgr_no,
   ...>  salary,
   ...>  job);

sqlite> .tables
employee

sqlite> .schema employee  -- 查詢table架構
CREATE TABLE employee
(emp_no,
 emp_name,
 dept_no,
 mgr_no,
 salary,
 job);

sqlite> .help

sqlite> .exit

2013年5月10日 星期五

Note about OSX

環境: 2013 MBPR 15" - OS X 10.8.3 (Mountain Lion)

SSH遠端連線
$ ssh user@hostname

找套件(pkg)
$ pkgutil --pkgs | grep pkg_name

更改截圖類型、預設名稱及存放路徑
$ defaults write com.apple.screencapture type jpg   # jpg
$ defaults write com.apple.screencapture type png   # png
$ defaults write com.apple.screencapture name "Snapshot"   # 預設檔名含中文,改為英文
$ defaults write com.apple.screencapture location Full_Path   # 存放路徑
$ killall SystemUIServer   #清除系統設定暫存

啟動 Apache Web Server, 啟動後在瀏覽器輸入http://localhost可看到"It Works!"字樣
$sudo apachectl start
$sudo apachectl stop
.

2013年5月9日 星期四