Skip to content

Instantly share code, notes, and snippets.

View maxcanna's full-sized avatar
🎯
Focusing

Massimiliano Cannarozzo maxcanna

🎯
Focusing
View GitHub Profile
@maxcanna
maxcanna / copyToSpotify.sh
Created March 14, 2017 13:55
Add songs to a Spotify playlist scanning a directory
#!/bin/bash
SPOTIFY_TOKEN=
SPOTIFY_USER=
SPOTIFY_PLAYLIST=
if [ -z "$(which jq)" ]; then
echo Missing jq
exit 1
fi
@maxcanna
maxcanna / pi.backup.sh
Last active March 15, 2020 20:18
raspberry pi SD backup
#!/bin/bash -e
sudo dd if=/dev/rdisk2 bs=1m | gzip > ~/Desktop/pi.$(date "+%Y.%m.%d").gz
#Following commands are to restore data to sd
#diskutil unmountDisk /dev/disk2
#gzip -dc ~/Desktop/pi.$(date "+%Y.%m.%d").gz | sudo dd of=/dev/rdisk2 bs=1m
@maxcanna
maxcanna / copy_gps_from_raw.sh
Last active July 22, 2016 12:15
Copy geolocation exif data from JPG to DNG
#!/bin/bash
for input in *.jpg
do
echo "Processing $input"
exiftool −overwrite_original_in_place -r -tagsFromFile $input -gps:all "${input//jpg/dng}"
done
@maxcanna
maxcanna / hdrdetect.sh
Created January 4, 2015 12:29
Automatically identify bracketed images
#!/bin/bash
# Canon
exiftool "-directory=HDR" -if '$bracketMode eq "AEB"' $1
# Nikon
exiftool "-directory=HDR" -if '$ShootingMode eq "Continuous, Exposure Bracketing, Auto ISO"' $1