Skip to content

Instantly share code, notes, and snippets.

@dderusha
dderusha / get_platform.py
Created January 26, 2018 01:21 — forked from pudquick/get_platform.py
Get Mac's serial number, hardware UUID, and board-id via python
import objc
from Foundation import NSBundle
IOKit_bundle = NSBundle.bundleWithIdentifier_('com.apple.framework.IOKit')
functions = [("IOServiceGetMatchingService", b"II@"),
("IOServiceMatching", b"@*"),
("IORegistryEntryCreateCFProperty", b"@I@@I"),
]
@dderusha
dderusha / Admin_no_more.sh
Created February 5, 2016 15:20
Find Admin account and convert it to standard
#!/bin/sh
## Demote admin users to standard
## Get list of users for demotion
#In the above, you need to replace the reverse grep (grep -ve) with your local admin #accounts between the quote marks. Place a pipe betwen each name if you have multiple #ones. if you only have one, no need for "-ve", just use grep -v "youradminname"
/bin/echo "Building list of local user accounts for demotion"
userList=$( /usr/bin/dscl . -list /Users UniqueID | /usr/bin/awk '$2 >= 501 { print $1; }' | /usr/bin/grep -v "adminuserhere" )
@dderusha
dderusha / javaKeys6to8.py
Created January 20, 2016 17:14
Java keys from version 6 to version 8 No need for apple java, use Oracles version 8
#!/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
# Created by Michael Lynn
def jdk_info_plists():
# Find all the JDK Info.plist files
JDK_ROOT = "/Library/Java/JavaVirtualMachines"
@dderusha
dderusha / FlashExtAtty.sh
Created January 18, 2016 18:33
Flash Extension Attribute
#!/bin/sh
#
############################################################################
#
# Extension Attribute checks to display Adobe Flash Player Version with Release number.
#
# Uses CFBundleShortVersionString because this is the "release version number of the bundle"
# Ref: https://developer.apple.com/library/IOS/#documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
#
############################################################################
@dderusha
dderusha / Cache_Cleaner.sh
Last active May 31, 2016 18:56
Clean OS X caches
#!/bin/sh
#created By Dan De Rusha modified 10-8-14
### DELETE UTC CACHES
rm -r /Library/Extensis
mkdir /Library/Extensis
chmod 777 /Library/Extensis
### DELETE MICROSOFT CACHES
rm /Users/*/Library/Preferences/Microsoft/Office\ Font\ Cache*
rm /Users/*/Library/Preferences/Microsoft/Office\ 2008/Office\ Font\ Cache*
@dderusha
dderusha / SetTimeZone.sh
Created October 29, 2015 20:27
Set OS X 10.10.x Time Zone using a script and Casper parameter 4
#!/bin/sh
# NAME
# setTimeZone.sh -- Set the time zone
#
# SYNOPSIS
# sudo setTimeZone.sh
# sudo setTimeZone.sh <mountPoint> <computerName> <currentUsername> <timeZone>
#
# If the $timeZone parameter is specified (parameter 4), this is the time zone that will be set.
#
@dderusha
dderusha / JSS test environment procedure.txt
Created October 9, 2015 15:34
List of things to test when testing a new JSS version
Self Service downloading packages?
Are profiles being enforced?
Can you login with LDAP user/pass
Can you login with local user/pass
Create a test policy and deploy package from SMB, AFP, Cloud
Does the policy work on and off the network
Can you run a second policy over SMB without failure to mount server
Can I recon?
Can I enroll a new workstation?
Can I image?
@dderusha
dderusha / AdobeCC_pkg_installer.sh
Created August 24, 2015 16:10
Adobe CCP Packages Installed with the Casper Suite via Self Service or at imaging time - set script to after - Script installs package when user logs in
#!/bin/sh
####################################################################################################
#
# written by Dan De Rusha, revised 2-11-15 for Creative Cloud Standard install from Self Service and imagaing
#
####################################################################################################
# Variables used for logging
logFile="/private/var/log/Adobe_CC_STD_11_20_14_Install.log"
@dderusha
dderusha / modify_Oracle_java8_Esko.py
Last active June 10, 2016 13:20 — forked from pudquick/modify_java.py
Esko Pilot and Esko Shuttle Using Oracle JDK 8r51 no longer needs Apple's Java 6
#!/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)):
@dderusha
dderusha / Remove_Ill_CC_user_prefs.sh
Created July 24, 2015 22:19
Remove Illustrator Creative Cloud User preferences
#!/bin/sh
set -euo pipefail # "e" and "o pipefail" let the script exit immediately on errors, "u" exits on undefined variables
###### Standard Variables #####
### You should not normally need to edit these
### If you need to modify one for your own script,
### move the line to the script variable section and rename for consistancy
### This contains more variable than are used to serve better as a template
### Remove unused variables in this section before merging to remote module branch
startTime=$(date "+%Y-%m-%d_%H:%M:%S")
scriptName=$(basename -- "$0") # $0 is the full path to the script. basename removes the path. dirname would return only the path (see scriptDir below)