Skip to content

Instantly share code, notes, and snippets.

@DieselTech
DieselTech / Docker-Clean
Created October 15, 2017 02:42
Cleanup Docker
List all containers (only IDs)
docker ps -aq
Stop all running containers
docker stop $(docker ps -aq)
Remove all containers
docker rm $(docker ps -aq)
Remove all images
@DieselTech
DieselTech / kavita_create_libraries_from_folders.py
Created April 26, 2023 22:34
Scans the top level directory of folders and submits them to kavita's API as their own library path.
import os
import requests
path = "M:\comics" # Replace with the path to your comics || This is for if your running the script on a different machine than your kavita host.
exclude_list = ["Marvel", "DC Comics", "Image"] # Replace with your publisher names to exclude. Thsese are generally the biggest folders in the library and will take a long time to scan.
url = "http://192.168.0.100:3995/api/Library/create" # Change with your own instances URL
jwt_token = "YOUR_JWT_TOKEN"
# Get your own JWT token by going to dev tools in your web browser, opening up the 'Storage' tab and then go to local storage. The token can be tricky to copy and paste since it's crazy long.
@DieselTech
DieselTech / Robocopy-CreateMylarBackup.ps1
Last active August 17, 2023 03:50
Creates a scheduled task to backup mylar3 using robocopy.
##############
# Mylar Backup using built-in robocopy. This creates 2 files, MylarRobocopyBackup.bat and MylarRobocopyBackup.ps1. The bat file is just used to call the .ps1 due to task scheduler not liking native .ps1 fiels somehow in 2023.
# The .ps1 file will stop the docker mylar3 container and then run robocopy on the db and ini files, then start the container back up.
# Dump the backup portion of the script.
$CreatePowershell = @'
# Setting variables - Change these to your mylar folder and where you want the backups to go to.
$mylarSource= "D:\Projects\Docker\mylar\mylar"
$mylarBackup= "D:\Projects\Backups\Mylar"