The idea is based on a gist by @jimbojsb.
You can use Pygments or Highlight.
brew install python
#!/usr/bin/python | |
import plistlib, os.path, os | |
# Based off of https://forums.developer.apple.com/message/6741 | |
# and http://apple.stackexchange.com/a/136976 | |
def jdk_info_plists(): | |
# Find all the JDK Info.plist files | |
JDK_ROOT = "/Library/Java/JavaVirtualMachines" | |
if (os.path.exists(JDK_ROOT) and os.path.isdir(JDK_ROOT)): |
The idea is based on a gist by @jimbojsb.
You can use Pygments or Highlight.
brew install python
import tempfile, os.path, shutil, glob, os, subprocess, re | |
debug = True | |
# It should take the logs from tmp and clone them somewhere | |
# It can then bunzip and combine them | |
def log(s): | |
global debug | |
if debug: | |
print s |
# Run using "sudo accept_xcode_license.sh" | |
# | |
# Solving the OSX Yosemite Xcode Command Line Tools Licensing problem | |
# for multiple updates in order to script post-install tasks. | |
# Typical error reads after running "xcode-select --install" when setting up | |
# Homebrew is: "Agreeing to the Xcode/iOS license requires admin priviledges, | |
# please re-run as root via sudo" | |
# | |
# CREDIT: | |
# Based on a tip found at http://krypted.com/mac-os-x/licensing-the-xcode-command-line-tools/ |
#!/bin/bash | |
# This script is designed to automate the setup of OS X Server 5.0.3 and later | |
# by authorizing and using the 'server' tool within /Applications/Server.app to | |
# run the initial setup and configuration of OS X Server's services. | |
# Script will check for the existence of the 'server' setup tool. If the 'server' setup tool | |
# is not located where the script expects it to be, the script will exit. | |
if [[ ! -e "/Applications/Server.app/Contents/ServerRoot/usr/sbin/server" ]]; then |
<!-- This can be added to a Munki pkginfo so as to deselect the MAU component | |
from being installed. However, some version of MAU would be probably | |
already installed if Office 2011 had ever been installed on this system. --> | |
<key>installer_choices_xml</key> | |
<array> | |
<dict> | |
<key>attributeSetting</key> | |
<integer>0</integer> | |
<key>choiceAttribute</key> | |
<string>selected</string> |
#!/usr/bin/env python | |
# To look at: https://github.com/kcrawford/mac-network/blob/master/lib/mac-network/wifi.rb | |
# To look at: https://stackoverflow.com/questions/28096630/mac-os-x-10-10-reorder-preferred-networks | |
''' | |
Playing around with CoreWLAN to return information about the wi-fi connection | |
Documentation: | |
https://developer.apple.com/library/mac/documentation/CoreWLAN/Reference/CWInterface_reference/translated_content/CWInterface.html |
#!/usr/bin/python | |
"""Bootstrap Chef with no other dependencies.""" | |
import os | |
import sys | |
import platform | |
import subprocess | |
import json | |
import plistlib | |
import urllib2 |
# This was all run from user space | |
# I haven't tested it with root | |
# ... but it didn't prompt for any permissions under userspace ^_^ | |
# Tested on 10.11.5 | |
import objc | |
from Foundation import NSBundle | |
EAP8021X_bundle = NSBundle.bundleWithPath_('/System/Library/PrivateFrameworks/EAP8021X.framework') | |
Security_bundle = NSBundle.bundleWithIdentifier_('com.apple.security') |
# Tested on 10.11 | |
# Note: | |
# The marketing information embedded in the ServerInformation.framework is not the same as what | |
# About This Mac displays - there are differences. | |
# | |
# For example: | |
# ServerInformation: 15" MacBook Pro with Retina display (Mid 2015) | |
# About This Mac: MacBook Pro (Retina, 15-inch, Mid 2015) | |
# |