This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
seq 2 250000 | | |
parallel --bar 'secretcli q block {} | jq -r ".block.last_commit.signatures[].validator_address | [{}-1,.] | @csv"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
banana.com | |
header { | |
Access-Control-Allow-Origin * | |
Access-Control-Allow-Methods * | |
Access-Control-Allow-Headers * | |
} | |
@corspreflight { | |
method OPTIONS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const forge = require("node-forge"); | |
let key = forge.util.createBuffer(new Uint8Array(new Array(32).fill(0x7)).buffer); | |
let iv = forge.util.createBuffer(new Uint8Array(new Array(12).fill(0x0)).buffer); | |
const input = forge.util.createBuffer(); | |
input.putString("banana"); | |
var cipher = forge.cipher.createCipher("AES-GCM", key); | |
cipher.start({ iv: iv }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
go build -ldflags '-linkmode external -extldflags "-static"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put in /etc/systemd/system/script-name.service | |
# Then run `sudo systemctl enable script-name` | |
[Unit] | |
Description=bla bla | |
[Service] | |
Type=oneshot | |
ExecStart=/bin/mount -o remount,exec /dev | |
RemainAfterExit=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker ps -a | | |
tail -n +2 | | |
awk '{print $1}' | | |
xargs -r docker rm -f | |
docker images | | |
tail -n +2 | | |
awk '{print $3}' | | |
xargs -r docker rmi -f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
seq 1000 1000 $(enigmacli status | jq -r .sync_info.latest_block_height) | | |
parallel --bar -P 1 --lb "printf '{} ' ; enigmacli q distribution community-pool --height {} | jq -r '.[].amount'" | | |
awk 'BEGIN{print "block_height,community_pool_scrt"; print "0,0"} {print $1 "," $2/10^6}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl -s http://bootstrap.mainnet.enigma.co:26657/net_info | | |
jq -cr '.result.peers[] | [.node_info.id,.remote_ip,.node_info.listen_addr] | @csv' | | |
tr -d \" | | |
tr , @ | | |
perl -pe 's#\@tcp://.+?:#:#g' | | |
sort > /tmp/peers.txt | |
echo "# Generated at $(date -u --rfc-3339=seconds) by https://gist.github.com/assafmo/a39fdb535f74ce2d6493a1a3f695e4ca" > /home/ubuntu/peers/peers.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat some.log | jq -R 'fromjson? | .date' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
## | |
# CPU scaling_governor=performance | |
## | |
printf 'Setting scaling_governor to performance... ' | |
echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor > /dev/null |