Skip to content

Instantly share code, notes, and snippets.

@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
@bruienne
bruienne / osx_parse_incompatible_apps.py
Last active September 30, 2022 13:09
Downloads and parses MigrationIncompatibleApplicationsList.plist for OS X versions 10.7-10.11
#!/usr/bin/python
# pylint: disable=fixme, line-too-long, missing-docstring, C0103
# Many parts of this were taken from Greg Neagle's COSXIP (https://github.com/munki/createOSXinstallPkg)
# No parsing of 'BannedRegexMatchVersion' keys currently because regex is hard.
#
# Output prints a list of incompatible apps for each major OS X version
# with its version and optional file listing of the target app.
import plistlib
@gregneagle
gregneagle / gist:6957826
Last active January 4, 2021 09:39
Using PyObjC and NSWorkspace to set the desktop picture. I am such a hypocrite!
#!/usr/bin/python
'''Uses Cocoa classes via PyObjC to set a random desktop picture on all screens.
Tested on Mountain Lion and Mavericks.
See:
https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSWorkspace_Class/Reference/Reference.html
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/Reference/Reference.html
@pudquick
pudquick / unified_history.sh
Last active October 21, 2020 01:55
Unified history in bash (with a focus on OS X)
# You need to add these two lines to your bash environment
shopt -s histappend
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
# In most *nix variants, that means adding them to your .bashrc file.
# However, on OS X, the default session for Terminal is a login session,
# meaning that it doesn't run .bashrc.
# As such, you'll need to include these commands into your
# .profile or .bash_profile (whichever you have/want).
@pmbuko
pmbuko / installed_packages.sh
Created November 2, 2012 17:35
Scrape the OS X install logs for installed packages and return in nice sorted format
#!/bin/bash
for log in $(/bin/ls -r /var/log/install.log*); do
bzgrep 'Writing receipt' $log | awk '{print $1,$2,$3,$10}'
done
@thomd
thomd / local POP3 on OSX
Created November 16, 2009 00:17
install a local POP3 server on OSX serving the system mailbox as a POP3 account.
#!/bin/sh
#
# install a local POP3 server on OSX serving the system mailbox as a POP3 account.
#
# get pre-compiled OS X binaries of UW's (University of Washington) ipop3d and imapd.
cd ~
curl -L -O http://www.macosxguru.net/downloads/localmail.zip
unzip localmail.zip
@bruienne
bruienne / elcap_incompatible.txt
Last active November 30, 2015 12:55
List of known incompatible apps for El Cap
1Password 2.12.1 ['/Applications/1Password.app', '/Library/InputManagers/1PasswdIM/1PasswdIM.bundle']
3D Weather Globe Screensaver 1.0 ['/Library/Screen Savers/3D Weather Globe Deluxe Edition.saver', '/Library/Screen Savers/3D Weather Globe 2.saver']
ADmitMac 9.0.1
AirDisplay 1.6.3 ['/System/Library/Extensions/AVFrameBuffer.kext', '/System/Library/Extensions/AVVideoCard.kext']
AJA 12.2.1
AJA IOHD Driver 6.0.3
Antidote HD 7.2
App Tamer 2.0.5
AT&T Laptop Connect Card 1.0.4
Avast Mac Security 10.14