Skip to content

Instantly share code, notes, and snippets.

View ccaviness's full-sized avatar

Clay Caviness ccaviness

View GitHub Profile
@bruienne
bruienne / gist:ec5205408b9e52bd5cfc
Last active June 7, 2024 19:59
Linux DMG/PKG notes
@pudquick
pudquick / get_platform.py
Last active August 18, 2022 21:02
Get Mac's serial number, hardware UUID, and board-id via python
import objc
from Foundation import NSBundle
IOKit_bundle = NSBundle.bundleWithIdentifier_('com.apple.framework.IOKit')
functions = [("IOServiceGetMatchingService", b"II@"),
("IOServiceMatching", b"@*"),
("IORegistryEntryCreateCFProperty", b"@I@@I"),
]
@pudquick
pudquick / last.py
Last active August 1, 2022 14:54
Parsing utmp/utmpx record entries for login, logout, shutdown and reboot on macOS with python and ctypes
from ctypes import CDLL, Structure, POINTER, c_int64, c_int32, c_int16, c_char, c_uint32
from ctypes.util import find_library
import time
c = CDLL(find_library("System"))
# https://opensource.apple.com/source/Libc/Libc-1158.50.2/include/NetBSD/utmpx.h.auto.html
# https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man3/endutxent.3.html#//apple_ref/doc/man/3/endutxent
BOOT_TIME = 2
@kconner
kconner / macOS Internals.md
Last active July 7, 2024 19:42
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options: