Skip to content

Instantly share code, notes, and snippets.

View alanorth's full-sized avatar

Alan Orth alanorth

View GitHub Profile
@alanorth
alanorth / proxy_params
Created August 21, 2026 17:58
nginx proxy_params
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Protect against "HTTPoxy" vulnerability in server-side libraries
# See: https://www.nginx.com/blog/mitigating-the-httpoxy-vulnerability-with-nginx/
# See: https://httpoxy.org/
proxy_set_header Proxy "";
proxy_connect_timeout 3600;
proxy_send_timeout 3600;
#!/usr/bin/env bash
#
# v2021-04-29
#
# I run it like this (using zsh syntax):
#
# $ for video (~/Pictures/2021/**/*.mp4(ND.)); do ~/Downloads/av1-tests/convert-av1.sh "$video"; done
#
# Reference:
# - https://ffmpeg.org/ffmpeg-codecs.html#libaom_002dav1
@alanorth
alanorth / arch-install-encrypted.md
Last active January 14, 2026 12:38
Installing Arch Linux on an SSD with plain boot but encrypted /, /home, etc.
@alanorth
alanorth / clean-snap-sync-external.sh
Last active May 9, 2025 17:47
Clean snapshots created by snap-sync
#!/usr/bin/env bash
#
# clean-snap-sync-external.sh v1.0.1 (2021-07-09)
#
# Changes
# -------
# 2021-07-09:
# - adjust logic to keep latest x, instead of delete oldest x
# - make output cleaner (hide btrfs subvolume delete output)
#
@alanorth
alanorth / datacenter-networks.tsv
Created April 16, 2025 07:34
Generate list of bot networks for nginx mapping
12876 (AS12876 - SCALEWAY S.A.S.)
132203 (TENCENT-NET-AP-CN Tencent Building)
13238 (YANDEX - YANDEX LLC)
136907 (HWCLOUDS-AS-AP HUAWEI CLOUDS)
14061 (DIGITALOCEAN-ASN)
14618 (AMAZON-AES)
16276 (OVH - OVH SAS)
16509 (AMAZON-02)
203020 (HOSTROYALE - HostRoyale Technologies Pvt Ltd)
204287 (HOSTROYALE_TECHNOLOGIES - HostRoyale Technologies Pvt Ltd)
@alanorth
alanorth / dspace-handle-server.service
Created April 11, 2025 09:52
/etc/systemd/system/dspace-handle-server.service
[Unit]
Description=DSpace Handle Server
# Only run if the DSpace Handle server is configured on this host
ConditionDirectoryNotEmpty=/home/cgspace.cgiar.org/handle-server
[Service]
Type=forking
User=dspace
ExecStart=/home/cgspace.cgiar.org/bin/start-handle-server
@alanorth
alanorth / ooniprobe-run.timer
Created April 3, 2025 07:10
~/.config/systemd/user/ooniprobe-run.service
[Unit]
Description=Run ooniprobe
[Service]
# https://www.ctrl.blog/entry/systemd-service-hardening.html
ProtectHome=read-only
ProtectKernelTunables=true
ProtectSystem=strict
PrivateDevices=true
PrivateTmp=true
@alanorth
alanorth / pre-process-media.sh
Last active April 2, 2025 15:06
Script for preparing media files for long-term archival
#!/usr/bin/env bash
#
# pre-process-media.sh v2024-04-28
#
# Prepare a directory of images and videos for long-term archival by normalizing
# their names, optimizing JPEGs with jpeg-archive, and stripping embedded MP4s
# from Android Motion Photos.
#
# SPDX-License-Identifier: GPL-3.0-only
@alanorth
alanorth / jellyfin.container
Created March 14, 2025 16:43
~/.config/containers/systemd/jellyfin.container
[Container]
Image=docker.io/jellyfin/jellyfin:latest
AutoUpdate=registry
PublishPort=8096:8096/tcp
UserNS=keep-id
Environment=TZ=Africa/Nairobi
AddDevice=/dev/dri/:/dev/dri/
Volume=jellyfin-config:/config:Z
Volume=jellyfin-cache:/cache:Z
Volume=/srv/video:/srv/video:ro
@alanorth
alanorth / chrome-104-ips.csv
Created October 23, 2024 13:15
Chrome 104 IPs
ip org network asn country
103.221.57.100 DZCRD Networks Ltd 103.221.56.0/22 132817 BE
103.221.57.101 DZCRD Networks Ltd 103.221.56.0/22 132817 BE
103.221.57.102 DZCRD Networks Ltd 103.221.56.0/22 132817 BE
103.221.57.105 DZCRD Networks Ltd 103.221.56.0/22 132817 BE
103.221.57.106 DZCRD Networks Ltd 103.221.56.0/22 132817 BE
103.221.57.107 DZCRD Networks Ltd 103.221.56.0/22 132817 BE
103.221.57.113 DZCRD Networks Ltd 103.221.56.0/22 132817 BE
103.221.57.115 DZCRD Networks Ltd 103.221.56.0/22 132817 BE
103.221.57.116 DZCRD Networks Ltd 103.221.56.0/22 132817 BE