Skip to content

Instantly share code, notes, and snippets.

@Safihre
Safihre / SABnzbdUnwantedExtensions.py
Created October 28, 2017 11:21
SABnzbdUnwantedExtensions.py
#!/usr/bin/python -OO
# Copyright 2008-2017 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#!/bin/sh
# See: https://github.com/Radarr/Radarr/wiki/Mass-Delete-via-API
HOST=http://radarr.local:7878
API_KEY= # Settings > General
ids=$(curl --silent $HOST/api/movie -X GET -H "X-Api-Key: $API_KEY" \
| jq '.[] | select(.monitored == false) | .id')
@agc93
agc93 / match-volumes.sh
Created March 20, 2017 00:32
Matching Docker volumes to containers
#!/usr/bin/env bash
for i in $(docker ps -q);do
echo "Container $i"
docker inspect -f '{{ json .Mounts }}' $i | python -m json.tool
echo "-------------------"
done
@nathforge
nathforge / expbackoff.sh
Created December 22, 2016 10:33
Exponential backoff in Bash
expbackoff() {
# Exponential backoff: retries a command upon failure, scaling up the delay between retries.
# Example: "expbackoff my_command --with --some --args --maybe"
local MAX_RETRIES=${EXPBACKOFF_MAX_RETRIES:-8} # Max number of retries
local BASE=${EXPBACKOFF_BASE:-1} # Base value for backoff calculation
local MAX=${EXPBACKOFF_MAX:-300} # Max value for backoff calculation
local FAILURES=0
while ! "$@"; do
FAILURES=$(( $FAILURES + 1 ))
if (( $FAILURES > $MAX_RETRIES )); then
@fffonion
fffonion / cf-ddns.sh
Last active July 4, 2018 10:04
Dynamic DNS script using Cloudflare API v4
#!/bin/bash
# can be A or AAAA
do_record=AAAA
# the interface to get ipv6 address
iface=eth0
# the static suffix we should add to
v6_suf=53
mail="me@email.com"
@JonasGroeger
JonasGroeger / sync-projects
Last active May 15, 2024 01:44
Gitlab: Clone / Pull all projects in a group
#!/usr/bin/env bash
# Documentation
# https://docs.gitlab.com/ce/api/projects.html#list-projects
NAMESPACE="YOUR_NAMESPACE"
BASE_PATH="https://gitlab.example.com/"
PROJECT_SEARCH_PARAM=""
PROJECT_SELECTION="select(.namespace.name == \"$NAMESPACE\")"
PROJECT_PROJECTION="{ "path": .path, "git": .ssh_url_to_repo }"
@munim
munim / youtube-dl-download-pluralsight.md
Last active July 28, 2022 21:19
youtube-dl to download pluralsight videos

Download Plural Sight videos

Software required:

youtube-dl

After installation and putting the youtube-dl in PATH

youtube-dl \
@SamuelChristie
SamuelChristie / tls_1_deprecation.md
Created November 2, 2015 16:08
Explanation of how to detect TLS 1.0 connections and, by way of custom headers, warn the user about the coming change to more modern TLS versions.
@andrealbinop
andrealbinop / setup-modernie-vagrant-boxes.md
Last active May 28, 2023 01:54
Setup modern.ie vagrant boxes

Setup modern.ie vagrant boxes

Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.

However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.

Pre-requisites

@bradcrawford
bradcrawford / feedly_export_saved_for_later
Last active February 26, 2024 07:07
Simple script that exports a users "Saved For Later" list out of Feedly as a JSON string
// Simple script that exports a users "Saved For Later" list out of Feedly
// as a JSON string.
//
// This was intended for use in the Google Chrome's "Inspector" tool so your
// mileage may vary if used in other contexts.
//
// Format of JSON is as follows:
// [
// {
// title: "Title",