···
+
set script-interpreter := ["uv", "run", "--script"]
# Quickly copy the Tailscale install command
···
+
# Create a .tar.gz archive from {{dir}}
+
archive_name="${DIR_NAME}-$(date '+%Y%m%d').tar.gz"
+
tar cvfz "$archive_name" "$DIR_NAME"
+
echo "Created archive $archive_name"
+
# Get the day of the week a given date falls on
+
dayofweek year month day:
+
from datetime import datetime
+
if __name__ == "__main__":
+
print("Usage: dayofweek <year> <month> <day>")
+
print(datetime(int(sys.argv[1]), int(sys.argv[2]), int(sys.argv[3])).strftime("%A"))
+
# Download an open source license
+
base_url="https://api.github.com/licenses"
+
headers="Accept: application/vnd.github.drax-preview+json"
+
res=$(curl --silent --header $headers $base_url)
+
selection=$(echo "$res" | jq ".[].key" | tr -d '"' | gum choose --limit=1)
+
res=$(curl --silent --header $headers $base_url/$selection | jq ."body")
+
echo -e "$res" | tr -d '"'
+
# Fetch and display public IP info
+
myip - Fetch and display public IP information from ipinfo.io
+
if __name__ == "__main__":
+
response = requests.get("https://ipinfo.io", timeout=60)
+
json_data = json.loads(response.text)
+
print(f"- {KEY_COLOR}{item.title():<16}{END_COLOR} {json_data[item]}")
# vim: ts=4 sts=4 sw=4 et ft=just