Skip to content

Instantly share code, notes, and snippets.

@homebysix
homebysix / .pre-commit-config.yaml
Last active June 28, 2021 16:55
Pre-commit config for public AutoPkg recipe repository (extended)
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",
"--",
]
@homebysix
homebysix / .pre-commit-config.yaml
Last active June 28, 2021 16:54
Pre-commit config for private 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.pretendco.cpe.",
"--override-prefix=local.",
"--strict",
"--",
@homebysix
homebysix / .pre-commit-config.yaml
Last active June 28, 2021 16:46
Pre-commit config for public AutoPkg recipe repository (basic)
repos:
- repo: https://github.com/homebysix/pre-commit-macadmin
rev: v1.10.1
hooks:
- id: check-autopkg-recipes
args: ["--recipe-prefix=com.github.yourusername."]
- id: forbid-autopkg-overrides
- id: forbid-autopkg-trust-info
@homebysix
homebysix / anonymizer.py
Created April 5, 2021 23:23
anonymizer.py
#!/usr/bin/env python3
"""
Name: anonymizer.py
Description: Simple Python script that anonymizes personal and company
information in an input file. Useful for running on logs
and Terminal outputs before sharing on GitHub or Slack.
Author: Elliot Jordan <elliot@elliotjordan.com>
Created: 2021-02-03
def readable_time(seconds):
"""Converts a number of seconds to a human-readable time in seconds, minutes, and hours."""
parts = []
if seconds >= 86400: # 1 day
days = seconds // 86400
if days == 1:
parts.append("{} day".format(int(days)))
else:
parts.append("{} days".format(int(days)))
#!/usr/local/autopkg/python
import os
import plistlib
from glob import glob
from Foundation import CFPreferencesCopyAppValue
# Input keys we don't care about comparing.
EXCLUDED_KEYS = (
@homebysix
homebysix / shard.sh
Last active February 1, 2021 23:44
shard.sh
#!/bin/bash
###
#
# Name: shard.sh
# Description: This Casper extension attribute takes a Mac serial
# number as input and uses that serial number to output a
# number from 0 to 9. This can be useful in scoping Casper
# policies to a specific percentage of the fleet.
# Author: Elliot Jordan <elliot@elliotjordan.com>
@homebysix
homebysix / https_spotter.py
Last active January 5, 2021 06:41
HTTPS Spotter
#!/usr/local/autopkg/python
# encoding: utf-8
# HTTPS Spotter
# Copyright 2016-2020 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 / url_mover.py
Created January 4, 2021 02:11
URLMover
#!/usr/local/autopkg/python
# encoding: utf-8
# URLMover
# 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 / jamfHelper_help.txt
Last active November 25, 2020 23:06
jamfHelper_help.txt
JAMF Helper Help Page
Usage: jamfHelper -windowType [-windowPostion] [-title] [-heading] [-description] [-icon] [-button1] [-button2] [-defaultButton] [-cancelButton] [-showDelayOptions] [-alignDescription] [-alignHeading] [-alignCountdown] [-timeout] [-countdown] [-iconSize] [-lockHUD] [-startLaunchd] [-fullScreenIcon] [-kill]
-windowType [hud | utility | fs]
hud: creates an Apple "Heads Up Display" style window
utility: creates an Apple "Utility" style window
fs: creates a full screen window the restricts all user input
WARNING: Remote access must be used to unlock machines in this mode