mkdir -p /opt/scripts
mkdir -p /var/log/custom
mkdir -p /var/root/Library/LaunchAgents
curl 'https://gist.githubusercontent.com/heywoodlh/0295135b9e24ec0729571497c9ab5a77/raw/b3032d9a563c956f574176c39cb2a5382f8c579c/auth-log.sh' -o /opt/scripts/auth-log.sh
chmod +x /opt/scripts/auth-log.sh
This file contains hidden or 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
| MAKE := make --no-print-directory | |
| DESCRIBE := $(shell git describe --match "v*" --always --tags) | |
| DESCRIBE_PARTS := $(subst -, ,$(DESCRIBE)) | |
| VERSION_TAG := $(word 1,$(DESCRIBE_PARTS)) | |
| COMMITS_SINCE_TAG := $(word 2,$(DESCRIBE_PARTS)) | |
| VERSION := $(subst v,,$(VERSION_TAG)) | |
| VERSION_PARTS := $(subst ., ,$(VERSION)) |
This file contains hidden or 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
| function Get-ProcessOutput | |
| { | |
| Param ( | |
| [Parameter(Mandatory=$true)]$FileName, | |
| $Args | |
| ) | |
| $process = New-Object System.Diagnostics.Process | |
| $process.StartInfo.UseShellExecute = $false | |
| $process.StartInfo.RedirectStandardOutput = $true |
This file contains hidden or 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/python | |
| from macholib import MachO | |
| import macholib | |
| import os | |
| import sys | |
| path = sys.argv[1] | |
| for root, dirs, files in os.walk(path): |
This file contains hidden or 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/python | |
| import subprocess | |
| import plistlib | |
| cmd = ['/usr/sbin/system_profiler', '-xml', 'SPApplicationsDataType'] | |
| proc = subprocess.Popen(cmd, shell=False, bufsize=-1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
| output, err = proc.communicate() | |
| plist = plistlib.readPlistFromString(output) | |
| items = plist[0]['_items'] | |
| for item in sorted(items, key=lambda x: x.get('path')): |
This file contains hidden or 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
| pm.expect(pm.globals.has('accessToken')).to.be.true; | |
| const sdk = require('postman-collection'); | |
| const JWS_REGEX = /^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/; | |
| const currentToken = pm.globals.get('accessToken').replace('Bearer ', ''); | |
| const path = pm.environment.get('url') + '/auth/token'; | |
| let expired = true; | |
| if(currentToken && currentToken.length > 0) { |
I've never had great understanding of launchctl but the deprecation of the old commands with launchctl 2 (10.10) has been terrible as all resources only cover the old commands, and documentation for Apple utilities is generally disgracefully bad, with launchctl not dissembling.
Mad props to https://babodee.wordpress.com/2016/04/09/launchctl-2-0-syntax/ which contains most details
Internally, launchd has several domains, but launchctl 1 would only ask for service names,
This file contains hidden or 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
| #!/bin/bash | |
| # | |
| ## -----------------------------=[ WARNING ]=-------------------------------- ## | |
| # | |
| # This script is now woefully out of date due to which accounts ESXi allows to | |
| # ssh into the box as well as sticky folders/file flags. | |
| # I've since ported the whole thing to python with a lot of bells and whistles | |
| # and if i get around to making it public, i'll put a link here. | |
| # | |
| ## -------------------------------=[ Info ]=--------------------------------- ## |
This file contains hidden or 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
| #!/bin/sh | |
| # User path | |
| /usr/bin/getconf DARWIN_USER_DIR | |
| # Temp directory | |
| # Note - $TMPDIR is the same as this | |
| /usr/bin/getconf DARWIN_USER_TEMP_DIR | |
| # Cache directory |
This file contains hidden or 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/python | |
| import os | |
| import sys | |
| from CoreFoundation import (CFPreferencesAppValueIsForced, | |
| CFPreferencesCopyAppValue, | |
| CFPreferencesCopyValue, | |
| kCFPreferencesAnyUser, | |
| kCFPreferencesAnyHost, |