Skip to content

Instantly share code, notes, and snippets.

@gaia
gaia / tezos-reward-gaps.sh
Created Dec 18, 2019
tezos-reward-gaps.sh: show time between baking/endorsing to help schedule node maintenance
View tezos-reward-gaps.sh
#!/bin/bash
# This script will only show time gaps between future endorsing slots.
# You need to install JQ: https://stedolan.github.io/jq/
# Enter your path to tezos-client here, without a trailing slash
tc="/home/tezos/tezos/tezos-client"
delegate="tz1______________"
timezone="America/New_York"
@gaia
gaia / privconnect.sh
Last active Dec 18, 2019
Tezos-Node: If Connection To Private Node is Lost, Trust then Connect
View privconnect.sh
#!/bin/bash
# Usage ./privconnect.sh 300 1.1.1.1
# checks twice, 300 seconds in between, if the node the script is being run on
# is connected to 1.1.1.1:9732. If it isn't trust then connect.
# Run it from cron, make sure the cron interval is greater than the sleep period
# between connection checks in this script. 2x or 3x the sleep period is good.
timeallowed=$1
privnodeip=$2
@gaia
gaia / blockspermin.sh
Last active Sep 15, 2019
Harmony (ONE): Blocks Per Minute & Seconds Between Blocks
View blockspermin.sh
#!/usr/bin/env bash
# This scripts takes no arguments.
blockearn="0.111"
onehour=$(curl -s https://harmony.one/1h | tr -d '[:blank:]' | sed -n '/EARNING/,/NOTEARNING/p')
average0=$(echo "$onehour" | sed -n "/Shard0/,/^$/p" | tail +3 | head -n-1 | sed 's/.*://g' | awk -v N=1 '{ sum += $N } END { if (NR > 0) print sum / NR }')
average1=$(echo "$onehour" | sed -n "/Shard1/,/^$/p" | tail +3 | head -n-1 | sed 's/.*://g' | awk -v N=1 '{ sum += $N } END { if (NR > 0) print sum / NR }')
average2=$(echo "$onehour" | sed -n "/Shard2/,/^$/p" | tail +3 | head -n-1 | sed 's/.*://g' | awk -v N=1 '{ sum += $N } END { if (NR > 0) print sum / NR }')
@gaia
gaia / average.sh
Last active Sep 15, 2019
Harmony (ONE): your node versus your the other nodes in your shard's average, in %, with alerts.
View average.sh
#!/usr/bin/env bash
# This script will not alert in the first few minutes (seconds_between_alerts)
# the first time it is run (e.g., shard$1-lastalert.txt does not exist)
# Also, it waits for $seconds_wait seconds before running for the first time (in case it is being run by cron)
# Usage: ./average.sh 3 one1xxxxxxxxxxxxxxxxxxxxxxxxxxxx
# That's the shard number followed by your address in that shard
# Optionally, if you just want the stats shown, use
# ./average.sh 3 one1xxxxxxxxxxxxxxxxxxxxxxxxxxxx status
@gaia
gaia / balance-at-cycle.sh
Last active Mar 21, 2019
Tezos; query balance at end of cycle
View balance-at-cycle.sh
#!/bin/bash
# USAGE: script.sh cyclenumber
# EXAMPLE: balance-at-cycle.sh 80
# REQUIRES: bc
# Note that rewards and bond are released on the last block of a cycle.
# For this reason, the amount you get here is the amount at the end of the cycle entered.
# So if you want to find out the balance at the beggining of cycle 80, you'd enter 79 in this script
# See this answer for more info:
@gaia
gaia / ChromeAppDownloader.py
Created Feb 13, 2019 — forked from arulrajnet/ChromeAppDownloader.py
Python Script to download the Chrome Extensions (CRX) file directly from the google chrome web store.
View ChromeAppDownloader.py
# -*- coding: utf-8 -*-
"""
Python Script to download the Chrome Extensions (CRX) file directly from the google chrome web store.
Referred from http://chrome-extension-downloader.com/how-does-it-work.php
"""
from __future__ import division
import argparse
import requests
View genesis_public_key
047ad5f2a62779643cd64e5d4217daaae51903f2f0e654c18c0ac5f47591d02f6956a5dc2d29a5fd0cc5ceff86df5ce23f89e532a8b1743c0f59ff4ab8eec40ad8
View keybase.md

Keybase proof

I hereby claim:

  • I am gaia on github.
  • I am eddieb (https://keybase.io/eddieb) on keybase.
  • I have a public key whose fingerprint is 1E9D A50C C5DB F7BD 0AC5 67D5 6357 5EE3 F0F9 FAFC

To claim this, I am signing this object:

You can’t perform that action at this time.