Skip to content

Instantly share code, notes, and snippets.

@juniorbird
Last active December 28, 2020 19:20
Show Gist options
  • Save juniorbird/298639509420963f8537 to your computer and use it in GitHub Desktop.
Save juniorbird/298639509420963f8537 to your computer and use it in GitHub Desktop.
My setup process for a new machine
# What is the name of the machine I'm working on?
export MYMACHINENAME="Laptop"
# What color should I write this name in the prompt?
export MYMACHINECOLOR="38;5;36m"
# What color should I use for tmux?
export MYMACHINETMUX="colour36"
# Personal or Work machine?
export MYMACHINETYPE="Work"
if [ -f ~/dotfiles/bashrc ]; then
# Some path to where it's good form for you to store files
source ~/dotfiles/bashrc
fi
# This is a good place to update your PATH, as it's machine-specific
if [[ "$MYMACHINETYPE" == 'Work' ]]; then
PATH=$PATH:$(npm -g bin);
fi
# This is a good place to update your PATH, as it's machine-specific
export PATH=$PATH:$HOME/bin/:~/dotfiles:/usr/local/lib:~/.rbenv/bin
#Automatically run Docker
if [[ "$MYMACHINENAME" == 'Silver Pet' ]] ; then
eval "$(docker-machine env default)"
fi

How to use this

  1. If setting up a Mac, go to 2. Otherwise, go to 5.
  2. cd ~ && curl https://gist.githubusercontent.com/juniorbird/298639509420963f8537/raw/setup-mac.sh > setup-mac.sh
  3. chmod +x setup-mac.sh
  4. ./setup-mac.sh
  5. If needed, copy your id_rsa.pub file into ~/.ssh/authorized_hosts
  6. If needed, copy your id_rsa file into ~/.ssh and chmod 600 id_rsa
  7. curl https://gist.githubusercontent.com/juniorbird/298639509420963f8537/raw/.bash_profile > .bash_profile
  8. Pick a color and name and vim it into there
  9. cd ~ && curl https://gist.githubusercontent.com/juniorbird/298639509420963f8537/raw/setup.sh > setup.sh
  10. chmod +x setup.sh
  11. ./setup.sh
  12. source ~/.bash_profile && source ~/dotfiles/bashrc && source ~/dotfiles/bash_aliases && source ~/dotfiles/bash_functions
  13. If installing a work computer, follow the work computer setup script
  14. If installing a home computer, curl https://gist.githubusercontent.com/juniorbird/298639509420963f8537/raw/setup-home.sh > setup-home.sh && chmod +x setup-home.sh && ./setup-home.sh
