Skip to content

Instantly share code, notes, and snippets.

Avatar

Menzo Wijmenga menzow

View GitHub Profile
@menzow
menzow / get_gcp_ip_ranges.sh
Created Oct 13, 2018
Recursively fetch all google cloud platform (gcp) ip address ranges. Outputs both ipv4 and ipv6 ranges in parsable format.
View get_gcp_ip_ranges.sh
#!/bin/bash
netblocks=$(dig @8.8.8.8 txt _cloud-netblocks.googleusercontent.com +short | grep -Eo '_cloud\S+')
function get_netblock_ips {
response=$(dig @8.8.8.8 txt +short "$1")
for block in $(echo "$response" | grep -Eo 'include:\S+' | cut -d: -f2 ); do
get_netblock_ips "$block"
done
echo "$response" | grep -Eo 'ip[46]:\S+' | cut -d: -f2-
@menzow
menzow / alexa-top-1m-tlds-counted.txt
Created Jul 12, 2018
Counted the top level domains of Alexa top 1 million sites. ( Counted in July 2018 )
View alexa-top-1m-tlds-counted.txt
49373 com
5323 net
3819 org
3699 ru
2761 jp
2714 cn
1697 de
1581 br
1474 in
1056 fr
View whois.sh
#!/bin/bash
# dependencies: jq, curl, bash
# Usage: ./whois.sh example.com
# Caches lookups in /var/cache/whois
# Sign up for api key here: https://jsonwhois.io/register
domain="$1"
cache_dir='/var/cache/whois'
cache_entry="$cache_dir/$domain"
json_whois_api_key="YOUR_API_KEY"
[[ ! -d "$cache_dir" ]] && mkdir -p "/var/cache/whois"
@menzow
menzow / slurp-test.sh
Created May 7, 2018
Run slurp and grep time_wait sockets. Works on both linux as macos.
View slurp-test.sh
#!/bin/bash
function socket_count(){
if [[ "$OSTYPE" == "darwin"* ]]; then
sysctl net.inet.tcp.tw_pcbcount | awk '{ print $2 }'
else
netstat -n | grep -i 80| grep -i time_wait | wc -l
fi
}
printf "Starting slurp..." && (slurp keyword -t example,example1,example2 &>/dev/null &)
sockets="$()"
@menzow
menzow / just-read-dark-system-fonts.css
Created Apr 9, 2018
Simple just read! (chrome extension) theme. Uses no external fonts or resources.
View just-read-dark-system-fonts.css
* {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
body {
font-family: Georgia,Cambria,"Times New Roman",Times,serif;
line-height: 1.75em;
font-size: 16px;
background-color: #212324;
View common-filenames
.htaccess
example.htaccess
_.htaccess
sample.htaccess
a.htaccess
.git/config
.cig
.git
htaccess_for_page_not_found_redirects.htaccess
debug
View bistro.tests.output.log
UpdateCTestConfiguration from :/home/bistro/bistro/cmake/Debug/DartConfiguration.tcl
UpdateCTestConfiguration from :/home/bistro/bistro/cmake/Debug/DartConfiguration.tcl
Test project /home/bistro/bistro/cmake/Debug
Constructing a list of tests
Done constructing a list of tests
Checking test dependency graph...
Checking test dependency graph end
test 1
Start 1: test_sqlite
@menzow
menzow / Makefile.am
Created Sep 14, 2017
Added missing dependencies to fbthrift Makefile
View Makefile.am
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
You can’t perform that action at this time.