Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
# As written, this requires the following:
# - OS X 10.6+ (may not work in 10.10, haven't tested)
# - python 2.6 or 2.7 (for collections.namedtuple usage, should be fine as default python in 10.6 is 2.6)
# - pyObjC (as such, recommended to be used with native OS X python install)
# Only tested and confirmed to work against 10.9.5
# Run with root
@bruienne
bruienne / modify_basesystem_dmg.py
Created April 8, 2015 03:27
Modify BaseSystem.dmg inside an InstallESD.dmg
#!/usr/bin/python
# modify_basesystem_dmg.py
#
# Adds additional frameworks to BaseSystem.dmg - Python is default
# Modify cpioextract() and xar_source to change what is extracted,
# and from what OS X installer PKG.
#
# To invoke:
#
# ./modify_basesystem_dmg.py /path/to/InstallESD.dmg
@bruienne
bruienne / gist:ec5205408b9e52bd5cfc
Last active June 7, 2024 19:59
Linux DMG/PKG notes
@pudquick
pudquick / reorder_wifi.py
Last active July 16, 2022 01:03
This python code uses Objective-C calls to reorder pre-existing SSIDs in your WiFi interfaces to place a preferred SSID at the top (without removing / re-adding)
#!/usr/bin/python
# As written, this requires the following:
# - OS X 10.6+ (may not work in 10.10, haven't tested)
# - python 2.6 or 2.7 (for collections.namedtuple usage, should be fine as default python in 10.6 is 2.6)
# - pyObjC (as such, recommended to be used with native OS X python install)
# Only tested and confirmed to work against 10.9.5
# Run with root
@trodemaster
trodemaster / gist:94ec1f1b24711a050634
Last active August 29, 2015 14:16
tools-rhel6-latest.sh
#!/bin/sh
# Install latest vmware tools from vmware.com repo for rhel 6
# get cert
wget -P /tmp http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub
# install cert
sudo rpm --import /tmp/VMWARE-PACKAGING-GPG-RSA-KEY.pub
# Setup repo
@pmbuko
pmbuko / password_dialog.py
Last active August 29, 2015 14:11
Simple python example of a Pashua password prompt dialog with a checkbox to save the password. Requires Pashua.app and the Pashua.py connector in the same path.
#!/usr/bin/python
#
# Simple python example of a Pashua password prompt window with a checkbox
# for saving the password to the keychain. None of it is wired up to
# actually function. It's just an example of what you can do.
#
# For easiest testing, you should have the Pashua.py connector and Pashua.app
# in the same directory as this script.
#
# The test password is 'password'.
@pudquick
pudquick / beamsync.py
Last active September 28, 2023 15:16
#!/usr/bin/python
import ctypes, ctypes.util
# Import CoreGraphics as a C library, so we can call some private functions
c_CoreGraphics = ctypes.CDLL(ctypes.util.find_library('CoreGraphics'))
def disable_beam_sync(doDisable):
if doDisable:
# Disabling beam sync:
# 1st: Enable Quartz debug
@pudquick
pudquick / 00 - Converting older Python.framework Xcode projects for Xcode 6.md
Last active August 6, 2022 16:07
An example of converting an older python.Framework Xcode project to compile in Xcode 6

When Apple moved to Xcode 5 (and later 6), they changed how you embed the Python.framework in a project: https://developer.apple.com/library/mac/technotes/tn2328/_index.html

This is a basic walkthrough of the process of conversion per that documentation for Xcode 6.

The example used here is the latest version of grahamgilbert's Crypt (at the time of this writeup): https://github.com/grahamgilbert/Crypt/tree/bdd49c849ed07fbc86d8c6f5bc31a525061d5077

(If you're viewing this via a gist blogging platform like roughdraft.io, make sure to view the original gist as there are image files included within the steps)

@frdmn
frdmn / osx-10-10-virtualbox.md
Last active February 22, 2022 08:39
Install OS X 10.10 Yosemite in VirtualBox
@bruienne
bruienne / gist:2b92cbf560522e170aca
Last active October 5, 2016 09:29
Spotlight suggestions profile skeleton
<?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>PayloadContent</key>
<array>
<dict>
<key>PayloadContent</key>
<dict>
<key>com.apple.Spotlight</key>