Skip to content

Instantly share code, notes, and snippets.

View AndrewWCarson's full-sized avatar
🐦

Andrew Worth Carson AndrewWCarson

🐦
View GitHub Profile
@AndrewWCarson
AndrewWCarson / marketing.py
Created December 5, 2019 22:52 — forked from pudquick/marketing.py
Using PrivateFrameworks to get marketing model information for Apple Macs without hitting their internet API (where possible) via python and pyobjc
# 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)
#
@AndrewWCarson
AndrewWCarson / bom.py
Created June 14, 2019 03:07 — forked from pudquick/bom.py
Parsing of bom files in pure python
# 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
@AndrewWCarson
AndrewWCarson / Is VM.py
Last active February 12, 2019 15:08 — forked from pudquick/macvm_detect.py
Addigy boolean Custom Fact that detects whether the machine is a VM based on a script from Mike Lynn <3.
#!/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)
@AndrewWCarson
AndrewWCarson / Disable Icon Preview High Sierra.sh
Last active August 23, 2018 04:50 — forked from MacChuck/DisableIconPreviewHighSierra.sh
Disables icon previews and preview column for all users in macOS High Sierra.
#!/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