發表文章

目前顯示的是 2月, 2015的文章

PHP Multi Process 程式以 PING 多主機應用為範例

嘗試使用 php pcntl_fork 寫各 ping 程式,一次偵測多台主機。 但目前還有些問題,如子程序沒辦法再程式中傳回父程序,這部份還要再仔細看一下手冊看看該如何處理。 https://github.com/mtchang/ping/blob/master/ping.php ref: http://php.net/manual/en/function.pcntl-fork.php http://pkwbim-programming-note.blogspot.tw/2008/01/phpmulti-process-1.html http://www.systn.com/data/articles/207_tw.html

Linux Mint 17 OR Ubuntu 的 Docker 服務安裝

# Linux mint 安裝 docker mtchang@mt ~ $  lsb_release -a No LSB modules are available. Distributor ID: LinuxMint Description: Linux Mint 17 Qiana Release: 17 Codename: qiana # ubuntu 因為安裝過程很煩,所以它把安裝過程寫成了script 放在  https://get.docker.com/ubuntu/  ,所以底下的安裝需要先透過 curl 抓回 script ,然後透過 shell 執行安裝。 mtchang@mt ~ $  sudo apt-get install curl # 它需要有 apparmor ,這是一個應用程式安全性的控管機制 mtchang@mt ~ $  sudo apt-get install apparmor # 安裝由 ubuntu 維護的 docker.io 套件,不要安裝原本 ubuntu 提供的 docker 套件 mtchang@mt ~ $  sudo apt-get install docker.io # 載入 bash 環境變數 mtchang@mt ~ $  source /etc/bash_completion.d/docker.io # 抓取安裝 script 並執行 mtchang@mt ~ $  curl -sSL https://get.docker.com/ubuntu/ | sudo sh # 直接執行 ubuntu 的影像檔 mtchang@mt ~ $  sudo docker run -i -t ubuntu /bin/bash # 第一次執行會發現還沒有 ubuntu 這個影像檔,會直接從網路上抓取 Unable to find image 'ubuntu' locally Pulling repository ubuntu 5ba9dab47459: Download complete 511136ea3c5a: Dow...