This file contains hidden or 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 Cocoa import NSImage, NSImageNameComputer, NSSize, NSMakeSize, NSMakeRect, NSBitmapImageRep, NSPNGFileType, NSData | |
from CoreGraphics import CGImage | |
from objc import NULL | |
size = NSMakeSize(512, 512) | |
image = NSImage.imageNamed_(NSImageNameComputer) | |
image.setSize_(size) |
This file contains hidden or 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 hidden or 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 plistlib | |
import subprocess | |
from Cocoa import NSBundle | |
if (len(sys.argv) == 2): | |
model = sys.argv[1] | |
else: |
This file contains hidden or 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
# ENVIRONMENT VARIABLES | |
# add my ~/bin dir to path | |
PATH=${PATH}:~/bin | |
export PATH | |
# simple prompt | |
# default macOS prompt is: \h:\W \u\$ | |
export PS1="\W \$ " |
This file contains hidden or 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
# ENVIRONMENT VARIABLES | |
# add my ~/bin dir to path | |
PATH=${PATH}:~/bin | |
export PATH | |
# simple prompt | |
# default macOS prompt is: \h:\W \u\$ | |
export PS1="\W \$ " |
This file contains hidden or 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/osascript | |
on run arguments | |
tell application "Finder" | |
-- no argument: get frontmost window or desktop | |
if (count of arguments) is 0 then | |
if (count of windows) is 0 then | |
set dir to (desktop as alias) | |
else | |
set dir to ((target of Finder window 1) as alias) |
This file contains hidden or 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 | |
PATH=/usr/bin:/bin:/usr/sbin:/sbin export PATH | |
# ssh-installer | |
# copies a pkg with scp and runs installer on target | |
# usage: ssh-installer [USER@]HOST PKGFILE [other installer options] | |
TMPPKGDIR="/private/tmp/ssh-installer/" |
This file contains hidden or 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
global html | |
global processedURLs | |
on appendLineWithDoc(theDoc) | |
tell application "Safari" | |
tell theDoc | |
try | |
my appendHTML(" <li>") | |
my appendHTML("<a href=\"" & URL & "\">") | |
my appendHTML(name) |
This file contains hidden or 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 hidden or 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 | |
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/munki export PATH | |
# this will run as a munki install_check script | |
# exit status of 0 means install needs to run | |
# exit status not 0 means no installation necessary | |
# adapted scripts from here: https://jamfnation.jamfsoftware.com/discussion.html?id=1989 |