Skip to content

Instantly share code, notes, and snippets.

@nikolay-n
nikolay-n / defsmon.py
Last active October 29, 2022 14:26
Defaults Monitor - tool to sniff defaults keys and values using unified log
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
'''
Defaults Monitor - tool to sniff defaults keys and values using unified log
to launch use standard python 2.7, eg python2.7 ./defsmon.py
'''
import os
@esutton
esutton / macos-installer-to-iso.sh
Last active January 12, 2023 05:25
Create macOS Catalina Bootable ISO Image
#!/bin/sh
#
# File: macos-installer-to-iso.sh
#
# Create a bootable ISO image from a macOS installer to install VMware ESXi guests.
#
# https://gist.github.com/Kutkovsky/613e29f35d3ef420b23b59ecdf7a28e0
# Debug on: set -x
set -eux
@talkingmoose
talkingmoose / Manage App Notifications.bash
Last active January 25, 2024 15:26
macOS Catalina will prompt users to allow Notifications from each app that makes a request. Administrators can manage these prompts using a Configuration Profile. If running Jamf Pro 10.19 or later, I suggest instead using this manifest: https://github.com/talkingmoose/jamf-manifests/blob/master/macOS%20Notifications%20(com.apple.notificationset…
#!/bin/bash
<<ABOUT_THIS_SCRIPT
-----------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
[email protected]
https://gist.github.com/talkingmoose/9faf50deaaefafa9a147e48ba39bb4b0
@arekdreyer
arekdreyer / postinstall-for-Composer-for-DEPNotify.zsh
Last active April 5, 2024 21:36
Postinstall script for Jamf Composer to install DEPNotify with supporting scripts and a LaunchDaemon
#!/bin/zsh
## postinstall
pathToScript=$0
pathToPackage=$1
targetLocation=$2
targetVolume=$3
# This postinstall script for Composer creates the following
# A LaunchDaemon that starts a separate script to run a Jamf Pro policy command
@talkingmoose
talkingmoose / Report Office for Mac License.sh
Created September 23, 2018 02:20
Use this script as part of an extension attribute in Jamf to report the type of Microsoft Office for Mac licensing in use.
#!/bin/sh
<<ABOUT_THIS_SCRIPT
-----------------------------------------------------------------------
Written by: William Smith
Professional Services Engineer
Jamf
[email protected]
https://github.com/talkingmoose/Jamf-Scripts
@igorvoltaic
igorvoltaic / useradd.sh
Last active July 25, 2024 10:23
Create new user using command line in Mac OS X. Do not forget to set correct permissions for the file.
#!/bin/sh
if [[ `id -u` != 0 ]]; then
echo "Must be root to run script"
exit
fi
read -p "Enter user name and press [ENTER]: " UserName
if [[ $UserName == `dscl . -list /Users UniqueID | awk '{print $1}' | grep -w $UserName` ]]; then
@scriptingosx
scriptingosx / techs.sh
Last active October 15, 2019 13:49
Sample script to modify authorization db on macOS
#!/bin/bash
# modify the system.preferences right
/usr/bin/security authorizationdb write system.preferences <<EndOfPlist
<?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>allow-root</key>
<true/>
@opragel
opragel / forcefully_remove_mdm_1015.sh
Last active June 10, 2024 06:29
forcefully_remove_mdm_1015.sh
#!/bin/bash
# Seriously there still apparently aren't enough warning labels
# If you don't understand the consequences don't do it
REMOVE_PATHS=( # "/var/db/ConfigurationProfiles/.passcodePolicesAreInstalled"
# "/var/db/ConfigurationProfiles/.cloudConfigHasActivationRecord"
# "/var/db/ConfigurationProfiles/.cloudConfigNoActivationRecord"
# "/var/db/ConfigurationProfiles/.cloudConfigProfileObtained"
# "/var/db/ConfigurationProfiles/.cloudConfigRecordFound"
# "/var/db/ConfigurationProfiles/.profilesAreInstalled"
@gregneagle
gregneagle / startosinstall_10.12.6_normalboot.txt
Last active February 6, 2024 07:28
Comparison of startosinstall's available options depending on boot OS environment
bash-3.2$ /Applications/Install\ macOS\ Sierra.app/Contents/Resources/startosinstall --usage
Usage: startosinstall --applicationpath <install macOS.app path>
Arguments
--applicationpath, a path to copy of the OS installer application to start the install with.
--license, prints the user license agreement only.
--agreetolicense, agree to license the license you printed with --license.
--rebootdelay, how long to delay the reboot at the end of preparing. This delay is in seconds and has a maximum of 300 (5 minutes).
--pidtosignal, Specify a PID to which to send SIGUSR1 upon completion of the prepare phase. To bypass "rebootdelay" send SIGUSR1 back to startosinstall.
--usage, prints this message.
@timsutton
timsutton / LoginDialog.xml
Last active November 27, 2019 09:07
Vectorworks 2017 deployment stuff - Munki pkginfos and a Luggage project for network licensing
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<LoginDialog>
<Days>1</Days>
<AutoFindServer>0</AutoFindServer>
<AutoFindMaxTime>1</AutoFindMaxTime>
<DontShowAtStartup>1</DontShowAtStartup>
<Servers>
<Server>license-server.org.my:5053</Server>
</Servers>
<Modules>