Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am triti on github.
  • I am triti (https://keybase.io/triti) on keybase.
  • I have a public key ASAXgcGquUfaS4HBSeb0TLld_yji_ycGG3NjxzVxuO5E-Qo

To claim this, I am signing this object:

<key>Processor</key>
<string>com.github.triti.SharedProcessors/XMLReader</string>
<key>Arguments</key>
<dict>
<key>xml_path</key>
<string>%destination_path%/com.eset.remoteadministrator.agent.pkg/PackageInfo</string>
<key>elements</key>
<array>
<dict>
<key>xpath</key>
@triti
triti / github.py
Created September 17, 2015 02:24
Pygments style that mimics the GitHub syntax highlighting color scheme.
# -*- coding: utf-8 -*-
"""
pygments.styles.github
~~~~~~~~~~~~~~~~~~~~~
Mimics the GitHub color scheme.
:copyright: Copyright 2015 by Tyler Riti.
"""
@triti
triti / software_update.sh
Last active August 30, 2016 19:54
Install all Apple software updates in a DeployStudio postinstall script. I wrote my own script because of a bug with the Software Update plugin in DeployStudio 1.6.12.
#!/bin/bash
# https://gist.github.com/595c89076a8db738b8da
# DeployStudio postinstall script to install all available Apple software
# updates. I wrote this because of a bug with the Software Update plugin
# in DeployStudio 1.6.12 that causes an infinite loop in certain circumstances.
installed_updates=()
@triti
triti / fix_mach_kernel_visibility.sh
Last active August 29, 2015 14:17
Simple script to fix /mach_kernel file visibility. Can be uploaded as a software payload in Absolute Manage.
#!/bin/bash
# https://gist.github.com/ac945399eb1f151bc6fc
# Simple script to set the hidden file flag on /mach_kernel.
# Adapted from Rich Trouton's adaption of Tim Sutton's script.
# Link: https://derflounder.wordpress.com/2015/03/11/fixing-mach_kernel-file-visibility-using-casper/
# Link: http://macops.ca/security-updates-leaving-mach_kernel-visible/
@triti
triti / mach_kernel_visibility.sh
Last active August 29, 2015 14:17
Absolute Manage custom information field to check for /mach_kernel visibility.
#!/bin/bash
# https://gist.github.com/e467f015b7657d6f18bc
# This custom information field checks for the hidden flag on /mach_kernel
# if the file exists.
# Adapted from Rich Trouton's adaption of Tim Sutton's script.
# Link: https://derflounder.wordpress.com/2015/03/11/fixing-mach_kernel-file-visibility-using-casper/
# Link: http://macops.ca/security-updates-leaving-mach_kernel-visible/
@triti
triti / EFI is 64-bit.sh
Created July 11, 2014 17:48
Absolute Manage custom info field to detect if the EFI is 64 bit capable or not.
#!/bin/bash
# EFI Is 64-bit
# Useful for detecting if a Mac is Mountain Lion/Mavericks/Yosemite compatible or not.
# https://gist.github.com/877099349c3e329c1fed
readonly FIRMWARE_ABI="$(/usr/sbin/ioreg -w0 -l -p IODeviceTree | /usr/bin/grep firmware-abi)"
case "${FIRMWARE_ABI}" in
@triti
triti / gatekeeper_enabled.sh
Created May 30, 2014 20:16
Absolute Manage custom information field to display whether Gatekeeper is enabled or not
#!/bin/bash
# https://gist.github.com/6fbb9900a406579eb394
# Absolute Manage custom information field to display the current Gatekeeper
# status. Based on the script by Rich Trouton
# https://github.com/rtrouton/rtrouton_scripts/blob/master/rtrouton_scripts/check_gatekeeper_status/check_gatekeeper_status.sh
result=''
os_version="$(/usr/bin/sw_vers -productVersion | awk -F. '{print $2}')"
@triti
triti / get_remote_management_users.sh
Created May 29, 2014 21:13
Outputs a comma-separated list of remote management users. For use as an Absolute Manage custom information field.
#!/bin/bash
# https://gist.github.com/a2c953516bac28315652
# Based on Rich Trouton's script
# https://github.com/rtrouton/rtrouton_scripts/blob/master/rtrouton_scripts/check_for_remote_management_accounts/check_for_remote_management_accounts.sh
readonly ARD_ALL_LOCAL_USERS="$(/usr/bin/defaults read /Library/Preferences/com.apple.RemoteManagement ARD_AllLocalUsers)"
remote_management_users=()
@triti
triti / set_ad_options.sh
Created April 28, 2014 14:25
Set AD options via DeployStudio parameters or custom properties.
#!/bin/bash
# https://gist.github.com/11373719
readonly SCRIPT_NAME=${0##*/}
readonly SCRIPT_VERSION=3.1
printf '%s - %s (%s)\n' "${SCRIPT_NAME}" "${SCRIPT_VERSION}" "$(/bin/date)"