#!/bin/bash
# Current Bash
brew install bash
sudo -s
echo /usr/local/bin/bash >> /etc/shells
chsh -s /usr/local/bin/bash
# Casks
brew tap caskroom/cask
brew cask install anylist
brew cask install backblaze
brew cask install endlesssky
brew cask install hazel
brew cask install imageoptim
brew cask install little-snitch
brew cask install scrivener
brew cask install spark
brew cask install twine
brew cask install xmind
# Other
# https://github.com/shannonmoeller/up/blob/master/up.sh
curl --create-dirs -o ~/.config/up/up.sh https://raw.githubusercontent.com/shannonmoeller/up/master/up.sh
pip install ccat
# https://github.com/LuRsT/hr
curl https://raw.githubusercontent.com/LuRsT/hr/master/hr > ~/bin/hr
chmod +x ~/bin/hr
rm ~/setup-home.sh
#!/bin/bash
# Get homebrew
xcode-select --install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install stuff I need
brew install bash # Latest version, not what Apple ships
brew install brew-cask-completions
brew install catimg
brew install ccat
brew install coreutils
brew install dos2unix
brew install gettext
brew install gnupg
brew install heroku
brew install heroku-node
brew install jq
brew install pinentry-mac
brew install reattach-to-user-namespace
brew install shellcheck
brew install shfmt
brew install sqldiff
brew install ssh-copy-id
brew install thefuck
brew install tmux
brew install tree
brew install urlview
brew install vimpager
brew install wget
brew install ykman
brew install ykpers
# Apps
brew tap caskroom/cask
brew cask install 1password
brew cask install alfred
brew cask install azure-data-studio
brew cask install cloudapp
brew cask install docker #install via cask = all the apps
brew cask install discord
brew cask install focusatwill
brew cask install git-extras
brew cask install gpg-suite
brew cask install keybase
brew cask install mysqlworkbench
brew cask install notion
brew cask install postman
brew cask install qlcolorcode qlstephen qlmarkdown quicklook-json qlprettypatch quicklook-csv betterzipql qlimagesize webpquicklook suspicious-package quicklookase qlvideo
brew cask install rescuetime
brew cask install spectacle
brew cask install stretchly
brew cask install switchhosts
brew cask install visual-studio-code
if ! command -v mas > /dev/null; then
brew install mas
fi
# Keymou https://manytricks.com/keymou/
mas install 449863619
# Moom https://manytricks.com/moom/
mas install 419330170
brew tap caskroom/fonts
brew cask install font-fira-code
brew cask install font-firacode-nerd-font
# Get node
# Installing w/homebrew can... cause problems
curl "https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE 's|.*>node-(.*)\.pkg</a>.*|\1|p')}.pkg" > "$HOME/Downloads/node-latest.pkg" && installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/"
sudo chown -R $(whoami) /usr/local/lib/node_modules/
# Python stuff
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python get-pip.py
pip install ccat
# Other Stuff
curl https://raw.githubusercontent.com/LuRsT/hr/master/hr > ~/bin/hr
chmod +x ~/bin/hr
curl --create-dirs -o ~/.config/up/up.sh https://raw.githubusercontent.com/shannonmoeller/up/master/up.sh
# npm i all the things
npm i -g eslint
npm i -g n
# Stretchly load my prefs
ln -s ~/dotfiles/stretchly/config.json /Users/wade.armstrong/Library/Application\ Support/stretchly/config.json
# Instructions
echo 'now add gist ID a36f76a138d725268009646236c7b6bc to sync VS Code'
# Basic setup for Vim and tmux
echo "vim and tmux setup..."
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
curl -L https://raw.githubusercontent.com/m3m0ryh0l3/extracturl/master/extract_url.pl > ~/bin/extract_url
chmod +x ~/bin/extract_url
# Install the things
vim -c ':PluginInstall'
vim -c ':q!'
tmux kill-server
tmux && tmux send-keys 'C-B I' C-m
rm ~/setup-mac.sh
#!/bin/bash
# Get the basics on there
cd ~ && git clone git@github.com:juniorbird/dotfiles.git
# Make a nice clean setup
echo "setting up directories..."
rm .bashrc
ln -s ~/dotfiles/bashrc .bashrc
ln -s ~/dotfiles/tmux.conf .tmux.conf
ln -s ~/dotfiles/vimrc .vimrc
ln -s ~/dotfiles/gitignore .gitignore
git config --global init.templatedir '~/dotfiles/git-template'
# install things need to be installed
echo "installing files..."
sudo yum install python27-pip
sudo python27 -m pip install setuptools
sudo python27 -m pip install thefuck==3.21
mkdir ~/bin
curl -L https://raw.githubusercontent.com/synacor/gitprompt/master/gitprompt.pl > ~/bin/gitprompt.pl
chmod +x ~/bin/gitprompt.pl
# Load the things
echo "sourcing things..."
cd dotfiles
source ~/.bash_profile
source ~/dotfiles/bashrc
source ~/dotfiles/bash_aliases
source ~/dotfiles/bash_functions
# Basic setup for Vim and tmux
echo "vim and tmux setup..."
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
curl -L https://raw.githubusercontent.com/m3m0ryh0l3/extracturl/master/extract_url.pl > ~/bin/extract_url
chmod +x ~/bin/extract_url
# Install the things
vim -c ':PluginInstall'
vim -c ':q!'
tmux kill-server
tmux && tmux send-keys 'C-B I' C-m
# Other Stuff
yum install -y epel-release
yum install -y jq
# https://github.com/shannonmoeller/up/blob/master/up.sh
curl --create-dirs -o ~/.config/up/up.sh https://raw.githubusercontent.com/shannonmoeller/up/master/up.sh
pip install ccat
# https://github.com/LuRsT/hr
curl https://raw.githubusercontent.com/LuRsT/hr/master/hr > ~/bin/hr
chmod +x ~/bin/hr
yum install catimg
echo "now run vim, :PluginInstall, run Tmux, C-B I"
rm ~/setup.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment