Skip to content

Instantly share code, notes, and snippets.

@harding
Created July 21, 2018 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harding/5598a1978a3b997c7360cdb234cb6838 to your computer and use it in GitHub Desktop.
Save harding/5598a1978a3b997c7360cdb234cb6838 to your computer and use it in GitHub Desktop.
Quick script to count nodes in Luke's seeder data
#!/bin/bash -eu
DATA=node-count.data
while git checkout HEAD~30
do
date=$( git log -1 --date=unix | grep ^Date | awk '{ print $2 }' )
echo -n "$date " >> $DATA
## $8 is the 30d uptime; 5..100 shows nodes with uptime >= 5%
awk '{print $8}' seeds.txt | numgrep 5..100 | wc -l >> $DATA
## Show progress
git log -1 | grep ^Date
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment