Skip to content

Instantly share code, notes, and snippets.

@tjluoma
tjluoma / youtube-rss.sh
Last active May 31, 2025 20:28
Did you know YouTube has RSS feeds? No? Probably because YouTube makes them nearly impossible to find. But here's an easy way to get the RSS feed for any YouTube user. Inspired by <https://eggfreckles.net/notes/youtube-rss/>
#!/usr/bin/env zsh -f
# Purpose: get the RSS feed for a YouTube page
# Inspired By: https://eggfreckles.net/notes/youtube-rss/
# Gist: https://gist.github.com/tjluoma/fdbc63ceb78a2aecd3d638fd18b6ec6e
#
# From: Timothy J. Luoma
# Mail: luomat at gmail dot com
# Date: 2020-01-17; updated 2021-01-10
# 2021-01-10 YouTube currently has both 'rssUrl' and
@tjluoma
tjluoma / com.tjluoma.autolock-on-login.plist
Created January 9, 2019 21:31
A 'launchd' plist to automatically lock your Mac as soon as you log in.
<?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.tjluoma.autolock-on-login</string>
<key>ProgramArguments</key>
<array>
<string>/System/Library/CoreServices/Menu Extras/user.menu/Contents/Resources/CGSession</string>
<string>-suspend</string>
@tjluoma
tjluoma / km-timemachine-mount-run-unmount.sh
Last active November 15, 2024 10:27
a variation of 'timemachine-mount-run-unmount.sh' meant to be used with Keyboard Maestro
#!/usr/bin/env zsh -f
# Purpose: Once you set the DEVICE,
# this script will mount your Time Machine drive,
# run Time Machine,
# and then unmount the drive
#
# From: Timothy J. Luoma
# Mail: luomat at gmail dot com
# Date: 2020-04-20
@tjluoma
tjluoma / pdf-rename-by-cdate.sh
Created December 26, 2019 21:55
rename PDF files by their creation date (as determined by PDF metadata)
#!/usr/bin/env zsh -f
# Purpose: rename PDFs by their creation date
#
# From: Timothy J. Luoma
# Mail: luomat at gmail dot com
# Date: 2019-12-26
NAME="$0:t:r"
if [[ -e "$HOME/.path" ]]
@tjluoma
tjluoma / menubar-visibility.sh
Created May 4, 2021 10:41
Show, change, toggle the menu bar visibility on macOS Big Sur
#!/usr/bin/env zsh -f
# Purpose: Toggle, or check, the menu bar visibility. Tested on macOS 11.
#
# From: Timothy J. Luoma
# Mail: luomat at gmail dot com
# Date: 2021-05-04
NAME="$0:t:r"
SCRIPT_NAME="$0"
@tjluoma
tjluoma / com.tjluoma.on_networkchange.plist
Created August 22, 2012 21:07
run a shell script whenever a Mac's network information changes
<?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>AbandonProcessGroup</key>
<true/>
<key>Label</key>
<string>com.tjluoma.on_networkchange</string>
<key>ProgramArguments</key>
<array>
#!/usr/bin/env zsh -f
# This tells the script to get the $PATH from the ~/.path file if it exists
# otherwise it will use the second $PATH in the "else" clause
if [[ -e "$HOME/.path" ]]
then
source "$HOME/.path"
else
PATH='/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin'
fi
@tjluoma
tjluoma / crashplanFixup.sh
Last active May 23, 2023 14:59 — forked from thewellington/crashplanFixup.sh
disables de-duplication in CrashPlan, which makes upload speeds much faster. Note: @thewellington did all the hard work here, I just added some to it.
#!/bin/zsh
# Purpose: disable deduplication in CrashPlan
#
# From: Tj Luo.ma
# Mail: luomat at gmail dot com
# Web: http://RhymesWithDiploma.com
# Date: 2014-03-23
#
#
# Forked from: <https://gist.github.com/thewellington/8984012>
@tjluoma
tjluoma / backupmas.sh
Created November 25, 2020 17:17
backup all of your Mac App Store apps
#!/usr/bin/env zsh -f
# Purpose: Create a backup of all Mac App Store apps
# NTS: like 'backup-mas-apps.sh' but without growlnotify
# From: Timothy J. Luoma
# Mail: luomat at gmail dot com
# Date: 2019-06-01
# point this to wherever you want backups to be made.
# it will be created if it does not exist
@tjluoma
tjluoma / macos-is-at-least.sh
Last active April 6, 2023 18:40
zsh script to compare macOS Versions - see https://rhymeswithdiploma.com/2020/07/10/macos-is-at-least/ for full explanation
#!/bin/zsh -f
# Purpose: Check to see if we are running on Big Sur
#
# From: Timothy J. Luoma
# Mail: luomat at gmail dot com
# Date: 2020-07-10
PATH="/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin"
# this will check to make sure `sw_vers` exists