Skip to content

Instantly share code, notes, and snippets.

@homebysix
homebysix / postinstall
Created April 6, 2018 01:11
Trigger 10.13.2 update to begin installing at login window
#!/bin/bash
"/System/Library/CoreServices/Software Update.app/Contents/Resources/SoftwareUpdateLauncher.app/Contents/MacOS/SoftwareUpdateLauncher" -RootInstallMode YES -SkipConfirm YES
@homebysix
homebysix / .gitlab-ci.yml
Last active January 25, 2019 19:19
MunkiPkg linting
variables:
TZ: America/Los_Angeles
munkipkg_linting:
script: python munkipkg_linting.py
@homebysix
homebysix / is_in_specified_subnet.sh
Last active March 18, 2019 17:43
is_in_specified_subnet.sh
#!/bin/bash
###
#
# Name: is_in_specified_subnet.sh
# Description: A script that detects whether this Mac is on a particular
# subnet, as determined by whether the IP starts with a
# specific string.
# Author: Elliot Jordan <elliot@elliotjordan.com>
# Created: 2015-09-21
@homebysix
homebysix / git_version.sh
Last active March 18, 2019 17:44
Casper extension attribute that collects the version of Git installed.
#!/bin/sh
###
#
# Name: git_version.sh
# Description: Casper extension attribute that displays the version of Git.
# Excludes /usr/bin/git in order to prevent Xcode install prompt.
# Author: Elliot Jordan <elliot@elliotjordan.com>
# Created: 2014-12-19
# Last Modified: 2014-12-22
@homebysix
homebysix / get_sourceforge_group_id.py
Last active March 18, 2019 17:44
get_sourceforge_group_id.py
#!/usr/bin/env python
'''
Name: get_sourceforge_group_id.py
Description: Given the name of a SourceForge project, returns its group
ID. Useful for creating AutoPkg recipes that leverage the
SourceForgeURLProvider processor.
Author: Elliot Jordan <elliot@elliotjordan.com>
Created: 2015-07-11
@homebysix
homebysix / convert_autopkg_recipes_to_yaml.py
Last active January 30, 2020 17:38
convert_autopkg_recipes_to_yaml.py
#!/usr/bin/python
import plistlib
from collections import OrderedDict
from glob import glob
import yaml
def represent_ordereddict(dumper, data):
value = []
@homebysix
homebysix / Eligible for AppPkgCreator.txt
Created February 5, 2020 15:33
Eligible for AppPkgCreator
Recipe ./aanklewicz-recipes/GameSalad/GameSalad.pkg.recipe is eligible for AppPkgCreator.
Recipe ./arubdesu-recipes/CharlesProxy/CharlesProxy.pkg.recipe is eligible for AppPkgCreator.
Recipe ./arubdesu-recipes/ClipMenu/ClipMenu.pkg.recipe is eligible for AppPkgCreator.
Recipe ./arubdesu-recipes/Google PythonAppEngineSDK/GoogleAppEngineLauncher.pkg.recipe is eligible for AppPkgCreator.
Recipe ./arubdesu-recipes/Isolator/Isolator.pkg.recipe is eligible for AppPkgCreator.
Recipe ./arubdesu-recipes/Pacifist/Pacifist.pkg.recipe is eligible for AppPkgCreator.
Recipe ./arubdesu-recipes/Reflector/Reflector.pkg.recipe is eligible for AppPkgCreator.
Recipe ./arubdesu-recipes/Sonos/Sonos.pkg.recipe is eligible for AppPkgCreator.
Recipe ./arubdesu-recipes/Synergy/Synergy.pkg.recipe is eligible for AppPkgCreator.
Recipe ./bochoven-recipes/JASP/JASP.pkg.recipe is eligible for AppPkgCreator.
@homebysix
homebysix / 2020-02-04 autopkg dupe recipe filenames.txt
Created February 4, 2020 18:00
AutoPkg duplicate recipes cleanup
adobeflashplayer.download
First commit 2013-08-25 20:54:44 -0700 for ./recipes/AdobeFlashPlayer/AdobeFlashPlayer.download.recipe
First commit 2015-01-18 22:52:12 +0000 for ./vmule-recipes/AdobeFlashPlayer/AdobeFlashPlayer.download.recipe
affinityphoto.download
First commit 2019-09-02 11:58:37 +0200 for ./peterkelm-recipes/Serif/AffinityPhoto.download.recipe
First commit 2019-09-05 16:45:32 +0200 for ./faumac-recipes/Affinity Photo/Affinity Photo.download.recipe
affinitypublisher.download
First commit 2019-09-05 16:45:32 +0200 for ./faumac-recipes/Affinity Publisher/Affinity Publisher.download.recipe
@homebysix
homebysix / send_imessage.sh
Last active April 28, 2020 22:40
send_imessage.sh
#!/bin/bash
RECIPIENT="+14155551212"
MESSAGE="Hello world"
cat << EOF > /tmp/send_imessage.scpt
tell application "Messages"
set serviceID to get id of first service
set theRecipient to buddy "${RECIPIENT}" of service id serviceID
send "${MESSAGE}" to theRecipient
@homebysix
homebysix / GlobalProtectService keychain item removal.sh
Created November 16, 2020 19:45
GlobalProtectService keychain item removal.sh
#!/bin/bash
# Remove GlobalProtectService keychain item from all users' login keychains.
USER_LIST=$(/usr/bin/dscl . -list /Users UniqueID | awk '$2 > 500 {print $1}')
for THIS_USER in $USER_LIST; do
USER_HOME=$(/usr/bin/dscl . -read "/Users/$THIS_USER" NFSHomeDirectory | awk '{print $2}')
USER_KEYCHAIN="$USER_HOME/Library/Keychains/login.keychain-db"
if [[ -f "$USER_KEYCHAIN" ]]; then
if /usr/bin/security find-generic-password -s "GlobalProtectService" "$USER_KEYCHAIN" &>/dev/null; then
/usr/bin/security delete-generic-password -s "GlobalProtectService" "$USER_KEYCHAIN" &>/dev/null
echo "Deleted GlobalProtectService item from $THIS_USER login keychain."