This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # No Copyright, product of Gemini under prompting by Andrew Jorgensen | |
| # No promises the math and science are right either | |
| import cv2 | |
| import numpy as np | |
| from PIL import Image | |
| from PIL.ExifTags import TAGS | |
| def get_exif(path): | |
| img = Image.open(path) | |
| exif = img._getexif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # build-sk-libfido2.sh | |
| # | |
| # Builds the OpenSSH FIDO2 security key provider (sk-libfido2.dylib) from | |
| # openssh-portable source for use with macOS's built-in SSH client. | |
| # | |
| # macOS ships OpenSSH with FIDO2 support compiled in, but without the | |
| # middleware library that talks to hardware keys. This script builds it, | |
| # statically linking libfido2/libcbor/libcrypto so there are no Homebrew | |
| # runtime dependencies. Build tools are removed afterward. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Author: Andrew Jorgensen | |
| # SPDX-License-Identifier: MIT-0 | |
| """Download all files from your reMarkable as PDFs | |
| Uses the local web interface (via USB Ethernet). | |
| """ | |
| from json import dumps, load | |
| from os import makedirs | |
| from os.path import exists, join | |
| from sys import stdout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Author: Andrew Jorgensen | |
| # SPDX-License-Identifier: MIT-0 | |
| import os | |
| from glob import glob | |
| from json import dumps, load | |
| from os.path import exists, getmtime, getsize, join, split | |
| from subprocess import run | |
| HEADER_5 = b"reMarkable .lines file, version=5" | |
| HEADER_6 = b"reMarkable .lines file, version=6" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright Andrew Jorgensen | |
| # SPDX-License-Identifier: MIT | |
| """Copies data from a URL sources to S3 objects""" | |
| import hashlib | |
| import json | |
| import os | |
| import tempfile | |
| from base64 import b64encode | |
| from decimal import Decimal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright Andrew Jorgensen | |
| # SPDX-License-Identifier: MIT | |
| import json | |
| from os import environ | |
| import boto3 | |
| MAP = json.loads(environ.get("MAP", '{"index.html":"/"}')) | |
| CLIENT = boto3.client("s3") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright Andrew Jorgensen | |
| # SPDX-License-Identifier: MIT | |
| """Receive SNS events in Lambda and POST to a JSON Webhook. | |
| Environment variables required: | |
| * URL - The Webhook URL to POST to (including any required keys) | |
| * TEMPLATE (default: {}) - The JSON data template to POST to the Webhook | |
| * MESSAGE_KEY (default: text) - Key to set to the SNS Message | |
| * TOPIC_KEY (optional) - Key to set to the Topic name from the SNS event | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash -e | |
| # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
| # SPDX-License-Identifier: MIT-0 | |
| fqdn="$(hostname -f)" | |
| address="$(/sbin/ip addr show dev eth1 | awk -F'( +|/)' '/inet / {print $3}')" | |
| if [[ "${address}" == "$(dig +short "${fqdn}")" && "${fqdn}." == "$(dig +short -x "${address}")" ]] | |
| then | |
| exit 0 | |
| fi | |
| TTL=21600 # 6 hours |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1 ` | |
| 1 [ | |
| 1 } | |
| 1 # | |
| 1 í | |
| 2 ] | |
| 2 { | |
| 4 = | |
| 4 , | |
| 4 * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright (c) Andrew Jorgensen. All rights reserved. | |
| # SPDX-License-Identifier: MIT-0 | |
| # Requires jq and assumes AWS CLI --output json | |
| DISTRIBUTION_ID="<YOUR DISTRIBUTION ID>" | |
| DISTRIBUTION_CONFIG="$( | |
| aws cloudfront get-distribution-config \ | |
| --id "${DISTRIBUTION_ID}" \ | |
| | jq -c .)" |
NewerOlder