Skip to content

Instantly share code, notes, and snippets.

View manicmachine's full-sized avatar

Corey Oliphant manicmachine

View GitHub Profile
@manicmachine
manicmachine / Management_Account_Password_Last_Set.sh
Created July 10, 2026 01:18
Jamf Pro EA: Management Account Password Last Set
#!/bin/bash
account="laps_account" # replace this with the account you wish to track
passwordLastSetTimeEpoch=$(/usr/bin/dscl . read "/Users/$account" accountPolicyData | /usr/bin/awk -F'[><]' '/<key>passwordLastSetTime<\/key>/{getline; print $3}' | /usr/bin/cut -d '.' -f1)
# Time in UTC -- use `date -jf` if you want the time in local timezone instead
echo "<result>$(/bin/date -juf %s "$passwordLastSetTimeEpoch")</result>"
@manicmachine
manicmachine / LAPS_Broken_EA.sh
Created July 10, 2026 00:54
Jamf Pro EA: LAPS Broken
#!/bin/bash
sync_metadata_path="/Library/laps_sync_metadata.json"
jamf_out=$(/usr/local/bin/jamf rotateManagementAccountPassword -verbose 2>&1)
result=""
# Create metadata file
if [[ ! -f "$sync_metadata_path" ]]; then
/usr/bin/touch "$sync_metadata_path"
/bin/chmod 600 "$sync_metadata_path"
@manicmachine
manicmachine / ChaChaPoly_Encryption.playground
Last active May 27, 2025 13:51
ChaChaPoly encryption in Swift with CryptoKit
import Foundation
import CryptoKit
extension SymmetricKey {
init?(base64EncodedString: String) {
guard let data = Data(base64Encoded: base64EncodedString) else {
return nil
}
self.init(data: data)