Skip to content

Instantly share code, notes, and snippets.

View Chris-Graffagnino's full-sized avatar

Chris Graffagnino Chris-Graffagnino

View GitHub Profile
@ekager
ekager / bad_place_notify.py
Last active October 28, 2022 08:18
Searches for specified search terms and sends emails if found
"""
This script will search 4chan (need to specify a board unfortunately) and then
search all comments on Reddit for specific keywords. If found, it will then send
an email with the links to any matching posts.
Because 4chan posts are archived after ~48 hours I would recommend setting this up
to run on that cadence as well.
Sender email will need "Allow less secure apps" to ON or similar setting.
I followed these instructions for setting that up:
@AndrewWestberg
AndrewWestberg / checkpeers.sh
Created January 12, 2020 02:25
Check the yaml file for valid peers before starting jormungandr
#!/bin/bash
cp /home/westbam/cardano/itn_rewards_v1-config.yaml /home/westbam/cardano/itn_rewards_v1-config.yaml.new
# find all addresses that are not commented out
sed -e '/ address/!d' -e '/^[[:space:]]*#/d' -e '/Brainy/d' -e 's@^.*/ip./\([^/]*\)/tcp/\([0-9]*\).*@\1 \2@' /home/westbam/cardano/itn_rewards_v1-config.yaml | \
while read addr port
do
echo "Checking $addr:$port"
RESULT=$(tcpping -x 1 $addr $port)
@michaeljfazio
michaeljfazio / jormon.sh
Last active February 23, 2020 20:52
Jormungandr Node Monitor
#!/bin/bash
#
# Author: Michael Fazio (sandstone.io)
#
# This script monitors a Jormungandr node for "liveness" and executes a shutdown if the node is determined
# to be "stuck". A node is "stuck" if the time elapsed since last block exceeds the sync tolerance
# threshold. The script does NOT perform a restart on the Jormungandr node. Instead we rely on process
# managers such as systemd to perform restarts.
POLLING_INTERVAL_SECONDS=30