This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# just a PyObjC example, this of course requires pyobjc also in your python (virtual)env | |
from Foundation import NSBundle, NSClassFromString | |
NSBundle.bundleWithPath_("/System/Library/PrivateFrameworks/SystemDesktopAppearance.framework").load() | |
sda_class = NSClassFromString('SystemDesktopAppearance') | |
print(sda_class.performSelector_('OSName')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
owner=timsutton | |
repo=brigadier | |
curl -s "https://api.github.com/repos/${owner}/${repo}/releases \ | |
| jq . \ | |
| grep download_count \ | |
| cut -d : -f 2 \ | |
| tr -d ' ,' \ | |
| awk '{s+=$1} END {print s}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# Copyright (c) 2002-2009, Apple, Inc. All Rights Reserved. | |
sub Usage1 | |
{ | |
qq{ | |
kickstart -- Quickly uninstall, install, activate, configure, and/or restart | |
components of Apple Remote Desktop without a reboot. | |
kickstart -uninstall -files -settings -prefs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>_metadata</key> | |
<dict> | |
<key>created_by</key> | |
<string>tsutton</string> | |
<key>creation_date</key> | |
<date>2016-07-04T18:46:13Z</date> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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.apple.Bluetooth.ByHost</key> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# | |
## Copyright © 2002-2014, 2018 Apple Inc. All Rights Reserved. | |
## | |
## IMPORTANT NOTE: This file is licensed only for use on Apple-branded | |
## computers and is subject to the terms and conditions of the Apple Software | |
## License Agreement accompanying the package this file is a part of. | |
## You may not port this file to another platform without Apple's written consent. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Alternate example using subprocess.Popen and finding the NSRunningApplication by PID | |
import AppKit | |
from time import sleep | |
from Foundation import NSURL | |
proc = subprocess.Popen(['/Applications/Xcode.app/Contents/MacOS/Xcode']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
join_zoom() { | |
# Joins the first Zoom meeting URL found in events happening now on | |
# your calendar, by searching their descriptions/locations info for | |
# "zoom.us" URLs, and opening them using `open` | |
# | |
# Another option for launching Zoom is directly, via its own URL handler like | |
# zoommtg://zoom.us/join?confno=123456789, but not sure how this works | |
# with static meeting URLs like zoom.us/my/myusername, and seems it | |
# could change in Zoom app updates, whereas the web URLs will always know | |
# what to do. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"> | |
<array> | |
<dict> | |
<key>_SPCommandLineArguments</key> | |
<array> | |
<string>/usr/sbin/system_profiler</string> | |
<string>-nospawn</string> | |
<string>-xml</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In 1.0.50, no user besides the one who installed Spotify will be able to execute it. This means either other users on the system, | |
# or, if Spotify was deployed using any mass-deployment tool or installer package, and is owned by the root user, Spotify will not | |
# launch for anyone. | |
# Dir listing comparisons courtesy of https://github.com/poundbangbash | |
# 1.0.50 | |
$ ls -l /Volumes/Spotify/Spotify.app/Contents/MacOS/ | |
total 63160 | |
-rwxr--r-- 1 homeadmin staff 30076384 Mar 1 13:36 Spotify |