Skip to content

Instantly share code, notes, and snippets.

View mattixpet's full-sized avatar
🇵🇸
<3

Matthias mattixpet

🇵🇸
<3
View GitHub Profile
@mikegerber
mikegerber / Fix WSL2 vs VPN networking.md
Last active December 9, 2025 12:57
Fix WSL2 vs VPN networking

The problem

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!

The solution

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.

@SeanPesce
SeanPesce / https_server.py
Last active October 9, 2025 09:27
Simple Python 3 HTTPS Server (SSL/TLS)
#!/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
@raprasad
raprasad / change_password.md
Last active August 14, 2024 20:22
django user; change password from shell

update django password

general changes

To use in dev environments

  • after python manage.py shell
from django.contrib.auth.models import User
@orip
orip / temp_chdir.py
Created July 22, 2012 19:22
temp_chdir
import os, contextlib
@contextlib.contextmanager
def temp_chdir(path):
"""
Usage:
>>> with temp_chdir(gitrepo_path):
... subprocess.call('git status')
"""
starting_directory = os.getcwd()