Skip to content

Instantly share code, notes, and snippets.

View mallej's full-sized avatar

Jens Malessa mallej

  • Hamburg
View GitHub Profile
@mallej
mallej / jamf-policy.sh
Created April 3, 2018 12:38
jamf policy
# initiate Policy with CUSTOM EVENT.
sudo jamf policy -event Issue_New_FV_Recovery_Key
# open global gitconfig with Atom editor
open -a /Applications/Atom.app/ ~/.gitconfig
# set nano as editor
git config --global core.editor nano
@mallej
mallej / open.sh
Created February 26, 2018 13:14
open
https://scriptingosx.com/2017/02/the-macos-open-command/
@mallej
mallej / command path.sh
Last active February 19, 2018 14:06
[command PATH] setting the path in scripts
# url: https://scriptingosx.com/2018/02/setting-the-path-in-scripts/
# Jamf scripts command path
#!/bin/bash
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/jamf/bin
@mallej
mallej / run-sh-file.sh
Created February 1, 2018 12:24
[run sh file] How To Run the .sh File Shell Script In Linux / UNIX #script
# more info here:
# https://www.cyberciti.biz/faq/run-execute-sh-shell-script/
# Set execute permission on your script:
chmod +x script-name-here.sh
# To run your script, enter:
./script-name-here.sh
# OR
sh script-name-here.sh
# OR
@mallej
mallej / reset-dep-testing-computer.sh
Last active February 1, 2018 12:13
[reset DEP testing mac] #dep #jamf #macos
#!/bin/bash
# #####################################################################################################################################
# Run this as root on your DEP testing computer, it'll bring it back to a state that will kick off DEP on reboot. Also, VMs will be your friend as well
#
# source: https://www.jamf.com/jamf-nation/discussions/26940/what-is-your-dep-test-environment-look-like#responseChild159889
#
# #####################################################################################################################################
# Remove .AppleSetupDone Allows the Setup Assistant to show again
rm /var/db/.AppleSetupDone
@mallej
mallej / mac-hardware.sh
Created January 31, 2018 12:02
mac hardware
# get mac serialnumber
ioreg -l | grep IOPlatformSerialNumber
@mallej
mallej / jamf-banner.sh
Created January 25, 2018 10:57
[Jamf Notifications]
/Library/Application\ Support/JAMF/bin/Management\ Action.app/Contents/MacOS/Management\ Action -title "You win" -subtitle "Thank you #JNUC" -message "That is a wrap"
# https://macmule.com/2015/11/16/making-downloaded-jss-configuration-profiles-readable/
openssl smime -inform DER -verify -in /path/to/downloaded.mobileconfig -noverify -out /path/to/de-signed.mobileconfig
plutil -convert xml1 /path/to/de-signed.mobileconfig
@mallej
mallej / jamf-reboot.sh
Last active January 29, 2018 16:16
[macOS - restart reboot] #macos #dialog #applescript #jamf
# https://www.jamf.com/jamf-nation/discussions/16614/reboot-machines#responseChild97418
jamf reboot -minutes 10 -message "Your Mac will reboot in 10 minutes to maintain smooth working order. Please close any open work now to avoid data loss of unsaved documents." -background