-
-
Save iainconnor/f9d4964ea4211e794d1d to your computer and use it in GitHub Desktop.
me=$(whoami) | |
# Get Sudo. | |
if [ $EUID != 0 ]; then | |
sudo "$0" "$@" | |
exit $? | |
fi | |
# Install Xcode command line tools. | |
xcode-select --install | |
# Install Homebrew. | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Configure Homebrew. | |
brew doctor | |
# Tap custom casks. | |
brew tap caskroom/cask | |
brew tap caskroom/fonts | |
brew tap caskroom/versions | |
brew tap homebrew/core | |
brew tap homebrew/services | |
brew tap blackfireio/homebrew-blackfire | |
brew update && brew upgrade && brew cleanup && brew cask cleanup | |
# Apps, fonts, and plugins. | |
brew cask installbettertouchtool blackfire-agent caffeine cool-retro-term cyberduck docker dropbox epubquicklook font-anonymice-powerline font-consolas-for-powerline font-dejavu-sans-mono-for-powerline font-droid-sans-mono-for-powerline font-fira-code font-fira-mono font-fira-mono-for-powerline font-firacode-nerd-font font-firacode-nerd-font-mono font-hasklig font-hasklig-nerd-font font-hasklig-nerd-font-mono font-inconsolata-dz-for-powerline font-inconsolata-g-for-powerline font-iosevka font-liberation-mono-for-powerline font-menlo-for-powerline font-meslo-for-powerline font-monofur-for-powerline font-monoid font-noto-mono-for-powerline font-roboto font-roboto-mono-for-powerline font-source-code-pro-for-powerline font-ubuntu-mono-derivative-powerline font-ubuntumono-nerd-font font-ubuntumono-nerd-font-mono go2shell google-chrome highsierramediakeyenabler iterm2 imageoptim intel-power-gadget istat-menus keyboard-cleaner macdown parallels-desktop phpstorm postman qlcolorcode qlimagesize qlmarkdown qlstephen quicklook-json resolutionator shuttle sourcetree spotify spotmenu steam sublime-text the-unarchiver vanilla virtualbox visual-studio-code webpquicklook zoomus-outlook-plugin | |
# System tools. | |
brew install autoconf bat boost brew-php-switcher codeception composer coreutils curl fish findutils freetype gdbm gettext grc git git-flow gmp highlight icu4c imagemagick jpeg libevent libmemcached libpng libtiff libtool libxml2 liblzf lua mcrypt memcached mhash mysql nginx openssl pcre php-code-sniffer php-cs-fixer phpmd phpunit pkg-config python3 rabbitmq rabbitmq-c re2c readline redis siege sqlite thefuck tree unixodbc unzip xdebug-osx xz | |
curl https://gist.githubusercontent.com/iainconnor/b5ef2c0e216ad26a748dd97721300720/raw/git-cleanup > /usr/local/bin/git-cleanup && chmod 755 /usr/local/bin/git-cleanup | |
# Fish replacing shell. | |
echo "/usr/local/bin/fish" >> /etc/shells | |
chsh -s /usr/local/bin/fish | |
curl -L https://get.oh-my.fish | fish | |
omf install artisan gi php-version brew git-flow thefuck brew-completions grc composer fish-spec osx agnoster cmorrell emoji-powerline gnuykeaj bobthefish gitstatus ocean | |
omf theme gnuykeaj | |
mkdir -p ~/.config/fish/functions | |
# Setup OSX to use Homebrew-installed apps. | |
echo 'set PATH $PATH /usr/local/opt/curl/bin' >> ~/.config/fish/config.fish | |
echo 'set PATH $PATH /usr/local/sbin' >> ~/.config/fish/config.fish | |
echo 'set PATH $PATH /usr/local/bin' >> ~/.config/fish/config.fish | |
echo 'set PATH $PATH /usr/sbin' >> ~/.config/fish/config.fish | |
echo 'set PATH $PATH /usr/bin' >> ~/.config/fish/config.fish | |
echo 'set PATH $PATH /sbin' >> ~/.config/fish/config.fish | |
echo 'set PATH $PATH /bin' >> ~/.config/fish/config.fish | |
echo 'set PATH $PATH ~/.composer/vendor/bin' >> ~/.config/fish/config.fish | |
echo "set -g default_user $me" >> ~/.config/fish/config.fish | |
echo 'alias cat="bat"' >> ~/.config/fish/config.fish | |
# PHP. | |
brew install [email protected] | |
pecl install ast | |
pecl install APCu | |
pecl install igbinary | |
pecl install imagick | |
pecl install memcached | |
pecl install oauth | |
pecl install redis | |
pecl install xdebug-2.7.0beta1 | |
pecl install mongodb | |
pecl install amqp | |
pecl install swoole | |
brew install blackfire-php73 | |
cd ~/Downloads | |
# Terminal themes. | |
curl -o ~/Downloads/terminal.zip -LOk https://github.com/lysyi3m/osx-terminal-themes/archive/master.zip | |
curl -o ~/Downloads/iterm.zip -LOk https://github.com/mbadolato/iTerm2-Color-Schemes/archive/master.zip | |
unzip ~/Downloads/terminal.zip && unzip ~/Downloads/iterm.zip && rm -f ~/Downloads/terminal.zip && rm -f ~/Downloads/iterm.zip | |
mkdir ~/Downloads/themes | |
mv ~/Downloads/iTerm2-Color-Schemes-master/schemes ~/Downloads/themes/iterm2 && rm -rf ~/Downloads/iTerm2-Color-Schemes-master | |
mv ~/Downloads/osx-terminal-themes-master/schemes ~/Downloads/themes/terminal && rm -rf ~/Downloads/osx-terminal-themes-master | |
# BTT profiles. | |
curl -o ~/Downloads/btt.zip -LOk https://github.com/vas3k/btt-touchbar-presets/archive/master.zip | |
unzip ~/Downloads/btt.zip && rm -f ~/Downloads/btt.zip | |
mv ~/Downloads/btt-touchbar-presets-master ~/Downloads/btt | |
# Setup Git. | |
read -e -p "Enter your git username: " USERNAME | |
read -e -p "Enter your git email address: " EMAIL | |
git config --global user.name $USERNAME | |
git config --global user.email $EMAIL | |
git config --global core.ignorecase false | |
git config --global core.autocrlf input | |
ssh-keygen -t rsa -b 4096 -C $EMAIL | |
eval "$(ssh-agent -s)" | |
ssh-add ~/.ssh/id_rsa | |
pbcopy < ~/.ssh/id_rsa.pub | |
sudo ln -s /usr/local/bin/git-flow /usr/bin/git-flow | |
sudo ln -s /usr/local/bin/gitflow-common /usr/bin/gitflow-common | |
sudo ln -s /usr/local/bin/git-flow-init /usr/bin/git-flow-init | |
sudo ln -s /usr/local/bin/git-flow-version /usr/bin/git-flow-version | |
sudo ln -s /usr/local/bin/git-flow-feature /usr/bin/git-flow-feature | |
sudo ln -s /usr/local/bin/git-flow-release /usr/bin/git-flow-release | |
sudo ln -s /usr/local/bin/git-flow-hotfix /usr/bin/git-flow-hotfix | |
sudo ln -s /usr/local/bin/git-flow-support /usr/bin/git-flow-support | |
sudo ln -s /usr/local/bin/gitflow-shFlags /usr/bin/gitflow-shFlags | |
# All done with Homebrew. | |
brew update && brew upgrade && brew cleanup && brew cask cleanup | |
# Expand "Save" and "Print" panels. | |
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true | |
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true | |
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true | |
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true | |
# Use current directory as default search scope in Finder. | |
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" | |
# Remove duplicate "Open With" options. | |
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user | |
# Show extensions in Finder. | |
defaults write NSGlobalDomain AppleShowAllExtensions -bool true | |
# Show path in Finder. | |
defaults write com.apple.finder ShowPathbar -bool true | |
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true | |
# Expand save panel by default. | |
defaults write -g NSNavPanelExpandedStateForSaveMode -bool true && \ | |
defaults write -g NSNavPanelExpandedStateForSaveMode2 -bool true | |
# Save locally by default. | |
defaults write -g NSDocumentSaveNewDocumentsToCloud -bool false | |
# Column view by default. | |
defaults write com.apple.Finder FXPreferredViewStyle clmv | |
# Allow selecting text in Quick Look. | |
defaults write com.apple.finder QLEnableTextSelection -bool true | |
# Use OSX print dialog in Chrome. | |
defaults write com.google.Chrome DisablePrintPreview -bool true | |
defaults write com.google.Chrome PMPrintingExpandedStateForPrint2 -bool true | |
# Copy email addresses, not names, from Mail. | |
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false | |
# Quit Printer app when complete. | |
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true | |
# Ignore Quarentine of unknown apps. | |
defaults write com.apple.LaunchServices LSQuarantine -bool false | |
# Reboot to a clean slate. | |
defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool false | |
# Enable "Tap to Click". | |
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true | |
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 | |
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 | |
# Invert scrolling direction. | |
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false | |
# Open Finder at "~/" directory. | |
defaults write com.apple.finder NewWindowTarget -string "PfLo" | |
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/" | |
# Don't create temporary files to network mounted drives. | |
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true | |
# Unhide "~/Library" folder. | |
chflags nohidden ~/Library | |
# Disable Time Machine prompt for every disk. | |
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true | |
# Configure Activity Monitor to always open a window, sorted by the most CPU intensive tasks. | |
defaults write com.apple.ActivityMonitor OpenMainWindow -bool true | |
defaults write com.apple.ActivityMonitor ShowCategory -int 0 | |
defaults write com.apple.ActivityMonitor SortColumn -string "cpUUsage" | |
defaults write com.apple.ActivityMonitor SortDirection -int 0 | |
# Change screenshot directory. | |
mkdir ~/Pictures/Screenshots | |
defaults write com.apple.screencapture location ~/Pictures/Screenshots | |
# Done. | |
echo "All Done. Your SSH Key is on the clipboard, ready for pasting into Git." |
👍 I approve, good set-up script.
Install
brew install bash
brew install bash-completion
Add to ~/.profile
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
Add to /etc/shells
/usr/local/Cellar/bash/VERSION/bin/bash
Sidenote: Brew really needs a "current version" symlink system!
brew tap homebrew/services
init.d style commands for managing plists. Lets you do stuff like brew services redis start
, etc...
Bash completion is nice, but I'm a convert to zsh and oh-my-zsh. My theme, FWIW: https://gist.github.com/cviebrock/31bf1d8d40c40e14fb96
@iainconnor - I'm assuming that will work, but might risk getting clobbered with an outdated version if they put up a "less new" version. My rule with homebrew is "use it sparingly, but otherwise exclusively".
Also, I have another line for you to add: https://coderwall.com/p/5w3jca/git-case-sensitivity-on-os-x
Worth noting that PHP5.4 is reaching EOL and that frameworks are rallying around at least 5.5, if not 5.6.
Maybe this should be amended to install all versions so that people can choose which to use. There's really no harm in using a newer version as it's always backwards compatible.
In any case, you should be doubly sure to install opcache
for whatever version of PHP you're using. It has some serious implications for class loading as per this ticket: https://bugs.php.net/bug.php?id=66773
brew install php56-opcache
Anyone who has done local development - especially on OSX+homebrew, where this is not included by default - has run afoul of this very subtle difference in behaviour. The expected behaviour is what you'll get after installing the .so
.
Would upgrade docker toolbox with Docker for Mac
Some advice from the trenches: Install composer via http://getcomposer.org, cp it to
/usr/local/bin/composer
. Then people cansudo composer self-update
when needed. Had issues with people not getting the bleeding edgiest-latest via homebrew in the past.