Skip to content

Instantly share code, notes, and snippets.

henrik242 / Global macOS hotkeys for Google Meet, Spotify and others using AppleScript and
Last active Mar 25, 2021
Global macOS hotkeys for Google Meet, Spotify and others using AppleScript and Fastscripts
View Global macOS hotkeys for Google Meet, Spotify and others using AppleScript and
henrik242 / Solr backup and
Last active Sep 3, 2020
Solr backup and restore (stored values only)
View Solr backup and

Backup all stored values from solr as json batches

#!/usr/bin/env bash
collar=myCollarId # replace this!
if [[ $1 = "gsm" ]]; then
View Microphone mute hotkey on
  1. Open
  2. Create new Quick Action
  3. Select Run AppleScript
  4. Add this:
set inputVolume to input volume of (get volume settings)
if inputVolume = 0 then
	set inputVolume to 100
	display notification "Volume set to 100" with title "✅ Microphone is on"
View Fix and rearrange screens and windows using hotkey in
  1. Install software
brew install yabai
brew install displayplacer
  1. Create hotkey
    • Use Automator --> Quick Action --> Library --> Utilities --> Run Shell Script
    • Set Workflow recieves: no input and Shell: /bin/bash
    • Add script and save
    • Assign shortcut in System preferences --> Keyboard --> Shortcuts -> Services -> General
View Spotify hotkeys on


  1. Install Shpotify: brew install shpotify
  2. Unzip into $HOME/Library/Services/
  3. Go to System Preferences -> Keyboard -> Shortcuts -> Services -> General
  4. Set hotkeys for each of your actions (I use control-cmd-option plus arrow keys or P)

You're done!

Manual installation

View Disable Device Enrollment Program (DEP) notification on macOS

Disable Device Enrollment Program (DEP) notification on macOS

With full reinstall (recommended)

   a. Boot into recovery using command-R during reboot, wipe the harddrive using Disk Utility, and select reinstall macOS

   b. Initial installation will run for approximately 1 hour, and reboot once

   c. It will then show a remaining time of about 10-15 minutes

henrik242 /
Last active Jan 11, 2019
Preliminary work that commits renames of .java files to .kt, and renames them back to prepare for IntelliJ code conversion
#!/usr/bin/env bash
set -o errexit -o pipefail -o nounset
if [[ $# -eq 0 ]]; then
echo "Usage: $0 [someotherclass.groovy ...]"
exit 1
printf "\n\nMoving files with git\n\n"
henrik242 /
Last active Dec 5, 2018
SolrCloud backup/restore without shared disk
#!/usr/bin/env bash
# explains that
# SolrCloud Backup/Restore requires a shared file system mounted at the same path on all nodes.
# This script uses the old Solr Backup/Restore procedure, which is useful if you don't have
# access to a shared disk.
# Requires that the target collection is already set up, with identical number of shards/replicas.
henrik242 / run-script-on-startup.command
Last active Oct 12, 2018
Run shell command in background upon macOS login, using tmux
View run-script-on-startup.command
#!/usr/bin/env bash
# Make this file executable with `chmod +x run-script-in-background.command`, and add it to
# System Preferences --> Users and Groups --> Startup Items. It needs to have the `.command` suffix.
tmux new-session -d -s ostepop \; send -t ostepop.0 "echo Let\'s do this\!; echo More stuff." ENTER