Skip to content

Instantly share code, notes, and snippets.

@rtrouton
rtrouton / gist:55d107a569978a1b2113
Created Aug 10, 2015
Disabling First-run dialogs in Office 2016 for Mac
View gist:55d107a569978a1b2113
#!/bin/bash
# Disabling First-run dialogs in Office 2016 for Mac
# Link: http://macops.ca/disabling-first-run-dialogs-in-office-2016-for-mac/
if [[ -e "/Applications/Microsoft Excel.app" ]]; then
/usr/bin/defaults write /Library/Preferences/com.microsoft.Excel kSubUIAppCompletedFirstRunSetup1507 -bool true
elif [[ -e "/Applications/Microsoft OneNote.app" ]]; then
/usr/bin/defaults write /Library/Preferences/com.microsoft.onenote.mac kSubUIAppCompletedFirstRunSetup1507 -bool true
elif [[ -e "/Applications/Microsoft Outlook.app" ]]; then
@rtrouton
rtrouton / gist:4ff699b3f7660ae06a13
Created Dec 27, 2014
Software Update keys in Yosemite's /Library/Preferences/com.apple.SoftwareUpdate.plist
View gist:4ff699b3f7660ae06a13
Automatically check for updates:
Enable: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool TRUE
Disable: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool FALSE
Download newly available updates in the background:
Enable: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool TRUE
Disable: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool FALSE
View SecureToken and sysadminctl in 10.13 (based on 10.13.2)
sysadminctl is a tool Apple introduced in 10.10 for working with system user accounts. In 10.13,
sysadminctl is Apple's recommended tool for working with user accounts in the CLI, replacing functionality
that has long been provided by dscl and adds new features available only in 10.13.
sysadminctl can be used to change user passwords, create new users (including automatically provisioning
the user home folder) or check the status of a new-to-10.13 security feature named SecureToken.
SecureToken is a user attribute like password type or user home location. SecureToken is not publicly
documented by Apple so it is not possible to provide a full technical description, but in practice one
needs only to know if a user has SecureToken or not. Having SecureToken set signifies that a user can
unlock a FileVault-encrypted volume. Without the SecureToken bit on a user account, that user will not
@rtrouton
rtrouton / com.apple.loginwindow.plist
Created Aug 14, 2015
Disable "Reopen windows..." on logout, restart or shutdown
View com.apple.loginwindow.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>TALLogoutSavesState</key>
<string>0</string>
</dict>
</plist>
View getosversionfromdmg.py
#!/usr/bin/python
#
# getosversionfromdmg.py
#
# Copyright (c) 2014 The Regents of the University of Michigan
#
# Retrieves the OS version and build from the InstallESD.dmg contained in
# a typical "Install (Mac) OS X <Name>.app" bundle.
#
# To run:
@rtrouton
rtrouton / set_dns_search_domains_on_wifi_interfaces
Created Jun 5, 2015
This script will set specified DNS search domains on a Mac's wireless interface(s).
View set_dns_search_domains_on_wifi_interfaces
#!/bin/bash
# For the SearchDomains variable, change the search domains
# to be the ones you need, separated by spaces. For example,
# if you needed to set verizon.com and comcast.com as DNS
# search domains, SearchDomains would be set like this:
#
# SearchDomains="verizon.com comcast.com"
#
@rtrouton
rtrouton / gist:11221544
Last active Feb 27, 2018
Script that checks for JAMF's Casper agent and verifies that it's communicating properly with the Casper server. Script assumes that the user has a web server where a Casper QuickAdd package is available for download as a .zip file.
View gist:11221544
#!/bin/bash
#
# User-editable variables
#
# For the fileURL variable, put the complete address
# of the zipped Casper QuickAdd installer package
fileURL="http://server_name_here.domain.com/quickadd_name_goes_here.zip"
@rtrouton
rtrouton / resize_vm_boot_partition.sh
Created Mar 3, 2017
Resize boot volume using diskutil to occupy all available space on the partition
View resize_vm_boot_partition.sh
#!/bin/bash
# Resize boot volume to occupy all available space on the partition
/usr/sbin/diskutil resizeVolume / R
@rtrouton
rtrouton / gist:6552a3010931f7a5b5ae
Created May 11, 2015
Script to install the latest available version of Adobe Flash for OS X. Includes check of the Developer ID Installer certificate to verify it was signed by Adobe.
View gist:6552a3010931f7a5b5ae
#!/bin/bash
# This script downloads and installs the latest Flash player for compatible Macs
# Determine OS version
osvers=$(sw_vers -productVersion | awk -F. '{print $2}')
# Determine current major version of Adobe Flash for use
# with the fileURL variable
@rtrouton
rtrouton / gist:94b8f1989b7c7d0c95ca
Last active Dec 7, 2017
Preinstall script for Sophos Enterprise Anti-Virus for Mac OS X 9.2.x installer
View gist:94b8f1989b7c7d0c95ca
#!/bin/bash
LOGGER="/usr/bin/logger"
# Determine working directory
install_dir=`dirname $0`
# Uninstall existing copy of Sophos 8.x by checking for the
# Sophos Antivirus uninstaller package in /Library/Sophos Anti-Virus.
# If present, the uninstallation process is run.