Skip to content

Instantly share code, notes, and snippets.

select setval('public."AutoTagging_Id_seq"', (SELECT MAX("Id")+1 FROM "AutoTagging"));
select setval('public."Commands_Id_seq"', (SELECT MAX("Id")+1 FROM "Commands"));
select setval('public."Config_Id_seq"', (SELECT MAX("Id")+1 FROM "Config"));
select setval('public."CustomFilters_Id_seq"', (SELECT MAX("Id")+1 FROM "CustomFilters"));
select setval('public."CustomFormats_Id_seq"', (SELECT MAX("Id")+1 FROM "CustomFormats"));
select setval('public."DelayProfiles_Id_seq"', (SELECT MAX("Id")+1 FROM "DelayProfiles"));
select setval('public."DownloadClientStatus_Id_seq"', (SELECT MAX("Id")+1 FROM "DownloadClientStatus"));
select setval('public."DownloadClients_Id_seq"', (SELECT MAX("Id")+1 FROM "DownloadClients"));
select setval('public."DownloadHistory_Id_seq"', (SELECT MAX("Id")+1 FROM "DownloadHistory"));
select setval('public."EpisodeFiles_Id_seq"', (SELECT MAX("Id")+1 FROM "EpisodeFiles"));
@Roxedus
Roxedus / prowlarr-migration.md
Last active January 8, 2022 05:43
Writeup on setting up Prowlarr with Postgres

So you hate SQLite

This document will go over the key items for migrating and setting up Postgres support in Prowlarr.

Creation of initial database

We do this also when migrating, this is to ensure Prowlarr sets up the required schema.

Setting up Postgres

#!/usr/bin/env python3
import os
import bencode
import re
import sys
# Inspired by https://github.com/ctminime/QB_Migrate_to_Linux
# Need `pip3 install bencode.py`.
# Run in folder like "/home/user/.local/share/data/qBittorrent/BT_backup/" (configured in qBitTorrent).
# Takes 2 parameters:
@hjbotha
hjbotha / free_ports.sh
Last active May 26, 2024 01:35
Free ports 80 and 443 on Synology NAS
#! /bin/bash
# NEWLY ADDED BACKUP FUNCTIONALITY IS NOT FULLY TESTED YET, USE WITH CARE, ESPECIALLY DELETION
# Developed for DSM 6 - 7.0.1. Not tested on other versions.
# Steps to install
# Save this script in one of your shares
# Edit it according to your requirements
# Backup /usr/syno/share/nginx/ as follows:
# # cd /usr/syno/share/
# # tar cvf ~/nginx.tar nginx
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active May 29, 2024 03:21 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@nrdmn
nrdmn / ipcollapse.py
Last active February 9, 2024 13:57
collapse a list of IP addresses
#!/usr/bin/python3
# reads a list of IP subnets in CIDR notation from stdin and collapses it
import sys
import ipaddress
subnets6 = []
subnets4 = []
input_list = sys.stdin.readlines()
@7596ff
7596ff / dotabrag.py
Created August 11, 2014 17:33
quick dotabrag tweet thing
import urllib
import json
import string
import sys
import ConfigParser
import tweepy
def craftTweet(match_id, level, hero, kills, deaths, assists):
unformatted = 'Just played a match: Hero: Lvl. {} {} K/D/A: {}/{}/{}\nDotabuff: {}'
@denji
denji / README.md
Last active April 25, 2023 21:48
Take a list of CIDR address blocks and combine them, for example, 192.168.0.0/24 and 192.168.1.0/24 gives 192.168.0.0/23. I usually use "list-iana-reserved-ranges | aggregate-cidr-addresses" to get a list of blocks to not report with firewall log processing.
@jasonrudolph
jasonrudolph / git-branches-by-commit-date.sh
Created February 12, 2012 20:40
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r