Skip to content

Instantly share code, notes, and snippets.

View kolobus's full-sized avatar

Mihail «Kolo» Fedorov kolobus

View GitHub Profile
@kolobus
kolobus / snipplr.jquery.js
Created November 7, 2012 20:32
Snip autoload on jquery
if ($('div.snip').length) {
$('head').append($('<link rel="stylesheet" href="/i/snipplr.css" type="text/css" media="screen" />'));
$('div.snip').each( function() {
$.getJSON('/i/snipplr.php?id='+$(this).attr('id'), function(snip) {
$('div.snip#'+snip.id).html(snip.source+'<p>View this snippet <a href="'+snip.link+'" target="_blank">on Snipplr</a></p>');
$('div.snip#'+snip.id+' li:odd').css("background-color", "#e0e0e0");
});
});
}
@kolobus
kolobus / traceroute.php
Last active December 12, 2015 03:28
Simple PHP backend used for ip.cx traceroute backend locations (some ot them).
<?php
$do = preg_match("/^[a-z0-9-.]+$/iD", $_GET["host"]);
if ($do) {
$host = escapeshellcmd($_GET["host"]);
passthru("`which traceroute` -m15 -w3 ".$host." 2>&1");
} else {
echo "Invalid input.";
}
?>
@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
}
?>
@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 / 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 / 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 / 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 / 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 / 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 / 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__"