Skip to content

Instantly share code, notes, and snippets.

@JackBracken
Created May 13, 2016 14:58
Show Gist options
  • Save JackBracken/458b4b164a4f1f2992703b81a9e352ca to your computer and use it in GitHub Desktop.
Save JackBracken/458b4b164a4f1f2992703b81a9e352ca to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Ask for the administrator password upfront.
sudo -v
# Keep-alive: update existing `sudo` time stamp until the script has finished.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Install xcode command line tools
xcode-select --install
# Install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install various useful utilities
brew install coreutils
# Install some other useful utilities like `sponge`.
brew install moreutils
# Install GNU `find`, `locate`, `updatedb`, and `xargs`, `g`-prefixed.
brew install findutils --with-default-names
# Install GNU `tar`
brew install gnu-tar --with-default-names
# Install GNU `sed`, overwriting the built-in `sed`.
brew install gnu-sed --with-default-names
brew install wget --with-iri
brew install jq
brew install homebrew/dupes/grep --with-default-names
brew tap caskroom/versions
brew install ack
brew install git
# Remove outdated versions from the cellar.
brew cleanup
# Add gnu-tar and gnu coreutils bin directories to beginning of path so we don't need to prefix them with `g`
BREW_PATH=`brew --prefix`
GNUTAR_PATH=`brew --prefix gnu-tar`
CUTILS_PATH=`brew --prefix coreutils`
sudo ln -s $BREW_PATH/bin/gsha256sum $BREW_PATH/bin/sha256sum
echo "export PATH=\"$GNUTAR_PATH/libexec/gnubin:$CUTILS_PATH/libexec/gnubin:$HOME/bin:$PATH\"" >> $HOME/.bash_profile
echo "export MANPATH=\"$CUTILS_PATH/libexec/gnuman:$BREW_PATH/man:$MANPATH\"" >> $HOME/.bash_profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment