Skip to content

Instantly share code, notes, and snippets.

View jhbush's full-sized avatar

Jason Bush jhbush

  • Coffee Cats Consulting
  • San Francisco Bay Area
  • 15:44 (UTC -07:00)
  • X @jasonhbush
View GitHub Profile
@jhbush
jhbush / third_party_kernel_extensions_ea.sh
Created December 22, 2017 19:19
Displays Third Party Kernel Extensions
#!/bin/bash
# Displays Third Party Kernel Extensions
echo "<result>$(kextstat -kl | awk '!/com\.apple/{printf "%s %s\n", $6, $7}')</result>"
@jhbush
jhbush / forcefully_remove_mdm_1013.sh
Created December 22, 2017 01:45 — forked from opragel/forcefully_remove_mdm_1015.sh
forcefully_remove_mdm_1013.sh
#!/bin/bash
# Seriously there still apparently aren't enough warning labels
# If you don't understand the consequences don't do it
# ################
# #### May cause 10.13.2+ machines that were DEP-enrolled to not be considered as such
# ################
# but really, you shouldn't do this
# one local user enabled for MDM come on apple
# ¯\_(ツ)_/¯
@jhbush
jhbush / gist:08e3a8a7adbab390c11fc4311b179d20
Created November 13, 2017 07:07 — forked from rtrouton/gist:3ac68ac3770ab23ebae354c581f526b7
MigrateADMobileAccountToLocalAccount.command script
#!/bin/bash
# Modified 2/7/2017
Version=1.2
# Original source is from MigrateUserHomeToDomainAcct.sh
# Written by Patrick Gallagher - https://twitter.com/patgmac
#
# Guidance and inspiration from Lisa Davies:
# http://lisacherie.com/?p=239
#
# Modified by Rich Trouton
@jhbush
jhbush / uninstall_office_2016.sh
Created November 8, 2017 23:14 — forked from pirafrank/uninstall_office_2016.sh
Uninstall Office 2016 from OS X completely
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo -e "
ROOT PRIVILEDGES NEEDED!
You have to run this script as root.
Aborting...
"
exit 1
else
@jhbush
jhbush / update_jamf_pro_user_inventory_using_nomad_credentials.sh
Created April 12, 2017 21:45
update_jamf_pro_user_inventory_using_nomad_credentials.sh
#!/bin/bash
# Original by Rich Trouton
# https://derflounder.wordpress.com/2017/04/12/identifying-which-active-directory-account-is-logged-into-enterprise-connect/
#
# This script is designed to do the following:
#
# 1. Identify if NoMAD is installed on a particular Mac
# 2. If NoMAD is installed, identify the username of the Active Directory account logged into NoMAD.
@jhbush
jhbush / com.trusourcelabs.NoMAD.plist
Last active April 25, 2017 05:43
NoMAD Preferences
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ADDomain</key>
<string>company.com</string>
<key>GetHelpOptions</key>
<string>https://itsupport.company.com</string>
<key>GetHelpType</key>
<string>URL</string>
@jhbush
jhbush / help.apple.com_urls
Created August 4, 2016 23:04 — forked from opragel/help.apple.com_urls
help.apple.com_urls
https://help.apple.com/deployment/osx/
https://help.apple.com/deployment/ios/
https://help.apple.com/deployment/business/
https://help.apple.com/deployment/education/
https://help.apple.com/icloud
https://help.apple.com/machelp/mac/10.12/
https://help.apple.com/serverapp/mac/
https://help.apple.com/advancedserveradmin/mac/4.0/
https://help.apple.com/configurator/
https://help.apple.com/profilemanager/mac/
@jhbush
jhbush / vpn_fixer_present_ea.sh
Last active July 27, 2016 16:32
Checks for the the files related to the VPN fixer temporary patch.
#!/bin/bash
# Checks for the the files related to the VPN fixer patch.
if [ -d "/usr/local/clamXav" ]; then
echo "<result>Yes</result>"
else
#!/bin/bash
#Sam Look November 2015, all care and no responsibility, this sucker will blitz everything so watch out
##### SUBROUTINES START HERE #####
Get_First_HDD(){
echo Starting search for HDD
for The_Disk in $(diskutil list | awk '/internal/ && /physical/ {print $1}'); do
echo Checking $The_Disk
if [[ ! "$The_HDD" ]] && [[ "$(diskutil info $The_Disk | awk '/Solid State/ && /No/')" ]]; then
@jhbush
jhbush / loginwindow_events.py
Created May 26, 2016 00:24 — forked from pudquick/loginwindow_events.py
Send polite Logout / "really" Logout / Restart / Shutdown Apple Events to loginwindow via python and pyObjC
import struct, objc
from Foundation import NSBundle
from Cocoa import NSAppleEventDescriptor
def OSType(s):
# Convert 4 character code into 4 byte integer
return struct.unpack('>I', s)[0]
# Create an opaque pointer type to mask the raw AEDesc pointers we'll throw around
AEDescRef = objc.createOpaquePointerType('AEDescRef', '^{AEDesc=I^^{OpaqueAEDataStorageType}}')