Skip to content

Instantly share code, notes, and snippets.

View lantrix's full-sized avatar
:octocat:
always coding and merging

Ted B lantrix

:octocat:
always coding and merging
View GitHub Profile
@lantrix
lantrix / Route 53 Updater
Created August 27, 2018 04:39 — forked from hsiboy/Route 53 Updater
BASH Script to keep Route53 updated with your current external IP address
Roll your own dynamic DNS service using Route53
@lantrix
lantrix / nginx.sh
Last active October 27, 2018 12:05
SearX Private search instance on docker with reverse proxy & SSL with letsencrypt (auto-renewing)
mkdir -p /usr/local/dockercerts
#nginx template
curl https://raw.githubusercontent.com/lantrix/nginx-proxy/master/nginx.tmpl > /usr/local/nginx.tmpl
#Setup nginx
docker run -d \
-p 80:80 -p 443:443 \
--name nginx \
-v /etc/nginx/conf.d \
@lantrix
lantrix / launch.json
Last active March 26, 2018 05:40
VSCode Bash Debug Config
{
"version": "0.2.0",
"configurations": [
{
"name": "Bash-Debug (type in script name)",
"type": "bashdb",
"request": "launch",
"program": "${command:SelectScriptName}",
"args": [
"one",
@lantrix
lantrix / rename-images-to-originaldate.sh
Last active October 2, 2018 04:53
Rename dir of images to match their EXIF OriginalDate - also change Create Date and OS Modify date to match the EXIF OriginalDate
#!/bin/bash
# Processing all files in a directory, this script will:
# - Change Create Date of an image to match the EXIF OriginalDate
# - Change OS Modify date to match the EXIF OriginalDate of the image
# - Rename image to match EXIF OriginalDate in format:
# YYYY-MM-DD HH:mm:ss.ext
DIR="$1"
# failsafe - fall back to current directory
@lantrix
lantrix / update-exif-gps.sh
Created March 11, 2018 11:28
ExifTool set GPS co-oords in a photo in Bash
#!/bin/bash
# ExifTool set GPS co-oords in a photo
command -v exiftool >/dev/null 2>&1 || { echo >&2 "I require exiftool but it's not installed. Aborting."; exit 1; }
if [ ! -n "$1" ]; then
echo "Usage: `basename $0` 0002.jpg 36.989213 -84.231474"
echo "Lat/Long must be in Decimal Degrees (DD)"
exit
@lantrix
lantrix / move-images.sh
Last active October 2, 2018 04:50
Move images to folders with YYYY-MM in them
#!/bin/bash
# Move images to folders with YYYY-MM in them
for x in *.jpg; do d=$(date -r "$x" +%Y-%m) ; mkdir -p "$d"; mv -- "$x" "$d/"; done
#!/bin/bash
# Processing filenames using an array - from https://www.cyberciti.biz/tips/handling-filenames-with-spaces-in-bash.html
DIR="$1"
# failsafe - fall back to current directory
[ "$DIR" == "" ] && DIR="."
# save and change IFS
OLDIFS=$IFS
@lantrix
lantrix / update-exif-from-date-in-filename.sh
Last active October 16, 2024 03:38
Update an exif DateTimeOriginal from data that is stored in the filename from the camera
#!/bin/bash
# For Camera Photos that need the following fix:
# - the DateTimeOriginal was in the filename (the actual time you want as Exif.Image.DateTimeOriginal, and File System Modification Date/Time)
# - The File System Modification Date/Time is wrong
# - the Exif.Image.DateTime was never set or was wrong
# - the Exif.Photo.DateTimeDigitized was never set or was wrong
# - the Exif.Image.DateTime was never set but exists in the MetadataDate
@lantrix
lantrix / unset-aws-vars.sh
Created January 16, 2018 05:21
Unset AWS variables in bash shell
while read var; do unset $var; done < <(set |grep AWS | sed 's/=.*$//')
@lantrix
lantrix / unset-vars.sh
Created December 7, 2017 06:45
Unset AWS env variables in bash
while read var; do unset $var; done < <(set |grep AWS | sed 's/=.*$//')