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
## This script echoes metrics pulled from borgbase API into a Prometheus agent friendly format | |
## jq is assumed installed | |
## Replace $API_KEY with a read only API key from your BrogBase account | |
## To use, set a cron job to write output of this script to a .prom file to be picked up by Prometheus agent | |
## Output format is as follows, repeated for each repo in account | |
## borg_repo_usage_mb_total{repo_name="<name>",repo_id="<id>"} <used space (mb):float> | |
## borg_repo_last_modified{repo_name="<name>",repo_id="<id>"} <timestamp (s):int) | |
## borg_repo_quota{repo_name="<name>",repo_id="<id>"} <quota size (mb):int> |
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
from itertools import count, cycle | |
from math import ceil, sqrt | |
from numpy import arange, array, full, ones, insert, where | |
from numpy import append as ap | |
from time import perf_counter as pf | |
from time import sleep | |
from tkinter import Canvas, Tk, constants | |
root = Tk() | |
# root.attributes('-fullscreen', True) # make fullscreen window |
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
import typer as t | |
def main(stdscr): | |
string = "Hello World!" | |
# Simple typing of a string | |
t.label(string) | |
# String on same line (default) | |
# Delay (ms) can be adjusted to your liking (default is 40ms) | |
t.label(string, delay=20, nl=0) |