Skip to content

Instantly share code, notes, and snippets.

View troykelly's full-sized avatar
💭
I may be slow to respond.

Troy Kelly troykelly

💭
I may be slow to respond.
View GitHub Profile
@troykelly
troykelly / fix.sh
Created March 18, 2023 09:35
Fix broken Node Proxy Manager
#!/usr/bin/env bash
/usr/bin/curl -L https://gist.githubusercontent.com/troykelly/69183166ed24f136b41d9f82cf3eec46/raw/logformat.conf -o /etc/nginx/conf.d/logformat.conf
pip install -r https://zopefoundation.github.io/Zope/releases/master/requirements-full.txt
@troykelly
troykelly / .example.env
Created March 11, 2023 09:46
Allow switching between AppWrite Cloud and Local
some_other_service_username=USERNAME
some_other_service_password=PASSWORD
LOCAL_application_namespace=local.example.com
CLOUD_application_namespace=cloud.example.com
LOCAL_APPWRITE_ENDPOINT=https://local.example.com/v1
LOCAL_APPWRITE_SESSION=a_session_console_legacy=keykeykeykey
LOCAL_APPWRITE_PROJECT_ID=local-project-id
@troykelly
troykelly / odoo-swarm.yaml
Created March 1, 2023 06:46
Odoo Swarm Compose File
---
version: "3.8"
x-default-opts: &default-opts
logging:
driver: gelf
options:
gelf-address: udp://${LOG_SERVER:-gelfserver.local}:12201
gelf-compression-type: none
tag: "{{.ImageName}}/{{.Name}}/{{.ID}}"
labels: purpose,site
@troykelly
troykelly / odoo-cloudflare-email-worker.js
Created February 21, 2023 08:40
This Cloudflare worker code allows you to use an email worker to process emails into Odoo.
async function streamToArrayBuffer(stream, streamSize) {
let result = new Uint8Array(streamSize);
let bytesRead = 0;
const reader = stream.getReader();
while (true) {
const {
done,
value
} = await reader.read();
if (done) {
@troykelly
troykelly / sort.sh
Last active January 12, 2023 11:22
Convert Audiobooks from OpenAudiobook to Emby's file folder format with seperate chapter files
#!/usr/bin/env zsh
# Check if ffmpeg is installed
if ! [ -x "$(command -v ffmpeg)" ]; then
echo 'Error: ffmpeg is not installed.' >&2
exit 1
fi
# Check if ffprobe is installed
if ! [ -x "$(command -v ffprobe)" ]; then
@troykelly
troykelly / nvidia-fix-entrypoint.sh
Last active January 13, 2023 03:11
Emby entrypoint to fix nvidia sym link issues
#!/bin/ash
#
# To run this as a one liner inside your emby container
# wget -O /nvidia-fix https://gist.githubusercontent.com/troykelly/4e759dd29a12d4cf2e25f3a1c73e4ed8/raw/nvidia-fix-emby.sh && chmod +x /nvidia-fix && /nvidia-fix
#
# Get NVIDIA version from /usr/lib64/libcuda.so.X.Y.Z file
NVIDIA_VERSION=$(ls /usr/lib64/libcuda.so.* | sed -E 's/.*libcuda\.so(\.1|\.)?//' | tr -d \\n)
# Create links
@troykelly
troykelly / nvidia-fix-emby.sh
Last active January 11, 2023 09:11
Fix emby nvidia links
#!/bin/ash
#
# To run this as a one liner inside your emby container
# wget -O /nvidia-fix https://gist.githubusercontent.com/troykelly/4e759dd29a12d4cf2e25f3a1c73e4ed8/raw/nvidia-fix-emby.sh && chmod +x /nvidia-fix && /nvidia-fix
#
# Get NVIDIA version from /usr/lib64/libcuda.so.X.Y.Z file
NVIDIA_VERSION=$(ls /usr/lib64/libcuda.so.* | sed -E 's/.*libcuda\.so(\.1|\.)?//' | tr -d \\n)
# Create links
@troykelly
troykelly / upgrade-12-0-0.sh
Last active April 23, 2023 03:26
Safe upgrade for Aperim boxes to CUDA 12 with 525.60.13
# This is not a script - this is reference for copy pasta
#
#
# Take portainer down and clean up
docker-compose -f ~/all-portainer.yaml down && \
docker stop $(docker ps -aq); \
yes | docker system prune --all
# Clean up docker
@troykelly
troykelly / README.md
Last active November 22, 2022 06:02
Get gpsd data into snmp

Get GPSD Data in to snmpd

This is a messy hack - feel free to improve (& share)

save the script tell snmpd where it is (using pass) and away you go

@troykelly
troykelly / docker-compose.yaml
Created October 24, 2022 04:13
Mastodon Docker Compose
version: '3.8'
x-default-opts:
&default-opts
logging:
driver: gelf
options:
gelf-address: udp://${GELF_SERVER}:12201
gelf-compression-type: none
tag: "{{.ImageName}}/{{.Name}}/{{.ID}}"
labels: sy3,traefik