This file contains hidden or 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
| powershell Get-DnsClientCache ^| Export-Csv dnclientcache-1.txt &node c:\rgr\bsync2.js dnclientcache-1.txt |
This file contains hidden or 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 sh | |
| curl -s https://www.iblocklist.com/lists.php | sed -n "s/.*value='\(http:.*\)'.*/\1/p" | xargs curl -L -s | gunzip | grep -P '\d+\.\d+\.\d+\.\d+' |
This file contains hidden or 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
| jq -r "[.value, .name, .timestamp] | @tsv" 2018-04-27-1524816001-fdns_a.json |
This file contains hidden or 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
| const ip4ToInt = ip => | |
| ip.split('.').reduce((int, oct) => (int << 8) + parseInt(oct, 10), 0) >>> 0; | |
| const isIp4InCidr = ip => cidr => { | |
| const [range, bits = 32] = cidr.split('/'); | |
| const mask = ~(2 ** (32 - bits) - 1); | |
| return (ip4ToInt(ip) & mask) === (ip4ToInt(range) & mask); | |
| }; | |
| const isIp4InCidrs = (ip, cidrs) => cidrs.some(isIp4InCidr(ip)); |
This file contains hidden or 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 suffix_black_list=[ | |
| "xml", | |
| "atom", | |
| "rss", | |
| "mml", | |
| "txt", | |
| "jad", | |
| "wml", | |
| "htc", | |
| "woff", |
This file contains hidden or 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
| icmp fast ping (50) | |
| psping -i 0 -n 50 www.google.com | |
| tcp ping | |
| psping -i 0 -n 10 www.google.com:443 | |
| tcp server for latency and bandwidth tests | |
| psping -s 10.0.0.1:5000 | |
| tcp latency test (8KB) | |
| psping -l 8k -n 1000 10.0.0.1:5000 | |
| tcp bandwidth test | |
| psping -b -l 8k -n 30s 10.0.0.1:5000 |
This file contains hidden or 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 inet_aton(a) { | |
| return a.split(".").reduce(function(a, b) { | |
| return (a << 8) + parseInt(b, 10); | |
| }, 0) >>> 0; | |
| } | |
| function inet_ntoa(a) { | |
| return (a >>> 24) + "." + (a >> 16 & 255) + "." + (a >> 8 & 255) + "." + (a & 255); | |
| } |
This file contains hidden or 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", |
This file contains hidden or 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 hidden or 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 |
OlderNewer