Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CasksInstall
#!/bin/bash
# xcode command tool
xcode-select --install
# check
xcode-select -p
# homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# check brew
brew doctor
brew update
# QuickLook
# https://github.com/sindresorhus/quick-look-plugins
# provisionql
brew cask install qlcolorcode qlstephen qlmarkdown quicklook-json qlimagesize webpquicklook suspicious-package quicklookase qlvideo quicklook-pat
# betterzipql 沒了
# https://github.com/samuelmeuli/glance 等開放用 cask 裝
brew install dnsmasq \
imagemagick \
graphicsmagick \
youtube-dl \
lame \
ffmpeg \
tig \
tree \
# php@7.1 \
# heroku \
# watchman \ # 給 npm test 用
# install cask
# brew tap homebrew/cask-cask
brew cask install alfred
brew cask alfred link
brew cask install google-chrome
brew cask install firefox
brew cask install 1password
brew cask install textmate
# brew cask install flash
brew cask install skype
# brew cask install mplayerx
brew cask install nally
brew cask install iterm2
brew cask install dropbox
brew cask install imageoptim
# brew cask install vox
# brew cask install livereload
brew cask install sourcetree
brew cask install evernote
brew cask install subler #字幕合成
brew cask install synergy
# brew cask install textexpander
#brew cask install movist
brew cask install spotify
# brew cask install virtualbox
# brew cask install virtualbox-extension-pack
# brew cask install x-mirage
brew cask install cloudapp
# brew cask install colorpicker # 沒了
# brew cask install colorpicker-hex # 沒了
brew cask install colorpicker-developer
brew cask install colorpicker-skalacolor
brew cask install colorpicker-materialdesign
# brew cask install xee
brew cask install r-name
# brew cask install simplecap
brew cask install appcleaner
brew cask install audacity
brew cask install istat-menus
#brew cask install sqlitebrowser # 沒了
brew cask install macdown
brew cask install sublime-text
brew cask install docker
brew cask install droplr
brew cask install debookee # 網路觀查
brew cask install iina # 影片播放
brew cask install air-video-server-hd
#brew cask install toggldesktop # 桌面計時軟體
#brew cask install wwdc
brew cask install ksdiff # Kaleidoscope 的命令工具
#brew cask install monolingual #移除語系工具
brew cask install sketch
brew cask install sketch-beta # 沒了
brew cask install sketch-toolbox #sketch 外掛管理工具
brew cask install gitbook-editor
brew cask install paw
brew cask install slack
brew cask install textmate
brew cask install robo-st # mongoDB GUI
# need password
# brew cask install mamp
# brew cask install splashtop-personal
brew cask install splashtop-streamer
brew cask install teamviewer
# brew cask install recordit
brew cask install visual-studio-code
# brew cask install robomongo # monogo DB clinet 沒
brew cask install sequel-pro # mysql DB clinet
brew cask install icons8 # icon 收集
brew cask install simplenote
brew cask install droplr
brew cask install agenda
brew cask install pgadmin4 # postgros sql 資料庫工具
brew cask install cheatsheet #顯示快速鍵
brew cask install redis-app # redis 軟體
# 安裝聯的 skype
#brew tap caskroom/versions
#cask install skype7
# font
brew tap homebrew/cask-fonts
brew cask install font-fontawesome
brew cask install font-aileron
brew cask install font-source-code-pro
brew cask install font-source-sans-pro
brew cask install font-hack
brew cask install font-inconsolata-dz-for-powerline
brew cask install font-fira-mono-for-powerline
brew cask install font-fira-sans
brew cask install font-fira-code
brew cask install font-open-sans
brew cask install font-m-plus
brew cask install font-exo2
brew cask install font-source-han-sans #思源黑
brew cask install font-noto-serif-cjk #思源宋
brew cask install font-firacode-nerd-font # 考慮用 nerd-font 系列取代 nerd-font
# install for zsh theme font
# https://github.com/powerline/fonts.git
# 再去 iterm2 改字體 Profile -> Text -> Non-ASCII Font 改為 Ubuntu Mono Derivative Powerline Font
# 思源黑體
# brew cask install https://gist.githubusercontent.com/visioncan/20cf9a4b9304196e35d2/raw/0affe47ac38749a0b4e895c9b60e6b7df4d313fc/font-source-han-sans-TC.rb
# zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# 手動裝 zsh autosuggestion plugin
git clone git://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
# VIM
sh <(curl -L https://github.com/kaochenlong/eddie-vim2/raw/master/utils/install_zhtw.sh)
cd ~/.vim/colors && curl -O https://raw.githubusercontent.com/tomasr/molokai/master/colors/molokai.vim
# 修改color
# vim ~/.vim/plugin/settings/settings.vim
# colorscheme 改為 rails_envy 或 molokai
# https://github.com/tomasr/molokai
# 編輯時讓可以滑鼠滾動
# set mouse=a
# nvm
# https://github.com/creationix/nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
nvm install 8.12
nvm install 12
nvm alias default 12
#nvm install stable
# f2e tool
npm install -g \
pnpm \
gulp \
diff-so-fancy \
babel-eslint \
eslint \
standard \
uglify-js \
vsce \
yarn \
gitbook-cli \
hexo-cli \
http-server
# install composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
#rvm
\curl -sSL https://get.rvm.io | bash -s stable
rvm requirements
rvm list known
rvm install 2.1.1
rvm use 2.1.1
gem install cocoapods
gem install scss-lint
# https://gist.github.com/saetia/1623487
# Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
#Disable disk image verification
defaults write com.apple.frameworks.diskimages skip-verify -bool true
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
#Enable Safari’s debug menu
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
# Enable the Develop menu and the Web Inspector in Safari
defaults write com.apple.Safari IncludeDevelopMenu -bool true
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
# 顯示完成 URL
defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true
# 改變螢幕截取的副檔名
defaults write com.apple.screencapture name "shot"
# 睡眠後需要密碼
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
# 關閉 safari 偏好設定不要 Spotlight 建議
defaults write com.apple.Safari UniversalSearchEnabled -bool false
# 系統偏好設定 > Spotlight > 關閉 Spotlight 建議與 bing 搜尋網頁
# 開啟 alfred2 使用 dropbox 的 Apps 資料夾
defaults write com.runningwithcrayons.Alfred-Preferences-3 dropbox.allowappsfolder -bool TRUE
# 使用純文字為 TextEdit 預設格式
defaults write com.apple.TextEdit RichText -int 0
##### Finder
# Finder 預設開啟為家目錄
defaults write com.apple.finder NewWindowTarget -string "PfHm"
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}"
# Finder 改搜尋範圍為目前資料夾
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# Finder 顯示路徑列
defaults write com.apple.finder ShowPathbar -bool true
# 關閉改變副檔名警告
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# 允許在 QuickLook 裡選取文字
defaults write com.apple.finder QLEnableTextSelection -bool YES
# 預設使用列表顯示
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
# 顯示隱藏檔
defaults write com.apple.finder AppleShowAllFiles -bool true
# 在桌面顯示 外接、掛載硬碟
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool false
defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
# 顯示副檔名
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# 預設儲存視窗為展開模式
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
killall Finder
#增加 Dock 的空格
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}' && killall Dock
# MplayerX
defaults write org.niltsh.MPlayerX SeekStepTimeR -float 5
defaults write org.niltsh.MPlayerX SeekStepTimeL -float -10
# 改中文化資料夾
sudo cp /System/Library/CoreServices/SystemFolderLocalizations/zh_TW.lproj/SystemFolderLocalizations.strings /System/Library/CoreServices/SystemFolderLocalizations/zh_TW.lproj/SystemFolderLocalizations.strings.backup
sudo cp /System/Library/CoreServices/SystemFolderLocalizations/en.lproj/SystemFolderLocalizations.strings /System/Library/CoreServices/SystemFolderLocalizations/zh_TW.lproj/SystemFolderLocalizations.strings
# 還要去資料夾移除 .localized
cd ~
rm */.localized
cd /
sudo rm */.localized
cd /System/
sudo rm */.localized
# SIP (System Integrity Protection)
# 開機按著 Command + R 直接進入
# 關閉 SIP
csrutil disable
# 開啟 SIP
csrutil enable
#重開機後 /Volums/Macintosh HD/System/Library/....
#Setup Github
ssh-keygen -t rsa -C "@gmail.com"
#copy ssh key to clipboard for adding to github.com
pbcopy < ~/.ssh/id_rsa.pub
#test connection
ssh -T git@github.com
# dnsmasq
mkdir -pv $(brew --prefix)/etc/ && \
echo 'address=/test/127.0.0.1' > $(brew --prefix)/etc/dnsmasq.conf && \
sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons && \
sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist && \
sudo mkdir -v /etc/resolver && \
sudo zsh -c 'echo "nameserver 127.0.0.1" > /etc/resolver/test'
#flush cache
# sudo discoveryutil mdnsflushcache && scutil --dns
sudo killall -HUP mDNSResponder
brew services restart dnsmasq # 重啟
#To configure dnsmasq, copy the example configuration to /usr/local/etc/dnsmasq.conf and edit to taste.
# cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
# 編輯 dnsmasq.conf 67行
#server=8.8.8.8
#server=195.68.1.1
# 83行
#address=/.iyp.tw/172.16.16.32 # ex:把 iyp.tw 子網域的轉到 172.16.16.32
#address=/dev/127.0.0.1 # ex:把 .dev 子網域的轉到 127.0.0.1
# 建資料夾
#sudo mkdir -p /etc/resolve
# 寫入檔案 /etc/resolver/dev
# sudo tee /etc/resolver/dev >/dev/null <<EOF
# nameserver 127.0.0.1
# EOF
# To have launchd start dnsmasq at startup:
#sudo cp -fv /usr/local/opt/dnsmasq/*.plist /Library/LaunchDaemons
# Then to load dnsmasq now:
#sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
# 重啟
#sudo launchctl stop homebrew.mxcl.dnsmasq
# 就好,會自動啟用
# `sudo launchctl stop homebrew.mxcl.dnsmasq && sudo launchctl start homebrew.mxcl.dnsmasq`
# 關閉憑證
https://github.com/sammcj/delete-unknown-root-ca
# YAHOO 無蝦米輸入法
sudo mkdir -p /Library/Input\ Methods/Yahoo\!\ KeyKey.app/Contents/Resources/DataTables/Generic
sudo curl -L -o /Library/Input\ Methods/Yahoo\!\ KeyKey.app/Contents/Resources/DataTables/Generic/liu3.cin https://www.dropbox.com/s/u5ouf4612g0dzou/boshiamy-lite.cin\?dl\=1
sudo curl -L -o /Library/Input\ Methods/Yahoo\!\ KeyKey.app/Contents/Resources/Yahoo16.icns https://www.dropbox.com/s/r3rrif8d27rxuty/Yahoo16.icns\?dl\=0
# 按cmd+shift+q 登出
# 相關設定 http://imgur.com/delete/pkkREgGZgh1v0mJ
# 取消一點通
YAHOOKEYPLIST = e26bd6ebb0d11e8cfa3101d426862e08
curl -o /Users/vcan/Library/Preferences/com.yahoo.KeyKey.OneKey.plist https://gist.githubusercontent.com/visioncan/e26bd6ebb0d11e8cfa3101d426862e08/raw/
# Airmail 設定
# https://cl.ly/123J0s3E1j3L
# https://cl.ly/3m0z3R3a1C3u
# sublime text Packages install
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/
rm -r User
ln -s ~/Dropbox/Apps/Sublime/User
# sublime text change icons
# sudo curl -L -o /Applications/Apps/Sublime\ Text.app/Contents/Resources/Sublime\ Text.icns https://www.dropbox.com/s/3v9s3ho1jivyfe8/Sublime%20Text.icns?dl=0
# 將目錄下 node_modules 在 timemachine 裡排除
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.