Skip to content

Instantly share code, notes, and snippets.

View nmcspadden's full-sized avatar

Nick McSpadden nmcspadden

View GitHub Profile
#!/usr/bin/python
import os
import sqlite3
tccpath = '/Library/Application Support/com.apple.TCC/TCC.db'
connection = sqlite3.connect(tccpath)
c = connection.cursor()
values = ('kTCCServiceAccessibility', 'com.rescuetime.RescueTime', 0)
c.execute('INSERT or REPLACE into access values(?, ?, ?, 1, 1, NULL, NULL)', values)
@nmcspadden
nmcspadden / ChefDK.download.recipe.xml
Last active February 4, 2016 18:28
ChefDK.download.recipe
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Description</key>
<string>Downloads the latest Chef DK for Mac version.</string>
<key>Identifier</key>
<string>com.facebook.autopkg.download.chefdk</string>
<key>Input</key>
<dict>
#!/bin/sh
# Set paths to our utilities
networksetup=/usr/sbin/networksetup
airport=/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport
# Determines which OS the script is running on
osvers=$(sw_vers -productVersion | awk -F. '{print $2}')
# On 10.7 and higher, the Wi-Fi interface needs to be identified.
#!/bin/sh
open "$HOME/Library/Application Support/minecraftedu/startlauncher.jar"
exit 0
#!/bin/sh
#VerifyMinecraftEdu
mcpath="/Library/Application Support/minecraftedu"
homepath="$HOME/Library/Application Support/"
endpath="$HOME/Library/Application Support/minecraftedu/"
if [[ -e "$mcpath" ]]
then
@nmcspadden
nmcspadden / autodmg_output.py
Created December 28, 2015 18:41
sys.excepthook error generating a PyObjc exception
Build finished successfully, image saved to /Library/AutoDMG/AutoDMG_full.hfs.dmg
Build successful
2015-12-28 09:35:29.059 AutoDMG[1429:313432] PyObjC: Converting exception to Objective-C:
sys.excepthook is missing
lost sys.stderr
2015-12-28 09:35:29.059 AutoDMG[1429:313440] PyObjC: Converting exception to Objective-C:
sys.excepthook is missing
lost sys.stderr
2015-12-28 09:35:29.059 AutoDMG[1429:313434] PyObjC: Converting exception to Objective-C:
sys.excepthook is missing
#!/bin/sh
/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -specifiedUsers
/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -users "admin" -privs -all -restart -agent
exit 0
line_01='set logInUser to "USER"'
line_02='set logInPassword to "PASSWORD"'
line_03='tell application "System Events"'
line_04='tell application process "loginwindow"'
line_05='key code 53'
line_06='delay 1'
line_07='key code 125'
line_08='delay 1'
line_09='key code 36 using option down'
line_10='delay 1'
#!/bin/bash
launchctl load /Library/LaunchDaemons/org.sacredsf.mcx.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.sacredsf.mcx.plist</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/libexec/ChangeMCXLion.sh</string>
</array>