Skip to content

Instantly share code, notes, and snippets.

View spiritualized's full-sized avatar

spiritualized

View GitHub Profile
@spiritualized
spiritualized / uptime-kuma.conf
Last active March 2, 2024 06:56
Uptime Kuma reverse proxy nginx config for a URL prefix
# nginx configuration snippet for running Uptime Kuma on a URL prefix
# set up for yourdomain.com/kuma, with traffic forwarded to a docker
# container with the hostname 'uptime-kuma'
# Use docker's DNS
resolver 127.0.0.11;
# uptime kuma
location /uptime {
@spiritualized
spiritualized / gist:c87fc97148e279b4c59c6fb51c1a7050
Last active May 25, 2023 17:09
Wizarr reverse proxy nginx config for a URL prefix
# Nginx reverse proxy config for wizarr in docker on a URL prefix
# Use docker's DNS
resolver 127.0.0.11;
# wizarr
location /wizarr/ {
set $upstream_app wizarr;
proxy_pass http://$upstream_app:5690;
@spiritualized
spiritualized / planka_snippet.conf
Last active May 24, 2023 23:44
Nginx reverse proxy config for Planka with a URL prefix
# In your docker-compose.yaml, set
# - BASE_URL=https://myhost.com
# with no port and no URL prefix.
location ^~ /planka {
# Set proxy headers
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
@spiritualized
spiritualized / one-folder-per-file.bat
Created March 25, 2023 14:13
Create an identically named folder for each file, and move them inside (windows)
@echo off
for %%i in (*) do (
if not "%%~ni" == "organize" (
md "%%~ni" && move "%%~i" "%%~ni"
)
)
@spiritualized
spiritualized / gist:42f10b85d2d281957cb40733adeb0a07
Created March 23, 2023 16:09
Plex: Fix library items stuck at the top of 'Recently Added' section (Windows)
Plex Media Server often stores incorrect 'added' timestamps when adding new items, causing some items to stick perpetually at the top
of the list. Run the following command in a command prompt to fix the database:
"%PROGRAMFILES%\Plex\Plex Media Server\Plex Media Server.exe" -sqlite "%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db" "UPDATE metadata_items SET added_at = created_at where added_at >= unixepoch();"
If that didn't work, you may have installed the 32bit build of Plex Media Server on 64bit Windows. Try the following:
"%PROGRAMFILES(X86)%\Plex\Plex Media Server\Plex Media Server.exe" -sqlite "%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db" "UPDATE metadata_items SET added_at = created_at where added_at >= unixepoch();"
The command can also be saved into a textfile, and renamed as 'fix-plex-recent-items.bat' for ease of use.
@spiritualized
spiritualized / activate.bat
Created December 16, 2016 12:05
Python virtualenv activate.bat (Windows) - derive prompt title from virtualenv directory's parent
@echo off
set "VIRTUAL_ENV=C:\path\to\project\venv"
CALL :RESOLVE "%VIRTUAL_ENV%\.." PromptName
for %%f in (%PromptName%) do set PromptName=%%~nxf
if defined _OLD_VIRTUAL_PROMPT (
set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
) else (
if not defined PROMPT (