Skip to content

Instantly share code, notes, and snippets.

@praul
praul / stash-borg.py
Last active April 21, 2021 13:07
Borg Backup from stash scenes and galleries with rating and tag
#!/usr/env/python3
configpath = '/path/to/stash/config' #Path to your stash config files. No trailing slash
dockerpath = '/data/' #The path for media Stash uses internally. In docker containers this is often /data/. With trailing slash
realpath = '/real/path/to/your/media/' #The Path where your media files are at. Corresponds to dockerpath. With trailing slash
repo = '/path/to/your/borg/repo' #Your Borg Repo Path. No trailing slash
scriptpath = '/tmp/' #Temp Path - Bash script will be created here. With trailing slash
tagid = 197 #If you want to create a tag to flag files that should be backupped, enter the Id here. Else enter 0
@praul
praul / fbshare.sh
Last active May 27, 2021 05:29
Share files to filebrowser docker
#!/bin/bash
#These are two scripts to share and unshare files and folders to filebrowser, that runs in a docker container via docker-compose.
#It works across filesystems and users dockers own mount-binds.
#This image and the corresponding docker-compose.yml has been used: https://github.com/filebrowser/filebrowser
#Additionally you need yaml_cli from here: https://github.com/Gallore/yaml_cli
#See https://gist.github.com/praul/21d0b11aec5a0b71be8e406e9d7858f7#file-fbunshare-sh for unshare script
# Adjust path to docker-compose folder accordingly
# Usage: fbshare.sh <FILE OR FOLDER>
@praul
praul / fbunshare.sh
Created May 27, 2021 05:29
Share files from filebrowser docker
#!/bin/bash
#These are two scripts to share and unshare files and folders to filebrowser, that runs in a docker container via docker-compose.
#It works across filesystems and users dockers own mount-binds.
#This image and the corresponding docker-compose.yml has been used: https://github.com/filebrowser/filebrowser
#See https://gist.github.com/praul/5234338823d61ac794e2fd95befc0b3d for share script
# Adjust path to docker-compose folder accordingly
# Usage: fbunshare.sh <FILE,FOLDER,OR PARTS OF IT>
@praul
praul / caddy-docker-blacklist-label.txt
Created May 27, 2021 08:14
Caddy Docker Blacklist
caddy: "domain.example.com"
caddy.@notblacklisted.not.path: "/login* /login /blacklisted*"
caddy.reverse_proxy: "@notblacklisted {{upstreams 8080 http}}"
@praul
praul / docker-compose.yml
Created June 24, 2021 07:35
Files for mtlynch / mediagoblin-docker
version: "3"
services:
mediagoblin:
image: heimpixel/mediagoblin_stl:01
ports:
- 6543:6543
volumes:
- /docker/user/datas/mediagoblin/media:/var/lib/mediagoblin #Your Media Path. Adjust Path in start.sh accordingly
- /docker/user/datas/mediagoblin/db/mediagoblin.db:/srv/mediagoblin.example.org/mediagoblin/mediagoblin.db #Your Database Path. Adjust Path in start.sh accordingly
@praul
praul / autoreplyer.py
Last active November 2, 2023 20:00
Python out-of-office notice with rebound protection
"""
Automatically replies to mails both unread and unanswered.
This script has a rebound and self mail protection. Also a rate limit protection.
You can adjust the time value with the variable blockhours
Thanks to for original gist: https://gist.github.com/BertrandBordage/e07e5fe8191590daafafe0dbb05b5a7b
WARNING: This answers to any both unread and unanswered mail, even if it is years old.
Don’t use on a mailbox with old messages left unread and unanswered.
Simply subclass ``AutoReplyer``, define the undefined class attribute,
@praul
praul / vmswitcher
Created August 25, 2022 06:46
vmswitch for virsh- shutdown one vm, start another. on shutdown, start the first one again
#!/bin/bash
# chmod +x and run this script directly, NOT with "bash vmswitcher"
# ./vmswitcher -d to run in background
#Enter your vm-ids here
IDLEVM="powersave-server"
ACTIVEVM="bin10"