Skip to content

Instantly share code, notes, and snippets.

@rtrouton
rtrouton / com.apple.loginwindow.plist
Created August 14, 2015 16:45
Disable "Reopen windows..." on logout, restart or shutdown
<?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>
@rtrouton
rtrouton / gist:94b8f1989b7c7d0c95ca
Last active June 7, 2021 14:22
Preinstall script for Sophos Enterprise Anti-Virus for Mac OS X 9.2.x installer
#!/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.
@rtrouton
rtrouton / gist:f92f263414aaeb946e54
Last active May 30, 2021 12:32
Install Xcode command line tools on 10.7.x - 10.10.x. Tested on 10.7.5, 10.8.5, 10.9.5 and 10.10.2.
#!/bin/bash
# Installing the Xcode command line tools on 10.7.x or higher
osx_vers=$(sw_vers -productVersion | awk -F "." '{print $2}')
cmd_line_tools_temp_file="/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress"
# Installing the latest Xcode command line tools on 10.9.x or higher
if [[ "$osx_vers" -ge 9 ]]; then
@rtrouton
rtrouton / gist:ffc22da3c36c61aad0fe
Last active December 3, 2020 08:39
Casper extension attribute for checking AppleCare warranty status
#!/bin/sh
# this script was written to query apple's service database to determine warranty coverage
# base on a system's serial number. This updated version stores the information locally so
# as not to have to query Apple's website repeatedly.
# author: Andrew Thomson
# date: 5/30/2013
@rtrouton
rtrouton / gist:2ca6f001b3cecb5037825c7f9d2e422e
Created April 28, 2017 16:13
Xcode iOS simulator download URLs (as of Xcode 8.3.1)
iOS 10.2 Simulator: https://devimages-cdn.apple.com/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK10_2-10.2.1.1484185528.dmg
iOS 10.1 Simulator: https://devimages-cdn.apple.com/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK10_1-10.1.1.1476902849.dmg
iOS 10.0 Simulator: https://devimages-cdn.apple.com/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK10_0-10.0.1.1474488730.dmg
iOS 9.3 Simulator: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg
iOS 9.2 Simulator: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_2-9.2.1.1451951473.dmg
iOS 9.1 Simulator: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_1-9.1.1.1446593668.dmg
iOS 9.0 Simulator: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_0-9.0.1.1443554484.dmg
iOS 8.4 Simulator: https://devimages.a
@rtrouton
rtrouton / com.company.launch_beamoff.plist
Created December 13, 2014 22:45
LaunchAgent to start BeamOff on login
<?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>Label</key>
<string>com.company.launch_beamoff</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/beamoff.app/Contents/MacOS/beamoff</string>
</array>
@rtrouton
rtrouton / gist:11bc3f21f47e1a79d099
Last active April 9, 2020 23:03
Downloading the latest release of a project from GitHub
#!/bin/bash
# How to set these variables:
#
# GitHub_Owner
# GitHub_Repo
#
# Example use:
#
# The Linde Group has repos on GitHub available
@rtrouton
rtrouton / gist:a01073797a6d7e1fff9a
Created October 10, 2014 16:08
Disable Apple iCloud and Diagnostic Pop-Ups
#!/bin/bash
# Determine OS version
osvers=$(sw_vers -productVersion | awk -F. '{print $2}')
sw_vers=$(sw_vers -productVersion)
# Determine OS build number
sw_build=$(sw_vers -buildVersion)
@rtrouton
rtrouton / gist:55d107a569978a1b2113
Created August 10, 2015 13:19
Disabling First-run dialogs in Office 2016 for Mac
#!/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 / getosversionfromdmg.py
Created September 13, 2016 15:29 — forked from bruienne/getosversionfromdmg.py
Get OS X version from DMG
#!/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: