Skip to content

Instantly share code, notes, and snippets.

View rderewianko's full-sized avatar

Ross Derewianko rderewianko

View GitHub Profile
#!/bin/bash
########################################################################
# Originally Created Created By: Andrina Kelly, andrina.kelly@bellmedia.ca
# Modifications from scripts from Bryson Tyrrell
# Final by Ross Derewianko
# Creation Date: April 2015
# Last modified: April, 18 2015
# Brief Description: Gather diagnostic logs and submit to the JSS
########################################################################
nc -z gateway.sandbox.push.apple.com 2195
nc -z gateway.sandbox.push.apple.com 2196
nc -z 35-courier.push.apple.com 5223
nc -z albert.apple.com 443
nc -z jssurl jssport
#!/bin/sh
OS=`/usr/bin/sw_vers -productVersion | /usr/bin/colrm 5`
if [[ "$OS" < "10.6" ]]; then
myVMList=`find /Users -name "*.vmx"`
else
myVMList=`mdfind -name ".vmx" | grep -Ev "vmx.lck" | grep -Ev "vmxf"`
fi
@rderewianko
rderewianko / gist:40e3fb8e7d40e9757adb
Created August 7, 2015 17:03
A simple debug for autopkgr (was posted on slack)
/usr/bin/python /usr/local/bin/autopkg run --recipe-list ~/Library/Application\ Support/AutoPkgr/recipe_list.txt --report-plist /tmp/autopkg-output.xml
@rderewianko
rderewianko / CheckWarranty
Last active September 28, 2015 19:45
Checks warranty of a machine, and reports back to the user in a popup
#!/bin/sh
#File Name:CheckWarranty.sh
########################################################################
# Created By: Andrew Tomson Modified by Ross Derewianko for Self Service
# Creation Date: Sept 2015
# Last modified: Sept 28, 2015
# Brief Description: Lets the user Know its changed
########################################################################
# this script was written to query apple's service database to determine warranty coverage
# base on a system's serial number. This updated version stores the infomration locally so
@rderewianko
rderewianko / .bash_profile
Created December 21, 2015 02:18
.bash_profile
alias sudo='sudo '
alias jamf='sh /usr/local/bin/jamfscript.sh '
@rderewianko
rderewianko / jamfscript.sh
Created December 21, 2015 02:20
removeFramework
#!/bin/sh
if [ $1 = "removeFramework" ]; then
echo "Framework Removing"
#put your removal script here...
else
/usr/local/bin/jamf $1
fi
@rderewianko
rderewianko / postinstall
Created January 15, 2016 03:29
post install that moves office 2016 into its own folder and then calls a python script
#!/bin/bash
# Determine working directory
install_dir=`dirname $0`
#Move them all into a folder like on 2011
mkdir /Applications/Microsoft\ Office\ 2016
chown root:wheel /Applications/Microsoft\ Office\ 2016
@rderewianko
rderewianko / set-image.py
Last active July 16, 2017 15:14
iconizes folders in osx
#!/usr/bin/env python
import Cocoa
import sys
Cocoa.NSWorkspace.sharedWorkspace().setIcon_forFile_options_(Cocoa.NSImage.alloc().initWithContentsOfFile_(sys.argv[1].decode('utf-8')), sys.argv[2].decode('utf-8'), 0) or sys.exit("Unable to set file icon")
@rderewianko
rderewianko / defaultwallpaper.py
Created June 16, 2016 17:34
Default wallpaper
#!/usr/bin/python
# https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSWorkspace_Class/Reference/Reference.html
# https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/Reference/Reference.html
# https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSScreen_Class/Reference/Reference.html
from AppKit import NSWorkspace, NSScreen
try:
from AppKit import NSWorkspaceDesktopImageScalingKey
except ImportError: