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
h2d(){ | |
echo $((16#$@)) | |
} |
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
V="9ad6a83" # Commit hash when modified, known working | |
START_MODIFIED=$(git log -n 1 --pretty=format:%h -- start.sh) # Last commit start.sh was modified | |
if [ "$V" != "$START_MODIFIED" ] | |
then | |
echo "UHOH! start.sh was updated, you need to update the custom start file!" | |
echo "Expected: [$V] | Retrieved: [$START_MODIFIED]" | |
else |
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 http = require('follow-redirects').http; | |
//top 1000 | |
var domains = ["google.com","facebook.com","youtube.com","yahoo.com","baidu.com","wikipedia.org","qq.com","linkedin.com","live.com","twitter.com","amazon.com","blogspot.com","taobao.com","google.co.in","sina.com.cn","wordpress.com","yahoo.co.jp","yandex.ru","bing.com","ebay.com","google.de","vk.com","hao123.com","163.com","tumblr.com","pinterest.com","google.co.uk","google.fr","googleusercontent.com","microsoft.com","msn.com","ask.com","mail.ru","google.co.jp","google.com.br","weibo.com","apple.com","paypal.com","google.ru","instagram.com","google.com.hk","xvideos.com","blogger.com","google.it","tmall.com","google.es","imdb.com","soso.com","craigslist.org","sohu.com","360.cn","go.com","amazon.co.jp","stackoverflow.com","bbc.co.uk","xhamster.com","google.com.mx","neobux.com","google.ca","fc2.com","cnn.com","imgur.com","alibaba.com","wordpress.org","flickr.com","espn.go.com","adcash.com","huffingtonpost.com","odnoklassniki.ru","t.co","conduit.com","thepira |
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
const subnetMap = { 8: 16777214, 9: 8388606, 10: 4194302, 11: 2097150, 12: 1048574, 13: 524286, 14: 262142, 15: 131070, 16: 65534, 17: 32766, 18: 16382, 19: 8190, 20: 4094, 21: 2046, 22: 1022, 23: 510, 24: 254, 25: 126, 26: 62, 27: 30, 28: 14, 29: 6, 30: 2, 31: 1}; | |
const AWS_IP_RANGE_URL = 'https://ip-ranges.amazonaws.com/ip-ranges.json'; | |
const CORS_URL = 'https://jsonp.afeld.me/?url=' + AWS_IP_RANGE_URL; | |
function filterUnique(p, c, i) { ~~p.indexOf(c) && p.push(c); return p; }; | |
fetch(CORS_URL) | |
.then(function(response) { | |
response |
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
_ssl() { | |
local adr=$1; | |
local _d; | |
_d=$( | |
echo -n \ | |
| openssl s_client -connect "$adr":443 2>/dev/null \ | |
| openssl x509 -noout -text \ | |
); | |
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
_dig() { | |
local domain=$1; | |
local type=$2; | |
dig "$domain" -t "$type" \ | |
| sed -n '/;; ANSWER SECTION/,/^$/p' \ | |
| sed '1d' \ | |
| sed '/^$/d'; | |
} |
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
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
Read 4K randomly from SSD* 150,000 ns 0.15 ms |
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
# req: prips | |
curl https://ip-ranges.amazonaws.com/ip-ranges.json \ | |
| grep -B 2 CLOUDFRONT \ | |
| grep 'ip_prefix' \ | |
| awk '{ print $2 }' \ | |
| tr -d '",' \ | |
| xargs -I{} prips {} |
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
#!/bin/bash | |
host01_temp() { | |
local key="host01.cpu.temp" | |
local temp=$(ssh stats@10.0.0.1 sensors | grep 'Physical id' | awk -F':' '{print $2 }' | awk '{print $1}' | tr -d '+' | tr -d '°C') | |
echo "$key $temp" | |
} | |
statsd `host01_temp` |
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
perl -MTime::HiRes -e 'printf("%.0f\n",Time::HiRes::time()*1000)' |
OlderNewer