less than 1 minute read

Things to do on a new Unix machine (e.g., new GCE VM).

New Unix Setup

GitHub SSH and keychain

  1. generate an SSH key for GitHub
     ssh-keygen -t ed25519 -C "YOUR_EMAIL_HERE"
     eval "$(ssh-agent -s)"
     ssh-add ~/.ssh/id_ed25519
    
  2. add the public key to GitHub: cat ~/.ssh/id_ed25519.pub
  3. git config stuff:
     git config --global user.name "YOUR_NAME_HERE"
     git config --global user.email "YOUR_EMAIL_HERE"
     git config --global core.filemode true
    
  4. add keychain: sudo apt install keychain, then add the following to .bashrc:
     # Use `keychain` to load my SSH key
     /usr/bin/keychain -q --nogui $HOME/.ssh/id_ed25519
     source $HOME/.keychain/$HOSTNAME-sh
    

WSL

Add the following to .bashrc:

# allow opening webpages with Chrome
export BROWSER="/mnt/c/Program Files/Google/Chrome/Application/chrome.exe"

This will allow opening URLs with sensible-browser, and was enough to make Chrome pop up e.g., when Google’s Python API wants to authenticate the user via a webpage prompt. To make xdg-open work additional fiddling is needed.