Skip to content

Instantly share code, notes, and snippets.

@borouhin
borouhin / seafile_collector.sh
Last active September 18, 2023 03:52
Seafile Collector for Prometheus Node Exporter
#!/bin/bash
# Get some useful Seafile metrics to be comsumed by Node Exporter's text collector (so that we don't need to write
# a separate exporter for Seafile)
# Fill in authorization token and server address (see below) and let this script run via cronjob at desired frequency
#
# Requires curl and jq to be installed (and prometheus-node-exporter, of course)
# Assumes there are no more than 1000 users, libraries and devices (otherwise increase per page limit or implement paging)
#
# If an error is encountered during API call, previous values are preserved and seafile_collector_result metric
@borouhin
borouhin / update_antirkn_bgp.sh
Last active May 7, 2022 09:08
Make Bird 2 config for serving RKN blocked routes
#!/bin/bash
# Requires libnet-cidr-lite-perl installed
# Best practices
set -Eeuo pipefail
# Local WAN Interface (using interface, not IP, so that we need not change the script on WAN IP changes)
WAN_IFACE='eth0'
# Local AS