Skip to content

Instantly share code, notes, and snippets.

WSL 2 Cisco AnyConnect Networking Workaround

Overview

WSL 2 uses a Hyper-V Virtual Network adapter. Network connectivity works without any issue when a VPN is not in use. However when a Cisco AnyConnect VPN session is established Firewall Rules and Routes are added which breaks connectivity within the WSL 2 VM. This issue is tracked WSL/issues/4277

Below outline steps to automatically configure the Interface metric on VPN connect and update DNS settings (/etc/resolv.conf) on connect/disconnect.

Manual Configuration

Set Interface Metrics

@mosherbrian
mosherbrian / git_gist_gitwatch.txt
Last active April 30, 2022 19:12 — forked from mkhairi/gitcheats.txt
git cheats
git --work-tree=/c/Dropbox/TextFolder/ --git-dir=/c/Users/bmosher/source/git_folder_for_repo.git init
cd git_folder_for_repo.git/
git branch -a
git checkout -b main
git branch -a
git config --global user.email "email@email"
git config --global user.name "Brian Mosher"
git remote add origin git@gist.github.com:123456789101111111.git
git fetch origin
git branch -a
@mosherbrian
mosherbrian / vertexFinder.js
Last active March 27, 2022 15:57
TamperMonkey script to help find vertices of CSS clip-path: polygon() function for CSS drawing
// ==UserScript==
// @name vertexFinder
// @namespace http://tampermonkey.net/
// @version 0.1
// @description logs clicked vertex coordinates in parent element percentages to console for CSS polygon clip-path
// @author Brian Mosher
// @match https://mosherbrian.github.io/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
@mosherbrian
mosherbrian / dragon-trainer.html
Last active February 5, 2022 18:12
Gist for Vanilla JS Academy Week 4 projects
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dragon Trainer Monthly</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
body {
margin: 0 auto;
// ==UserScript==
// @name Gist HTML Live Preview
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Display a button on GitHub Gist HTML files to preview the file using https://raw.githack.com to serve the page in developer mode.
// @author Brian Mosher
// @match https://gist.github.com/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
@mosherbrian
mosherbrian / random-ron.html
Last active January 30, 2022 23:05
Gist for Vanilla JS Academy Week 3 projects
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Random Ron</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
body {
margin: 0 auto;
@mosherbrian
mosherbrian / character-and-word-count.html
Last active January 23, 2022 17:22
Week 2 - Wednesday Project
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Character & Word Count</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
body {
margin: 0 auto;
@mosherbrian
mosherbrian / password-multiple-forms.html
Last active January 18, 2022 02:34
VanillaJS - Week1 Friday Project
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Password Visibility - Multiple Forms</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
body {
margin: 0 auto;