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/sh | |
export PATH=/usr/bin:/bin:/usr/sbin:/sbin | |
xcodePath="/Applications/Xcode.app" | |
if [ ! -e "$xcodePath" ]; then | |
echo "no app at $xcodePath, exiting..." | |
exit 1 | |
fi |
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/sh | |
# template script for running a command as user | |
# The presumption is that this script will be executed as root from a launch daemon | |
# or from some management agent. To execute a single command as the current user | |
# you can use the `runAsUser` function below. | |
# by Armin Briegel - Scripting OS X | |
# |
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 | |
# this script will return the current default application for a url scheme | |
# for use as a Jamf Extension attribute | |
# by Armin Briegel - Scripting OS X | |
# Permission is granted to use this code in any way you want. | |
# Credit would be nice, but not obligatory. | |
# Provided "as is", without warranty of any kind, express or implied. |
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" standalone="no"?> | |
<plugin name="AutoPkg Recipe" id="com.scriptingsosx.autopkg-recipe-definition" version="1.0" xmlns:plisteditpro="http://www.fatcatsoftware.com/plisteditpro"> | |
<extension point="com.apple.xcode.plist.structure-definition" name="AutoPkg Recipe" id="com.scriptingosx.autopkg-recipe-definition"> | |
<definition name="_root_" localizedString="AutoPkg Recipe" class="Dictionary" identifyingKey="Identifier"> | |
<dictionaryKeys> | |
<key name="Comment" localizedString="Comment" class="String" use="optional"></key> | |
<key name="Description" localizedString="Description" class="String" use="default"></key> | |
<key name="Identifier" localizedString="Identifier" class="String" use="required"></key> | |
<key name="Input" localizedString="Input" class="Input" use="required"></key> | |
<key name="MinimumVersion" localizedString="MinimumVersion" class="String" use="default"></key> |
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 Foundation | |
let process = Process() | |
process.launchPath = "/usr/bin/say" | |
process.arguments = ["-v", "?"] | |
let outPipe = Pipe() | |
process.standardOutput = outPipe | |
process.terminationHandler = { process in | |
let outData = outPipe.fileHandleForReading.readDataToEndOfFile() | |
let output = String(data: outData, encoding: .utf8) ?? "" |
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>PayloadContent</key> | |
<dict> | |
<key>com.scriptingosx.ChooserUI</key> |
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/zsh | |
# pkgAndNotarize.sh | |
# 2019 - Armin Briegel - Scripting OS X | |
# place a copy of this script in in the project folder | |
# when run it will build for installation, | |
# create a pkg from the product, | |
# upload the pkg for notarization and monitor the notarization status |
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 | |
# use argument 1 as the version or get it from sw_vers | |
os_ver=${1-:$(sw_vers -productVersion)} | |
# string comparison | |
if [[ "$os_ver" == 10.13.* ]]; then | |
echo "macOS High Sierra" | |
elif [[ "$os_ver" == 10.12.* ]]; then | |
echo "macOS Sierra" |
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 | |
export PATH=/usr/bin:/bin:/usr/sbin:/sbin | |
# allusers.sh | |
# | |
# written by Armin Briegel, Scripting OS X, 2018 | |
# | |
# code is provided as is, with no guarantees that it will work etc. | |
# adapt and use as you will |
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 sys | |
import argparse | |
import urlparse | |
import urllib | |
import plistlib | |
import os.path | |
import subprocess |
NewerOlder