Skip to content

Instantly share code, notes, and snippets.

@mnem
Last active September 7, 2016 21:03
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mnem/6560977 to your computer and use it in GitHub Desktop.
Save mnem/6560977 to your computer and use it in GitHub Desktop.
Things to install on a fresh Mac: bash <(curl -fsSL https://gist.github.com/mnem/6560977/raw/install_all_the_things.sh)
#!/usr/bin/env bash
function execute_after_confirm {
read -p "$1 ($2) ? [y/n] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
shift
for var in "$@"
do
echo $var
eval $var
return_code=$?
if [[ $return_code != 0 ]] ; then
exit $return_code
fi
done
fi
}
execute_after_confirm \
'Generate SSH keys' \
"ssh-keygen -t rsa -C \"`uname -n`\"" \
'pbcopy < ~/.ssh/id_rsa.pub ##### Copied key to clipboard #####'
execute_after_confirm \
'Install Homebrew' \
'ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"' \
'brew doctor'
ALL_THE_THINGS=\
'git'\
' tmux'\
' the_silver_searcher'\
' grc'\
' cmake'\
' nmap'\
' figlet'\
' gibo'\
' parallel'\
' uncrustify'\
' toilet'\
' tree'\
' htop'\
' chruby'\
' ruby-install'
execute_after_confirm \
'Install useful packages' \
"brew install $ALL_THE_THINGS"
RUBY_VERSION="2.2.3"
execute_after_confirm \
"Install Ruby" \
"ruby-install ruby $RUBY_VERSION" \
'source /usr/local/share/chruby/chruby.sh' \
"chruby $RUBY_VERSION"
execute_after_confirm \
"Install Homesick" \
'gem install homesick' \
'homesick clone git@github.com:mnem/dotty_bash.git' \
'homesick symlink dotty_bash' \
'homesick clone git@github.com:mnem/dotty_tmux.git' \
'homesick symlink dotty_tmux'
@mnem
Copy link
Author

mnem commented Sep 14, 2013

One line execute:

bash <(curl -fsSL https://gist.github.com/mnem/6560977/raw/install_all_the_things.sh)

Also, why it's a terrible idea to execute scripts like this:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment