Skip to content

Instantly share code, notes, and snippets.

@ericchansen
Last active May 8, 2023 18:31
Show Gist options
  • Save ericchansen/8a7054a40f6c2701caf871d600bf0816 to your computer and use it in GitHub Desktop.
Save ericchansen/8a7054a40f6c2701caf871d600bf0816 to your computer and use it in GitHub Desktop.
Fresh Ubuntu install script
sudo apt-get update && sudo apt-get upgrade
sudo apt-get -y install build-essential curl
git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/libexec/git-core/git-credential-wincred.exe"
# Setup Docker. These directions work on WSL2.
sudo addgroup --system docker
sudo adduser $USER docker
newgrp docker
sudo chown root:docker /var/run/docker.sock
sudo chmod g+w /var/run/docker.sock
start_ssh_string='
if [ -z "$SSH_AUTH_SOCK" ]; then\n
# Check for a currently running instance of the agent
RUNNING_AGENT="`ps -ax | grep '\''ssh-agent -s'\'' | grep -v grep | wc -l | tr -d '\''[:space:]'\''`"
if [ "$RUNNING_AGENT" = "0" ]; then
# Launch a new instance of the agent
ssh-agent -s &> .ssh/ssh-agent
fi
eval `cat .ssh/ssh-agent`
fi
'
echo "$start_ssh_string" >> ~/.bash_profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment