Skip to content

Instantly share code, notes, and snippets.

@bg002h
Last active November 3, 2020 00:17
Show Gist options
  • Save bg002h/ce5f5e6a5432395f2d19a9f0d5bf819c to your computer and use it in GitHub Desktop.
Save bg002h/ce5f5e6a5432395f2d19a9f0d5bf819c to your computer and use it in GitHub Desktop.
Blockstream Satellite monitoring scripts
FileName: WhatHaveIGot
#!/bin/bash
cat $1 | grep -P "[0-9]{1,6}\) - G" -o | grep -P "[0-9]{1,6} -o | uniq | sort -g
FileName: MissingInSequence
#!/bin/bash
awk '{for(i=p+1; i<$1; i++) print i} {p=$i}' $1
FileName: RangeMissingInSequence
#!/bin/bash
awk 'NR==1{first=$1; last=$1} $1==last+1{last=$1; next} first==last{print first; first=$1; last=first; next} {print first, last; first=$1; last=first} END{print first, last}' $1
USAGE
WhatHaveIGot ./debug.log | MissingInSequence | RangeMissingInSequence | less
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment