This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" Graham Gilbert 5/1/16 | |
Change TARGET_APP and the app name on line 53 to your chosen app to quit. | |
Run this as often as you'd like via a launchagent. | |
No warranty expressed or implied. If things go kaboom, it's your problem! | |
""" | |
from AppKit import NSWorkspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
"""Enables location services, allows Maps and Timezone""" | |
import os | |
import platform | |
import subprocess | |
import sys | |
try: | |
sys.path.append('/usr/local/munki/munkilib/') | |
import FoundationPlist | |
except ImportError as error: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ctypes import CDLL | |
loginPF = CDLL('/System/Library/PrivateFrameworks/login.framework/Versions/Current/login') | |
result = loginPF.SACLockScreenImmediate() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo ruby -e 'key = [125, 137, 82, 35, 210, 188, 221, 234, 163, 185, 31]; IO.read("/etc/kcpassword").bytes.each_with_index { |b, i| break if key.include?(b); print [b ^ key[i % key.size]].pack("U*") }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
'''Uses a web geoip service and cocoaDialog to allow end users to change | |
the time zone on their Mac (assuming they can get on the internet)''' | |
import json | |
import subprocess | |
import sys | |
import urllib2 | |
from gmacpyutil import cocoadialog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
"""Estimates computers manufacture date, inspiration and data structures from: | |
https://github.com/isaacatmann/Casper-Born-on-Date | |
""" | |
import datetime | |
import objc | |
#pylint: disable=no-name-in-module | |
from Foundation import NSBundle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
"""Collect inventory via osquery, etc""" | |
import csv | |
import datetime | |
import os | |
import platform | |
import plistlib | |
import subprocess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
Manual inventory report - most functions borrowed from chilcote's pyfacts. | |
Writes unique csv to /tmp on each run. Created Allister Banks October 2015 | |
""" | |
import csv | |
import datetime | |
#import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProgressDialog(object): | |
def __init__(self, message, title, use_bar=True): | |
super(self.__class__, self).__init__() | |
self.message = message | |
self.title = title | |
self.use_bar = use_bar | |
self.queue = None | |
self.process = None | |
def display(self): | |
# [ begin black magic ] |