From f058967d1cc19cc1a8b2bea90e104b64c0393e77 Mon Sep 17 00:00:00 2001 From: will king Date: Tue, 16 Apr 2024 16:48:54 -0700 Subject: [PATCH] Updated a couple of things --- check_ip.sh | 17 +++++++++++++++++ compiletex | 16 ++++++++++++---- restart_cinnamon.sh | 1 + telegram_photo_rename | 14 ++++++++++++++ 4 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 check_ip.sh create mode 100644 restart_cinnamon.sh create mode 100644 telegram_photo_rename diff --git a/check_ip.sh b/check_ip.sh new file mode 100644 index 0000000..1bce4ef --- /dev/null +++ b/check_ip.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Check if this the ip address has updated + +EXPECTED_IP_ADDR="50.52.118.232" +ACTUAL_IP_ADDR="$(curl ifconfig.me/ip)" +NTFY_URL="ntfy.sh/hr8fhsk" + +if [[ "$EXPECTED_IP_ADDR" == "$ACTUAL_IP_ADDR" ]]; +then + exit 0 +else + curl \ + -d "IP addr changed. Expected: $EXPECTED_IP_ADDR Got: $ACTUAL_IP_ADDR Consider updating cloudflare etc." \ + "$NTFY_URL" + + exit 1 +fi diff --git a/compiletex b/compiletex index 386978e..1bd066a 100755 --- a/compiletex +++ b/compiletex @@ -10,11 +10,19 @@ biber "$tex" latex "$flags" "$tex" pdflatex "$flags" "$tex" -echo -echo "Removing biliography database \n\t$tex" -rm $tex.bbl +echo "Removing extra files related to $tex" +rm -v $tex.bbl +rm -v $tex.toc +rm -v $tex.aux +rm -v $tex.snm +rm -v $tex.run.xml +rm -v $tex.out +rm -v $tex.nav +rm -v $tex.log +rm -v $tex.blg +rm -v $tex.bcf -echo +echo echo Done exit 0 diff --git a/restart_cinnamon.sh b/restart_cinnamon.sh new file mode 100644 index 0000000..e4e548f --- /dev/null +++ b/restart_cinnamon.sh @@ -0,0 +1 @@ +export DISPLAY=:1; cinnamon --replace & diff --git a/telegram_photo_rename b/telegram_photo_rename new file mode 100644 index 0000000..710571d --- /dev/null +++ b/telegram_photo_rename @@ -0,0 +1,14 @@ +#!/bin/python + +import exif +import os + +# read files + +files = os.listdir() + +for filename in files: + #split out date + #convert date format + #add date to exif data + pass