Skip to content

Instantly share code, notes, and snippets.

View scriptsandthings's full-sized avatar

Scripts and Things scriptsandthings

  • Columbus, OH
View GitHub Profile
@jrussett
jrussett / pan_globalprotect_notes.md
Last active January 31, 2025 23:13
Dealing with PaloAltoNetworks GlobalProtect VPN

Prevent Automatic daemon launching:

Modify the launchd agent for GlobalProtect:

sudo nvim /Library/LaunchAgents/com.paloaltonetworks.gp.pangpa.plist
  • Modify RunAtLoad and KeepAlive to <false/>
sudo nvim /Library/LaunchAgents/com.paloaltonetworks.gp.pangps.plist
#!/bin/bash
loggedInUser=$( /usr/sbin/scutil <<< "show State:/Users/ConsoleUser" | awk -F’: ‘ ‘/[[:space:]]+Name[[:space:]]:/ { if ( $2 != "loginwindow" ) { print $2 }}’ )
sudo -u $loggedInUser chflags -R nouchg /Users/$loggedInUser
diskutil resetUserPermissions / $loggedInUser
exit 0
@arekdreyer
arekdreyer / postinstall-for-Composer-for-DEPNotify.zsh
Last active April 5, 2024 21:36
Postinstall script for Jamf Composer to install DEPNotify with supporting scripts and a LaunchDaemon
#!/bin/zsh
## postinstall
pathToScript=$0
pathToPackage=$1
targetLocation=$2
targetVolume=$3
# This postinstall script for Composer creates the following
# A LaunchDaemon that starts a separate script to run a Jamf Pro policy command
@chriswayg
chriswayg / Ubuntu_Debian_Cloud_images_in_Proxmox.md
Last active March 17, 2025 11:38
Ubuntu and Debian Cloud images in Proxmox
@pirkla
pirkla / apiAuth.sh
Last active February 11, 2022 12:46
Generate a bearer token from the Jamf Pro UAPI
# Generate a token
tokenResp=$(curl -k -u "username:password" -X POST "https:/yoururl.jamfcloud.com/uapi/auth/tokens" -H "accept: application/json")
# parse the token from the response
token=$(echo $tokenResp | awk -F '[:,{"}]' ' {print $6} ')
# pass the token into a cURL command
curl -k -X GET "https://yoururl.jamfcloud.com/uapi/v1/inventory-preload" -H "accept: application/json" -H "Authorization: Bearer $token"
# The expiration time can be found with the following
time=$(echo $tokenResp | awk -F "[:,{}]" ' {print $5} ')
@kaluche
kaluche / kerberos-autoconf.sh
Created November 12, 2019 15:39
Autoconf of /etc/krb5.conf. Replace default value with your value.
#!/bin/bash
if [ "$1" == "-h" ]; then
echo "Usage: `basename $0` Autoconf of /etc/krb5.conf. Replace default value with your value."
echo " -r <REALM> (Your Realm. Ex: FOO)"
echo " -k <KDC> (The KDC. Ex: DC1)"
echo " -f <FQDN> (The FQDN of your domain. Ex: FOO.LOCAL)"
exit 0
fi
while getopts r:k:f: option
do
@talkingmoose
talkingmoose / Add Computer to Static Group.bash
Created March 21, 2020 00:10
Prompts an administrator to choose a Jamf Pro static group and provide a computer serial number to add to that group.
#!/bin/bash
# server connection information
URL="https://talkingmoose.jamfcloud.com"
userName="API-Editor"
password="P@55w0rd"
httpErrorCodes="200 Request successful
201 Request to create or update object successful
400 Bad request
@ishad0w
ishad0w / sources.list
Last active January 27, 2025 08:33
Debian 10 (Buster) -- Full sources.list
deb http://deb.debian.org/debian buster main contrib non-free
deb-src http://deb.debian.org/debian buster main contrib non-free
deb http://deb.debian.org/debian buster-updates main contrib non-free
deb-src http://deb.debian.org/debian buster-updates main contrib non-free
deb http://security.debian.org/debian-security/ buster/updates main contrib non-free
deb-src http://security.debian.org/debian-security/ buster/updates main contrib non-free
@ChristopherA
ChristopherA / macOS-Preferences-Defaults.sh
Last active December 1, 2024 19:54
macOS Preferences Defaults
#!/usr/bin/env zsh
#===========================================================================
# * INFO
#
# macOS Preferences Defaults
# By Christopher Allen @ChristopherA https://github.com/christophera/
# My most basic macOS preferences, in this gist to make it easy to load on
# multiple machines and VMs. Ideally runs on all macOS versions since Yosemite,
@talkingmoose
talkingmoose / add-AD-user-data-to-Jamf-Pro.ps1
Last active March 11, 2022 04:02
Reads a pre-defined Advanced Computer Search and gets list of newly enrolled devices and their usernames. Looks up usernames in Active Directory and retrieves more user detail. Populates devices records with additional user in Jamf Pro.
# INSTRUCTIONS
# Create a folder on the Administrator Desktop named "Project"
# Run the script to generate the AES key
# Run the script to generate the Active Directory encrypted password file
# Run the script to generate the Jamf Pro encrypted password file
# Update the following variables:
# JamfProServer