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
  • 01:25 (UTC -08:00)
  • X @jasonhbush
View GitHub Profile
@jhbush
jhbush / enable_location_services.zsh
Created December 15, 2022 17:26
Enables location services and sets date and time automatically.
#!/bin/zsh
# Enable Location Services script
# Find the device UUID
uuid=$( /usr/sbin/ioreg -d2 -c IOPlatformExpertDevice | /usr/bin/awk -F\" '/IOPlatformUUID/{print $(NF-1)}' )
# Enable macOS Location Services
/usr/bin/defaults write /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd LocationServicesEnabled -int 1
/usr/bin/defaults write /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.$uuid LocationServicesEnabled -int 1
@jhbush
jhbush / Set Computer PreStage Scope.bash
Created April 20, 2021 21:14 — forked from talkingmoose/Set Computer PreStage Scope.bash
As of Jamf Pro 10.14, the Jamf Pro API (/uapi) allows access to create and update scopes for computer PreStage Enrollments. Edit the information at the top and include a list of computer serial numbers for the COMPLETE scope. (The script replaces the scope list; it doesn't update.) Be sure to leave the opening and closing parentheses.
#!/bin/bash
# server connection information
URL="https://talkingmoose.jamfcloud.com"
username="API-Editor"
password="P@55w0rd"
# provide the Jamf Pro ID of the PreStage Enrollment; look in the URL when viewing the PreStage Enrollment
prestageID="1"
How to Help Someone use a Computer
Computer people are fine human beings, but they do a lot of harm in the ways they "help" other people with their computer problems. Now that we're trying to get everyone online, I thought it might be helpful to write down everything I've been taught about helping people use computers.
First you have to tell yourself some things:
* Nobody is born knowing this stuff.
* You've forgotten what it's like to be a beginner.
* If it's not obvious to them, it's not obvious.
* A computer is a means to an end. The person you're helping probably cares mostly about the end. This is reasonable.
<?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>PayloadContent</key>
<array>
<dict>
<key>PayloadDisplayName</key>
<string>ManagedClient logging</string>
<key>PayloadEnabled</key>
@jhbush
jhbush / import_departments_into_jss.sh
Created June 20, 2019 15:22 — forked from neilmartin83/import_departments_into_jss.sh
Import a list of Departments into your JSS from a text file
#!/bin/sh
# Import a text file containing a list of Departments into your JSS!
# The text file must be formatted with Unix (LF) line breaks
# Important note: if your text file contains & characters, replace them with &amp;
# Change these for your environment
user="jssuser"
pass="jsspass"
jssurl="https://my.jss.org:8443"
import base64
import getpass
import sys
import xml.etree.ElementTree as Et
import urllib
import urllib2
reload(sys)
sys.setdefaultencoding('utf-8')
@jhbush
jhbush / catalogUtilities.py
Created April 17, 2018 20:48 — forked from Piker-Alpha/catalogUtilities.py
Show and set the CatalogURL on macOS 10.10 and greater
#!/usr/bin/python
import objc
from Foundation import NSBundle, NSClassFromString
SeedingBundle = NSBundle.bundleWithPath_('/System/Library/PrivateFrameworks/Seeding.framework')
functions = [
('currentCatalog', '@'),
@jhbush
jhbush / unenrollFromSeedingProgram.py
Created April 17, 2018 20:47 — forked from Piker-Alpha/unenrollFromSeedingProgram.py
Python implementation of: seedutil unenroll
#!/usr/bin/python
''' Python implementation of "seedutil unenroll" '''
import os
import objc
from Foundation import NSBundle, NSClassFromString
SeedingBundle = NSBundle.bundleWithPath_('/System/Library/PrivateFrameworks/Seeding.framework')
@jhbush
jhbush / enrollInSeedProgram.py
Created April 17, 2018 20:47 — forked from Piker-Alpha/enrollInSeedProgram.py
Python implementation of: seedutil enroll <program>
#!/usr/bin/python
''' Python implementation of "seedutil enroll <program>" '''
import os
import objc
from Foundation import NSBundle, NSClassFromString
SeedingBundle = NSBundle.bundleWithPath_('/System/Library/PrivateFrameworks/Seeding.framework')
@jhbush
jhbush / RemotelyApproveUAMDM.scpt
Created March 1, 2018 19:55
Remotely Approve UAMDM in 10.13.+
tell application "System Preferences" to activate
tell application "System Events"
tell application process "System Preferences"
set currentWindow to name of window 1
if currentWindow does not contain "Profiles" then
click button "Show All" of group 1 of group 2 of toolbar 1 of window 1
delay 2
click button "Profiles" of scroll area 1 of window "System Preferences"
delay 2