Skip to content

Instantly share code, notes, and snippets.

@talkingmoose
talkingmoose / Match Version Number or Higher.bash
Last active March 20, 2025 14:08
Generates a regular expression (regex) that matches the provided version number or higher. Useful for Jamf Pro's "matches regex" operator in searches and smart groups where the results need to be the current version of an app or higher.
#!/bin/bash
<<ABOUT_THIS_SCRIPT
-------------------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
[email protected]
https://gist.github.com/2cf20236e665fcd7ec41311d50c89c0e
@gregneagle
gregneagle / adminopen.sh
Created March 9, 2020 18:57
Guess what this can be used for? (Hint: read the comments)
#!/bin/bash
# This script is designed to be run as root, perhaps by a management tool
# It takes one argument, a path to an app to be launched (or a name of an app,
# if you don't mind LaunchServices deciding which if any app to launch)
#
# If the current console user is not a member of the admin group, the user will
# be added to to the group. The app will then be launched in the console user's
# context.
# When the app exits (or this script is killed via SIGINT), if we had promoted
@dpid
dpid / how-to-notarize-unity-for-macos.md
Last active December 6, 2023 20:42
How to notarize a Unity build for MacOs 10.15 Catalina

How to notarize a Unity build for macOs 10.15 Catalina

As of January 2020, all apps running on macOs 10.15 Catalina are required to be notarized. For Unity games distributed outside the Mac App Store, such as with Steam, the notarization process is done post build using a series of Xcode command line tools.

Prerequisites

  • a Mac that is compatible with macOs 10.15 Catalina :
    • MacBook (2015 or newer)
    • MacBook Air (2012 or newer)
  • MacBook Pro (2012 or newer)
@talkingmoose
talkingmoose / Enable all macOS software updates.bash
Last active May 31, 2024 08:45
The /Library/Preferences/com.apple.SoftwareUpdate.plist seems impervious to being managed via configuration profile (at least on macOS Mojave). While not enforced management, add this script to a Jamf policy and run it on a routine basis such as once per week on scoped Macs.
#!/bin/bash
/usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate.plist AutomaticCheckEnabled -bool TRUE
/usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate.plist AutomaticDownload -bool TRUE
/usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate.plist AutomaticallyInstallMacOSUpdates -bool TRUE
/usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate.plist ConfigDataInstall -bool TRUE
/usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate.plist CriticalUpdateInstall -bool TRUE
/usr/bin/defaults write /Library/Preferences/com.apple.commerce.plist AutoUpdate -bool TRUE
exit 0
@ccstone
ccstone / Raw_AppleScript_Event_Codes_2006.tsv
Last active April 14, 2025 10:56
Raw AppleScript Event Codes (2006)
Code Terminology Kind Usage Line
$scr scripting additions folder Property of class: domain System Events : Disk-Folder-File Suite 1
%doc music folder Property of class: user domain object System Events : Disk-Folder-File Suite 2
µdoc music folder Enumeration Standard Additions : File Commands 3
ƒhlp help Enumeration Standard Additions : File Commands 4
ƒhlp help folder Enumeration Standard Additions : File Commands 5
ƒlib shared libraries Enumeration Standard Additions : File Commands 6
ƒlib shared libraries folder Enumeration Standard Additions : File Commands 7
ƒmod modem scripts Enumeration Standard Additions : File Commands 8
ƒmod modem scripts folder Enumeration Standard Additions : File Commands 9
@bradtraversy
bradtraversy / docker-help.md
Last active April 14, 2025 16:45
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

Disable Device Enrollment Notification on Mac.md

Restart the Mac in Recovery Mode by holding Comment-R during restart

Open Terminal in the recovery screen and type

csrutil disable
@gregneagle
gregneagle / sysctl_demo.py
Last active December 5, 2024 10:39
Based on sysctl function by Michael Lynn aka frogor aka pudquick aka ????
# Based on sysctl function by Michael Lynn
# https://gist.github.com/pudquick/581a71425439f2cf8f09
from ctypes import CDLL, c_uint, byref, create_string_buffer
from ctypes import cast, POINTER, c_int32, c_int64
from ctypes.util import find_library
import struct
libc = CDLL(find_library('c'))
@JuanRamino
JuanRamino / command-line-ninja.md
Last active April 14, 2021 14:17
command line ninja

Ctrl+

  • Ctrl+U : This clears the entire line so you can type in a completely new command.
  • Ctrl+K : This deletes the line from the position of the cursor to the end of the line.
  • Ctrl+W : This deletes the word before the cursor only.
  • Ctrl+R : This lets you search your command history for something specific. another press to browse in history
  • Ctrl+A : Go to beggining of line
  • Ctrl+E : Go to end of line
  • Ctrl+L : clear the screen
  • Ctrl+S : stops output to screen