Skip to content

Instantly share code, notes, and snippets.

@opragel
opragel / install_ringcentral_desktop_macos.sh
Last active August 30, 2021 12:14
install_ringcentral_desktop_macos.sh
#!/bin/bash
# Running artisinal bash install scripts is generally not recommended.
# your funeral
DOWNLOAD_URL="https://downloads.ringcentral.com/sp/RingCentralForMac"
DMG_VOLUME_PATH="/tmp/RingCentral for Mac"
APP_NAME="RingCentral For Mac.app"
APP_PATH="/Applications/$APP_NAME"
APP_PROCESS_NAME="Softphone"
APP_INFO_PLIST="Contents/Info.plist"
@opragel
opragel / o-chrome.mobileconfig
Created July 10, 2016 21:25
o-chrome.mobileconfig
<?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>PayloadContent</key>
<array>
<dict>
<key>PayloadContent</key>
<dict>
<key>com.google.Chrome</key>
@opragel
opragel / remove_eset_nod32antivirus_osx.sh
Created June 14, 2016 20:17
remove_eset_nod32antivirus_osx.sh
#!/bin/bash
APP_PROCESS_NAMES=( "ESET NOD32 Antivirus" \
"esets_ctl" \
"esets_daemon" \
"esets_kac" \
"esets_mac" )
DAEMON_PATHS=( "/Library/LaunchDaemons/com.eset.esets_daemon.plist")
@opragel
opragel / launch_googledrive_osx.sh
Last active June 6, 2016 07:19
launch_googledrive_osx.sh
#!/bin/bash
currentUser=$(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");')
launchctl asuser "$currentUser" open "/Applications/Google Drive.app/"
@opragel
opragel / remove_teamviewer_osx.sh
Last active November 24, 2019 11:55
remove_teamviewer_osx.sh
#!/bin/bash
# WARNING: this script is potentially dangerous, it modifies the authorizationdb
# in a way that is far from best practice. your funeral
APP_PROCESS_NAME="TeamViewer"
DAEMON_PATHS=( "/Library/LaunchDaemons/com.teamviewer.Helper.plist"
"/Library/LaunchDaemons/com.teamviewer.teamviewer_service.plist" )
REMOVE_PATHS=( "/Applications/TeamViewer.app"
@opragel
opragel / tempfix_managedpref_parentalcontrolsd_cpu.sh
Last active January 27, 2018 16:56
tempfix_managedpref_parentalcontrolsd_cpu.sh
#!/bin/bash
# this is not following best practices
# removing explicit familyControlsEnabled keys to mitigate high parentalcontrolsd cpu usage
rm -rf /Library/Managed\ Preferences/com.apple.applicationaccess.new.plist
rm -rf /Library/Managed\ Preferences/*/com.apple.applicationaccess.new.plist
if pgrep 'parentalcontrolsd'; then
killall -STOP parentalcontrolsd
fi
@opragel
opragel / fastuser_logincheck.py
Last active April 26, 2016 17:47 — forked from pudquick/fastuser_logincheck.py
Using CGSSessionCopyAllSessionProperties to detect logged-in users the way the Fast User switching menu extra does on OS X with python and pyobjc
import objc
from Foundation import NSBundle
CG_bundle = NSBundle.bundleWithIdentifier_('com.apple.CoreGraphics')
functions = [("CGSSessionCopyAllSessionProperties", b"@"),]
objc.loadBundleFunctions(CG_bundle, globals(), functions)
allSessionProperties = CGSSessionCopyAllSessionProperties()
for session in allSessionProperties:
@opragel
opragel / appstoreupdateagent
Last active April 20, 2016 07:26
appstoreupdateagent-notes
#!/bin/bash
# pretty dang sure this is intended for root
# -now: check for updates now
# -later: for performing updates queued for later
# -nmos: for faking major OS available message
/System/Library/PrivateFrameworks/CommerceKit.framework/Versions/Current/Resources/appstoreupdateagent -now
@opragel
opragel / help.apple.com_urls
Last active July 4, 2020 05:05
help.apple.com_urls
help.apple.com pages:
https://help.apple.com/accessibility/mac/control/10.12/
https://help.apple.com/deployment/macos/
https://help.apple.com/deployment/ios/
https://help.apple.com/deployment/business/
https://help.apple.com/education/
https://help.apple.com/deployment/education/
https://help.apple.com/machelp/mac/10.12/
https://help.apple.com/serverapp/mac/
@opragel
opragel / lazy_install_microsoft_office2016vl.sh
Last active April 5, 2018 15:36
lazy_install_microsoft_office2016vl.sh
#!/bin/bash
CHOICES_XML_PATH="/tmp/office2016-choices.xml"
MSO2016_PKG_PATH="/tmp/microsoft_office2016_volumeinstaller.pkg"
MSO2016_SERIALIZER_PATH="/tmp/Microsoft_Office_2016_VL_Serializer.pkg"
INSTALLER_TARGET="/"
MAU_APP_PATH="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app"
DOUBLE_SECRET_MAU_PATH="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/Microsoft AU Daemon.app"