Skip to content

Instantly share code, notes, and snippets.

@iampavan
iampavan / EAGrabber.sh
Created December 24, 2024 20:53 — forked from brunerd/EAGrabber.sh
Grab Jamf Extension Attributes (including recovery key) as they come down during recon
#!/bin/bash
# Joel Bruner - EA Grabber: Surreptitiously grabs Jamf Extension Attributes (EAs) during recon
#touch file for debug
[ -f /tmp/debug ] && set -x
#############
# VARIABLES #
#############
@iampavan
iampavan / getDefaultAppForURL.sh
Created December 3, 2024 15:19 — forked from scriptingosx/getDefaultAppForURL.sh
two scripts to set and read default app for url schemes (http, mailto, ssh, etc.) for use with Jamf Pro
#!/bin/bash
# this script will return the current default application for a url scheme
# for use as a Jamf Extension attribute
# by Armin Briegel - Scripting OS X
# Permission is granted to use this code in any way you want.
# Credit would be nice, but not obligatory.
# Provided "as is", without warranty of any kind, express or implied.
@iampavan
iampavan / bash_strict_mode.md
Created May 18, 2022 12:35 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
@iampavan
iampavan / no_automount
Created June 1, 2021 21:11 — forked from akrabat/no_automount
Add a volume to /etc/fstab to prevent auto-mounting. See http://akrabat.com/prevent-an-external-drive-from-auto-mounting-on-macos/
#!/usr/bin/env bash
# Usage: ./no_automount My\ Disk
NAME=$1
if [ -z "$NAME" ] ; then
echo "Usage: no_automount {Disk Name}"
exit 1
fi
FSTAB=/etc/fstab
@iampavan
iampavan / rename_computer.sh
Created October 28, 2020 11:18
rename_computer
#!/bin/sh
# Use the country names in the script parameters ($4, $5....)
# Example output = USA-C02VMTEST00
# variables
LOGGED_IN_USER=$(stat -f%Su /dev/console)
LOGGED_IN_UID=$(id -u $LOGGED_IN_USER)
JAMFHELPER="/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"