Skip to content

Instantly share code, notes, and snippets.

View n8felton's full-sized avatar
🍎

Nate Felton n8felton

🍎
View GitHub Profile
@n8felton
n8felton / extract_printer_icon.sh
Last active March 16, 2020 19:22
Small snippet to extract printer icons from macOS printer drivers
MODEL="Xerox WorkCentre 6655"
ICON=$(gunzip -c "/Library/Printers/PPDs/Contents/Resources/${MODEL}.gz" | awk '/APPrinterIconPath/ {gsub(/"/,"",$2); print $2}')
/usr/bin/sips -s format png "${ICON}" --out "${MODEL}.png" --addIcon --resampleHeightWidthMax 512
@n8felton
n8felton / munki_categories.txt
Created August 1, 2017 01:46
Shortened list of munki categories
Configurations
Developer Tools
Drivers
Graphics & Design
Math & Science
Plugins
Printers
Productivity
Utilities
@n8felton
n8felton / mas_categories.txt
Created August 1, 2017 01:36
Mac App Store (MAS) Categories
Business
Developer Tools
Education
Entertainment
Finance
Games
Graphics & Design
Health & Fitness
Lifestyle
Medical
@n8felton
n8felton / gist:b0345b9d005ae1ececcdeeedad50a1a1
Created August 1, 2017 01:26
Unique categories found in munki recipes for autopkg
3D
Admin
Admin Tool
Administrative Tools
Android Development
Application Development
Applications
Apps
Audio
Backup Software
@n8felton
n8felton / detect_fusion_drive.py
Last active May 11, 2017 19:16
Detect if a Mac shipped with a factory installed Apple Fusion drive
#!/usr/bin/python
import objc
from Foundation import NSBundle
IOKit_bundle = NSBundle.bundleWithIdentifier_('com.apple.framework.IOKit')
functions = [("IOServiceGetMatchingServices", b"iI@o^I"),
("IOServiceNameMatching", b"@*"),
("IORegistryEntryCreateCFProperty", b"@I@@I"),
@n8felton
n8felton / upgrade_check_10.12.sh
Created March 28, 2017 13:55
Check if the Mac hardware supports macOS 10.12
######################
# Check hardware model
######################
hwmodel=$(sysctl -n hw.model)
hwmodel_re='([[:alpha:]]*)([[:digit:]]*),([[:digit:]])'
if [[ $hwmodel =~ $hwmodel_re ]]; then
hwmodel_name="${BASH_REMATCH[1]}"
hwmodel_num="${BASH_REMATCH[2]}"
hwmodel_rev="${BASH_REMATCH[3]}"
fi
@n8felton
n8felton / API_Framworks
Created February 2, 2017 13:59
API Frameworks and Protocols
http://swagger.io/
http://www.odata.org/
@n8felton
n8felton / HP_M2727_reset
Created January 12, 2017 14:34
Administrator Password Reset Laserjet M2727 MFP - Cold Reset
Administrator Password Reset Laserjet M2727 MFP - Cold Reset
To do an NVRAM reset follow these steps:
1. Turn off the printer.
2. Hold down the Cancel button and the right arrow button and while holding them turn on the power.
3. Wait for the message Permanent storage init. Then release the buttons.
Wait for about 2 min. When the printer is back at the ready screen it has been reset.
@n8felton
n8felton / new_gist_file_0
Created January 8, 2017 18:20
DeployStudio Latest Version
http://www.deploystudio.com/Downloads/_dss.current