Skip to content

Instantly share code, notes, and snippets.

sheagcraig /
Last active November 27, 2021 23:51
Check for Adware per Apple Kbase article
"""Identify or remove files known to be involved in Adware/Malware
Most of the code applies to building a list of malware files. Thus,
both extension attribute and removal handling are included.
Cleans files as a Casper script policy; thus, it expects four total
arguments, the first three of which it doesn't use, followed by
sheagcraig /
Last active July 15, 2021 17:48
Uninstall Microsoft Lync


According to Microsoft, Lync must be completely uninstalled, following the procedures documented at, at least for Calendar functionality to work correctly.

This repo contains a python script for removing all referenced Lync components for all normal users on a machine, i.e., with homes in /Users.

It is somewhat naive in that it assumes the users have not moved the Lync keychain items out of the Login keychain and into some other keychain. It handles the potential for multiple "" certificates in the login keychain, however. This is all done by running the security command as a subprocess. Improvements could probably be made to do this all with the Security Framework and the PyObjC bridge, but this gets the job done.

Using UninstallLync in Your Environment

You will need to edit the pattern global APP_PW_PATTERN at the top of the script to look for your environment's email domai

from Foundation import NSString, NSUTF8StringEncoding
from Security import *
# As per:
# and:
access = SecAccessControlCreateWithFlags(
sheagcraig / Makefile
Last active August 7, 2019 14:35
Set Microsoft Outlook as Default Handler for mailto, vcf, and ics
include /usr/local/share/luggage/luggage.make
sheagcraig /
Created September 26, 2016 15:05
Silent Uninstall of Office 2016
# Completely uninstall Office 2016, as per:
# and
import glob
import os
sheagcraig / Makefile
Last active October 26, 2017 21:24
Munki/Outset/PyObjC Self Service Set Apple Mail as Default Handler for mailto
include /usr/local/share/luggage/luggage.make
pack-usr-local-sas-sas.png \
pack-script-postinstall \ \
sheagcraig /
Created May 4, 2017 14:05
Get IP Address for all computers in the JSS
#!/usr/bin/env python
@shea_craig is possible with python-jss to generate a list of IP addresses for
computers in the JSS?
from operator import itemgetter
sheagcraig / AppleAdwareList
Last active October 29, 2016 14:22
Apple Identified Adware
# TODO: handle Safari extensions:
# Amazon Shopping Assistant by Spigot Inc.
# Ebay Shopping Assistant by Spigot Inc.
# Searchme by Spigot, Inc.
# Slick Savings by Spigot Inc.
# GoPhoto.It
# Omnibar
sheagcraig / turn-ssh-roaming-off
Last active January 21, 2016 15:23
Munki pkginfo to solve CVE-0216-0777 and CVE-0216-0778
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
sheagcraig /
Last active August 29, 2015 14:25
Der Flounder Test
import ssl
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.poolmanager import PoolManager
from requests.packages.urllib3.contrib import pyopenssl
#import jss