To use in dev environments
- after
python manage.py shell
from django.contrib.auth.models import User| import os, contextlib | |
| @contextlib.contextmanager | |
| def temp_chdir(path): | |
| """ | |
| Usage: | |
| >>> with temp_chdir(gitrepo_path): | |
| ... subprocess.call('git status') | |
| """ | |
| starting_directory = os.getcwd() |
| #!/usr/bin/env python3 | |
| # Author: Sean Pesce | |
| # References: | |
| # https://stackoverflow.com/questions/19705785/python-3-simple-https-server | |
| # https://docs.python.org/3/library/ssl.html | |
| # https://docs.python.org/3/library/http.server.html | |
| # Shell command to create a self-signed TLS certificate and private key: | |
| # openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out cert.crt -keyout private.key |
WSL2 uses a random network from the 172.16.0.0/12 RFC1918 private IP address block. And our VPN uses that address block, too, with a route metric of 1 (= most preferred.)
This breaks networking for WSL2. Meh!
While messing around with the interface/route metric of the VPN network may work around the problem, it also reduces the priority of the VPN. We do not really want this. Additionally, changing the interface metric does not seem to be permanent, so it requires more work when it breaks again.