Skip to content

Instantly share code, notes, and snippets.

@buglessdr
Forked from codeinthehole/osx_bootstrap.sh
Last active November 23, 2020 21:02
Show Gist options
  • Save buglessdr/9ba653cb2aff31137c7d01e5d250ab6c to your computer and use it in GitHub Desktop.
Save buglessdr/9ba653cb2aff31137c7d01e5d250ab6c to your computer and use it in GitHub Desktop.

Revisions

  1. buglessdr revised this gist Nov 23, 2020. No changes.
  2. buglessdr revised this gist Nov 23, 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
    @@ -115,6 +115,7 @@ CASKS=(
    slack
    snagit
    vagrant
    #this can fail because of OSX settings - may need to setup install apart.
    virtualbox
    visual-studio-code
    vlc
  3. buglessdr revised this gist Nov 23, 2020. 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
    @@ -109,7 +109,6 @@ CASKS=(
    firefox
    grammarly
    iterm2
    macvim
    microsoft-office
    pycharm-ce
    skype
  4. buglessdr revised this gist Nov 23, 2020. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -109,7 +109,6 @@ CASKS=(
    firefox
    grammarly
    iterm2
    java11
    macvim
    microsoft-office
    pycharm-ce
    @@ -125,6 +124,12 @@ CASKS=(
    echo "Installing cask apps..."
    brew cask install ${CASKS[@]}

    echo "Installing java11..."
    brew install java11
    sudo ln -sfn /usr/local/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk
    echo 'export PATH="/usr/local/opt/openjdk@11/bin:$PATH"' >> ~/.zshrc
    export CPPFLAGS="-I/usr/local/opt/openjdk@11/include"

    echo "Installing fonts..."
    brew tap caskroom/fonts
    FONTS=(
  5. buglessdr revised this gist Nov 23, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -98,6 +98,9 @@ brew tap homebrew/cask
    echo "Setting up tap..."
    brew tap homebrew/cask-versions

    echo "adding tap for core..."
    brew tap homebrew/core

    CASKS=(
    #citrix-workspace
    #this isn't working right now unsure why.
  6. buglessdr revised this gist Nov 23, 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
    @@ -93,7 +93,7 @@ echo "Cleaning up..."
    brew cleanup

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

    echo "Setting up tap..."
    brew tap homebrew/cask-versions
  7. buglessdr revised this gist Nov 23, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -95,6 +95,9 @@ brew cleanup
    echo "Installing cask..."
    brew install caskroom/cask/brew-cask

    echo "Setting up tap..."
    brew tap homebrew/cask-versions

    CASKS=(
    #citrix-workspace
    #this isn't working right now unsure why.
  8. buglessdr revised this gist Nov 23, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -96,7 +96,8 @@ echo "Installing cask..."
    brew install caskroom/cask/brew-cask

    CASKS=(
    citrix-workspace
    #citrix-workspace
    #this isn't working right now unsure why.
    docker
    dropbox
    firefox
  9. buglessdr revised this gist Nov 23, 2020. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -101,8 +101,6 @@ CASKS=(
    dropbox
    firefox
    grammarly
    google-chrome
    gpgtools
    iterm2
    java11
    macvim
  10. buglessdr revised this gist Nov 23, 2020. 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
    @@ -100,7 +100,6 @@ CASKS=(
    docker
    dropbox
    firefox
    flux
    grammarly
    google-chrome
    gpgtools
  11. buglessdr revised this gist Nov 23, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -108,11 +108,13 @@ CASKS=(
    java11
    macvim
    microsoft-office
    pycharm-ce
    skype
    slack
    snagit
    vagrant
    virtualbox
    visual-studio-code
    vlc
    )

  12. buglessdr revised this gist Nov 23, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -97,11 +97,11 @@ brew install caskroom/cask/brew-cask

    CASKS=(
    citrix-workspace
    colluquy
    docker
    dropbox
    firefox
    flux
    grammarly
    google-chrome
    gpgtools
    iterm2
    @@ -110,7 +110,7 @@ CASKS=(
    microsoft-office
    skype
    slack
    spectacle
    snagit
    vagrant
    virtualbox
    vlc
  13. buglessdr revised this gist Nov 23, 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
    @@ -107,6 +107,7 @@ CASKS=(
    iterm2
    java11
    macvim
    microsoft-office
    skype
    slack
    spectacle
  14. buglessdr revised this gist Nov 23, 2020. 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
    @@ -103,7 +103,6 @@ CASKS=(
    firefox
    flux
    google-chrome
    google-drive
    gpgtools
    iterm2
    java11
  15. buglessdr revised this gist Nov 23, 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
    @@ -83,6 +83,7 @@ PACKAGES=(
    tree
    vim
    wget
    zsh
    )

    echo "Installing packages..."
  16. buglessdr revised this gist Nov 23, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions osx_bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -95,14 +95,17 @@ echo "Installing cask..."
    brew install caskroom/cask/brew-cask

    CASKS=(
    citrix-workspace
    colluquy
    docker
    dropbox
    firefox
    flux
    google-chrome
    google-drive
    gpgtools
    iterm2
    java11
    macvim
    skype
    slack
  17. @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"