Skip to content

Instantly share code, notes, and snippets.

View AndrewWestberg's full-sized avatar

Andrew Westberg AndrewWestberg

  • NEWM, DripDropz, BCSH, Cardano Developer
  • Florida
  • 09:56 (UTC -04:00)
  • X @amw7
View GitHub Profile
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
#
@AndrewWestberg
AndrewWestberg / crontab
Last active March 21, 2021 00:39
How to send slots to pooltool
# m h dom mon dow command
0 21 * * * /home/westbam/haskell/everyFiveDays.sh && /home/westbam/Development/cncli/nextslots.sh
55 21 * * * /home/westbam/haskell/everyFiveDays.sh && /home/westbam/Development/cncli/sendslots.sh
@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)
#!/bin/bash
cd /home/westbam/cardano/storage
sqlite3 blocks.sqlite "delete from Blocks where hash in (select bi.hash from BlockInfo bi order by depth desc limit 20);delete from BlockInfo where depth in (select depth from BlockInfo order by depth desc limit 20);update Tags set hash=(select hash from BlockInfo order by depth desc limit 1) where name='HEAD';"
#!/bin/bash
cd /home/USERNAME/cardano
BLOCK_HASH=`/home/USERNAME/.cargo/bin/jcli rest v0 node stats get --host http://127.0.0.1:3100/api | grep 'lastBlockHash:' | sed -e 's/^[[:space:]]*//' | sed -e 's/lastBlockHash: //'`
FOUND=`/usr/bin/node /home/USERNAME/cardano/check_for_block.js $BLOCK_HASH`
if [[ "$FOUND" -eq 1 ]]; then
echo "`date`: Block Found!!"
else