Skip to content

Instantly share code, notes, and snippets.

@opragel
opragel / macos_keyboard_shortcuts.md
Last active April 17, 2025 17:16
macOS favorite keyboard shortcuts

macOS keyboard shortcut favorites

Legend

Command (or Cmd)  - ⌘
Control (or Ctrl) - ^
Option (or Alt)   - ⌥
Shift             - ⇧
Fn (Function)     - 🌐
@weswhet
weswhet / mscupdate.py
Last active February 6, 2025 16:19
quit, update, and reopen all apps that have an update available in Managed Software Center.
#!/usr/local/munki/munki-python
import argparse
import os
import pathlib
import plistlib
import pprint
import pwd
import subprocess
from time import sleep
@np5
np5 / 20250227_output.csv
Last active February 27, 2025 21:17
Apple computer / model identifiers model id models ID IDENTIFIERS APPLE mac MacPro script parse download output
Model Type Identifier
MacBook Air LAPTOP Mac14,15
MacBook Air LAPTOP Mac14,2
MacBook Air LAPTOP Mac15,12
MacBook Air LAPTOP Mac15,13
MacBook Air LAPTOP MacBookAir10,1
MacBook Air LAPTOP MacBookAir2,1
MacBook Air LAPTOP MacBookAir3,1
MacBook Air LAPTOP MacBookAir3,2
MacBook Air LAPTOP MacBookAir4,1
@macshome
macshome / defang.md
Last active April 23, 2025 04:03
How to defang system protections on macOS

How to Defang macOS System Protections

If you want to change things on the root drive of a Mac you will need to take some steps to disable the built in security of the system. Most of these steps are the same regardless if you are on Intel or Apple Silicon. If there is a difference it is noted.

Note that all of these things put a Mac into an unsupported and less secure state.

Make sure you either perform these steps in a VM or that you reset the protections after you are done poking around

Protections and Terms

(This list is not exahustive on the details of each. Check the links at the end for more info.)

@talkingmoose
talkingmoose / Speed Dating for Mac Admins.md
Last active April 9, 2025 19:07
Resources for my Penn State 2022 MacAdmins Campfire presentation on June 2

Speed Dating for Mac Admins

Terminal Login Banner

Last login: Wed Jun  1 23:03:39 on ttys000


                        'c.            Logged in as: bill.smith
                     ,xNMM.            ---------------------------------
@byt3bl33d3r
byt3bl33d3r / log4j_rce_check.py
Created December 10, 2021 06:02
Python script to detect if an HTTP server is potentially vulnerable to the log4j 0day RCE (https://www.lunasec.io/docs/blog/log4j-zero-day/)
#! /usr/bin/env python3
'''
Needs Requests (pip3 install requests)
Author: Marcello Salvati, Twitter: @byt3bl33d3r
License: DWTFUWANTWTL (Do What Ever the Fuck You Want With This License)
This should allow you to detect if something is potentially exploitable to the log4j 0day dropped on December 9th 2021.
@drewkerr
drewkerr / get-focus-mode.js
Last active April 4, 2025 04:29
Read the current Focus mode on macOS Monterey (12.0+) using JavaScript for Automation (JXA)
const app = Application.currentApplication()
app.includeStandardAdditions = true
function getJSON(path) {
const fullPath = path.replace(/^~/, app.pathTo('home folder'))
const contents = app.read(fullPath)
return JSON.parse(contents)
}
function run() {
@maxisam
maxisam / bash_strict_mode.md
Created August 9, 2021 16:42 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation

set -e, -u, -o, -x pipefail

The set lines

  • These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing.
  • With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.
  • set -euxo pipefail is short for:
set -e
set -u
@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