Skip to content

Instantly share code, notes, and snippets.

View pyther's full-sized avatar

Matthew Gyurgyik pyther

View GitHub Profile
---
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
@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
@pyther
pyther / wsl_dns.py
Last active November 2, 2024 22:26
#!/usr/bin/env python
import argparse
import re
import datetime
import ipaddress
import os
import sys
def get_iface_networks(dev):

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

#!/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 \
package main
import (
"fmt"
"github.com/google/gopacket"
"github.com/google/gopacket/pcap"
"github.com/google/gopacket/layers"
"log"
)
Name: keepassx
Version: 2.0
Release: 1%{?dist}
Summary: Cross-platform password manager
Group: User Interface/Desktops
License: GPLv2+
URL: http://www.keepassx.org
Source0: keepassx-%{version}.tar.gz
BuildRequires: qt4-devel > 4.1
BuildRequires: libXtst-devel
Puppet::Functions.create_function(:modularfile) do
def modularfile(path)
path = path.gsub('.', '0x2e')
call_function('hiera', [path])
end
end