Skip to content

Instantly share code, notes, and snippets.

@llimllib
Last active February 19, 2024 13:56
Show Gist options
  • Save llimllib/aa4420cac617774ee2a54d8603d862e4 to your computer and use it in GitHub Desktop.
Save llimllib/aa4420cac617774ee2a54d8603d862e4 to your computer and use it in GitHub Desktop.

Revisions

  1. llimllib revised this gist Mar 15, 2021. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    #!/usr/bin/env bash
    # many settings from https://raw.githubusercontent.com/mathiasbynens/dotfiles/master/.macos
    # many settings from https://raw.githubusercontent.com/thoughtbot/laptop/master/mac
    # instructions on finding the default you've changed: https://pawelgrzybek.com/change-macos-user-preferences-via-command-line/
    # previous install notes at:
    # https://gist.github.com/llimllib/ee591266e05bd880629a4e7511a61bb3
    # https://gist.github.com/llimllib/e864a92da94ceb1ef0da2e06fd1f8d70
  2. llimllib revised this gist Jan 8, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -115,6 +115,9 @@ defaults write com.apple.driver.AppleBluetoothMultitouch.mouse TrackpadTwoFinger
    # fix key repeat in vs code. I don't use it that often, but this is necessary when I do
    defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false

    # speed up window opening by disabling animation
    defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool NO

    # reboot systemUIServer to enable defaults to take effect
    killall SystemUIServer

  3. llimllib revised this gist May 3, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install.sh
    Original file line number Diff line number Diff line change
    @@ -201,7 +201,6 @@ sudo chsh -s /usr/local/bin/bash llimllib

    brew tap caskroom/cask
    brew cask install alfred
    brew cask install caffeine
    brew cask install chromium
    brew cask install docker
    brew cask install firefox
    @@ -210,6 +209,7 @@ brew cask install hipchat
    brew cask install iterm2
    brew cask install java
    brew cask install karabiner-elements # and copy karabiner config folder into ~/.config
    brew cask install keepingyouawake
    brew cask install keybase
    brew cask install kindle
    brew cask install macvim
  4. llimllib revised this gist Jan 15, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -142,6 +142,7 @@ brew install autoconf
    brew install automake
    brew install bash
    brew install cmake
    brew install colordiff
    brew install coreutils
    brew install curl
    brew install dep
  5. llimllib revised this gist Jan 13, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -215,6 +215,7 @@ brew cask install macvim
    brew cask install slack
    brew cask install spotify
    brew cask install vagrant
    brew cask install virtualbox
    brew cask install vlc

    # install chrome extensions: lastpass and ublock origin
  6. llimllib revised this gist Jan 13, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -214,6 +214,7 @@ brew cask install kindle
    brew cask install macvim
    brew cask install slack
    brew cask install spotify
    brew cask install vagrant
    brew cask install vlc

    # install chrome extensions: lastpass and ublock origin
  7. llimllib revised this gist Jan 7, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install.sh
    Original file line number Diff line number Diff line change
    @@ -149,7 +149,7 @@ brew install devd
    brew install direnv
    brew install dos2unix
    brew install findutils
    brew install fzf
    brew install fzf && /usr/local/opt/fzf/install --all
    brew install gcc
    brew install git
    brew install gnu-sed
  8. llimllib revised this gist Jan 7, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -160,6 +160,7 @@ brew install grep
    brew install htop
    brew install hub
    brew install jq
    brew install md5sha1sum
    brew install modd
    brew install neovim
    brew install nginx
  9. llimllib revised this gist Jan 7, 2019. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion install.sh
    Original file line number Diff line number Diff line change
    @@ -222,7 +222,8 @@ git config --global credential.helper osxkeychain

    # create a personal access token to allow git to work on your computer

    # copy ~/.ssh from before and chown to your user
    # copy ~/.ssh to the new computer and chown to your user
    # copy ~/.gnupg to the new computer

    # * set iTerm ctrl-tab and ctrl-shift-tab to "next term" and "prev term" rather
    # than cycle
  10. llimllib revised this gist Jan 7, 2019. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -19,8 +19,6 @@ trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT
    # * use caps lock as esc for all keyboards
    # * increase screen resolution to retina

    # TODO: have a repeatable process for dotfiles; I just copied them manually from backup

    # set the computer name:
    sudo scutil --set ComputerName "nina"
    sudo scutil --set HostName "nina"
    @@ -193,7 +191,6 @@ cd ..
    cp -r code/personal_code/homedir/.* .

    git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
    # go into vim and :VundleInstall
    fancy_echo "now open vim and run :VundleInstall"
    fancy_echo "then quit and mkdir ~/.vim/colors; cp .vim/bundle/Base2Tone-vim/colors/*.vim ~/.vim/colors"

  11. llimllib revised this gist Jan 7, 2019. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion install.sh
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,8 @@ trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT
    # * use caps lock as esc for all keyboards
    # * increase screen resolution to retina

    # XXX set your computer name here, unless you want it to be nina!
    # TODO: have a repeatable process for dotfiles; I just copied them manually from backup

    # set the computer name:
    sudo scutil --set ComputerName "nina"
    sudo scutil --set HostName "nina"
    @@ -192,6 +193,7 @@ cd ..
    cp -r code/personal_code/homedir/.* .

    git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
    # go into vim and :VundleInstall
    fancy_echo "now open vim and run :VundleInstall"
    fancy_echo "then quit and mkdir ~/.vim/colors; cp .vim/bundle/Base2Tone-vim/colors/*.vim ~/.vim/colors"

    @@ -208,6 +210,7 @@ brew cask install google-chrome
    brew cask install hipchat
    brew cask install iterm2
    brew cask install java
    brew cask install karabiner-elements # and copy karabiner config folder into ~/.config
    brew cask install keybase
    brew cask install kindle
    brew cask install macvim
  12. llimllib revised this gist Jan 6, 2019. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion install.sh
    Original file line number Diff line number Diff line change
    @@ -192,7 +192,6 @@ cd ..
    cp -r code/personal_code/homedir/.* .

    git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
    # go into vim and :VundleInstall
    fancy_echo "now open vim and run :VundleInstall"
    fancy_echo "then quit and mkdir ~/.vim/colors; cp .vim/bundle/Base2Tone-vim/colors/*.vim ~/.vim/colors"

  13. llimllib revised this gist Jan 6, 2019. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion install.sh
    Original file line number Diff line number Diff line change
    @@ -183,7 +183,6 @@ brew install vim
    brew install wget
    brew install yarn
    brew install youtube-dl
    brew install zlib

    # install dotfiles
    mkdir code
  14. llimllib revised this gist Jan 6, 2019. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -19,8 +19,7 @@ trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT
    # * use caps lock as esc for all keyboards
    # * increase screen resolution to retina

    # TODO: have a repeatable process for dotfiles; I just copied them manually from backup

    # XXX set your computer name here, unless you want it to be nina!
    # set the computer name:
    sudo scutil --set ComputerName "nina"
    sudo scutil --set HostName "nina"
  15. llimllib revised this gist Jan 6, 2019. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -22,10 +22,10 @@ trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT
    # TODO: have a repeatable process for dotfiles; I just copied them manually from backup

    # set the computer name:
    sudo scutil --set ComputerName "hickory"
    sudo scutil --set HostName "hickory"
    sudo scutil --set LocalHostName "hickory"
    sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "hickory"
    sudo scutil --set ComputerName "nina"
    sudo scutil --set HostName "nina"
    sudo scutil --set LocalHostName "nina"
    sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "nina"

    # speed up key repeat
    defaults write NSGlobalDomain KeyRepeat -int 1
  16. llimllib revised this gist Jan 6, 2019. 1 changed file with 13 additions and 13 deletions.
    26 changes: 13 additions & 13 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    #!/usr/bin/env bash
    # many settings from https://raw.githubusercontent.com/mathiasbynens/dotfiles/master/.macos
    # many settings from https://raw.githubusercontent.com/thoughtbot/laptop/master/mac
    # previous install notes at:
    @@ -21,10 +22,10 @@ trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT
    # TODO: have a repeatable process for dotfiles; I just copied them manually from backup

    # set the computer name:
    sudo scutil --set ComputerName "nina"
    sudo scutil --set HostName "nina"
    sudo scutil --set LocalHostName "nina"
    sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "nina"
    sudo scutil --set ComputerName "hickory"
    sudo scutil --set HostName "hickory"
    sudo scutil --set LocalHostName "hickory"
    sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "hickory"

    # speed up key repeat
    defaults write NSGlobalDomain KeyRepeat -int 1
    @@ -125,6 +126,11 @@ if ! command -v brew >/dev/null; then
    'https://raw.githubusercontent.com/Homebrew/install/master/install' | ruby
    fi

    # Seems to be necessary to install some base libs like zlib. Requires you to
    # enter your password
    # https://github.com/pyenv/pyenv/issues/1219
    sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

    brew install mas

    # install Xcode, seems like some things depend on it. Unfortunately this
    @@ -167,7 +173,7 @@ brew install openconnect
    brew install openssl
    brew install postgres && brew services start postgresql
    brew install python
    brew install pyenv
    brew install pyenv --HEAD
    brew install rbenv
    brew install reattach-to-user-namespace
    brew install ripgrep
    @@ -178,6 +184,7 @@ brew install vim
    brew install wget
    brew install yarn
    brew install youtube-dl
    brew install zlib

    # install dotfiles
    mkdir code
    @@ -196,7 +203,6 @@ sudo chsh -s /usr/local/bin/bash llimllib

    brew tap caskroom/cask
    brew cask install alfred
    brew cask install atom
    brew cask install caffeine
    brew cask install chromium
    brew cask install docker
    @@ -210,7 +216,6 @@ brew cask install kindle
    brew cask install macvim
    brew cask install slack
    brew cask install spotify
    brew cask install visual-studio-code
    brew cask install vlc

    # install chrome extensions: lastpass and ublock origin
    @@ -256,12 +261,7 @@ cp ttf/* /Library/Fonts/
    cd -
    rm -rf $TEMP

    # In order to build a python with pyenv I had to tell it where
    # to find homebrew's openssl libs:
    # https://github.com/pyenv/pyenv/wiki/Common-build-problems#error-the-python-ssl-extension-was-not-compiled-missing-the-openssl-lib
    CFLAGS="-I$(brew --prefix openssl)/include" \
    LDFLAGS="-L$(brew --prefix openssl)/lib" \
    pyenv install -v 3.7.2
    pyenv install -v 3.7.2
    pyenv global 3.7.2
    pip install ipython

  17. llimllib created this gist Jan 6, 2019.
    268 changes: 268 additions & 0 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,268 @@
    # many settings from https://raw.githubusercontent.com/mathiasbynens/dotfiles/master/.macos
    # many settings from https://raw.githubusercontent.com/thoughtbot/laptop/master/mac
    # previous install notes at:
    # https://gist.github.com/llimllib/ee591266e05bd880629a4e7511a61bb3
    # https://gist.github.com/llimllib/e864a92da94ceb1ef0da2e06fd1f8d70

    fancy_echo() {
    local fmt="$1"; shift

    # shellcheck disable=SC2059
    printf "\n$fmt\n" "$@"
    }

    # handle failures
    trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT

    # Things I don't know how to do from the command line:
    # * use caps lock as esc for all keyboards
    # * increase screen resolution to retina

    # TODO: have a repeatable process for dotfiles; I just copied them manually from backup

    # set the computer name:
    sudo scutil --set ComputerName "nina"
    sudo scutil --set HostName "nina"
    sudo scutil --set LocalHostName "nina"
    sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "nina"

    # speed up key repeat
    defaults write NSGlobalDomain KeyRepeat -int 1
    defaults write NSGlobalDomain InitialKeyRepeat -int 20

    # Disable “natural” (Lion-style) scrolling
    defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false

    # Disable Notification Center and remove the menu bar icon
    launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist 2> /dev/null

    # I don't think this worked; instead I went into system preferences and
    # set do not disturb to run from 3:01AM to 3:00AM

    # Disable auto-correct
    defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false

    # Set the icon size of Dock items to 16 pixels
    defaults write com.apple.dock tilesize -int 16

    # Set the magnification to true
    defaults write com.apple.dock magnification -int 1

    # Wipe all (default) app icons from the Dock
    defaults write com.apple.dock persistent-apps -array

    # Show only open applications in the dock
    defaults write com.apple.dock static-only -bool true

    # remove autohide delay
    defaults write com.apple.dock autohide-delay -float 0

    # Automatically hide and show the Dock
    defaults write com.apple.dock autohide -bool true

    # show batter percentage
    defaults write com.apple.menuextra.battery ShowPercent -bool true

    # show the date in the toolbar
    defaults write com.apple.menuextra.clock DateFormat -string 'EEE MMM d H:mm'

    # Disable the sound effects on boot
    sudo nvram SystemAudioVolume=" "

    # Disable sound effects when changing volume
    defaults write NSGlobalDomain com.apple.sound.beep.feedback -integer 0

    # Disable sounds effects for user interface changes
    defaults write NSGlobalDomain com.apple.sound.uiaudio.enabled -int 0

    # Set alert volume to 0
    defaults write NSGlobalDomain com.apple.sound.beep.volume -float 0.0

    # Show volume in the menu bar
    defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.volume" -int 0

    # Show Bluetooth in the menu bar
    defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.bluetooth" -int 0

    # Avoid creating .DS_Store files on network or USB volumes
    defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
    defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true

    # don't hide files
    defaults write com.apple.Finder AppleShowAllFiles true

    # Show the ~/Library folder
    chflags nohidden ~/Library

    # Show the /Volumes folder
    sudo chflags nohidden /Volumes

    # mouse to max tracking speed
    defaults write -g com.apple.mouse.scaling -int 3

    # disable shake to locate mouse pointer
    defaults write ~/Library/Preferences/.GlobalPreferences CGDisableCursorLocationMagnification -bool YES

    # disable pinch to zoom
    defaults write com.apple.driver.AppleBluetoothMultitouch.mouse TrackpadPinch -int 0

    # disable trackpad rotate
    defaults write com.apple.driver.AppleBluetoothMultitouch.mouse TrackpadRotate -int 0

    # disable double tap to zoom
    defaults write com.apple.driver.AppleBluetoothMultitouch.mouse MouseOneFingerDoubleTapGesture -int 0
    defaults write com.apple.driver.AppleBluetoothMultitouch.mouse TrackpadTwoFingerDoubleTapGesture -int 0

    # fix key repeat in vs code. I don't use it that often, but this is necessary when I do
    defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false

    # reboot systemUIServer to enable defaults to take effect
    killall SystemUIServer

    if ! command -v brew >/dev/null; then
    fancy_echo "Installing Homebrew ..."
    curl -fsS \
    'https://raw.githubusercontent.com/Homebrew/install/master/install' | ruby
    fi

    brew install mas

    # install Xcode, seems like some things depend on it. Unfortunately this
    # required me to open app store and log in; `mas signin` did not work
    fancy_echo 'you may need to log in to app store for this to work'
    mas install `mas search Xcode | grep -E '\d\s*Xcode\s*\(' | awk '{print $1}'`
    mas install `mas search Monosnap | grep -E '\d\s*Monosnap' | awk '{print $1}'`

    brew install awscli
    brew install autoconf
    brew install automake
    brew install bash
    brew install cmake
    brew install coreutils
    brew install curl
    brew install dep
    brew install devd
    brew install direnv
    brew install dos2unix
    brew install findutils
    brew install fzf
    brew install gcc
    brew install git
    brew install gnu-sed
    brew install gpg
    brew install go
    brew install gpg-agent
    brew install grep
    brew install htop
    brew install hub
    brew install jq
    brew install modd
    brew install neovim
    brew install nginx
    brew install nmap
    brew install node
    brew install numpy
    brew install oath-toolkit
    brew install openconnect
    brew install openssl
    brew install postgres && brew services start postgresql
    brew install python
    brew install pyenv
    brew install rbenv
    brew install reattach-to-user-namespace
    brew install ripgrep
    brew install sqlite
    brew install tmux
    brew install tree
    brew install vim
    brew install wget
    brew install yarn
    brew install youtube-dl

    # install dotfiles
    mkdir code
    cd code
    git clone https://github.com/llimllib/personal_code.git
    cd ..
    cp -r code/personal_code/homedir/.* .

    git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
    # go into vim and :VundleInstall
    fancy_echo "now open vim and run :VundleInstall"
    fancy_echo "then quit and mkdir ~/.vim/colors; cp .vim/bundle/Base2Tone-vim/colors/*.vim ~/.vim/colors"

    # now set the updated bash as your login shell
    sudo chsh -s /usr/local/bin/bash llimllib

    brew tap caskroom/cask
    brew cask install alfred
    brew cask install atom
    brew cask install caffeine
    brew cask install chromium
    brew cask install docker
    brew cask install firefox
    brew cask install google-chrome
    brew cask install hipchat
    brew cask install iterm2
    brew cask install java
    brew cask install keybase
    brew cask install kindle
    brew cask install macvim
    brew cask install slack
    brew cask install spotify
    brew cask install visual-studio-code
    brew cask install vlc

    # install chrome extensions: lastpass and ublock origin

    # tell git to use the osx keychain
    git config --global credential.helper osxkeychain

    # create a personal access token to allow git to work on your computer

    # copy ~/.ssh from before and chown to your user

    # * set iTerm ctrl-tab and ctrl-shift-tab to "next term" and "prev term" rather
    # than cycle

    # install base2tone space-dark
    wget https://raw.githubusercontent.com/atelierbram/Base2Tone-iterm2/master/ColorPresets/base2tone-space-dark.itermcolors
    fancy_echo "open iterm -> preferences -> profiles -> color presets and import base2tone-space-dark.itermcolors"

    # download iosevka and install it
    TEMP=$(mktemp -d)
    cd $TEMP
    wget https://github.com/be5invis/Iosevka/releases/download/v2.0.2/02-iosevka-term-2.0.2.zip
    unzip 02-iosevka-term-2.0.2.zip
    cp ttf/* /Library/Fonts/
    cd -
    rm -rf $TEMP

    # download hack and install it
    TEMP=$(mktemp -d)
    cd $TEMP
    wget https://github.com/source-foundry/Hack/releases/download/v3.003/Hack-v3.003-ttf.zip
    unzip *.zip
    cp ttf/* /Library/Fonts/
    cd -
    rm -rf $TEMP

    # install fira code
    TEMP=$(mktemp -d)
    cd $TEMP
    wget https://github.com/tonsky/FiraCode/releases/download/1.206/FiraCode_1.206.zip
    unzip *.zip
    cp ttf/* /Library/Fonts/
    cd -
    rm -rf $TEMP

    # In order to build a python with pyenv I had to tell it where
    # to find homebrew's openssl libs:
    # https://github.com/pyenv/pyenv/wiki/Common-build-problems#error-the-python-ssl-extension-was-not-compiled-missing-the-openssl-lib
    CFLAGS="-I$(brew --prefix openssl)/include" \
    LDFLAGS="-L$(brew --prefix openssl)/lib" \
    pyenv install -v 3.7.2
    pyenv global 3.7.2
    pip install ipython

    rbenv install 2.6.0