Skip to content

Instantly share code, notes, and snippets.

gregneagle / gist:6957826
Last active Jan 4, 2021
Using PyObjC and NSWorkspace to set the desktop picture. I am such a hypocrite!
View gist:6957826
'''Uses Cocoa classes via PyObjC to set a random desktop picture on all screens.
Tested on Mountain Lion and Mavericks.
pudquick /
Last active Oct 21, 2020
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 /
Created Nov 2, 2012
Scrape the OS X install logs for installed packages and return in nice sorted format
for log in $(/bin/ls -r /var/log/install.log*); do
bzgrep 'Writing receipt' $log | awk '{print $1,$2,$3,$10}'
bruienne /
Last active Sep 12, 2020
Downloads and parses MigrationIncompatibleApplicationsList.plist for OS X versions 10.7-10.11
# pylint: disable=fixme, line-too-long, missing-docstring, C0103
# Many parts of this were taken from Greg Neagle's COSXIP (
# 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
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
OSREL=`/usr/bin/uname -r | cut -f 1 -d '.'`;
case "${OSREL}" in
thomd / local POP3 on OSX
Created Nov 16, 2009
install a local POP3 server on OSX serving the system mailbox as a POP3 account.
View local POP3 on OSX
# 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
bruienne / elcap_incompatible.txt
Last active Nov 30, 2015
List of known incompatible apps for El Cap
View elcap_incompatible.txt
1Password 2.12.1 ['/Applications/', '/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
#fix for custom guest login keychain errors
GID=`id -g`
if [[ ${GID} == 201 ]]; then
$LOGGER -s -t "Current user is guest. Creating a login.keychain" 1>&2
security create-keychain -p "" login.keychain
security login-keychain -s ~/Library/Keychains/login.keychain