Skip to content

Instantly share code, notes, and snippets.

@bruienne
bruienne / osx_parse_incompatible_apps.py
Last active Sep 12, 2020
Downloads and parses MigrationIncompatibleApplicationsList.plist for OS X versions 10.7-10.11
View osx_parse_incompatible_apps.py
#!/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
@bruienne
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/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
View beamsync.py
#!/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 / unified_history.sh
Last active Oct 21, 2020
Unified history in bash (with a focus on OS X)
View unified_history.sh
# 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).
View fix.guest.keychain.sh
#!/bin/sh
#fix for custom guest login keychain errors
LOGGER="/usr/bin/logger"
GID=`id -g`
if [[ ${GID} == 201 ]]; then
$LOGGER -s -t fix.guest.keychain.sh "Current user is guest. Creating a login.keychain" 1>&2
security create-keychain -p "" login.keychain
security login-keychain -s ~/Library/Keychains/login.keychain
@gregneagle
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
#!/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
View createmyguest.sh
#!/bin/bash
#variables
DSCL="/usr/bin/dscl"
SECURITY="/usr/bin/security"
LOGGER="/usr/bin/logger"
OSREL=`/usr/bin/uname -r | cut -f 1 -d '.'`;
case "${OSREL}" in
10)
@pmbuko
pmbuko / installed_packages.sh
Created Nov 2, 2012
Scrape the OS X install logs for installed packages and return in nice sorted format
View installed_packages.sh
#!/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 Nov 16, 2009
install a local POP3 server on OSX serving the system mailbox as a POP3 account.
View local POP3 on OSX
#!/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