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 |
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| # | |
| # Copyright 2014 - The Regents of the University of Michigan. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # 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> |
| import objc | |
| from Foundation import NSBundle | |
| IOKit_bundle = NSBundle.bundleWithIdentifier_('com.apple.framework.IOKit') | |
| functions = [("IOServiceGetMatchingService", b"II@"), | |
| ("IOServiceMatching", b"@*"), | |
| ("IORegistryEntryCreateCFProperty", b"@I@@I"), | |
| ] |
| #!/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 |