Skip to content

Instantly share code, notes, and snippets.

@homebysix
homebysix / delete_jamf_remote_policies.py
Last active December 20, 2023 18:51
delete_jamf_remote_policies.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This script leverages the jamf-pro-sdk module to remove policies left over
from usage of the deprecated Jamf Remote app.
"""
import re
from jamf_pro_sdk import JamfProClient, PromptForCredentials
@homebysix
homebysix / osx-software-update-urls.txt
Last active September 29, 2023 20:34 — forked from geoff-nixon/osx-software-update-urls.txt
URLs of the index files used by the software update client on OS X
10.3 (Panther):
https://swscan.apple.com/scanningpoints/scanningpointX.xml
10.4 (Tiger):
https://swscan.apple.com/content/catalogs/index.sucatalog
https://swscan.apple.com/content/catalogs/index-1.sucatalog
10.5 (Leopard):
https://swscan.apple.com/content/catalogs/others/index-leopard.merged-1.sucatalog
@homebysix
homebysix / filevault_escrow_helper-1.0.plist
Created September 20, 2023 14:31
Escrow Buddy logout pkginfo for Munki
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>RestartAction</key>
<string>RequireLogout</string>
<key>catalogs</key>
<array>
<string>testing</string>
</array>
@homebysix
homebysix / ModifyAuthDBLoginMechs.sh
Last active June 18, 2023 03:55
macos-authdb-mechs
#!/bin/bash
###
#
# Name: ModifyAuthDBLoginMechs.sh
# Description: This script provides functions that can help Mac IT
# administrators modify and maintain the list of
# login mechanisms in the macOS authorization database.
# For details see:
# https://www.elliotjordan.com/posts/macos-authdb-mechs
@homebysix
homebysix / docklib_example.py
Last active June 4, 2023 20:13
docklib_example.py
#!/usr/local/bin/managed_python3
"""docklib_example.py
This example script demonstrates how Mac admins can use the docklib module to
manage the default state of Mac users' Docks. The script is meant to run at
login in user context using a tool like Outset or a custom LaunchAgent.
For details, see: https://www.elliotjordan.com/posts/resilient-docklib/
"""
@homebysix
homebysix / update_changelog_diffs.py
Created November 16, 2021 06:29
update_changelog_diffs.py
#!/usr/bin/env python3
"""Given the path to a Markdown-formatted change log, this script will update
the diff links for each version at the bottom of the document. For an example
of the diff links, see: https://keepachangelog.com
Currently only supports GitHub, GitLab, and Bitbucket diff links.
"""
@homebysix
homebysix / ip_addresses.sh
Last active September 30, 2021 15:21
A Casper extension attribute that displays the active IP addresses of the Mac.
#!/bin/bash
###
#
# Name: ip_addresses.sh
# Description: A Casper extension attribute that displays the active IP
# addresses of the Mac.
# Author: Elliot Jordan <elliot@elliotjordan.com>
# Created: 2014-06-04
# Last Modified: 2015-03-18
@homebysix
homebysix / PkgCreator_to_AppPkgCreator.py
Last active July 5, 2021 00:42
Convert AutoPkg recipes to AppPkgCreator
#!/usr/local/autopkg/python
# encoding: utf-8
# PkgCreator to AppPkgCreator
# Copyright 2019-2021 Elliot Jordan
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@homebysix
homebysix / .pre-commit-config.yaml
Last active June 28, 2021 16:55
Pre-commit config for private AutoPkg recipe repository (YAML recipes and overrides)
repos:
- repo: https://github.com/homebysix/pre-commit-macadmin
rev: v1.10.1
hooks:
- id: check-autopkg-recipes
args: [
"--recipe-prefix=com.pretendco.cpe.",
"--override-prefix=local.",
"--",
]
@homebysix
homebysix / .pre-commit-config.yaml
Last active June 28, 2021 16:55
Pre-commit config for public AutoPkg recipe repository (with processors)
repos:
- repo: https://github.com/homebysix/pre-commit-macadmin
rev: v1.10.1
hooks:
- id: check-autopkg-recipes
args: [
"--recipe-prefix=com.github.yourusername.",
"--strict",
"--",
]