Skip to content

Instantly share code, notes, and snippets.

@Madse
Madse / WSL2_VPN_Workaround_Instructions.md
Created January 26, 2023 00:34 — forked from machuu/WSL2_VPN_Workaround_Instructions.md
Workaround for WSL2 network broken on VPN

Overview

Internet connection and DNS routing are broken from WSL2 instances, when some VPNs are active. The workaround breaks down into two problems:

  1. Network connection to internet
  2. DNS in WSL2

This problem is tracked in multiple microsoft/WSL issues including, but not limited to:

@Madse
Madse / persistent_c_mount_wsl.sh
Created April 18, 2021 14:05 — forked from sgtoj/persistent_c_mount_wsl.sh
Ubuntu for Windows: Mounting C: Drive to WSL's Root
# allow `mount` cmd without password
echo "$USER ALL=NOPASSWD: /bin/mount" | (sudo su -c 'EDITOR="tee -a" visudo')
# add the mount directive to `fstab`
sudo mkdir -p /c
sudo sh -c "echo '/mnt/c /c none bind' >> /etc/fstab"
# update to `.bashrc` to auto mount at login
echo "sudo mount -a" >> ~/.bashrc
# now reload it
source ~/.bashrc
@Madse
Madse / git-branches-by-commit-date.sh
Created March 6, 2020 12:05 — forked from l15n/git-branches-by-commit-date.sh
List remote Git branches and the last commit's author and author date for each branch. Sort by most recent commit's author date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ai %ar by %an" $branch | head -n 1` \\t$branch; done | sort -r
@Madse
Madse / TestDatabaseSetup.md
Created March 3, 2020 08:02 — forked from gvenzl/TestDatabaseSetup.md
A script that sets up test databases for Oracle, MySQL, Postgres, SQL Server, and Db2