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
#to officially do nothing | |
: | |
#there you go, this could be used when writing or troubleshooting a script and you have only a single item in an if clause | |
if [ "${this}" = "that" ]; then | |
#actually not sure what to do here, let's do nothing | |
: | |
else | |
echo "This else, I'll do" |
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
#!/bin/bash | |
#macOS - returns 0 or 1 depending on if we are a running in a VM or not | |
grep -c VMM <<< $(sysctl -n machdep.cpu.features) |
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
#!/bin/bash | |
#Joel Bruner - removes all ZoomOpener variants for all users | |
############# | |
# VARIABLES # | |
############# | |
#folder names where lurking webservers live | |
folderNames=".ringcentralopener | |
.zoomus |
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
#!/bin/sh | |
#brunerd - shell_vers | |
#a simple version checker of available shells | |
#not guaranteed to always work (I'm looking at YOU dash!) | |
#specify another volume to test | |
target="$1" | |
#loop through /etc/shells either locally or on specified target volume | |
for shell in $(grep -v ^\# "${1}"/etc/shells); do |
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
#!/bin/bash | |
#certChecker - gets the certificate expiration(s) from a pkg or an app and outputs as CSV | |
: <<-EOL | |
MIT License | |
Copyright (c) 2020 Joel Bruner (brunerd.com) | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights |
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
#!/bin/bash | |
#Joel "brunerd" Bruner - repack and expired pkg, stripping off all certs | |
#we can specify a target as an argument | |
target="$1" | |
#if target not specified we ask | |
while [ ! -d "${target}" -a ! -f "${target}" ]; do | |
read -p "Please provide a target file or folder: " target | |
done |
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
#!/bin/bash | |
: <<-EOL | |
MIT License | |
Copyright (c) 2020 Joel Bruner | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
#!/bin/bash | |
#clean the com.apple.macl attribute from a file or folders using zip to sidestep SIP on Catalina | |
#WARNING: This will overwrite the original file/folders with the zipped version - DO NOT use on production data | |
#hold down command key at launch or touch /tmp/debug to enable xtrace command expansion | |
commandKeyDown=$(/usr/bin/python -c 'import Cocoa; print Cocoa.NSEvent.modifierFlags() & Cocoa.NSCommandKeyMask > 1') | |
[ "$commandKeyDown" = "True" -o -f /tmp/debug ] && set -x && xtraceFlag=1 | |
#hacky example to clean the com.apple.macl attribute from a file using zip to sidestep SIP | |
: <<-EOL |
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
#Serial Number - x86/ARM | |
mySerial=$(/usr/libexec/PlistBuddy -c "print :0:IOPlatformSerialNumber" /dev/stdin <<< "$(ioreg -ard1 -c IOPlatformExpertDevice)") | |
#UUID - x86/ARM | |
myUUID=$(/usr/libexec/PlistBuddy -c "print :0:IOPlatformUUID" /dev/stdin <<< "$(ioreg -ard1 -c IOPlatformExpertDevice)") | |
#Provisioning UDID - ARM only, Monterey+ only | |
myProvisioningUDID=$(system_profiler -xml SPHardwareDataType | sed -e $'s/^[ \t]*//g;s/[ \t]*$//g' -e "s/date>/string>/g; s/data>/string>/g;s/real>/string>/g" | sed -e :a -e N -e '$!ba' -e 's/\n//g' | plutil -extract "0._items.0.provisioning_UDID" raw -o - -) | |
#Model ID - Universal |
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
#!/bin/bash | |
#https://gist.github.com/brunerd/d775ab7b362b72d9feb0c4035f922ede | |
function printState | |
{ | |
echo commandKeyDown: $commandKeyDown | |
echo controlKeyDown: $controlKeyDown | |
echo optionKeyDown: $optionKeyDown | |
echo shiftKeyDown: $shiftKeyDown | |
echo functionKeyDown: $functionKeyDown |
OlderNewer