View update_changelog_diffs.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. | |
""" | |
View docklib_example.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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/ | |
""" |
View .pre-commit-config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | |
"--", |
View .pre-commit-config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.", | |
"--", | |
] |
View .pre-commit-config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | |
"--", | |
] |
View .pre-commit-config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | |
"--", | |
] |
View .pre-commit-config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
View anonymizer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
View readable_time.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))) |
View detect_autopkg_variable_changes.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 = ( |
NewerOlder