This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # _*_ coding:utf-8 _*_ | |
| """Helper tool to generate AutoDMG profiles.""" | |
| import xml.etree.ElementTree as ET | |
| import sys | |
| import re | |
| import argparse | |
| import urllib2 | |
| import plistlib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Retrieve the Serial Number | |
| ioreg -c IOPlatformExpertDevice -d 2 | awk -F\" '/IOPlatformSerialNumber/{print $(NF-1)}' | |
| # Retrieve the Hardware UUID | |
| ioreg -c IOPlatformExpertDevice -d 2 | awk -F\" '/IOPlatformUUID/{print $(NF-1)}' | |
| # Retrieve the Model Identifier, e.g. iMac16,1; Macmini7,1' VMware7,1 | |
| sysctl -n hw.model | |
| # Convert macOS SMB path to UNC path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # $OpenBSD: sshd_config,v 1.95 2015/04/27 21:42:48 djm Exp $ | |
| # This is the sshd server system-wide configuration file. See | |
| # sshd_config(5) for more information. | |
| # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin | |
| # The strategy used for options in the default sshd_config shipped with | |
| # OpenSSH is to specify options with their default value where | |
| # possible, but leave them commented. Uncommented options override the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _logger () { | |
| echo "$(basename $0): ${1}" | |
| # -i Log the process id of the logger process with each line. | |
| # -t [tag] Mark every line in the log with the specified tag. | |
| logger -i -t "$(basename $0) " "${1}" | |
| } | |
| # Turn off file globbing so we can pass asterisks as parameters | |
| set -f | |
| # Sets BASH to exit immediately if any command has a non-zero exit status. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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>PayloadIdentifier</key> | |
| <string>com.example</string> | |
| <key>PayloadRemovalDisallowed</key> | |
| <false/> | |
| <key>PayloadScope</key> | |
| <string>System</string> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Read the current policy and save to a plist | |
| /usr/bin/security \ | |
| authorizationdb \ | |
| read \ | |
| system.preferences.printing > "${TMPDIR}/system.preferences.printing.plist" | |
| # Show the current policy saved to the plist | |
| cat "${TMPDIR}/system.preferences.printing.plist" \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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/> | |
| <key>authenticate-user</key> | |
| <true/> | |
| <key>class</key> | |
| <string>user</string> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [[ $EUID -ne 0 ]]; then | |
| echo "This script must be run as root." | |
| exit 1 | |
| fi | |
| GROUP="staff" | |
| preferences=( | |
| "system.preferences" \ | |
| "system.preferences.printing" \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ dscl . -read /Groups/_lpadmin | |
| AppleMetaNodeLocation: /Local/Default | |
| GeneratedUID: ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000062 | |
| GroupMembership: itsadmin | |
| NestedGroups: ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000050 | |
| Password: * | |
| PrimaryGroupID: 98 | |
| RealName: | |
| Print Administrators | |
| RecordName: |