This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Parse the output of a duplicati run and upload to prometheus. Assumes duplicati is running in kubernetes and the gateway is as well. | |
# Also requires that duplicati is run with the following commands: | |
# --run-script-after=/scripts/upload_results_to_prometheus.sh --run-script-result-output-format=json | |
import os | |
import prometheus_client | |
import json | |
json_filename = os.environ.get('DUPLICATI__RESULTFILE', '/tmp/latest_duplicati_resultfile.json') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Generates a tree on the command line showing you which pid and query is blocking which. Looks like: | |
Blocking and Blocked Query Tree | |
=============================== | |
2022-06-09 21:14:06.707790 [15257]: (SELECT item.id AS item_id, item.itemid AS item_id) | |
-> 2022-06-09 21:14:17.785848 [15536]: (UPDATE item SET foo_id=187 WHERE item.id = 37454797) | |
-> 2022-06-09 21:14:07.364804 [15280]: (UPDATE item SET foo_id=187 WHERE item.id = 37454797) | |
-> 2022-06-09 21:14:09.445913 [15344]: (UPDATE item SET foo_id=1 WHERE item.id = 37460570) | |
-> 2022-06-09 21:14:07.059882 [15275]: (UPDATE item SET foo_id=1 WHERE item.id = 37460570) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Instructions forged into playbook from https://gist.github.com/strarsis/e533f4bca5ae158481bbe53185848d49 | |
# To use: | |
# - Install ansible (apt-get update -y && apt-get install -y ansible) | |
# - Run "ansible-playbook playbook.yml" wherever you downloaded this gist to. | |
# - Don't forget to "Enable agent for Windows OpenSSH (experimental)" in keepass to allow this to work. | |
--- | |
- name: Setup for keepass | |
hosts: localhost | |
remote_user: root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Searches for all .mkv files in the current directory and below, and converts them using handbrake. | |
import subprocess | |
import os | |
import sys | |
g_preset = "Super HQ 1080p30 Surround" | |
g_output_extension = "m4v" | |
g_output_root_dir = "e:/VideoConverted" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
goto check_Permissions | |
:check_Permissions | |
echo Administrative permissions required. Detecting permissions... | |
net session >nul 2>&1 | |
if %errorLevel% == 0 ( | |
echo Success: Administrative permissions confirmed; continuing. |