Skip to content

Instantly share code, notes, and snippets.

@peteristhegreat
Last active January 24, 2023 17:46
Show Gist options
  • Save peteristhegreat/c532cf932ad860544fc63546119913f5 to your computer and use it in GitHub Desktop.
Save peteristhegreat/c532cf932ad860544fc63546119913f5 to your computer and use it in GitHub Desktop.
Setting up a new mac...

Rough list of steps taken...

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • Install brew things
brew install --cask slack firefox google-chrome sourcetree microsoft-teams
brew install --cask rectangle iterm2 visual-studio-code adobe-acrobat-reader scroll-reverser dotnet maccy parallels
brew install git git-extras htop tree most watch coreutils tldr git-flow-avh
brew install jq python-yq nginx awscli nvm bash-completion
ssh-keygen
cat ~/.ssh/id_rsa.pub
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

echo 'export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion' >> ~/.bash_profile
kubectl completion bash | sudo tee $(brew --prefix)/etc/bash_completion.d/kubectl > /dev/null
  • Copy over .bash_history
  • Copy any tweaks to .aliases
alias godevl='cd ~/development/advise; pwd'

alias k='kubectl'
alias docker='nerdctl -n k8s.io'
  • Copy any tweaks to .exports
#########################
# Bash History Persistence
export HISTCONTROL=ignoredups:erasedups  # no duplicate entries
export HISTSIZE=100000                   # big big history
export HISTFILESIZE=100000               # big big history
shopt -s histappend                      # append to history, don't overwrite it

if [[ $PROMPT_COMMAND == *"history"* ]]; then
> :
else
>
> # Save and reload the history after each command finishes
> #export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
> export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
fi
#
  • Install vtop
nvm install --lts
npm install -g vtop
  • Set git globals
git config --global user.name "John Doe"
git config --global user.email [email protected]
mkdir -p $HOME/Library/KeyBindings/
echo '{
    "\UF729"  = moveToBeginningOfLine:;
    "\UF72B"  = moveToEndOfLine:;
    "$\UF729" = moveToBeginningOfLineAndModifySelection:;
    "$\UF72B" = moveToEndOfLineAndModifySelection:;
  }' > $HOME/Library/KeyBindings/DefaultKeyBinding.dict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment