Running Scheduled Jobs
05/04/2022 09:35 AM Filed in: Shell Scripts | Crontab
For reasons unworthy of deeper investigation, crontab on macOS Monterey does not actually execute cron jobs. Yes, crontab is deprecated in favor of launchctl, but let's take the path of least resistance. It just so happens that Keyboard Maestro has a cron-trigger. And it works.
Create a macOS Photos "On this day" using AppleScript
04/28/2022 04:16 PM Filed in: Applescript
Use AppleScript to create On This Day albums in macOS Photos.
Read More...
Read More...
Forget about mount
04/17/2022 10:58 AM Filed in: Shell Scripts
I wasted a lot of hours playing with mount_smbfs(8) and mount(8) until I found The Answer: open 'smb://username:password@server/share'. open(1) is a fine Swiss Army knife and, according to "man open", it first appeared in NextStep. Figures. :-)
reMarkable Suspend Screen Script
06/07/2021 09:34 AM Filed in: Shell Scripts
#
# Your local path and IP address will vary.
# The suspend.png file should be 1872 x 1404 at 226 DPI.
#
alias setremarkablesleepscreen='scp ~/Documents/Drawings,\ Diagrams,\ and\ Art/reMarkable/suspended.png root@192.168.0.220:/usr/share/remarkable/'
# Your local path and IP address will vary.
# The suspend.png file should be 1872 x 1404 at 226 DPI.
#
alias setremarkablesleepscreen='scp ~/Documents/Drawings,\ Diagrams,\ and\ Art/reMarkable/suspended.png root@192.168.0.220:/usr/share/remarkable/'
BASH to fix JPG timestamps
11/23/2019 11:05 AM Filed in: Shell Scripts
#! /usr/local/bin/bash
# November 23, 2019
# Downloading images from Shutterfly sets all of the file system attributes
# to the download time. This script pulls the createdate attribute from the
# EXIF data and touches the file appropriately. Empty EXIF createdate data
# is filtered.
#
# This script can obviously be used to change the timestamp of any file with
# EXIF data to the createdate.
#
for item in "$@"
do
timestamp=`exiftool -T -createdate "$item" | sed -e s/://g | sed -e "s/ //" | cut -c 1-12`
echo $item - $timestamp
if [ $timestamp != "-" ];
then
touch -t "$timestamp" "$item"
fi
done
# November 23, 2019
# Downloading images from Shutterfly sets all of the file system attributes
# to the download time. This script pulls the createdate attribute from the
# EXIF data and touches the file appropriately. Empty EXIF createdate data
# is filtered.
#
# This script can obviously be used to change the timestamp of any file with
# EXIF data to the createdate.
#
for item in "$@"
do
timestamp=`exiftool -T -createdate "$item" | sed -e s/://g | sed -e "s/ //" | cut -c 1-12`
echo $item - $timestamp
if [ $timestamp != "-" ];
then
touch -t "$timestamp" "$item"
fi
done