- 基本的 layouts,使用 baseof 的
_default。 - 建置好 Pipes,也可以預先寫好安裝套件的
package.json。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo "Update Homebrew" | |
| echo "brew update && brew upgrade --all" | |
| brew update && brew upgrade | |
| echo "brew cleanup" | |
| brew cleanup -s | |
| echo "Update NPM global" |
Let's Encrypt client (Certbot) 有兩種運行模式:
- Standalone: 啟動一個獨立伺服器回應 ACME challenges
- Webroot: 使用我們的 nginx 某目錄來回應
Webroot 模式比較好 因為不需要替換 Nginx 服務的 80 埠。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var http = require('http'), | |
| fs = require('fs'); | |
| function serveStaticFile(res, path, contentType, responseCode) { | |
| if(!responseCode) responseCode = 200; | |
| fs.readFile(__dirname + path, function(err, data){ | |
| if(err) { | |
| res.writeHead(500, {'Content-Type': 'text/plain'}); | |
| res.end('500 - Internal Error'); | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if [ -f ~/.bashrc ]; then | |
| source ~/.bashrc | |
| fi | |
| function git_branch { | |
| ref=$(git symbolic-ref HEAD 2> /dev/null) || return; | |
| echo "("${ref#refs/heads/}") "; | |
| } | |
| function git_since_last_commit { |
Vagrant 可以配置本地開發環境(虛擬機),同時管理遠端主機(Digital Ocean),在一個專案目錄下、只用一個 Vagrantfile。
首先安裝外掛:
vagrant plugin install vagrant-digitalocean
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # install xcode command tool | |
| xcode-select --install | |
| # check | |
| xcode-select -p | |
| # install brew | |
| ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo -e "\n移除不需要的預設套件" | |
| meteor remove autopublish insecure | |
| echo -e "\n安裝基礎會員帳戶套件" | |
| meteor add accounts-password alanning:roles | |
| echo -e "\n安裝 Flow 路由套件" | |
| meteor add kadira:flow-router kadira:blaze-layout |
官方調教的是 Raspbian,Debian 的分支,目前代號Wheezy,也就是 Debian 7。
可手動升級到 Debian 8 Jessie。
首先將官方映像燒到 SD 卡,Mac 上推薦使用 ApplePi-Baker 程式。
在最簡模式,插入 Raspbian SD 卡、接上實體網路線、接上 USB 電源,系統會自動從區網 DHCP 取得網路 ip,從遠端 Mac 上以終端機 ssh 登入,執行 ssh pi@192.168.x.x 預設密碼是 raspberry。
登入後先執行 sudo raspi-config,使用文字選取介面完成幾項初始工作:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -o errexit | |
| # IP or URL of the server you want to deploy to | |
| APP_HOST=example.com | |
| # Uncomment this if your host is an EC2 instance | |
| # EC2_PEM_FILE=path/to/your/file.pem | |
| # You usually don't need to change anything below this line |