Skip to content

Instantly share code, notes, and snippets.

View kolobus's full-sized avatar

Mihail «Kolo» Fedorov kolobus

View GitHub Profile
@kolobus
kolobus / geofeed.csv
Created January 30, 2024 01:57
Geofeed
2a10:cc40:cc40::/44 IL IL-TA Petah Tiqwa
2a0b:4e00::/29 CH CH-ZH Zurich
2a10:2f01:21a::/48 IL IL-TA Petah Tiqwa
@kolobus
kolobus / ip-cached.sh
Created June 26, 2022 00:33
Fetch new IP and cache it to shared memory
#!/bin/bash
if [ ! -f "/dev/shm/node-ip" ]; then
curl -s4 checkip.amazonaws.com > /dev/shm/node-ip
echo "*********** IP renewed *************"
fi
nn_ipaddress=$(cat /dev/shm/node-ip)
echo $nn_ipaddress
@kolobus
kolobus / cf-ddns.rsc
Last active March 5, 2024 15:15 — forked from ChrisG661/cf-ddns.rsc
Mikrotik RouterOS Cloudflare Dynamic DNS Script
# Cloudflare Dynamic DNS update script
# Required policy: read, write, test, policy
# Add this script to scheduler
# Install DigiCert root CA or disable check-certificate
# Configuration ---------------------------------------------------------------------
:local TOKEN "__TOKEN__"
:local ZONEIDv6 "__ZONEID__"
:local RECORDIDv6 "__RECORDID__"
@kolobus
kolobus / assets.sh
Created June 15, 2017 22:03
Assets random gen
#!/bin/bash
source pubkey.txt
args=("$@")
seed_ip='78.47.196.146'
komodo_binary='./komodod'
delay=2
function komodo_asset ()
{
if [ $[RANDOM % 10] == 1 ]
@kolobus
kolobus / heartbeat.sh
Created December 22, 2016 10:23
Using jq example
#!/bin/bash
cd /mnt/heartbeat
/usr/bin/docker exec heartbeat komodo-cli getinfo > www/heartbeat.json
bid=$(cat www/heartbeat.json | jq '.blocks')
notarized=$(cat www/heartbeat.json | jq '.notarized')
nhash=$(cat www/heartbeat.json | jq '.notarizedhash' | sed -e 's/"//g')
txid=$(cat www/heartbeat.json | jq '.notarizedtxid' | sed -e 's/"//g')
@kolobus
kolobus / keybase.md
Created December 6, 2016 00:03
Keybase proof

Keybase proof

I hereby claim:

  • I am kolobus on github.
  • I am kolo (https://keybase.io/kolo) on keybase.
  • I have a public key whose fingerprint is 493E 0F07 CC48 03F3 DA1F 517C F225 8EF2 C55A 2A2F

To claim this, I am signing this object:

@kolobus
kolobus / ip.php
Created October 16, 2016 17:04
Get external IP
<?php
header("Content-Type: text/plain");
// Comment the following line if you're not under cloudflare
echo @$_SERVER["HTTP_CF_CONNECTING_IP"] ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER["REMOTE_ADDR"];
// Uncomment the following line if you're not under cloudflare
// echo $_SERVER["REMOTE_ADDR"];
@kolobus
kolobus / ni
Created October 16, 2016 16:50
myip=`curl -s4 checkip.amazonaws.com`
sleep 4
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"SuperNET\",\"method\":\"myipaddr\",\"ipaddr\":\"$myip\"}"
tests/addnotarys_7776
./btc_7776
./kmd_7776
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"$myip\"}"
./dpow_7776
sleep 3
./wp_7776
@kolobus
kolobus / whois.db.sh
Created February 12, 2014 22:22
Get list of all active TLD's w/whois server
#!/bin/bash
# 1
wget -qO root.zone http://www.internic.net/domain/root.zone
# 2
cat root.zone | grep "IN\sNS" | awk '{print $1}' | uniq | sort | sed -r 's/\.//g' | sed '/^$/d' > zone.list 2> /dev/null
# 3
@kolobus
kolobus / getsms.php
Last active December 14, 2015 11:28
Replacement for gnokii SMS daemon. Based on http://xgu.ru/wiki/Gnokii but a bit tricky.
<?php
if ($_REQUEST["sender"] == "+7921*******" AND $_REQUEST["pass"] == "****") {
// You're free to do any actions - post to twitter, send another SMS or just write to file
// As I do for displaying this on my homepage
$fp = fopen("/home/kolo/****/****.txt","w");
fwrite($fp, stripslashes($_REQUEST["text"]));
fclose($fp);
mail("kolo@****", "SMS Alarm @ +7926****", var_export($_REQUEST, true)); // Good for debugging
}
?>