Skip to content

Instantly share code, notes, and snippets.

View inigoflores's full-sized avatar

Iñigo Flores inigoflores

View GitHub Profile
%% -*- erlang -*-
[
{kernel,
[
%% force distributed erlang to only run on localhost
{inet_dist_use_interface, {127,0,0,1}}
]},
{lager,
[
{suppress_supervisor_start_stop, true},
@inigoflores
inigoflores / lost_witness_ratio.sh
Last active January 31, 2022 23:00
Pisces - Get the lost witness ratio due to network problems
#!/bin/bash
echo "Checking the logs...\r\n"
total=$(grep -hE 'miner_onion_server:decrypt:{[0-9]+,[0-9]+} sending witness at RSSI' /home/pi/hnt/miner/log/console.log* |wc -l)
lost=$(cat /home/pi/hnt/miner/log/console.log* |grep "max retry" |wc -l)
delivered=$(grep -hE 'successfully sent witness to challenger' /home/pi/hnt/miner/log/console.log* | wc -l)
percentage=$(echo "print(round($lost/$total*100,2))" | python3)
echo "Witnesses\r";
echo "---------------------------------------";
echo "Total received = $total\r";
@inigoflores
inigoflores / Fix_pisces_P100_lan.md
Last active August 22, 2023 22:05
Fix Pisces P100 Lan
@inigoflores
inigoflores / pisces_fix_lan.sh
Created January 12, 2022 22:01
Pisces Fix Lan
#!/bin/bash
sudo sed -i "/# By default this script does nothing./a\\\n# Fix Pisces 1Gb Ethernet problem\n/sbin/ethtool -s eth0 advertise 0x0f &\n\n" /etc/rc.local
@inigoflores
inigoflores / pisces_witnessed_beacons.sh
Last active January 12, 2022 19:15
Pisces Witnessed Beacons
#!/bin/bash
grep -hE 'miner_onion_server:decrypt:{[0-9]+,[0-9]+} sending witness at RSSI' /home/pi/hnt/miner/log/console.log* |\
awk '{print $1,$2,$10,$14}' | \
sort -n | awk '{printf "%s %s | RSSI: %s SNR: %s Noise: %s\n", $1, $2, $3, $4, ($3-$4)}'
@inigoflores
inigoflores / pisces_noise_profile.sh
Last active February 16, 2022 11:52
Pisces RSSI/SNR Profile
#!/bin/bash
grep -E 'miner_onion_server:decrypt:{[0-9]+,[0-9]+} sending witness at RSSI' /home/pi/hnt/miner/log/console.log* | \
awk '{print $10,$14}' | sort -nr | uniq -c | \
awk '{printf "RSSI: %s SNR: %s Noise: %s, Count: %s\n", $2, $3, ($2 - $3), $1}'
@inigoflores
inigoflores / gist:93d51d37291212e1dbfca9fc6b649d68
Created December 19, 2021 14:09
helium miner send_witness -> not found ; Wait 30 seconds ; send_witness -> client sending data
2021-12-19 00:39:20.499 7 [info] <0.1664.0>@miner_onion_server:decrypt:370 could not decrypt packet received via radio: treating as a witness
2021-12-19 00:39:20.499 7 [info] <0.19143.2>@miner_onion_server:send_witness:188 sending witness at RSSI: -118, Frequency: 868.3, SNR: -12.5
2021-12-19 00:39:21.383 7 [info] <0.19143.2>@libp2p_transport_relay:connect_to:71 init relay transport with ["/p2p/112KFuDzLJVs5pNR858DAqnxdHYVoNTd87NEGaPVTCJxjaCMkuEs/p2p-circuit/p2p/1126dZdgunc3nGzQby66HKMawEnrDs51wYXzRqSyxFUwHeD
Nv64M","/p2p/112KFuDzLJVs5pNR858DAqnxdHYVoNTd87NEGaPVTCJxjaCMkuEs","/p2p/1126dZdgunc3nGzQby66HKMawEnrDs51wYXzRqSyxFUwHeDNv64M"]
2021-12-19 00:39:22.724 7 [warning] <0.19143.2>@miner_onion_server:send_witness:243 failed to dial challenger "/p2p/1126dZdgunc3nGzQby66HKMawEnrDs51wYXzRqSyxFUwHeDNv64M": [{"/p2p/112KFuDzLJVs5pNR858DAqnxdHYVoNTd87NEGaPVTCJxjaCMkuEs
/p2p-circuit/p2p/1126dZdgunc3nGzQby66HKMawEnrDs51wYXzRqSyxFUwHeDNv64M",not_found}]
2021-12-19 00:39:52.727 7 [info] <0.19143.2>@miner_onion_server:
@inigoflores
inigoflores / cp09640.geojson
Created June 19, 2017 10:33
Código Postal 09640 (Burgos)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@inigoflores
inigoflores / cp46800.geojson
Last active June 19, 2017 10:24
Código Postal 46800 (Xátiva)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@inigoflores
inigoflores / carto-menos-ine.geojson
Last active June 19, 2017 10:37
Codigos postales en ds-codigos-postales-cartociudad que no están en ds-codigos-postales-ine
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.