Skip to content

Instantly share code, notes, and snippets.

View notverypc's full-sized avatar
🍰
Cake or Death?

Ben notverypc

🍰
Cake or Death?
View GitHub Profile
@haircut
haircut / README.md
Last active February 20, 2020 13:01
How to manage ONLY FDE Recovery Key Escrow in Jamf Pro 9.101+

How to manage ONLY FDE Recovery Key Escrow in Jamf Pro 9.101+

The Jamf Pro GUI allows you to automatically set up the necessary payloads to manage the FDE Recovery Key Escrow process for macOS 10.13+.

However, the settings reside in the "Security & Privacy" grouping within the Jamf Pro GUI, forcing you to manage settings other than those related to recovery key escrow. You may inadvertently lock your users out of being able to make changes to the firewall, analytics settings, screen saver password requirement, etc.

You can upload a custom profile to the Jamf Pro Server that manages only FDE Recover Key Escrow preferences, but it takes a little work.

You'll also need to sign your resultant configuration profile to prevent the Jamf Pro Server from manipulating its contents or preventing deployment. You can use an Apple Developer certificate, or your Jamf Pro Server's CA (if self signed).

@gregneagle
gregneagle / fancy_defaults_read.py
Last active December 5, 2024 10:38
fancy_defaults_read.py: Reads a preference, prints its value, type, and where it is defined.
#!/usr/bin/python
import os
import sys
from CoreFoundation import (CFPreferencesAppValueIsForced,
CFPreferencesCopyAppValue,
CFPreferencesCopyValue,
kCFPreferencesAnyUser,
kCFPreferencesAnyHost,
@joshua-d-miller
joshua-d-miller / 802.1x Fix.py
Last active January 18, 2019 12:46
When deploying an EAP-TLS profile for 802.1x Ethernet, this script will create a User Identity preference which will allow a logged in user to use any Ethernet interface that is connected to their machine.
#!/usr/bin/python
# pylint: disable=C0103, W0612, E1101, E0602, E0611
# pylint: disable=W0101, W0110, W0141
''''Fix 802.1x When Using Config Profiles and EAP-TLS'''
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# This script will determine the profile ID that was used when
# installing the 802.1x Ethernet Identity preference and make
# a copy of the keychain entry to be used as a user identity preference
# so that any Ethernet can be used when a user is logged in. As of 10.12.3
@faun
faun / smb_fs_automount.sh
Last active February 19, 2025 01:08
Script to mount remote SMB volume using password stored in Mac OS keychain without needing admin or sudo priveliges
#!/usr/bin/env bash
# Fetch the password from the keychain if it exists
PASSWORD_ENTERED=false
ACCOUNT_NAME='login'
SERVICE_NAME='mount_volume'
PASSWORD=$(
security 2> /dev/null \
find-generic-password -w \
-a $ACCOUNT_NAME \
@pudquick
pudquick / get_platform.py
Last active August 18, 2022 21:02
Get Mac's serial number, hardware UUID, and board-id via python
import objc
from Foundation import NSBundle
IOKit_bundle = NSBundle.bundleWithIdentifier_('com.apple.framework.IOKit')
functions = [("IOServiceGetMatchingService", b"II@"),
("IOServiceMatching", b"@*"),
("IORegistryEntryCreateCFProperty", b"@I@@I"),
]
@squarism
squarism / iterm2.md
Last active August 10, 2025 12:54
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@lamw
lamw / gist:487c9ecb2dc7d043eec8
Last active October 30, 2022 06:21
Automate silent installation of VMware Tools for Mac OS X
#!/bin/bash
# 1 = VMware Tools ISO is mounted from vSphere
# 2 = Download VMware Tools (assumes you can connect to internet)
INSTALL_METHOD=2
# Thanks to Rich Trouton for tip on Tools being available online
VMWARE_TOOLS_DOWNLOAD_URL=http://softwareupdate.vmware.com/cds/vmw-desktop/fusion/7.1.2/2779224/packages/com.vmware.fusion.tools.darwin.zip.tar
# DO NOT MODIFY BEYOND HERE #
@rtrouton
rtrouton / gist:11bc3f21f47e1a79d099
Last active April 9, 2020 23:03
Downloading the latest release of a project from GitHub
#!/bin/bash
# How to set these variables:
#
# GitHub_Owner
# GitHub_Repo
#
# Example use:
#
# The Linde Group has repos on GitHub available
@grahampugh
grahampugh / manifest-find.sh
Last active August 29, 2015 14:19
Munki Manifest Find
#!/bin/bash
### A script to find which manifests contain references to a package or other manifest via included_manifests
### Your Munki repository must be mounted as a volume
### Syntax:
### $ ./manifest-find.sh -f <package or manifest name>
### Examples:
### $ ./manifest-find.sh -f Xcode
### $ ./manifest-find.sh -f _regular_users
@bryanzak
bryanzak / SetStudentDesktop.py
Last active August 29, 2015 13:56
Mavericks does not respect MCX applied to com.apple.desktop.plist. This script - which can be called via a LaunchAgent for every user that logs in - will read the plist file and extract the desktop image set by MCX. Normally this key is found in Background > default > ImageFilePath but sometimes (perhaps related to not being managed? or Mission …
#!/usr/bin/env python
# 1.1 2014-03-04 BP rewrote to use complete.plist MCX since the pref file method was unreliable
# 1.0 2014-02-23 BP first release for use with 10.9.x base images
# based on gist published by Greg Neagle: https://gist.github.com/gregneagle/6957826
# only needed (and tested) on 10.9, but may work on older OS versions
from AppKit import NSWorkspace, NSScreen
from Foundation import NSURL