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 | |
# Determine OS version | |
OSVERS=$(sw_vers -productVersion | awk -F. '{print $2}') | |
# Macs running 10.6.x or earlier are not able to use profiles. | |
# If the script detects that it is running on an OS earlier than | |
# 10.7.0, the script will exit at this point to avoid problems. | |
if [[ ${OSVERS} -lt 7 ]]; then |
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 sys, os, os.path, tempfile, plistlib, shutil | |
class TempApp(object): | |
def __init__(self, infoPlist_dict, app_path=None, bundle_name='TempApp', cleanup=True, app_icon=None): | |
# infoPlist_dict: A dict containing key values that should be set/overridden | |
# vs. the normal Python.app keys. | |
# app_path: The path to where your app should go. Example: '/usr/local/myOrgStuff' | |
# This directory needs to pre-exist. If app_path is left at None, | |
# a temporary directory will be created and used and the value of | |
# cleanup will be forced to True |
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/env python | |
import os | |
import zipfile | |
""" | |
Helper class that lets one add whole directory contents. | |
License | |
-------------------- |
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
<?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 current release version of Eclipse.</string> | |
<key>Identifier</key> | |
<string>com.github.sheagcraig.download.EclipseIDE</string> | |
<key>Input</key> | |
<dict> |
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
# frogor user check v1 | |
# http://osx.michaellynn.org/freenode-osx-server/freenode-osx-server_2013-04-09.html | |
from SystemConfiguration import SCDynamicStoreCopyConsoleUser | |
from objc import NULL | |
import sys | |
username = (SCDynamicStoreCopyConsoleUser(NULL, NULL, NULL) or [NULL])[0] | |
username = [username,''][username in [u"loginwindow", None]] | |
sys.stdout.write(username + "\n") |
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
- Start on single user mode: Hit the Command and S keys at start-up | |
Wait until the writing stops completely | |
-At the line, type (after root): /sbin/fsck -fy (space after the k) | |
Hit the ENTER key | |
wait until it finishes and says "... appears to be OK" | |
next, type: /sbin/mount -uw / (space after the t and after the w) |
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 | |
# Put a background in the same directory as this .py file and name it | |
backdrop_filename = "backdrop.jpg" | |
# http://wallreborn.com/wp-content/uploads/2015/05/cool-desktop-backgrounds-8-Cool-Wallpaper.jpg | |
# is a pretty sweet example to try with | |
# Then run this script from the Terminal :) |
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
""" | |
First attempt at bringing security into play with the .pem files. | |
Only the security tool is used, no additional tools (openssl, etc.). | |
This code does the following: | |
- Creates the specified keychain if it doesn't exist | |
- Unlocks it with the specified password | |
- Configures it to not lock | |
- Adds it to the keychain search paths if it's not present already (necessary for 10.9) | |
- Import the client.pem cert / identity |
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
# Skip to the end to see what this can do. | |
# | |
# http://s.sudre.free.fr/Stuff/Ivanhoe/FLAT.html | |
# Flat packages are xar files with a particular structure | |
# We're looking for the PackageInfo file within the xar file | |
import urllib2, ctypes, zlib | |
import xml.etree.ElementTree as ET | |
class SimpleObj(object): |
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
<?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>PayloadContent</key> | |
<array> | |
<dict> | |
<key>PayloadCertificateFileName</key> | |
<string>my.org.cer</string> | |
<key>PayloadContent</key> |
OlderNewer