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 | |
#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
#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 | |
#Joel Bruner | |
#BTSharingStateas - report bluetooth sharing states from system_profiler using jpt to parse output | |
#if jpt is not installed locally, embed function from jpt.min into this script: https://github.com/brunerd/jpt | |
#get all the data once | |
SPBluetooth=$(system_profiler -json SPBluetoothDataType 2>/dev/null) | |
#get the paths related to service state | |
statePaths=$(jpt -jd '$..service_state' <<< "${SPBluetooth}") |
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 | |
#fixJSON-TrailersComments - fix JSON with trailing commas and comments (JS, Shell and * style) | |
: <<-LICENSE_BLOCK | |
Copyright (c) 2020 Joel Bruner (https://github.com/brunerd) | |
Licensed under the MIT License | |
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 copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HO |
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
#malformed JSON (according to json_pp) by macOS version | |
#jpt (https://github.com/brunerd/jpt) can parse all of these now | |
## NOTES on the Files ## | |
# USD generated JSON contains # comments | |
# /private/var/db/ionodecache.json - has a single *** COMMENT *** line at the top | |
# /System/Library/PrivateFrameworks/CoreAnalytics.framework/Versions/A/Resources/defaultConfig.json i - is "JSON Lines" aka "concatenated JSON" | |
# Most of the others have trailing commas after the final member of arrays and objects | |
## SPECIAL Note ## |
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 4 columns, instead of 3 in line 5.
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
Status,Issue Notes,Path,Error Output | |
ERROR,"""JSON Lines""/Concatenated",/System/Library/PrivateFrameworks/CoreAnalytics.framework/Versions/A/Resources/defaultConfig.json,"garbage after JSON object, at character offset 143 (before """"addTransform"":{""uui..."") at /usr/bin/json_pp5.18 line 45." | |
ERROR,Trailing Comma,/Library/Developer/CommandLineTools/usr/lib/swift/migrator/overlay4.json,"malformed JSON string, neither array, object, number, string or atom, at character offset 41290 (before ""]\n"") at /usr/bin/json_pp5.18 line 45." | |
ERROR,Trailing Comma,/Library/Developer/CommandLineTools/usr/lib/swift/migrator/overlay42.json,"malformed JSON string, neither array, object, number, string or atom, at character offset 608 (before ""]\n"") at /usr/bin/json_pp5.18 line 45." | |
ERROR,*** Comment ***,/private/var/db/ionodecache.json,"malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before ""*** Device Tree ***\n..."") at /usr/bin/json_pp5.18 line 45." | |
ERROR,Trailing Commas,/S |
OlderNewer