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 zsh | |
#=========================================================================== | |
# * INFO | |
# | |
# macOS Preferences Defaults | |
# By Christopher Allen @ChristopherA https://github.com/christophera/ | |
# My most basic macOS preferences, in this gist to make it easy to load on | |
# multiple machines and VMs. Ideally runs on all macOS versions since Yosemite, |
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
#!/bin/bash | |
# | |
# Toggles the state of the "Use F1, F2, etc. keys as standard function keys" option | |
# in the System Keyboard Shortcuts settings in Ventura & Sonoma | |
if [[ $(defaults read -g 'com.apple.keyboard.fnState') == '0' ]] | |
then | |
defaults write -g 'com.apple.keyboard.fnState' -boolean true | |
else defaults write -g 'com.apple.keyboard.fnState' -boolean false | |
fi |
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
echo -e "auth sufficient pam_watchid.so\nauth sufficient pam_tid.so" | cat - /etc/pam.d/sudo | sudo tee /etc/pam.d/sudo > /dev/null |
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
(* | |
AppleScript example that uses GUI Scripting to toggle the "Position Lock" button in the Edit page | |
(as of Resolve 18.1.4, you can't map a keyboard shortcut to this in the native keyboard Shortcuts | |
prefs). | |
This also requires 'cliclick' (available from Homebrew). | |
Note that the checkbox index is unfortunately a moving target in Resolve. In Resolve 18.1.4, | |
"checkbox 21" will target the Position Lock button ONLY if the "Media Pool" and "Edit Index" panels | |
are open in the Edit Page. If any other panels are open, the checkbox index will change! |
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 bash | |
# | |
# To create a Mosyle Device Group containing systems that do/don't have the plugin installed, | |
# enable the "Show the command response as an attribute on Device Info" checkbox in the | |
# Custom Command profile for this script, and create an attribute label for it. Then | |
# you can use the value stored in that Custom Attribute label as the Criteria for building | |
# the device group. | |
# | |
# This is handy for showing the Blend-X installer in Mosyle Self Service only on machines | |
# that don't already have it installed. |
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 bash | |
vault_item_uuid="YOUR VAULT ITEM UUID" | |
opnsense_otp=$(op item get ${vault_item_uuid} --otp) | |
opnsense_pwd=$(op item get ${vault_item_uuid} --fields password) | |
# "pbcopy" is a macOS only built-in that copies whatever was piped to it to the system clipboard | |
echo -n "$opnsense_otp$opnsense_pwd" | pbcopy |
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
-- Launches BusyCal in minimized mode. | |
-- If it's already running, then don't do anything. | |
tell application "System Events" to (name of processes) contains "BusyCal" | |
if the result is false then | |
activate application "BusyCal" | |
tell application "System Events" | |
set visible of process "BusyCal" to false | |
end tell | |
end if |
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
#!/bin/bash | |
# | |
# Extract the original filename of renamed .R3D file. This is useful for reconstructing | |
# R3D files restored from a data-recovery operation from an HFS+ drive. | |
# | |
# note: the “-m 1” argument tells grep to stop after the first returned match. | |
# The pipe to "cut” is a dumb way to trim the leading “V” character on the returned filename | |
strings "FILE.R3D" | grep -m 1 -E "^.*[A-Z][0-9]{3}_[A-Z][0-9]{3}_[0-9]{4}[A-Z0-9]{2}_[0-9]{3}.R3D" | cut -c2- |
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
#!/bin/bash | |
# | |
# diceware(): Generate a Diceware passphrase | |
# | |
# note: This script has OSX-specific dependencies (pbcopy, pbpaste) | |
function diceware() { | |
# arg1: wordcount (default = 8) | |
# arg2: delimiter (default = space) |
NewerOlder