Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
set -Eeuo pipefail
#
# 20191001 | tatze
# ------------------------------------------
# programs needed:
# - ffmpeg
# - youtube-dl
# ------------------------------------------
# ------------------------------------------
@tatze
tatze / reduce_media
Last active August 22, 2019 22:25
creates reduced versions of images and mp4 either in relative (path) or absolute (collection) directory... mainly used to save space on smartphones
#!/bin/bash
set -Eeuo pipefail
#
# 20190822 | tatze
# ------------------------------------------
# programs needed:
# - ffmpeg
# - imagemagick
# ------------------------------------------
# ------------------------------------------
@tatze
tatze / generate_password
Created August 10, 2019 22:36
create 20-digit password
</dev/urandom tr -dc 'A-Za-z0-9!#$%&\()*+,-./:;<=>?@[\]^_{|}' | head -c 20 ; echo
@tatze
tatze / rm_apple_files
Created January 6, 2019 13:40
remove all that apple related ._ files
find . -iname '._*' -exec rm -rf {} \;
@tatze
tatze / exif_rename
Last active February 5, 2023 13:12
find images and movies recursively and rename them by prepending their EXIF timestamp
# add trailing timestamps when missing
# needs: exiftool
#
# Regular files
find . -iregex '.*\.jpe?g$' -not -regex '.*/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9][0-9][0-9].*' -exec exiftool -q -d "%Y%m%d_%H%M%S-%%f.%%e" "-filename<createdate" {} \;
find . -iregex '.*\.mp4$' -not -regex '.*/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9][0-9][0-9].*' -exec exiftool -q -d "%Y%m%d_%H%M%S-%%f.%%e" "-filename<createdate" {} \;
#
# Apple files
find . -iregex '.*\.HEIC$' -not -regex '.*/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9][0-9][0-9].*' -exec exiftool -q -d "%Y%m%d_%H%M%S-%%f.%%e" "-filename<createdate" {} \;
find . -iregex '.*\.mov$' -not -regex '.*/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9][0-9][0-9].*' -exec exiftool -q -d "%Y%m%d_%H%M%S-%%f.%%e" "-filename<creationdate" {} \;