Skip to content

Instantly share code, notes, and snippets.

TJ Luoma tjluoma

Block or report user

Report or block tjluoma

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tjluoma
tjluoma / km-timemachine-mount-run-unmount.sh
Last active Apr 21, 2020
a variation of 'timemachine-mount-run-unmount.sh' meant to be used with Keyboard Maestro
View km-timemachine-mount-run-unmount.sh
#!/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
View get-with-yt-dl.sh
#!/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 / bulkocrpdfs.sh
Created Mar 28, 2020
This script will bulk OCR all of the PDFs in a given directory. https://github.com/jbarlow83/OCRmyPDF is doing all of the hard work, TBH.
View bulkocrpdfs.sh
#!/usr/bin/env zsh -f
# Purpose: OCR all of the PDFs in a given directory
#
# From: Timothy J. Luoma
# Mail: luomat at gmail dot com
# Date: 2020-03-27
# ⚠️⚠️⚠️ !!! ⚠️⚠️⚠️ !!! ⚠️⚠️⚠️ !!! ⚠️⚠️⚠️ !!! ⚠️⚠️⚠️ !!! ⚠️⚠️⚠️ !!! ⚠️⚠️⚠️ !!! ⚠️⚠️⚠️ !!! ⚠️⚠️⚠️ !!! ⚠️⚠️⚠️ !!! ⚠️⚠️⚠️ !!! ⚠️⚠️⚠️ !!! ⚠️⚠️⚠️
# !!! ⚠️⚠️⚠️ you *MUST* change this to the directory where all of your PDFs are that you want to OCR !!!
DIR="$HOME/AllMyPDFs"
@tjluoma
tjluoma / cue2csv.sh
Created Mar 6, 2020
take a .cue file and output a CSV showing timestamp and chapter title. See <https://talk.automators.fm/t/extract-chapters-from-mp3/6797>
View cue2csv.sh
#!/usr/bin/env zsh -f
# Purpose: take a .cue file and create a .csv showing timestamp first and chapter title second
#
# From: Timothy J. Luoma
# Mail: luomat at gmail dot com
# Date: 2020-03-06
NAME="$0:t:r"
if [[ -e "$HOME/.path" ]]
@tjluoma
tjluoma / Open in Marked.sh
Last active Feb 27, 2020
BBEdit script to open the current file in Marked 2
View Open in Marked.sh
#!/usr/bin/env zsh -f
#
# Author: Timothy J. Luoma
# Email: luomat at gmail dot com
# Date: 2018-08-23
#
# Purpose: BBEdit Script to open the current file in Marked 2 <http://marked2app.com>
NAME="$0"
@tjluoma
tjluoma / youtube-rss.sh
Last active Feb 25, 2020
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. Based on <https://eggfreckles.net/2020/01/03/youtube-rss/>
View youtube-rss.sh
#!/usr/bin/env zsh -f
# Purpose: get the RSS feed for a YouTube page
# Inspired By: https://eggfreckles.net/2020/01/03/youtube-rss/
#
# From: Timothy J. Luoma
# Mail: luomat at gmail dot com
# Date: 2020-01-17
NAME="$0:t:r"
@tjluoma
tjluoma / get-dropbox-path.sh
Created Jan 14, 2020
shell commands to parse the ~/.dropbox/info.json file and determine where Dropbox is installed
View get-dropbox-path.sh
# If you have a 'work' or 'business' Dropbox and a 'personal' one,
# this will only work on the 'personal' one
JSON="$HOME/.dropbox/info.json"
if [[ ! -e "$JSON" ]]
then
echo "$NAME: '$JSON' file not found." >>/dev/stderr
exit 2
@tjluoma
tjluoma / pdf-rename-by-cdate.sh
Created Dec 26, 2019
rename PDF files by their creation date (as determined by PDF metadata)
View pdf-rename-by-cdate.sh
#!/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 / mdpdfpagecount.sh
Created Dec 24, 2019
Use `mdls` on macOS to get the number of pages in PDF files
View mdpdfpagecount.sh
#!/usr/bin/env zsh -f
# Purpose: count PDF pages with a variety of tools
#
# From: Timothy J. Luoma
# Mail: luomat at gmail dot com
# Date: 2019-12-23
NAME="$0:t:r"
if [[ -e "$HOME/.path" ]]
@tjluoma
tjluoma / rename-files-by-filetype.sh
Created Oct 4, 2019
use 'file' command to make sure files have the proper (expected) extension
View rename-files-by-filetype.sh
#!/usr/bin/env zsh -f
# Purpose: use 'file' command to make sure image files have proper extension
#
# From: Timothy J. Luoma
# Mail: luomat at gmail dot com
# Date: 2019-10-04
NAME="$0:t:r"
if [[ -e "$HOME/.path" ]]
You can’t perform that action at this time.