Skip to content

Instantly share code, notes, and snippets.

@andrewharmellaw
Forked from codeinthehole/osx_bootstrap.sh
Last active January 8, 2021 09:46
Show Gist options
  • Save andrewharmellaw/71e76430661dc095a252ecc2892d12dc to your computer and use it in GitHub Desktop.
Save andrewharmellaw/71e76430661dc095a252ecc2892d12dc to your computer and use it in GitHub Desktop.

Revisions

  1. andrewharmellaw revised this gist Jan 8, 2021. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -73,7 +73,6 @@ CASKS=(
    alfred
    box-sync
    docker
    dropbox
    evernote
    firefox
    gpg-suite
  2. andrewharmellaw revised this gist Jan 4, 2021. 1 changed file with 5 additions and 8 deletions.
    13 changes: 5 additions & 8 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/usr/bin/env bash
    #
    #
    # Bootstrap script for setting up a new OSX machine
    #
    #
    # This should be idempotent so it can be run multiple times.
    #
    # Some apps don't have a cask and so still need to be installed by hand. These
    @@ -106,6 +106,7 @@ echo "Mac App Store Apps - TBC"
    #ipython
    #)
    #sudo pip install ${PYTHON_PACKAGES[@]}

    echo "Installing Ruby gems"
    RUBY_GEMS=(
    bundler
    @@ -123,7 +124,7 @@ echo "Install various Java versions"
    sh -c ./brew_install_java.sh

    # If rustc isn't available, install Rust via (Rustup)
    if ! $(which rustc); then
    if ! $(which rustc); then
    echo "Installing Rust..."
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    source $HOME/.cargo/env
    @@ -140,10 +141,6 @@ fi

    echo "Configuring OSX..."

    # Require password as soon as screensaver or sleep mode starts
    defaults write com.apple.screensaver askForPassword -int 1
    defaults write com.apple.screensaver askForPasswordDelay -int 0

    # Show filename extensions by default
    defaults write NSGlobalDomain AppleShowAllExtensions -bool true

    @@ -157,4 +154,4 @@ echo "Creating folder structure..."
    [[ ! -d Workspaces/Personal ]] && mkdir Workspaces/Personal
    [[ ! -d Workspaces/TW ]] && mkdir Workspaces/TW

    echo "Bootstrapping complete"
    echo "Bootstrapping complete"
  3. andrewharmellaw revised this gist Jan 1, 2021. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -54,7 +54,6 @@ brew update
    PACKAGES=(
    git
    graphviz
    jenv
    keybase
    libressl
    npm
    @@ -120,7 +119,10 @@ npm install marked -g
    echo "Please look at the osx_bootstrap.sh and setup oh-my-zsh manually."
    # sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

    # If rustc isn't available, install Rustup
    echo "Install various Java versions"
    sh -c ./brew_install_java.sh

    # If rustc isn't available, install Rust via (Rustup)
    if ! $(which rustc); then
    echo "Installing Rust..."
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  4. andrewharmellaw revised this gist Jan 1, 2021. 1 changed file with 29 additions and 74 deletions.
    103 changes: 29 additions & 74 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/usr/bin/env bash
    #
    #
    # Bootstrap script for setting up a new OSX machine
    #
    #
    # This should be idempotent so it can be run multiple times.
    #
    # Some apps don't have a cask and so still need to be installed by hand. These
    @@ -10,6 +10,11 @@
    # - TBC
    #
    # Notes:
    # - You'll need to install the Xcode command line tools for things like Rust to
    # work. (See https://www.studytonight.com/post/solved-mac-os-xcrun-error-invalid-active-developer-path-missing-xcrun
    # for more info.) To install run:
    #
    # xcode-select --install
    #
    # - If installing full Xcode, it's better to install that first from the app
    # store before running the bootstrap script. Otherwise, Homebrew can't access
    @@ -23,11 +28,11 @@
    # - http://notes.jerzygangi.com/the-best-pgp-tutorial-for-mac-os-x-ever/

    echo "Starting bootstrapping"
    echo "(Make sure you've done the pre-requisites in the comment at the top of this script.)"

    # Check for Homebrew, install if we don't have it
    if test ! $(which brew); then
    echo "Installing homebrew..."
    # ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
    fi

    @@ -47,39 +52,14 @@ brew update
    #brew install findutils

    PACKAGES=(
    #ack
    #autoconf
    #automake
    #boot2docker
    #ffmpeg
    #gettext
    #gifsicle
    git
    graphviz
    #hub
    #imagemagick
    jenv
    #jq
    #libjpeg
    #libmemcached
    #lynx
    #markdown
    #memcached
    #mercurial
    keybase
    libressl
    npm
    #pkg-config
    #postgresql
    #python
    python3
    #pypy
    #rabbitmq
    rbenv
    #rename
    #ssh-copy-id
    #terminal-notifier
    #the_silver_searcher
    #tmux
    #tree
    vim
    wget
    )
    @@ -90,84 +70,46 @@ brew install ${PACKAGES[@]}
    echo "Cleaning up..."
    brew cleanup

    # echo "Installing cask..."
    # brew install caskroom/cask/brew-cask

    CASKS=(
    alfred
    box-sync
    #colluquy
    docker
    dropbox
    evernote
    firefox
    #flux
    #google-chrome
    #google-drive
    #gpgtools
    gpg-suite
    intellij-idea
    iterm2
    macdown
    #macvim
    #skype
    slack
    #spectacle
    sublime-text
    tomighty
    #vagrant
    #virtualbox
    #vlc
    visual-studio-code
    zulip
    )

    echo "Installing cask apps..."
    brew install --cask ${CASKS[@]}

    echo "Installing Java..."
    brew tap adoptopenjdk/openjdk
    brew install --cask adoptopenjdk13

    #echo "Setting up jenv" - NOTE: I NEED TO MAKE THESE IDEMPOTENT SO FOR NOW YOU NEED TO RUN THEM MANUALLY
    echo "Please look at the osx_bootstrap.sh and setup jenv manually."
    #echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc
    # grep -q -F 'eval "$(jenv init -)"' ~/.zshrc || echo 'eval "$(jenv init -)"' >> ~/.zshrc
    # jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home

    echo "Mac App Store Apps - TBC"
    # https://github.com/mas-cli/mas
    # Trello

    echo "Installing fonts via brew..."
    #echo "Installing fonts..."
    #brew tap caskroom/fonts
    #FONTS=(
    # font-inconsolidata
    # font-roboto
    # font-clear-sans
    #)
    #brew cask install ${FONTS[@]}

    #echo "Installing Powerline fonts..." - NOTE: I NEED TO MAKE THIS IDEMPOTENT SO FOR NOW YOU NEED TO RUN IT MANUALLY
    echo "Please look at the osx_bootstrap.sh and setup Powerline Fonts (for oh-my-zsh) manually."
    #git clone https://github.com/powerline/fonts.git --depth=1
    #cd fonts
    #./install.sh
    #cd ..
    #rm -rf fonts

    #echo "Installing Python packages..."
    #PYTHON_PACKAGES=(
    #ipython
    #virtualenv
    #virtualenvwrapper
    #)
    #sudo pip install ${PYTHON_PACKAGES[@]}

    echo "Installing Ruby gems"
    RUBY_GEMS=(
    bundler
    #filewatcher
    #cocoapods
    )
    sudo gem install ${RUBY_GEMS[@]}

    @@ -178,10 +120,23 @@ npm install marked -g
    echo "Please look at the osx_bootstrap.sh and setup oh-my-zsh manually."
    # sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

    echo "Configuring OSX..."
    # If rustc isn't available, install Rustup
    if ! $(which rustc); then
    echo "Installing Rust..."
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    source $HOME/.cargo/env
    fi

    # If ponyc isn't available, install Ponyup
    #if ! $(which ponyc); then
    # echo "Installing Pony..."
    # sh -c "$(curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/ponylang/ponyup/latest-release/ponyup-init.sh)"
    # NOTE: Need to add the ponylang binary dir to $PATH here - I'm writing path-updater in rust to do this...
    # ponyup update ponyc release
    # ponyup update corral release
    #fi

    # Set fast key repeat rate
    defaults write NSGlobalDomain KeyRepeat -int 0
    echo "Configuring OSX..."

    # Require password as soon as screensaver or sleep mode starts
    defaults write com.apple.screensaver askForPassword -int 1
    @@ -200,4 +155,4 @@ echo "Creating folder structure..."
    [[ ! -d Workspaces/Personal ]] && mkdir Workspaces/Personal
    [[ ! -d Workspaces/TW ]] && mkdir Workspaces/TW

    echo "Bootstrapping complete"
    echo "Bootstrapping complete"
  5. andrewharmellaw revised this gist Dec 30, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -131,7 +131,7 @@ brew install --cask adoptopenjdk13
    #echo "Setting up jenv" - NOTE: I NEED TO MAKE THESE IDEMPOTENT SO FOR NOW YOU NEED TO RUN THEM MANUALLY
    echo "Please look at the osx_bootstrap.sh and setup jenv manually."
    #echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc
    #echo 'eval "$(jenv init -)"' >> ~/.zshrc
    # grep -q -F 'eval "$(jenv init -)"' ~/.zshrc || echo 'eval "$(jenv init -)"' >> ~/.zshrc
    # jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home

    echo "Mac App Store Apps - TBC"
  6. andrewharmellaw revised this gist Dec 30, 2020. 1 changed file with 14 additions and 6 deletions.
    20 changes: 14 additions & 6 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -46,10 +46,6 @@ brew update
    # Install GNU `find`, `locate`, `updatedb`, and `xargs`, g-prefixed
    #brew install findutils

    # TODO install oh-my-zsh
    sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
    #brew install bash

    PACKAGES=(
    #ack
    #autoconf
    @@ -133,7 +129,7 @@ brew tap adoptopenjdk/openjdk
    brew install --cask adoptopenjdk13

    #echo "Setting up jenv" - NOTE: I NEED TO MAKE THESE IDEMPOTENT SO FOR NOW YOU NEED TO RUN THEM MANUALLY
    echo "Please look at the osx_bootstrap.sh and setup jenv manually"
    echo "Please look at the osx_bootstrap.sh and setup jenv manually."
    #echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc
    #echo 'eval "$(jenv init -)"' >> ~/.zshrc
    # jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home
    @@ -142,7 +138,7 @@ echo "Mac App Store Apps - TBC"
    # https://github.com/mas-cli/mas
    # Trello

    #echo "Installing fonts..."
    echo "Installing fonts via brew..."
    #brew tap caskroom/fonts
    #FONTS=(
    # font-inconsolidata
    @@ -151,6 +147,14 @@ echo "Mac App Store Apps - TBC"
    #)
    #brew cask install ${FONTS[@]}

    #echo "Installing Powerline fonts..." - NOTE: I NEED TO MAKE THIS IDEMPOTENT SO FOR NOW YOU NEED TO RUN IT MANUALLY
    echo "Please look at the osx_bootstrap.sh and setup Powerline Fonts (for oh-my-zsh) manually."
    #git clone https://github.com/powerline/fonts.git --depth=1
    #cd fonts
    #./install.sh
    #cd ..
    #rm -rf fonts

    #echo "Installing Python packages..."
    #PYTHON_PACKAGES=(
    #ipython
    @@ -170,6 +174,10 @@ sudo gem install ${RUBY_GEMS[@]}
    echo "Installing global npm packages..."
    npm install marked -g

    # echo "Installing oh-my-zsh..." - NOTE: I NEED TO MAKE THIS IDEMPOTENT SO FOR NOW YOU NEED TO RUN IT MANUALLY
    echo "Please look at the osx_bootstrap.sh and setup oh-my-zsh manually."
    # sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

    echo "Configuring OSX..."

    # Set fast key repeat rate
  7. andrewharmellaw revised this gist Dec 30, 2020. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -101,6 +101,7 @@ CASKS=(
    alfred
    box-sync
    #colluquy
    docker
    dropbox
    evernote
    firefox
    @@ -131,6 +132,12 @@ echo "Installing Java..."
    brew tap adoptopenjdk/openjdk
    brew install --cask adoptopenjdk13

    #echo "Setting up jenv" - NOTE: I NEED TO MAKE THESE IDEMPOTENT SO FOR NOW YOU NEED TO RUN THEM MANUALLY
    echo "Please look at the osx_bootstrap.sh and setup jenv manually"
    #echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc
    #echo 'eval "$(jenv init -)"' >> ~/.zshrc
    # jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home

    echo "Mac App Store Apps - TBC"
    # https://github.com/mas-cli/mas
    # Trello
  8. andrewharmellaw revised this gist Dec 30, 2020. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -121,6 +121,7 @@ CASKS=(
    #vagrant
    #virtualbox
    #vlc
    zulip
    )

    echo "Installing cask apps..."
    @@ -133,8 +134,6 @@ brew install --cask adoptopenjdk13
    echo "Mac App Store Apps - TBC"
    # https://github.com/mas-cli/mas
    # Trello
    # Alfred
    # Itsycal

    #echo "Installing fonts..."
    #brew tap caskroom/fonts
  9. andrewharmellaw revised this gist Dec 30, 2020. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -62,6 +62,7 @@ PACKAGES=(
    graphviz
    #hub
    #imagemagick
    jenv
    #jq
    #libjpeg
    #libmemcached
    @@ -76,6 +77,7 @@ PACKAGES=(
    python3
    #pypy
    #rabbitmq
    rbenv
    #rename
    #ssh-copy-id
    #terminal-notifier
    @@ -96,20 +98,25 @@ brew cleanup
    # brew install caskroom/cask/brew-cask

    CASKS=(
    alfred
    box-sync
    #colluquy
    dropbox
    evernote
    firefox
    #flux
    #google-chrome
    #google-drive
    #gpgtools
    gpg-suite
    intellij-idea
    iterm2
    macdown
    #macvim
    #skype
    slack
    #spectacle
    sublime-text
    tomighty
    #vagrant
    #virtualbox
  10. andrewharmellaw revised this gist Dec 30, 2020. 1 changed file with 11 additions and 11 deletions.
    22 changes: 11 additions & 11 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -119,24 +119,24 @@ CASKS=(
    echo "Installing cask apps..."
    brew install --cask ${CASKS[@]}

    #echo "Installing Java..."
    #brew tap adoptopenjdk/openjdk
    #brew cask install adoptopenjdk13
    echo "Installing Java..."
    brew tap adoptopenjdk/openjdk
    brew install --cask adoptopenjdk13

    echo "Mac App Store Apps - TBC"
    # https://github.com/mas-cli/mas
    # Trello
    # Alfred
    # Itsycal

    echo "Installing fonts..."
    brew tap caskroom/fonts
    FONTS=(
    font-inconsolidata
    font-roboto
    font-clear-sans
    )
    brew cask install ${FONTS[@]}
    #echo "Installing fonts..."
    #brew tap caskroom/fonts
    #FONTS=(
    # font-inconsolidata
    # font-roboto
    # font-clear-sans
    #)
    #brew cask install ${FONTS[@]}

    #echo "Installing Python packages..."
    #PYTHON_PACKAGES=(
  11. andrewharmellaw revised this gist Dec 30, 2020. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -92,8 +92,8 @@ brew install ${PACKAGES[@]}
    echo "Cleaning up..."
    brew cleanup

    echo "Installing cask..."
    brew install caskroom/cask/brew-cask
    # echo "Installing cask..."
    # brew install caskroom/cask/brew-cask

    CASKS=(
    box-sync
    @@ -117,7 +117,7 @@ CASKS=(
    )

    echo "Installing cask apps..."
    brew cask install ${CASKS[@]}
    brew install --cask ${CASKS[@]}

    #echo "Installing Java..."
    #brew tap adoptopenjdk/openjdk
  12. andrewharmellaw revised this gist Dec 28, 2020. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -27,7 +27,8 @@ echo "Starting bootstrapping"
    # Check for Homebrew, install if we don't have it
    if test ! $(which brew); then
    echo "Installing homebrew..."
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    # ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
    fi

    # Update homebrew recipes
    @@ -46,6 +47,7 @@ brew update
    #brew install findutils

    # TODO install oh-my-zsh
    sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
    #brew install bash

    PACKAGES=(
    @@ -117,6 +119,10 @@ CASKS=(
    echo "Installing cask apps..."
    brew cask install ${CASKS[@]}

    #echo "Installing Java..."
    #brew tap adoptopenjdk/openjdk
    #brew cask install adoptopenjdk13

    echo "Mac App Store Apps - TBC"
    # https://github.com/mas-cli/mas
    # Trello
  13. andrewharmellaw revised this gist Dec 28, 2020. 1 changed file with 19 additions and 17 deletions.
    36 changes: 19 additions & 17 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -84,10 +84,6 @@ PACKAGES=(
    wget
    )

    echo "Mac App Store Apps"
    # https://github.com/mas-cli/mas
    # Trello

    echo "Installing packages..."
    brew install ${PACKAGES[@]}

    @@ -105,7 +101,8 @@ CASKS=(
    #flux
    #google-chrome
    #google-drive
    gpgtools
    #gpgtools
    gpg-suite
    iterm2
    #macvim
    #skype
    @@ -120,6 +117,12 @@ CASKS=(
    echo "Installing cask apps..."
    brew cask install ${CASKS[@]}

    echo "Mac App Store Apps - TBC"
    # https://github.com/mas-cli/mas
    # Trello
    # Alfred
    # Itsycal

    echo "Installing fonts..."
    brew tap caskroom/fonts
    FONTS=(
    @@ -129,13 +132,13 @@ FONTS=(
    )
    brew cask install ${FONTS[@]}

    echo "Installing Python packages..."
    PYTHON_PACKAGES=(
    #echo "Installing Python packages..."
    #PYTHON_PACKAGES=(
    #ipython
    #virtualenv
    #virtualenvwrapper
    )
    sudo pip install ${PYTHON_PACKAGES[@]}
    #)
    #sudo pip install ${PYTHON_PACKAGES[@]}

    echo "Installing Ruby gems"
    RUBY_GEMS=(
    @@ -160,15 +163,14 @@ defaults write com.apple.screensaver askForPasswordDelay -int 0
    # Show filename extensions by default
    defaults write NSGlobalDomain AppleShowAllExtensions -bool true

    # Enable tap-to-click
    defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
    defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1

    # Disable "natural" scroll
    defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
    # Show hidden files in Finder
    defaults write com.apple.Finder AppleShowAllFiles true
    killall Finder

    echo "Creating folder structure..."
    [[ ! -d Wiki ]] && mkdir Wiki
    [[ ! -d Workspace ]] && mkdir Workspace
    [[ ! -d Workspaces ]] && mkdir Workspaces
    [[ ! -d Workspaces/Clients ]] && mkdir Workspaces/Clients
    [[ ! -d Workspaces/Personal ]] && mkdir Workspaces/Personal
    [[ ! -d Workspaces/TW ]] && mkdir Workspaces/TW

    echo "Bootstrapping complete"
  14. andrewharmellaw revised this gist Dec 27, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -111,6 +111,7 @@ CASKS=(
    #skype
    slack
    #spectacle
    tomighty
    #vagrant
    #virtualbox
    #vlc
  15. andrewharmellaw revised this gist Dec 27, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -98,6 +98,7 @@ echo "Installing cask..."
    brew install caskroom/cask/brew-cask

    CASKS=(
    box-sync
    #colluquy
    dropbox
    firefox
  16. andrewharmellaw revised this gist Dec 27, 2020. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -84,6 +84,10 @@ PACKAGES=(
    wget
    )

    echo "Mac App Store Apps"
    # https://github.com/mas-cli/mas
    # Trello

    echo "Installing packages..."
    brew install ${PACKAGES[@]}

  17. andrewharmellaw revised this gist Dec 27, 2020. 1 changed file with 53 additions and 54 deletions.
    107 changes: 53 additions & 54 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -7,8 +7,7 @@
    # Some apps don't have a cask and so still need to be installed by hand. These
    # include:
    #
    # - Twitter (app store)
    # - Postgres.app (http://postgresapp.com/)
    # - TBC
    #
    # Notes:
    #
    @@ -35,52 +34,52 @@ fi
    brew update

    # Install GNU core utilities (those that come with OS X are outdated)
    brew tap homebrew/dupes
    brew install coreutils
    brew install gnu-sed --with-default-names
    brew install gnu-tar --with-default-names
    brew install gnu-indent --with-default-names
    brew install gnu-which --with-default-names
    brew install gnu-grep --with-default-names
    #brew tap homebrew/dupes
    #brew install coreutils
    #brew install gnu-sed --with-default-names
    #brew install gnu-tar --with-default-names
    #brew install gnu-indent --with-default-names
    #brew install gnu-which --with-default-names
    #brew install gnu-grep --with-default-names

    # Install GNU `find`, `locate`, `updatedb`, and `xargs`, g-prefixed
    brew install findutils
    #brew install findutils

    # Install Bash 4
    brew install bash
    # TODO install oh-my-zsh
    #brew install bash

    PACKAGES=(
    ack
    autoconf
    automake
    boot2docker
    ffmpeg
    gettext
    gifsicle
    #ack
    #autoconf
    #automake
    #boot2docker
    #ffmpeg
    #gettext
    #gifsicle
    git
    graphviz
    hub
    imagemagick
    jq
    libjpeg
    libmemcached
    lynx
    markdown
    memcached
    mercurial
    #hub
    #imagemagick
    #jq
    #libjpeg
    #libmemcached
    #lynx
    #markdown
    #memcached
    #mercurial
    npm
    pkg-config
    postgresql
    python
    #pkg-config
    #postgresql
    #python
    python3
    pypy
    rabbitmq
    rename
    ssh-copy-id
    terminal-notifier
    the_silver_searcher
    tmux
    tree
    #pypy
    #rabbitmq
    #rename
    #ssh-copy-id
    #terminal-notifier
    #the_silver_searcher
    #tmux
    #tree
    vim
    wget
    )
    @@ -95,21 +94,21 @@ echo "Installing cask..."
    brew install caskroom/cask/brew-cask

    CASKS=(
    colluquy
    #colluquy
    dropbox
    firefox
    flux
    google-chrome
    google-drive
    #flux
    #google-chrome
    #google-drive
    gpgtools
    iterm2
    macvim
    skype
    #macvim
    #skype
    slack
    spectacle
    vagrant
    virtualbox
    vlc
    #spectacle
    #vagrant
    #virtualbox
    #vlc
    )

    echo "Installing cask apps..."
    @@ -126,17 +125,17 @@ brew cask install ${FONTS[@]}

    echo "Installing Python packages..."
    PYTHON_PACKAGES=(
    ipython
    virtualenv
    virtualenvwrapper
    #ipython
    #virtualenv
    #virtualenvwrapper
    )
    sudo pip install ${PYTHON_PACKAGES[@]}

    echo "Installing Ruby gems"
    RUBY_GEMS=(
    bundler
    filewatcher
    cocoapods
    #filewatcher
    #cocoapods
    )
    sudo gem install ${RUBY_GEMS[@]}

  18. @codeinthehole codeinthehole created this gist Mar 30, 2015.
    169 changes: 169 additions & 0 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,169 @@
    #!/usr/bin/env bash
    #
    # Bootstrap script for setting up a new OSX machine
    #
    # This should be idempotent so it can be run multiple times.
    #
    # Some apps don't have a cask and so still need to be installed by hand. These
    # include:
    #
    # - Twitter (app store)
    # - Postgres.app (http://postgresapp.com/)
    #
    # Notes:
    #
    # - If installing full Xcode, it's better to install that first from the app
    # store before running the bootstrap script. Otherwise, Homebrew can't access
    # the Xcode libraries as the agreement hasn't been accepted yet.
    #
    # Reading:
    #
    # - http://lapwinglabs.com/blog/hacker-guide-to-setting-up-your-mac
    # - https://gist.github.com/MatthewMueller/e22d9840f9ea2fee4716
    # - https://news.ycombinator.com/item?id=8402079
    # - http://notes.jerzygangi.com/the-best-pgp-tutorial-for-mac-os-x-ever/

    echo "Starting bootstrapping"

    # Check for Homebrew, install if we don't have it
    if test ! $(which brew); then
    echo "Installing homebrew..."
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    fi

    # Update homebrew recipes
    brew update

    # Install GNU core utilities (those that come with OS X are outdated)
    brew tap homebrew/dupes
    brew install coreutils
    brew install gnu-sed --with-default-names
    brew install gnu-tar --with-default-names
    brew install gnu-indent --with-default-names
    brew install gnu-which --with-default-names
    brew install gnu-grep --with-default-names

    # Install GNU `find`, `locate`, `updatedb`, and `xargs`, g-prefixed
    brew install findutils

    # Install Bash 4
    brew install bash

    PACKAGES=(
    ack
    autoconf
    automake
    boot2docker
    ffmpeg
    gettext
    gifsicle
    git
    graphviz
    hub
    imagemagick
    jq
    libjpeg
    libmemcached
    lynx
    markdown
    memcached
    mercurial
    npm
    pkg-config
    postgresql
    python
    python3
    pypy
    rabbitmq
    rename
    ssh-copy-id
    terminal-notifier
    the_silver_searcher
    tmux
    tree
    vim
    wget
    )

    echo "Installing packages..."
    brew install ${PACKAGES[@]}

    echo "Cleaning up..."
    brew cleanup

    echo "Installing cask..."
    brew install caskroom/cask/brew-cask

    CASKS=(
    colluquy
    dropbox
    firefox
    flux
    google-chrome
    google-drive
    gpgtools
    iterm2
    macvim
    skype
    slack
    spectacle
    vagrant
    virtualbox
    vlc
    )

    echo "Installing cask apps..."
    brew cask install ${CASKS[@]}

    echo "Installing fonts..."
    brew tap caskroom/fonts
    FONTS=(
    font-inconsolidata
    font-roboto
    font-clear-sans
    )
    brew cask install ${FONTS[@]}

    echo "Installing Python packages..."
    PYTHON_PACKAGES=(
    ipython
    virtualenv
    virtualenvwrapper
    )
    sudo pip install ${PYTHON_PACKAGES[@]}

    echo "Installing Ruby gems"
    RUBY_GEMS=(
    bundler
    filewatcher
    cocoapods
    )
    sudo gem install ${RUBY_GEMS[@]}

    echo "Installing global npm packages..."
    npm install marked -g

    echo "Configuring OSX..."

    # Set fast key repeat rate
    defaults write NSGlobalDomain KeyRepeat -int 0

    # Require password as soon as screensaver or sleep mode starts
    defaults write com.apple.screensaver askForPassword -int 1
    defaults write com.apple.screensaver askForPasswordDelay -int 0

    # Show filename extensions by default
    defaults write NSGlobalDomain AppleShowAllExtensions -bool true

    # Enable tap-to-click
    defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
    defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1

    # Disable "natural" scroll
    defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false

    echo "Creating folder structure..."
    [[ ! -d Wiki ]] && mkdir Wiki
    [[ ! -d Workspace ]] && mkdir Workspace

    echo "Bootstrapping complete"