Skip to content

Instantly share code, notes, and snippets.

@dderusha
dderusha / get_platform.py
Created January 26, 2018 01:21 — forked from pudquick/get_platform.py
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"),
]
@dderusha
dderusha / modify_Oracle_java8_Esko.py
Last active June 10, 2016 13:20 — forked from pudquick/modify_java.py
Esko Pilot and Esko Shuttle Using Oracle JDK 8r51 no longer needs Apple's Java 6
#!/usr/bin/python
import plistlib, os.path, os
# Based off of https://forums.developer.apple.com/message/6741
# and http://apple.stackexchange.com/a/136976
def jdk_info_plists():
# Find all the JDK Info.plist files
JDK_ROOT = "/Library/Java/JavaVirtualMachines"
if (os.path.exists(JDK_ROOT) and os.path.isdir(JDK_ROOT)):