From 56e43e1e169db23ef461e3e953c11b3288d4c1ee Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Thu, 29 Feb 2024 11:24:09 -0500 Subject: [PATCH] Small cleanup --- .../3.x/scripts/addons/y_aligned_camera.py | 2 +- configs/git/.gitconfig | 1 + configs/ssh/config | 11 ++-- scripts/catto | 58 ------------------- 4 files changed, 6 insertions(+), 66 deletions(-) delete mode 100755 scripts/catto diff --git a/configs/blender/3.x/scripts/addons/y_aligned_camera.py b/configs/blender/3.x/scripts/addons/y_aligned_camera.py index 0216a4f..cb60c4e 100644 --- a/configs/blender/3.x/scripts/addons/y_aligned_camera.py +++ b/configs/blender/3.x/scripts/addons/y_aligned_camera.py @@ -1,6 +1,6 @@ bl_info = { "name": "Evan's Y-aligned Camera Creator", - "author": "Evan Pratten ", + "author": "Evan Pratten ", "version": (1, 0), "blender": (3, 0, 0), "description": "Adds a camera that is aligned with the Y axis by default", diff --git a/configs/git/.gitconfig b/configs/git/.gitconfig index 37ce2f3..2dc0487 100644 --- a/configs/git/.gitconfig +++ b/configs/git/.gitconfig @@ -47,5 +47,6 @@ [credential "https://gist.github.com"] helper = helper = !/usr/bin/gh auth git-credential + [push] autoSetupRemote = true diff --git a/configs/ssh/config b/configs/ssh/config index a03c938..606ad98 100644 --- a/configs/ssh/config +++ b/configs/ssh/config @@ -21,8 +21,8 @@ Host github.com gist.github.com Host unifi HostName dreammachinepro.local User root - #PreferredAuthentications password - # PubkeyAuthentication no + PreferredAuthentications password + PubkeyAuthentication no Host ewpratten-steamdeck HostName ewpratten-steamdeck.local @@ -36,9 +36,6 @@ Host 10.80.0.218 PubkeyAcceptedKeyTypes +ssh-rsa HostKeyAlgorithms=+ssh-rsa -Host sniffr.home - User pi - # Default hostnames I may encounter in the wild Host openrepeater.local HostName openrepeater.local @@ -113,7 +110,7 @@ Host gianna-desktop # Various Aliases Host desktop - HostName desktop.evan.vpn.ewp.fyi + HostName ewpratten-desktop.home Host laptop - HostName laptop.evan.vpn.ewp.fyi + HostName ewpratten-laptop.home diff --git a/scripts/catto b/scripts/catto deleted file mode 100755 index e7df79d..0000000 --- a/scripts/catto +++ /dev/null @@ -1,58 +0,0 @@ -#! /usr/bin/env python3 -import sys -import requests -import json -import argparse -import os -import tempfile -from pathlib import Path -import netrc - -def main() -> int: - ap = argparse.ArgumentParser() - ap.add_argument("image", help="Image to upload") - ap.add_argument("--no-compress", help="Don't compress the image", action="store_true") - args = ap.parse_args() - - # Load the API key from the .netrc file - if "catto.pictures" not in netrc.netrc().hosts: - print("No catto.pictures entry in .netrc file") - return 1 - login, account, password = netrc.netrc().authenticators("catto.pictures") - - # Parse the image to a path - image_path = Path(args.image) - - # Ensure the file actually exists - if not image_path.exists(): - print("File not found", file=sys.stderr) - return 1 - - # Compress the image to a temporary file - with tempfile.NamedTemporaryFile(suffix=image_path.suffix) as temp: - # Compress - if not args.no_compress: - os.system(f"convert {image_path} -quality 25% {temp.name}") - image_path = Path(temp.name) - - # Strip all exif data - os.system(f"exiftool -EXIF= {image_path}") - - # Upload the image - with open(image_path, "rb") as f: - r = requests.post( - "https://upload.catto.pictures", - files={"image": (temp.name, f, f"image/{image_path.suffix[1:]}")}, - headers={ - "Authorization": password, - "Domain": "img.ewpratten.com", - } - ) - if r.status_code != 200: - print(f"Error uploading image:\n{r.text}", file=sys.stderr) - return 1 - print(json.loads(r.text)["url"]) - -if __name__ == "__main__": - sys.exit(main()) -