Skip to content

Instantly share code, notes, and snippets.

@Blumed
Forked from codeinthehole/osx_bootstrap.sh
Last active November 10, 2017 14:54
Show Gist options
  • Save Blumed/6456b8b93cf35f6e38536ba7ff5be0d4 to your computer and use it in GitHub Desktop.
Save Blumed/6456b8b93cf35f6e38536ba7ff5be0d4 to your computer and use it in GitHub Desktop.

Revisions

  1. Blumed revised this gist Nov 10, 2017. 1 changed file with 18 additions and 104 deletions.
    122 changes: 18 additions & 104 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -4,12 +4,6 @@
    #
    # 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
    @@ -22,9 +16,16 @@
    # - 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/
    #
    # Found install script here:
    #
    # - https://gist.github.com/codeinthehole/26b37efa67041e1307db

    echo "Starting bootstrapping"

    echo "Installing Xcode commandline tools"
    xcode-select --install

    # Check for Homebrew, install if we don't have it
    if test ! $(which brew); then
    echo "Installing homebrew..."
    @@ -34,54 +35,11 @@ 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
    node
    npm
    pkg-config
    postgresql
    python
    python3
    pypy
    rabbitmq
    rename
    ssh-copy-id
    terminal-notifier
    the_silver_searcher
    tmux
    tree
    vim
    wget
    )

    @@ -95,21 +53,11 @@ echo "Installing cask..."
    brew install caskroom/cask/brew-cask

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

    echo "Installing cask apps..."
    @@ -119,51 +67,17 @@ echo "Installing fonts..."
    brew tap caskroom/fonts
    FONTS=(
    font-inconsolidata
    font-firacode-nerd-font
    font-roboto
    font-clear-sans
    font-source-sans-pro
    )
    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 nvm..."
    touch ~/.bash_profile
    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash

    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
    npm install gulp gulp-cli -g

    echo "Bootstrapping complete"
    echo "Bootstrapping complete"
  2. @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"