Skip to content

Instantly share code, notes, and snippets.

View pyther's full-sized avatar

Matthew Gyurgyik pyther

View GitHub Profile
@pyther
pyther / syslinux-install_update
Created January 9, 2011 23:25
syslinux-install_update
#!/bin/bash
#
# Sylinux Installer / Updater Scripts
# Copyright (C) 2011 Matthew Gyurgyik <pyther@pyther.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#

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

---
Description: Downloads the latest Slack disk image and builds a package
Identifier: org.example.autopkg.pkg.slack
Input:
NAME: Slack
PKG_ID: com.tinyspeck.slackmacgap
MinimumVersion: "2.3"
ParentRecipe: org.example.autopkg.download.slack
Process:
---
Description: Downloads the latest Slack disk image
Identifier: org.example.autopkg.download.slack
Input:
NAME: Slack
DOWNLOAD_URL: https://slack.com/ssb/download-osx-universal
MinimumVersion: "2.3"
Process:
- Processor: URLDownloader
% cat globalprotect_preinstall.sh
#!/bin/sh
#
# PLIST Configuration from https://docs.paloaltonetworks.com/globalprotect/10-1/globalprotect-admin/mobile-endpoint-management/manage-the-globalprotect-app-using-jamf/deploy-the-globalprotect-mobile-app-using-jamf
PORTAL=vpn1.acme.corp
PLIST="/Library/Preferences/com.paloaltonetworks.GlobalProtect.settings.plist"
if [[ -f $PLIST ]]; then
echo "WARNING: $PLIST already exists. Skipping."
exit 0
#!/bin/bash
HARDWARE="\
kmod-pcengines-apuv2 \
kmod-crypto-hw-ccp \
kmod-gpio-nct5104d kmod-gpio-button-hotplug \
kmod-sp5100-tco \
kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb3 \
kmod-sound-core kmod-pcspkr \
amd64-microcode \
#!/bin/bash
# Detects Linux Distribution
#
# Most Distributions have lsb_release or use /etc/lsb_release
# For those that do not we have some fallback cases
OS=$(uname -s)
VER=$(uname -r)
#!/usr/bin/env python
import argparse
import re
import datetime
import ipaddress
import os
import sys
def get_iface_networks(dev):
@pyther
pyther / ipda.py
Last active January 28, 2021 07:09
Listens for networkd signals and deprecate the ip6 route on the interface when the interface gets reconfigured
#!/usr/bin/env python3
from functools import cache
import argparse
import dbus
import subprocess
import json
import dbus.mainloop.glib
package main
import (
"fmt"
"github.com/google/gopacket"
"github.com/google/gopacket/pcap"
"github.com/google/gopacket/layers"
"log"
)