Skip to content

Instantly share code, notes, and snippets.

@cjbischoff
Created December 20, 2016 18:28
Show Gist options
  • Save cjbischoff/6a56952fa2fe06319f4c77a46a9269ef to your computer and use it in GitHub Desktop.
Save cjbischoff/6a56952fa2fe06319f4c77a46a9269ef to your computer and use it in GitHub Desktop.
Installs and upgrades OS X tools and command-line utils using Homebrew. Replaces the cruft with GNU's versions.
#!/bin/bash
#
# Installs and upgrades OS X tools and command-line utils using [Homebrew] (www.brew.sh).
# This will use GNU's available toolset.
#
# # #
# Function to install homebrew [ http://brew.sh ]
# # #
install_brew() {
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
}
clear
# # #
# install Homebrew and must-have packages
# # #
hash brew 2>/dev/null || install_brew
brew update && brew upgrade
# # #
# Install GNU utilities and link them with their default names
# # #
brew install coreutils
brew tap homebrew/dupes
brew install binutils diffutils gawk wget
brew install findutils --default-names
brew install gnu-getopt --default-names
brew install gnu-indent --default-names
brew install gnu-tar --default-names
brew install gnu-sed --default-names
brew install gnutls --default-names
brew install grep --default-names
brew install python --with-brewed-openssl
brew install openssh --with-brewed-openssl
brew install macvim --override-system-vim --custom-system-icons
brew install vim --override-system-vi
# # #
# Update core OS X tools
# # #
brew install openssl bash emacs gpatch nano m4 make curl rsync
brew install git ctags jq most the_silver_searcher colordiff mercurial tree htop-osx
brew install z figlet gource youtube-dl jpeg ffmpeg faac lame webp x264 xvid
brew install mongodb redis
brew install go node python3
brew install rbenv ruby-build rbenv-aliases rbenv-default-gems rbenv-gem-rehash rbenv-vars
brew install zsh zsh-completions zsh-history-substring-search zsh-lovers zsh-syntax-highlighting
# link restricted formulae
brew link curl --force
# # #
# OPTIONAL: also link sqlite
# # #
# brew link sqlite --force
# # #
# OPTIONAL: set zsh as your login shell
# # #
# sudo chsh -s $(which zsh)
# # #
# nodeJS configuration
# # #
npm install -g coffee-script bower grunt-cli
echo 'Add the following to your ~/.bashrc or ~/.zshrc:'
echo ''
echo '# GNU utils PATH'
echo 'gnu_dir="$(brew --prefix coreutils)"'
echo 'export PATH="$gnu_dir/libexec/gnubin:$PATH"'
echo 'export MANPATH="$gnu_dir/libexec/gnuman:$MANPATH"'
echo ''
echo '# sed'
echo 'sed_dir="$(brew --prefix gnu-sed)"'
echo 'PATH="$sed_dir/libexec/gnubin:$PATH"'
echo 'MANPATH="$sed_dir/libexec/gnuman:$MANPATH"'
echo ''
echo '# tar'
echo 'tar_dir="$(brew --prefix gnu-tar)"'
echo 'PATH="$tar_dir/libexec/gnubin:$PATH"'
echo ''
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment