Skip to content

Instantly share code, notes, and snippets.

@philip-goh
Created June 14, 2020 08:22
Show Gist options
  • Save philip-goh/5774a0efc40c2126afddfa216b276840 to your computer and use it in GitHub Desktop.
Save philip-goh/5774a0efc40c2126afddfa216b276840 to your computer and use it in GitHub Desktop.
Access PostgreSQL running on your host from within WSL2
#!/bin/bash
socat -d -d TCP-LISTEN:5432,reuseaddr,fork TCP:$(cat /etc/resolv.conf | tail -n1 | cut -d " " -f 2):5432
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment