Skip to content

Instantly share code, notes, and snippets.

@Dimtree
Dimtree / camera.sh
Created September 21, 2023 12:03
Repeatedly take photos from webcam using ffmpeg and upload them to PrusaConnect
#!/bin/bash
# based on this script by nunofgs
# https://gist.github.com/nunofgs/84861ee453254823be6b069ebbce9ad2
# fingerprint needs to be unique per camera
# it's just a random string, generate one with `uuidgen` or `pwgen 32 1`
# if you lose it, delete and re-add the camera in PrusaConnect then rotate $FINGERPRINT and $TOKEN here
FINGERPRINT=fingerprint-goes-here
# PrusaConnect "other camera" token
@Dimtree
Dimtree / sign-vbox-modules
Created January 10, 2023 17:48
Sign VirtualBox modules for Secure Boot on Fedora 37. See https://gist.github.com/reillysiemens/ac6bea1e6c7684d62f544bd79b2182a4
#!/bin/sh
# /usr/local/sbin/sign-vbox-modules
readonly hash_algo='sha256'
readonly key='/root/module-signing/MOK.priv'
readonly x509='/root/module-signing/MOK.der'
# The exact location of `sign-file` might vary depending on your platform.
alias sign-file="/usr/src/kernels/$(uname -r)/scripts/sign-file"
@Dimtree
Dimtree / build-xmrig.sh
Created March 18, 2022 08:12
build xmrig from source on Debian
#!/bin/bash -e
TMPDIR="$(mktemp -d)"
sudo apt-get install --mark-auto libuv1-dev libssl-dev libhwloc-dev cmake git
pushd "${TMPDIR}"
git clone https://github.com/xmrig/xmrig.git
cd xmrig
sed -i 's/kDefaultDonateLevel = 1;/kDefaultDonateLevel = 0;/g' ./src/donate.h
sed -i 's/kMinimumDonateLevel = 1;/kMinimumDonateLevel = 0;/g' ./src/donate.h
mkdir build
cd build
class Iodine < Formula
desc "Tunnel IPv4 data through a DNS server"
homepage "http://code.kryo.se/iodine/"
url "http://code.kryo.se/iodine/iodine-0.7.0.tar.gz"
sha256 "ad2b40acf1421316ec15800dcde0f587ab31d7d6f891fa8b9967c4ded93c013e"
head do
url "https://github.com/yarrick/iodine.git"
end
@Dimtree
Dimtree / build-caddy-no-telemetry.sh
Created April 3, 2019 20:57
Build a Caddy webserver release with no telemetry enabled.
#!/bin/bash -e
mkdir -p out
export GOPATH="$(mktemp -d)"
go get -u -v github.com/mholt/caddy/caddy
go get -u -v github.com/caddyserver/builds
pushd "$GOPATH"/src/github.com/mholt/caddy/caddy
sed -i 's/var EnableTelemetry = true/var EnableTelemetry = false/' caddymain/run.go
go run build.go
#!/bin/bash
cloudflare_email="test@example.com" # Your Cloudflare email
cloudflare_api_key="API_KEY_HERE" # Your Cloudflare API key
cloudflare_dns_zone="DNS_ZONE_HERE" # DNS zone containing the record you want to modify
cloudflare_dyndns_record="home.example.com" # Name of the record you want to modify
res="$(curl -sS -X GET "https://api.cloudflare.com/client/v4/zones/$cloudflare_dns_zone/dns_records" \
-H "X-Auth-Email: $cloudflare_email" \
-H "X-Auth-Key: $cloudflare_api_key" \
diff --git a/src/NzbDrone.Core/Qualities/Quality.cs b/src/NzbDrone.Core/Qualities/Quality.cs
index fedbd0b34..0602558af 100644
--- a/src/NzbDrone.Core/Qualities/Quality.cs
+++ b/src/NzbDrone.Core/Qualities/Quality.cs
@@ -79,6 +79,8 @@ public override bool Equals(object obj)
//public static Quality WEBRip2160p { get { return new Quality(17, "WEBRip-2160p", QualitySource.WebRip, 2160); } }
public static Quality WEBDL2160p => new Quality(18, "WEBDL-2160p", QualitySource.Web, 2160);
public static Quality Bluray2160p => new Quality(19, "Bluray-2160p", QualitySource.Bluray, 2160);
+ public static Quality Remux1080p => new Quality(20, "Remux-1080p", QualitySource.Bluray, 1080);
+ public static Quality Remux2160p => new Quality(21, "Remux-2160p", QualitySource.Bluray, 2160);
@Dimtree
Dimtree / build-nginx-fancyindex.sh
Last active February 28, 2022 09:16
Compile ngx-fancyindex dynamically for current nginx version
#!/bin/bash -e
#echo "Please enter NGINX version:"
#read version
version=$(nginx -v 2>&1 | egrep -o "([0-9]{1,}\.)+[0-9]{1,}")
echo "Read NGINX version as \"$version\""
tmpdir=$(mktemp -d)
pushd "$tmpdir"
#!/bin/bash
APP_TOKEN="your_token_here"
USER_TOKEN="your_token_here"
if [ $# -eq 0 ]; then
echo "Usage: ./pushover <message> [title]"
exit
fi
@Dimtree
Dimtree / Update_R53.py
Created August 23, 2015 00:31
Updates a Route53 subdomain to a given IP address, designed for dynamic IPs
#!/usr/bin/python
import boto
from boto.route53.record import ResourceRecordSets
import urllib2
AWS_ACCESS_KEY_ID = 'access_key_here'
AWS_SECRET_ACCESS_KEY = 'secret_key_here'
AWS_R53_ZONE = 'zone_id_here'
AWS_R53_ADDR = 'subdomain.example.com'