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
(\d+)\.(\d+)(\.(\d+))?(\.(\d+))?(?:(?:-(alpha\d*|beta\d*|rc\d*))?) | |
Will detect these formats | |
1.21.23 | |
1.21.23-rc | |
1.21.23-rc1 | |
2.21.23-alpha | |
1.211.233-beta12 | |
3.12 |
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
import json | |
import urllib2 | |
def github_latest_release(user,repo): | |
SUPPORTED_TYPES=['dmg','zip','gz'] | |
DEST=str(u'https://api.github.com/repos/%s/%s/releases' % (user,repo)) | |
data = json.load(urllib2.urlopen(DEST)) | |
try: | |
latest_release = data[0]['assets'][0]['browser_download_url'] | |
for t in SUPPORTED_TYPES: |
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
-(void)writeFormatString:(NSString*)format, ... | |
{ | |
if(format){ | |
va_list args; | |
va_start(args, format); | |
NSString *str = [[NSString alloc] initWithFormat:format arguments:args]; | |
va_end(args); | |
} | |
} |
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
http://swcdn.apple.com/content/downloads/21/49/091-7363/o9veiecea89qkdmk94met1af4wu2fuwn2j/JavaForOSX.pkg |
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 | |
''' Place this script at the root of the project directory | |
and enter this for a Run Script during build phase of the helper app | |
${PROJECT_DIR}"/HelperTool_CodeSign_RunScript.py | |
put the run script right after Target Dependencies | |
What this script does is write the SMPrivilegedExecutables dictionary |
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 | |
from AppKit import NSWorkspace | |
def closeRunningApplication(bundle_id): | |
ws = NSWorkspace.sharedWorkspace() | |
runningApps = ws.runningApplications() | |
for i in runningApps: | |
if i.bundleIdentifier() == bundle_id: | |
i.terminate() |
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 | |
''' | |
Pass in the Full path to the application as the first arg | |
for example /usr/local/sbin/rm_global_login.py /Applicaitons/MunkiMenu.app | |
''' | |
import os | |
import sys | |
from LaunchServices import * |
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 | |
import subprocess | |
import plistlib | |
from os import seteuid | |
from ServiceManagement import * | |
from SystemConfiguration import SCDynamicStoreCopyConsoleUser | |
installdir = 'Applications' |
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
Precedence is: | |
/Library/Managed Preferences/ -- MCX | |
~/Library/Preferences -- User Home | |
/Library/Preferences/ -- Shared | |
~/Library/Preferences/com.app.plist = kCFPreferencesCurrentUser | |
kCFPreferencesCurrentApplication | |
kCFPreferencesAnyHost | |
~/Library/Preferences/.GlobalPreferences = kCFPreferencesCurrentUser |
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
#!/bin/bash | |
cread(){ | |
case "$1" in | |
red|alert) local COLOR=$(printf "\\e[1;31m");; | |
green|attention) local COLOR=$(printf "\\e[1;32m");; | |
yellow|warn) local COLOR=$(printf "\\e[1;33m");; | |
blue|question) local COLOR=$(printf "\\e[1;34m");; | |
purple|info) local COLOR=$(printf "\\e[1;35m");; | |
cyan|notice) local COLOR=$(printf "\\e[1;36m");; |