[[PageOutline]] = Mac 設定 = == 開發環境設定 == {{{ #install xcode command tool xcode-select --install # check xcode-select -p # install home-brew ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # check brew brew doctor brew update # install develop environment brew install ansible brew install gradle brew cask install java brew cask install intellij-idea-ce ## community edition # install JSON toolkits brew install jq brew install npm npm install json2csv -g # install azure-cli npm install azure-cli -g }}} == 辦公環境設定 == {{{ # install firefox brew cask install firefox-zh-tw # 編輯器 brew cask install sublime-text # Markdown 筆記用: brew cask install macdown # Markdown 寫文件用: brew cask install gitbook-editor brew cask install pandoc # 群組溝通用:slack brew cask install slack # 資料分析用 brew cask install tableau-public ## 拿來分析一些 CSV 用 # MS Office 日常文書用 brew cask install microsoft-office }}} == 網路環境設定 == * Mac 無線網路設定 [[File:Funp_wifi.png|480px]] * Android 手機無線網路設定 [[File:Android_WiFi.png|240px]] == 鍵盤快速鍵 == * 首先,認識一下選單上的鍵盤符號對應: [[Image(800px-Hotkeys.png)]] == 終端機設定 == * 一開始覺得很奇怪,為何用 `screen` 有顏色,不用就沒有顏色。 * 原因是預設的 `TERM` 不支援,需改為 `xterm-256color` 才行。 * [[Image(Mac_terminal_xterm.png)]] * 修改後,查詢 `$TERM` 環境變數應該會看到: {{{ ~$ echo $TERM xterm-256color }}} = Azure = * 若要使用命令列建立與管理 Azure 資源,您必須具備以下條件: * 有 Azure 帳戶 (免費試用版) - 註冊 Azure - https://azure.microsoft.com/zh-tw/ * 安裝 Azure CLI - https://azure.microsoft.com/zh-tw/documentation/articles/xplat-cli-install/ * 登入使用您帳戶的相關 Azure 資源 - https://azure.microsoft.com/zh-tw/documentation/articles/xplat-cli-connect/ == Azure CLI 安裝 == === Mac OS X === {{{ brew install npm npm install azure-cli -g }}} * 雖然 homebrew 裡也有 `azure-cli`,但版本比較舊,建議用 npm 的版本。 {{{ ~$ brew info azure-cli azure-cli: stable 0.10.6 (bottled), HEAD }}} === Docker === * Docker Hub - https://hub.docker.com/r/microsoft/azure-cli/ * azure-cli 的 github - https://github.com/azure/azure-xplat-cli * 在 Docker主機中,執行: {{{ docker run -it microsoft/azure-cli }}} === 小技巧 === * 在 Docker 主機中,有 `azure.completion.sh` 可以讓 Azure CLI 提供指令的建議。若有需要,請在 Mac OS 的家目錄建立 .bashrc 與 .bash_profile 檔案,並 `source 路徑/azure.completion.sh` * 如果懶得從 docker image 裡面取得 azure.completion.sh 可至以下 gist 路徑取得: ** https://gist.githubusercontent.com/jazzwang/4397a4a13507fef8d94010a49337d120/raw/b7dc8b8086198d01c92f52cb5bd363d3811e0b40/azure.completion.sh * 以下是我的設定,供參考: ** `.bash_profile` {{{ # ~/.profile: executed by the command interpreter for login shells. # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login # exists. # see /usr/share/doc/bash/examples/startup-files for examples. # the files are located in the bash-doc package. # the default umask is set in /etc/profile; for setting the umask # for ssh logins, install and configure the libpam-umask package. #umask 022 # if running bash if [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fi fi # set PATH so it includes user's private bin if it exists if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi }}} ** `.bashrc` {{{ ## for Intellij IDEA export JAVA_HOME="$(/usr/libexec/java_home)" ## for terminal export CLICOLOR=1 export LSCOLORS="Gxfxcxdxbxegedabagacad" alias ls='ls -GFh' source /usr/local/etc/bash_completion.d/git-completion.bash source /usr/local/etc/bash_completion.d/azure.completion.sh source /usr/local/etc/bash_completion.d/docker source /usr/local/etc/bash_completion.d/brew source /usr/local/etc/bash_completion.d/brew-cask source /usr/local/etc/bash_completion.d/gradle }}} == Azure 術語與觀念 == * Azure 建立和處理資源的部署模型有二種: 資源管理員和傳統 * 傳統的文件入口:https://azure.microsoft.com/zh-tw/documentation/articles/virtual-machines-command-line-tools/ * Microsoft 建議大部分的新部署使用 Resource Manager model。(常看到的 ARM 縮寫,指的就是 Azure Resource Manager) * 資源管理員文件入口:https://azure.microsoft.com/zh-tw/documentation/articles/xplat-cli-azure-resource-manager/ {{{ #!html
縮寫 | 全文 | 說明 |
---|---|---|
ASM | ||
ARM | Azure Resource Manager | Azure 資源管理員 |
Resource Group |
變數 | 可用選項 |
---|---|
location | 詳見 azure location list
|
os-type |
|
image-urn | 詳見 azure vm image list
|
指令 | 描述 | 範例 |
---|---|---|
brew doctor |
檢查 brew 系統是否有潛在問題 | ~$ brew doctor Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry and just ignore them. Thanks! Warning: Your Homebrew is outdated. You haven't updated for at least 24 hours. This is a long time in brewland! To update Homebrew, run `brew update`. |
brew desc |
顯示套件的簡單描述 | ~$ brew desc mysql mysql: Open source relational database management system |
brew info |
顯示套件的詳細描述 | ~$ brew info mysql mysql: stable 5.7.12 (bottled) Open source relational database management system https://dev.mysql.com/doc/refman/5.7/en/ Conflicts with: mariadb, mariadb-connector-c, mysql-cluster, mysql-connector-c, percona-server Not installed From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/mysql.rb ==> Dependencies Build: cmake ✘ Required: openssl ✔ ==> Options --with-archive-storage-engine Compile with the ARCHIVE storage engine enabled --with-blackhole-storage-engine Compile with the BLACKHOLE storage engine enabled --with-debug Build with debug support --with-embedded Build the embedded server --with-local-infile Build with local infile loading support --with-test Build with unit tests ==> Caveats We've installed your MySQL database without a root password. To secure it run: mysql_secure_installation To connect run: mysql -uroot To have launchd start mysql now and restart at login: brew services start mysql Or, if you don't want/need a background service you can just run: mysql.server start |