Assorted shell and Python scripts

Use uv in shebang

+1 -1
dayofweek
···
-
#!/usr/bin/env python
+
#!/usr/bin/env -S uv run --script
#
# Usage: dayofweek <year> <month> <day>
#
+6 -1
myip
···
-
#!/usr/bin/python3
+
#!/usr/bin/env -S uv run --script
+
# /// script
+
# dependencies = [
+
# "requests",
+
# ]
+
# ///
"""
myip - Fetch and display public IP information from ipinfo.io
+1 -1
nerdfont_installer
···
#!/usr/bin/env bash
# LICENSE
-
# Copyright 2022 Jeffrey Serio <hyperreal@fedoraproject.org>
+
# Copyright 2022 Jeffrey Serio <hyperreal@moonshadow.dev>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
+7 -1
oci_reg_helper
···
-
#!/usr/bin/env python3
+
#!/usr/bin/env -S uv run --script
+
# /// script
+
# dependencies = [
+
# "docopt",
+
# "rich",
+
# ]
+
# ///
"""OCI Registry Helper
-24
resend_borg_error.py
···
-
# /// script
-
# dependencies = [
-
# "resend",
-
# ]
-
# ///
-
-
import subprocess
-
from pathlib import Path
-
-
import resend
-
-
resend.api_key = (
-
Path("/usr/local/etc/resend_api_key.txt").read_text().strip("\n")
-
)
-
-
params: resend.Emails.SendParams = {
-
"from": "Borgmatic <admin@hyperreal.coffee>",
-
"to": ["hyperreal@moonshadow.dev"],
-
"subject": "[moonshadow] Error running Borgmatic",
-
"text": "There was an error running your Borgmatic backup on moonshadow. Please investigate.",
-
}
-
-
email = resend.Emails.send(params)
-
print(email)