2013年3月29日 星期五

rsync on different ssh port

$ rsync -av --progress --rsh='ssh -p23' somefile user@host:somedir/




Reference :
rsync +ssh on different port?

Windows 無法開啟我的電腦 -> 內容

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

Data Type: REG_DWORD [Dword Value] // Value Name: NoPropertiesMyComputer

Value Data: [0 - Display Properties / 1 - Hide Properties]




Reference :
Enable/Disable System Properties Access from My Computer

Windows 無法使用 Crtl+Shift 切換輸入法

Start -> Run -> regedit

HKEY_CURRENT_USER\Keyboard Layout\Toggle
Language Hotkey = 1



Value
Meaning
1
Key Sequence for Toggle enabled: LEFT ALT+SHIFT is set (standard value)
2
Key Sequence for Toggle enabled: CTRL+SHIFT.
3
Key Sequences disabled.
4
When default locale is Thai the accent grave key is set for toggle, otherwise it’s disabled.





Reference :
How-to add Keyboard layouts to the language bar. | RES Software Blog

Windows 顯示電腦資訊

我的電腦 -> 內容
sysdm.cpl


dxdiag


msinfo32

2013年3月28日 星期四

vim 使用 tabular 對齊內容

安裝:

如果已經安裝過 pathogen,則直接下載 tabular 到 ~/.vim/bundle 資料夾就可以嘍

$ mkdir -p ~/.vim/bundle
$ cd ~/.vim/bundle
$ git clone git://github.com/godlygeek/tabular.git


使用 :
|start|eat|left|
|12|5|7|
|20|5|15|

要將此資料整理的話,則在編輯器輸入
:Tab/|

 | start | eat | left |
 | 12    | 5    | 7   |
 | 20    | 5    | 15 |




Reference :
godlygeek/tabular · GitHub
Vim 程式撰寫排版用 Plugin - Tabular | Tsung's Blog

vim 安裝 pathogen 套件管理工具

下載 pathogen 到 ~/.vim/autoload/pathogen.vim
$ mkdir -p ~/.vim/autoload ~/.vim/bundle
$ curl -Sso ~/.vim/autoload/pathogen.vim https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim


在 ~/.vimrc 最前面加入這一行
$ vi ~/.vimrc
execute pathogen#infect() 




Reference :
tpope/vim-pathogen · GitHub 
Vim 插件管理工具 pathogen - DaNmarner的中文博客

2013年3月15日 星期五

2013年3月14日 星期四

Linux mount CIFS Windows Share

# mount -t cifs //192.168.24.200/share-name /mnt -o username=shareuser,password=sharepassword,uid=1000



# vi /etc/fstab
192.168.5.3:/share/data     /mnt   nfs     defaults        0       0



Reference :
Linux mount CIFS Windows Share

VI remove Windows ^M

:%s/C-vC-m//g

Where C-v is Ctrl-v and C-m is Ctrl-m.




Reference :
Daily Vim: Text Editor Tips, Tricks, Tutorials, and HOWTOs: Removing Ctrl-M

Debian / Ubuntu dhclient 不修改 DNS

$ vi /etc/dhcp/dhclient.conf
......
request subnet-mask, broadcast-address, time-offset, routers,
#        domain-name, domain-name-servers, domain-search, host-name,
        netbios-name-servers, netbios-scope, interface-mtu,
        rfc3442-classless-static-routes, ntp-servers;
......

把粗體那行註解或刪除




Reference :
Ubuntu 使用dhcp不覆盖/etc/resolv.conf_明_百度空间

PHP Parse a time/date

function strptime is undefined
strptime (PHP 5 >= 5.1.0)

date_parse (PHP 5 >= 5.2.0)

date_parse_from_format (PHP 5 >= 5.3.0)




Reference :
PHP: strptime - Manual
PHP: date_parse - Manual
PHP: date_parse_from_format - Manual

2013年3月13日 星期三

PHP date to timestamp

$date = strptime($_GET['date'], '%Y-%m-%d');

$ts = mktime(0, 0, 0, $date['tm_mon']+1, $date['tm_mday'], $date['tm_year']+1900);




Reference :
PHP: mktime - Manual
How to convert date to timestamp in PHP? - Stack Overflow

2013年3月4日 星期一

塔塔醬 Tartar Sauce

塔塔醬 Tartar Sauce (4人份)

酸黃瓜 25公克
酸豆 1/2 大匙
新鮮香草末 一大匙
美乃滋 150公克
香草醋 1/2大匙
鹽、胡椒 少許

1. 酸黃瓜切成細末
2. 拌入酸豆、新鮮香草、腌黃瓜、美乃滋、香草醋
3. 加鹽、胡椒調味接口

凱撒沙拉 Caesar Salad

凱撒醬汁 Caesar Dressing (4人份)

腌制鯷魚 4條
雞蛋 1個
檸檬汁 1大匙
大蒜 1粒
帕瑪森起司粉 1大匙
橄欖油 3大匙
法式芥末醬 1/4茶匙
黑胡椒 少許

1. 大蒜去皮切碎磨成泥、雞蛋打散,和檸檬汁一起放于小鋼盆中攪拌均勻,隔水加熱至微燙即離火,趁熱時拌入起司粉
2. 緩緩加入橄欖油,繼續攪拌至呈乳狀
3. 鯷魚放入研缽中搗爛
4. 將芥末、鯷魚扮入醬汁中,最後加黑胡椒調味


我的醬

Q比美乃滋 キューピーマヨネーズ 100克
洋蔥末 1大匙
酸豆 caper 2小匙 / 酸黃瓜末
巴西里 parsley 切碎 2小匙 / 其他香料
水煮蛋壓碎 一顆 ()
檸檬汁 1大匙、檸檬皮 少許
黃芥末 mastard 1/2小匙
鹽 適量
白糖 2小匙 (Q比美乃滋比較不甜,所以加一點進去)
黑胡椒 適量




沙拉材料

蘿蔓生菜 
鮪魚 (真正的凱撒沙拉在醬料一定要有鯷魚,而我沒有鯷魚,所以在沙拉內加入鮪魚)
法國麵包 or 土司
起司粉


1. 生菜洗淨後,用手撕成對折後塞得進嘴巴的大小,然後用沙拉脫水器甩乾
2. 用手將麵包隨意撕成方形小丁。平底鍋加入橄欖油,將他煎的酥黃。(伴上油後用烤箱烤也是可以啦)
3. 將生菜、土司丁、鮪魚、沙拉醬放入大的沙拉攪拌碗中拌勻
4. 盛盤後撒上起司粉 ~