Skip to content

Instantly share code, notes, and snippets.

@swissrouting
swissrouting / nostream.service
Last active December 25, 2022 02:59
nostream.service
# systemd service to run and monitor Nostream (Nostr TS Relay) automatically.
# Assumes that the user `nostr` exists and that the relay code is located
# in the directory `/home/nostr/nostream`.
[Unit]
Description=Nostr TS Relay
After=network.target
StartLimitIntervalSec=0
[Service]
#!/bin/bash
# Mirrors notes from one nostr relay to another.
#
# Example usage:
# nostr-mirror.sh wss://source.relay.example wss://target.relay.example
# Source relay to fetch events from (wss://...).
SOURCE=$1
# Target relay to send these events to (wss://...).
TARGET=$2
@swissrouting
swissrouting / amboss-ping.sh
Last active October 29, 2022 00:02 — forked from C-Otto/sh
Shell script that sends a health check ping to the Amboss API
#!/bin/bash
# Sends a health check ping to the Amboss API.
# Docs: https://docs.amboss.space/api/monitoring/health-checks
URL="https://api.amboss.space/graphql"
NOW=$(date -u +%Y-%m-%dT%H:%M:%S%z)
echo "Timestamp: ${NOW}"
SIGNATURE=$(lightning-cli signmessage "$NOW" | jq -r .zbase)
echo "Signature: ${SIGNATURE}"
JSON="{\"query\": \"mutation HealthCheck(\$signature: String!, \$timestamp: String!) { healthCheck(signature: \$signature, timestamp: \$timestamp) }\", \"variables\": {\"signature\": \"$SIGNATURE\", \"timestamp\": \"$NOW\"}}"
echo "Sending ping..."