Skip to content

Instantly share code, notes, and snippets.

@smgoller
Last active April 27, 2017 19:44
Show Gist options
  • Save smgoller/b31e63be5251bbb586fa91904d843162 to your computer and use it in GitHub Desktop.
Save smgoller/b31e63be5251bbb586fa91904d843162 to your computer and use it in GitHub Desktop.
alfalfa bootstrap
#!/usr/bin/env bash
[[ -d /usr/local/Homebrew ]] || /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
hash foo 2>/dev/null || brew install ansible lastpass-cli
echo "Enter your lastpass username:"
read username
lpass login ${username}
mkdir -p ~/.ssh
lpass show --notes 7467094604006037409 > ~/.ssh/id_rsa_toolsmiths
lpass show --field="Public Key" 7467094604006037409 > ~/.ssh/id_rsa_toolsmiths.pub
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa_toolsmiths*
ssh-add ~/.ssh/id_rsa_toolsmiths
[[ -d ~/workspace ]] || mkdir ~/workspace
[[ -d ~/workspace/alfalfa ]] || git clone [email protected]:smgoller/alfalfa.git ~/workspace/alfalfa
echo "Turning on remote login - user password required"
sudo systemsetup -setremotelogin on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment