目錄雙向同步的解決方案
可以使用 csync (不要使用 rsync ,因為一不小心你的檔案就會被刪除)
csync 比較簡單
ubuntu 下可以用下面指令安裝
$sudo apt-get install csync-owncloud
補充其他資料:
DRDB: 好像是 block-based 的同步
https://syncthing.net/ : 類似 btsync
unison: 兩個檔案即時同步
syncany 似乎也不錯,不過他做的事情比較多
2016年1月25日 星期一
2015年12月8日 星期二
android sdk 常用指令
tools/android 開啟 Android SDK Magager
tools/android avd Displays the AVD Manager window.
tools/android avd Displays the AVD Manager window.
2015年11月18日 星期三
iptables Packet Flow
forwarding
mangle PREROUTING
nat PREROUTING
mangle FORWARD
filter FORWARD
mangle POSTROUTING
nat POSTROUTING
2015年11月13日 星期五
替 docker container 的 apt/yum 設定 proxy
要替 apt-get / yum 設定 proxy 很簡單
這對你需要一直 rebuild image 然後 rebuild 時無法使用 cache 時很有用
只要加上下面的內容到 Dockerfile 即可
ENV http_proxy=https://evil.corp.proxy:80 ENV https_proxy=https://evil.corp.proxy:80
2015年6月7日 星期日
scala list collect 用法
scala list collect 用法
collect methoad 接受 PartialFunction 作為參數。結果產生一個 list。輸出 list 的內容是該 PartialFunction 有定義且由 PartialFunction 運算後的值
PartialFunction 長的像這樣
{
case a: Int => a.toString
case a: String => 1
}
以下面例子作為說明
List(1, 2, "3", Nil) collect { case a: Int => a.toString case b: String => 1}
其結果為
List(1, 2, 1)
說明
原始的 list 內容是整數 1, 2
和字串 3 和一個 Nil 物件
整數 1 和 2 有定義在 PartialFunction,
因此1 和 2 經過 PartialFunction 運算後,會放在結果
又字串 3 有定義在 PartialFunction,
因此 3 經過 PartialFunction 運算後,會放在結果
又 Nil 不沒有定義在 PartialFunction
因此沒有出現在結果
collect methoad 接受 PartialFunction 作為參數。結果產生一個 list。輸出 list 的內容是該 PartialFunction 有定義且由 PartialFunction 運算後的值
PartialFunction 長的像這樣
{
case a: Int => a.toString
case a: String => 1
}
以下面例子作為說明
List(1, 2, "3", Nil) collect { case a: Int => a.toString case b: String => 1}
其結果為
List(1, 2, 1)
說明
原始的 list 內容是整數 1, 2
和字串 3 和一個 Nil 物件
整數 1 和 2 有定義在 PartialFunction,
因此1 和 2 經過 PartialFunction 運算後,會放在結果
又字串 3 有定義在 PartialFunction,
因此 3 經過 PartialFunction 運算後,會放在結果
又 Nil 不沒有定義在 PartialFunction
因此沒有出現在結果
2015年5月21日 星期四
2015年5月9日 星期六
linux process manager
linux process manager
command line
1. top
2. atop
3. htop
gui
1. lxtask
2. gnome-system-monitor
command line
1. top
2. atop
3. htop
gui
1. lxtask
2. gnome-system-monitor
2015年5月2日 星期六
how to show the partition filesystem on disk in linux?
use command
sudo parted -l
to show partition filesystem on disk
sudo parted -l
to show partition filesystem on disk
2015年3月13日 星期五
linux 雙顯示卡(nvidia, intel) 切換
如果你的電腦或筆記型電腦有支援雙顯示卡,而且有正確安裝驅動程式的話, nvidia 會提供 prime-select 指令讓你切換顯示卡。而從 nvidia-setting 這隻程式也可以讓你用 gui 來切換顯示卡。
2014年12月20日 星期六
use cdrom in docker container.
- make sure you never mount your cdrom.
- run you container using the command like ``` docker run -i -t -v /dev/cdrom:/dev/cdrom dockerfiles/centos-lamp /bin/bash```
- type ```mkdir /mnt/cdrom``` in your container bash.
- type ```mount -t iso9660 -o ro /dev/cdrom /mnt/cdrom``` in your container bash.
- see you cdrom using ```ls /mnt/cdrom``` in your container bash.
訂閱:
文章 (Atom)