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

@markcaudill
markcaudill / 55-bytes-of-css.md
Created September 29, 2022 12:30 — forked from JoeyBurzynski/55-bytes-of-css.md
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@markcaudill
markcaudill / zip_code_coordinates.csv
Last active March 31, 2020 15:39 — forked from erichurst/US Zip Codes from 2013 Government Data
All US zip codes with their corresponding latitude and longitude coordinates. Comma delimited for your database goodness. Source: https://www2.census.gov/geo/docs/maps-data/data/gazetteer
We can't make this file beautiful and searchable because it's too large.
ZIP,LAT,LNG
00601,18.180555,-66.749961
00602,18.361945,-67.175597
00603,18.455183,-67.119887
00606,18.158327,-66.932928
00610,18.294032,-67.127156
00612,18.402253,-66.711397
00616,18.420412,-66.671979
00617,18.447538,-66.557681
00622,17.991245,-67.153993
# -*- coding: utf-8 -*-
from datetime import datetime
import sublime_plugin
class TimestampCommand(sublime_plugin.EventListener):
"""Expand `isoD`, `now`, `datetime`, `utcnow`, `utcdatetime`,
`date` and `time`
"""
#!/bin/sh
cd /tmp/
sudo apt-get install build-essential
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
tar -xzf Python-2.7.2.tgz
cd Python-2.7.2
sudo apt-get install libsqlite3-dev zlib1g-dev libncurses5-dev
sudo apt-get install libgdbm-dev libbz2-dev libreadline5-dev
sudo apt-get install libssl-dev libdb-dev
./configure --enable-shared
@markcaudill
markcaudill / short.py
Created July 12, 2012 13:22 — forked from darkf/short.py
nanoshorten
# nanoshorten - a very tiny URL shortener Web application written in Bottle and sqlite
# copyright (c) 2012 darkf
# licensed under the WTFPL (WTF Public License)
# see http://sam.zoy.org/wtfpl/ for details
from bottle import get, request, run
import sqlite3, random, string
con = sqlite3.connect('short.db')
c = con.cursor()
@markcaudill
markcaudill / snow.sh
Created December 21, 2011 19:37 — forked from sontek/snowjob.sh
Make your terminal snow
#!/bin/bash
LINES=$(tput lines)
COLUMNS=$(tput cols)
declare -A snowflakes
declare -A lastflakes
clear