This file contains 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
# Tested on 10.11 | |
# Note: | |
# The marketing information embedded in the ServerInformation.framework is not the same as what | |
# About This Mac displays - there are differences. | |
# | |
# For example: | |
# ServerInformation: 15" MacBook Pro with Retina display (Mid 2015) | |
# About This Mac: MacBook Pro (Retina, 15-inch, Mid 2015) | |
# |
This file contains 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
# Python routines for parsing bom files | |
# | |
# Examples so far: | |
# | |
# dump_bom(filename) - prints diagnostic structure information about bom file (including path list) | |
from ctypes import BigEndianStructure, c_char, c_uint8, c_uint16, c_uint32, sizeof, memmove, addressof | |
class BOMHeader(BigEndianStructure): | |
_pack_ = 1 |
This file contains 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/python | |
from ctypes import CDLL, c_uint, byref, create_string_buffer | |
libc = CDLL('/usr/lib/libc.dylib') | |
def sysctl(name): | |
size = c_uint(0) | |
libc.sysctlbyname(name, None, byref(size), None, 0) | |
buf = create_string_buffer(size.value) | |
libc.sysctlbyname(name, buf, byref(size), None, 0) |
This file contains 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 | |
# This disables the Column View icon in Finder for all users | |
# Change file separators so we don't get hung up on spaces | |
OIFS=$IFS | |
IFS=$'\n' | |
# Iterate through all users | |
for user in $(dscl . list /Users UniqueID | awk '$2 >= 500 {print $1}'); do |