2014年8月4日 星期一

session_set_cookie_params()

session_set_cookie_params()要在session_start()之前呼叫
session_set_cookie_params()是"當client沒有傳session key時,設定cookie為參數所指定的值"
換句話說,當使用者下一次瀏覽該頁面時,因為client會傳session key給server,所以session_set_cookie_params()並不會更新cookie lifetime
得用setcookie()更新cookie lifetime

2014年6月29日 星期日

Vim TagList, Ctags

Tag List:
vim-taglist.sourceforge.net/

Ctags:
http://ctags.sourceforge.net/

教學:
http://rickey-nctu.blogspot.tw/2009/02/vim-taglist.html
http://rickey-nctu.blogspot.tw/2009/02/vim-srcexpl.html

2014年6月8日 星期日

Vim:
c[motion]: change command
caw: change a word (delete a word including the trailing space under the current cursor position, and enter insert mode)
ciw: change inner word (delete a word under the current cursor position, and enter insert mode)
cw: change from the the current cursor position to the end of the current word

2014年5月24日 星期六

GNU screen好用指令

1.
CTRL + A + ESC or CTRL + A + [ 進入copy mode

2.
You can use vi like commands to navigate through the scollback buffer.

3.
Copying Text
Once the cursor is at the beginning location, press SPACEBAR to set your first mark. Next navigate to the ending position and hit it again. The second SPACEBAR will set your end mark and exit copy mode. One neat and often useful feature is selecting a rectangle on the screen rather than full lines. Use c and C to set the left and right column margins to the cursor’s current location.

4.
Pasting
Pasting is easy, just hit CTRL+a to activate screen then ] to paste.

5.
CTRL + A + n: next window
CTRL + A + p: previous window

6.
screen -ls 列出所有sessions
CTRL + A + :quit 退出session
CTRL + A + K 退出session
CTRL + A + D Detach Session

6.
CTRL + A + H: 把目前的畫面以文字形式存在文字檔