This file contains 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
<?php | |
$data = "lazy dog"; | |
foreach (hash_algos() as $v) { | |
$r = hash($v, $data, false); | |
printf("%-12s %3d %s\n", $v, strlen($r), $r); | |
} | |
/* |
This file contains 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
CREATE OR REPLACE FUNCTION inet_aton(ip) AS ( | |
cast( | |
split_part(ip, '.', 1)::UINTEGER * 16777216 + | |
split_part(ip, '.', 2)::UTINYINT * 65536 + | |
split_part(ip, '.', 3)::UTINYINT * 256 + | |
split_part(ip, '.', 4)::UTINYINT as UINTEGER) | |
); | |
-- select inet_aton('255.255.255.252'); |
This file contains 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
function getY(max, height, diff, value) { | |
return parseFloat((height - (value * height / max) + diff).toFixed(2)); | |
} | |
function removeChildren(svg) { | |
[...svg.querySelectorAll("*")].forEach(element => svg.removeChild(element)); | |
} | |
function defaultFetch(entry) { | |
return entry.value; |
This file contains 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
<?php | |
class File_Streamer | |
{ | |
private $_fileName; | |
private $_contentLength; | |
private $_destination; | |
public function __construct() | |
{ | |
if (!isset($_SERVER['HTTP_X_FILE_NAME']) |
This file contains 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
# https://help.duckduckgo.com/duckduckgo-help-pages/results/duckduckbot/ | |
20.191.45.212 | |
23.21.227.69 | |
40.88.21.235 | |
50.16.241.113 | |
50.16.241.114 | |
50.16.241.117 | |
50.16.247.234 | |
52.5.190.19 |
This file contains 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
#!/usr/bin/env bash | |
cd /usr/share/GeoIP; | |
curl -LRO https://download.db-ip.com/free/dbip-country-lite-$(date +%Y-%m).mmdb.gz; | |
curl -LRO https://download.db-ip.com/free/dbip-city-lite-$(date +%Y-%m).mmdb.gz; | |
curl -LRO https://download.db-ip.com/free/dbip-asn-lite-$(date +%Y-%m).mmdb.gz; | |
gunzip dbip-$(date +%Y-%m).mmdb.gz; | |
ln -sf dbip-country-lite-$(date +%Y-%m).mmdb dbip-country-lite.mmdb; | |
ln -sf dbip-city-lite-$(date +%Y-%m).mmdb dbip-city-lite.mmdb; | |
ln -sf dbip-asn-lite-$(date +%Y-%m).mmdb dbip-asn-lite.mmdb; | |
geoipupdate -v; |
This file contains 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
tac $HISTFILE | awk '!x[$0]++' | tac | sponge $HISTFILE | |
awk '!x[$0]++' ~/.bash_history | |
tac ~/.bash_history | awk '!x[$0]++' | tac | |
# https://medium.com/@dblume/have-only-unique-lines-in-your-bash-history-941e3de68c03 |
This file contains 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
var s=document.body.innerText.split("\n"); | |
console.log(s.length); | |
var nn=s.map(v=>{try {var x=JSON.parse(v)}catch(err){console.log(v);}return x||[];}).flat(); | |
document.body.innerHTML="<pre>" + | |
nn.sort(sdl).map(n=>{try{var h=new URL(n.url||n.hostname).hostname}catch(err){h=n.url}; return [n.id,(''+n.rtt).padStart(3),(0.001+n.dl).toFixed(0).padStart(4,' '),(0.001+n.elapsed).toFixed(1).padStart(4,' '),(n.country||n.cc).padEnd(20," "),n.name.padEnd(20," "),n.ip,h||n.url||n.hostname].join("\t");}).join("\n") | |
+"</pre>"; | |
console.log(nn.length); | |
function srtt(a,b){return a.rtt-b.rtt} | |
function sdl(a,b){return b.dl-a.dl} |
This file contains 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
(async function() { | |
var cl = Array.from(document.getElementsByName("countryCodes[]")[0].options).map(v => v.value); | |
var a=[]; | |
console.log(cl); | |
for (var cn of cl) { | |
r = await fetch("https://www.ip2location.com/free/visitor-blocker", { | |
"headers": { | |
"content-type": "application/x-www-form-urlencoded", | |
}, | |
"referrer": "https://www.ip2location.com/free/visitor-blocker", |
NewerOlder