Skip to content

Instantly share code, notes, and snippets.

View kolobus's full-sized avatar

Mihail «Kolo» Fedorov kolobus

View GitHub Profile
@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 / 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");
});
});
}