Skip to content

Instantly share code, notes, and snippets.

View smashism's full-sized avatar
:shipit:
ship it!

emily smashism

:shipit:
ship it!
View GitHub Profile
@smashism
smashism / get_github_version.sh
Created March 23, 2015 15:07
get_github_version
#!/bin/sh
#
# checks for github.app on machine
# using version integer rather than name
# intended for scoping updates (with patchoo)
# by github.com/smashism
# https://github.com/smashism/casper-extension-attributes/blob/master/get_github_version
# last updated 2015-03-20
#
@smashism
smashism / omnigraffle6_ea.sh
Last active August 22, 2017 06:13
omnigraffle 6 ea
#!/bin/sh
#
# originally by jhbush jamfnation and macadmins slack #jamfnation
# modified by emilyk
# 2015-08-20
#
currentUser=`ls -l /dev/console | awk {' print $3 '}`
if [ -d "/Applications/OmniGraffle.app" ]; then
result=`cat /Users/$currentUser/Library/Containers/com.omnigroup.OmniGraffle6/Data/Library/Application\ Support/Omni\ Group/Software\ Licenses/OmniGraffle*.omnilicense | grep -A 1 Key | grep string | sed 's/<string>//g' | sed 's/<\/string>//g' | awk '{print $1}'`
@smashism
smashism / omnigraffle5_ea.sh
Created August 22, 2015 16:58
omnigraffle5 ea
#!/bin/sh
#
# by emily k 2014-06-10
# checks for omnigraffle 5 sn
# updated 2015-08-21
#gets current user
currentUser=`ls -l /dev/console | cut -d " " -f 4`
#checks for app, then checks user library for license file
#!/bin/sh
/usr/local/bin/jamf launchJAMFHelper -path '/Library/Application Support/JAMF/bin/jamfHelper.app'
#!/bin/bash
#
# software_update_count.sh
# gets amount of updates in integer for EA <> Smart Computer group
# github.com/smashism
# last update: 2016-10-18
#
# get LastUpdatesAvailable
#!/bin/bash
# Get current user and OS information.
CURRENT_USER=$(/usr/bin/stat -f%Su /dev/console)
USER_ID=$(id -u "$CURRENT_USER")
OS_MAJOR=$(/usr/bin/sw_vers -productVersion | awk -F . '{print $1}')
OS_MINOR=$(/usr/bin/sw_vers -productVersion | awk -F . '{print $2}')
# Launch the app using launchctl.
echo "Launching App Store..."
#!/bin/bash
# adapted by github.com/smashism
# created 2015-03-12
# updated 2016-11-07 - changed from cocoaDialog to jamfHelper
# lets user get browser versions for updating
#
# provided AS IS with no guarantee or warranty
# "You want the rest of the 'champaggin'?" "No… and it's pronounced 'cham-pain.'"
#!/bin/sh
#
# adapted by github.com/smashism
# created 2015-03-12
# last updated 2016-11-07 - change from cocoaDialog to jamfHelper
# uses jamfHelper to display computer information to user
# helpful for troubleshooting if user can't find info themselves
#
# offered AS IS with no warranty or guarantee
#!/bin/bash
#
# NoMAD_LastPasswordExpireDate
# Checks NoMAD plist for LastPasswordExpireDate (AD password expiration)
# By github.com/smashism
# Last modified 2016-11-30
# Provided as-is with no support or warranty
loggedInUser=$(python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");')
#!/bin/sh
####################################################
## Use the legacy binary if running on < 10.7
####################################################
os_version=$(system_profiler SPSoftwareDataType -xml | grep -A 2 'os_version</key>' | grep -o 'OS X [0-9]\+.[0-9]\+' | grep -o '[0-9]\+.[0-9]\+')
major_version=$(echo $os_version | grep -o '[0-9]\+\.' | grep -o '[0-9]\+')
minor_version=$(echo $os_version | grep -o '\.[0-9]\+' | grep -o '[0-9]\+')
/usr/bin/tar -xf /private/tmp/JAMFQuickAdd/Binaries.tar.gz -C /private/tmp/JAMFQuickAdd
/bin/mkdir -p /usr/local/bin