Skip to content

Instantly share code, notes, and snippets.

@ntrogers
Last active March 27, 2020 20:36
Show Gist options
  • Save ntrogers/4a5dcefdb8a26342697e8ae67c450bf1 to your computer and use it in GitHub Desktop.
Save ntrogers/4a5dcefdb8a26342697e8ae67c450bf1 to your computer and use it in GitHub Desktop.
[macOS - Useful Commands] #macOS
# kickstart ARD
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -allowAccessFor -allUsers -privs -all
# browse for DNS-SD discoverable services (all types)
dns-sd -B _services._dns-sd._udp local.
# browse for all present services of type "IPP"
dns-sd -B _ipp._tcp local.
#lookup specific info about the printer named "Officejet 6600 @ mbp"
dns-sd -L "Officejet 6600 @ mbp" _ipp._tcp local.
# look up the IPv4 and IPv6 addresses for a given hostname
dns-sd -Gv4v6 mbp2-2.local
# see /etc/services for available services
# Get numeric chmod permissions for file
stat -f %A /path/to/file
# Mount network drive
osascript -e 'mount volume "smb://username:password@server/SMCSD Server"'
# View Package Contents
pkgutil –-expand thePackage.pkg /destination
pkgutil –-expand-full thePackage.pkg /destination
# Get application bundle identifier
defaults read /Applications/Safari.app/Contents/Info.plist CFBundleIdentifier
# Disable print sharing
cupsctl --no-share-printers
# Location of generic printer driver
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/Resources/Generic.ppd
# List all print drivers installed on a system
lpinfo -m -h 127.0.0.1:631
# Reset the printing system
lpstat -p | cut -d' ' -f2 | xargs -I{} lpadmin -x {}
# Show available printer options
lpoptions -p <printername> -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment