BASH to fix JPG timestamps

#! /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 "$@"
timestamp=`exiftool -T -createdate "$item" | sed -e s/://g | sed -e "s/ //" | cut -c 1-12`
echo $item - $timestamp
if [ $timestamp != "-" ];
touch -t "$timestamp" "$item"

Shell Scripts for ProGallery Management


# Get the base name, create a _tn version, downsize the _tn to a max of 1280 pixels,
# and copy them to the target gallery. (Future: add a command line arg for gallery)

a=`basename -s .jpg $1`
cp $a.jpg ${a}_tn.jpg
sips -Z 1280 ${a}_tn.jpg
mv $a.jpg /Volumes/wwwroot/Pictures/Food
mv ${a}_tn.jpg /Volumes/wwwroot/Pictures/Food

# I use ProGallery -
# ProGallery uses a CSV file as the image directory source.
# The first line is labels: Title, ThumbnailPath, ImagePath.
# Images are displayed in order, so we need to add the labels
# and the
new images *at the top*. Also, Title can include HTML, so I do.

# Strip off the header of the existing file.
grep -v Thumbnail /Volumes/wwwroot/Albums/Food.csv > /Volumes/wwwroot/Albums/Food.csv.o
# Delete the existing file.
rm /Volumes/wwwroot/Albums/Food.csv
# Create the labels for the new file
echo \"Image\", \"Thumbnail\", \"Fullsize\" > /Volumes/wwwroot/Albums/Food.csv
# Add the new image
echo '"'${a}'
'${a}'"', ../Pictures/Food/${a}_tn.jpg, ../Pictures/Food/${a}.jpg >> /Volumes/wwwroot/Albums/Food.csv
# Concatenate the old list of images to the end
cat /Volumes/wwwroot/Albums/Food.csv.o >> /Volumes/wwwroot/Albums/Food.csv
# Delete the old image list
rm /Volumes/wwwroot/Albums/Food.csv.o
# Open the gallery file to edit the Title.
open -a /Applications/ /Volumes/wwwroot/Albums/Food.csv

Rhythm24 Notes

If trying to record a new workout causes the three indicator lights to blink yellow+red, then the memory is full. Either connect to the Rhythm app and download or delete the existing workouts, or hold down both buttons for 10 seconds to erase all of the stored workouts. (It looks like the Rhythm24 has a whopping 128K (K) of memory.)

Heartrate recording is 5 bytes per record - a 4 byte timestamp and a 1 byte data field.
Cycling recording is 12 bytes per record - a 4 byte timestamp, a 4 byte distance, a 2 byte speed, and 1 byte each for cadence and heart rate.

Total capacity - about 11 hours of mostly running, probably only a couple of hours of full cycling data.

The Rhythm24 won't appears as a heart rate monitor on Cyclemeter unless the Rhythm24 is in recording mode. Oddly enough, you can turn OFF the Rhythm24 recording mode and Cyclemeter will continue to record the heart rate data.

If the Rhythm app doesn't see the Rhythm24 device, the easiest fix is to delete the app and reinstall it.

Raspberry Pi Jessie Setup


General configuration information about Raspberry Pi network interfaces.

sudo vi /etc/hostname
sudo /etc/init.d/
sudo reboot

sudo  adduser paulbeda
sudo adduser paulbeda sudo

sudo vi /etc/dhcpcd.conf

sudo vi /etc/wpa_supplicant/wpa_supplicant.conf



interface eth0

static ip_address=
static routers=
static domain_name_servers=

interface wlan0

static ip_address=
static routers=
static domain_name_servers=

Use sudo raspi-config to enable camera, SSH, vnc, etc.

sudo apt-get install samba samba-common-bin -y
sudo chown -R pi:pi /path/to/share
sudo cp /etc/samba/smb.conf /etc/samba/smb.bak
sudo vi /etc/samba/smb.conf
Leave workgroup as WORKGROUP

Uncomment WINS support, change this line, it should enable the NETBIOS name RASPBERRYPI on your network

# wins support = no

wins support = yes
[TV] #This is the name of the share it will show up as when you browse

comment = TV Folder
path = /mnt/usbstorage/TV
create mask = 0775
directory mask = 0775
read only = no
browseable = yes
public = yes
force user = pi
#force user = root
only guest = no
Assuming the hostname of your pi is RaspberryPI, the path of this share is now \\RASPBERRYPI\TV or \\RASPBERRYPI.IP\TV

Ctrl+X, Y and Enter to save and exit nano

Set a samba password for pi

sudo smbpasswd -a pi
Restart the samba server¨

sudo service samba restart
If you are on Jessie you may see this error, it is because of systemd. With init.d on previous debian releases samba restarted both smbd and nmbd, now it doesn’t.


   Loaded: masked (/dev/null)

   Active: inactive (dead)
You need to restart these services separately instead

sudo service smbd restart
sudo service nmbd restart
Now try to access the samba share, if all is well, repeat the process by editing smb.conf again and adding additional shares.

NB: You may need to restart your device as well as any Mac or Windows machines you want to access the samba shares.


Indoor Forests

Baby Tomatoes

Many Baby Tomatoes

Baby Peppers

Baby Eggplant