Skip to content

Instantly share code, notes, and snippets.

@AlgusDark
Last active May 19, 2020 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlgusDark/33e8f6504c9bbecc9aad642fcfc1f6ec to your computer and use it in GitHub Desktop.
Save AlgusDark/33e8f6504c9bbecc9aad642fcfc1f6ec to your computer and use it in GitHub Desktop.
New MacBook setup
#!/usr/bin/env bash
# Ask for administrator password
sudo -v
# Keep-alive script.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
if [ ! "$(which brew)" ]; then
echo "Installing homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
fi
echo "Updating Brew"
brew update
brew upgrade
echo "Installing software"
brew install coreutils \
findutils \
gnu-tar \
gnu-sed \
gawk \
gnutls \
gnu-indent \
gnu-getopt \
grep \
zsh \
wget \
htop \
nmap \
links \
git \
python \
python3 \
node
brew cask install iterm2 \
google-chrome \
visual-studio-code \
qlcolorcode \
qlstephen \
qlmarkdown \
quicklook-json \
qlimagesize \
qlvideo \
webpquicklook \
tuxera-ntfs \
java \
xquartz \
keepingyouawake
if [ ! -f /usr/local/bin/sha256sum ]; then
sudo ln -s /usr/local/bin/gsha256sum /usr/local/bin/sha256sum
fi
echo "cleaning up homebrew"
brew cleanup
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo "export PATH=\"$(brew --prefix coreutils)/libexec/gnubin:$PATH\"" >> ~/.zshrc
if ! [[ $(git config --global user.name) ]] || ! [[ $(git config --global user.email) ]]; then
echo "Configuration for git"
fi
if ! [[ $(git config --global user.name) ]]; then
read -rp 'Name: ' name
git config --global user.name "$name"
fi
if ! [[ $(git config --global user.email) ]]; then
read -rp 'Email: ' email
git config --global user.email "$email"
fi
# Check if we have keys already
if [ ! -f ~/.ssh/id_rsa.pub ]; then
if [ -z "$email" ];then
read -rp 'Email: ' email
git config --global user.email "$email"
fi
ssh-keygen -t rsa -b 4096 -C "$email"
eval "$(ssh-agent -s)"
ssh-add -K ~/.ssh/id_rsa
fi
# Copy the contents of the id_rsa.pub file to your clipboard
pbcopy < ~/.ssh/id_rsa.pub
cat << "EOF"
███████╗██╗███╗ ██╗██╗███████╗██╗ ██╗██╗
██╔════╝██║████╗ ██║██║██╔════╝██║ ██║██║
█████╗ ██║██╔██╗ ██║██║███████╗███████║██║
██╔══╝ ██║██║╚██╗██║██║╚════██║██╔══██║╚═╝
██║ ██║██║ ╚████║██║███████║██║ ██║██╗
╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝╚══════╝╚═╝ ╚═╝╚═╝
██████
██████ ████▒▒████
████▒▒████████████████████████████▒▒██
██░░████▒▒██░░░░░░░░░░░░░░░░░░░░████▒▒████
██░░░░░░████▒▒██░░░░░░░░░░░░██░░░░░░░░████▒▒██
██░░░░░░██▒▒██░░░░░░░░░░░░░░░░██░░░░░░░░██▒▒██
██░░░░░░██▒▒██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░████
██░░░░░░░░██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██
██░░░░░░████░░░░░░██░░░░░░░░░░░░░░██░░░░░░░░ ░░██
██░░░░░░██░░░░░░██░░░░░░░░░░░░░░░░██░░ ░░░░░░██
██░░░░░░██░░░░░░██░░ ░░ ██ ██░░░░░░░░░░░░██
██░░░░░░░░██░░░░░░██░░░░░░░░██░░░░██ ████░░░░██░░░░██
██░░░░░░░░██░░░░██░░░░░░░░██░░░░██ ██░░░░░░██░░██
██░░░░░░░░██░░░░██░░░░░░██░░░░░░██ ██████░░░░████
██░░░░░░░░██░░████░░░░██████████ ██ ██░░░░████
██░░░░░░░░██░░████████ ████ ██ ▒▒ ██░░░░██
██░░░░░░░░████████▒▒░░ ▒▒ ░░ ██░░████████ ██
██░░░░░░░░████░░██▒▒░░ ▒▒░░ ▒▒ ██░░████ ████ ██
██░░░░░░░░██ ████▒▒░░ ▒▒▒▒ ████░░██ ██ ██
██░░░░░░░░██ ██░░░░ ████░░░░██ ██
██░░░░░░░░██ ████░░ ██████░░░░░░██ ██
██░░░░░░░░░░██ ██▓▓▓▓▓▓▓▓▓▓░░▓▓ ██░░░░██ ██
██░░░░░░░░░░██ ██ ▓▓▓▓▓▓▓▓░░▓▓██░░████ ██
██░░░░░░░░░░██ ██░░░░██▓▓▓▓▓▓▓▓░░▓▓██████ ████
██░░░░░░░░░░██ ████████░░░░▓▓▓▓░░██░░▓▓██ ██░░░░██
██░░░░░░░░░░░░██████████████░░░░██████░░██ ██░░░░░░██
██░░░░░░░░░░████ ████████████████████▓▓██░░░░░░░░██
██░░░░░░░░░░██ ████░░░░░░░░░░░░░░░░░░████░░░░░░░░██
██░░░░░░░░██ ██████████████████ ██░░░░██
██░░░░██ ████████ ██░░██ ████
████ ██░░██ ████
██
Your SSH key has been copied to your clipboard. Go to https://github.com/settings/keys and setup your new key
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment