Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
for id in $(cat $1);
do
echo "Allocate $id, Amount $2"
graph indexer rules set $id allocationAmount $2 parallelAllocations 1 decisionBasis always
done
import sys
with open(sys.argv[1], 'r') as f:
n = 0
for line in f:
if len(line) > n:
n = len(line)
with open(sys.argv[1], 'r') as f:
for line in f:
new = '{}{}'.format(line[0].lower(), line[1:]).strip().ljust(n)
#!/bin/bash
# Loga may contain different subgraphs - filter subgrafs manualy first of all
NAME_BASE=$(echo $1 | cut -d'.' -f 1)
SUMMARY_JSONL="${NAME_BASE}-summary.jsonl"
OUTPUT_JSONL="${NAME_BASE}.jsonl"
TREEBUF="${NAME_BASE}.treebuf"
AGORA=<PATH>agora1/agora/target/release/agora
echo "Converting log to jsonl $1"
# Script to convert ipfs to b58decode, eg QmTN6gMCBCYTgbis33eSvr6sLsQoQ3R6a2KzR7CqmMABQP -> '0xdfffeffgkjfijfoiqfioqmfqiomfdfffeffgkjfijfoiqfioqmfqiomf
# Require: file with list of ipfs: each row is one ipfs
# Usage: python3 convert-ipfs-to-bytes32.py file.csv
import binascii
import base58
import sys
def ipfs_b32(ipfs):
output = base58.b58decode(ipfs)
output = output[2:]
#!/bin/bash
# Log may contain different subgraphs - filter subgrafs manualy first of all
# query.20201126_44.log
GRAPHS_LIST="<PATH>/all-graphs-list.csv"
TIMESTAMP=$(date --date="yesterday" +%Y%m%d)
#NAME_BASE=$(echo $1 | cut -d'.' -f 1,2)
NAME_BASE="query.${TIMESTAMP}"
LOGS="/fluentd/log/query-node/${NAME_BASE}*"
SUMMARY_JSONL="/fluentd/log/summary/${NAME_BASE}.summary.jsonl"
@davaymne
davaymne / Grafana - Main Page
Last active January 12, 2021 11:36
Grafana - Main Page
{
"__inputs": [
{
"name": "DS_GRAPHQL_DATA SOURCE",
"label": "GraphQL Data Source",
"description": "",
"type": "datasource",
"pluginId": "fifemon-graphql-datasource",
"pluginName": "GraphQL Data Source"
},