Skip to content

Instantly share code, notes, and snippets.

@menzow
menzow / Makefile.am
Created September 14, 2017 12:01
Added missing dependencies to fbthrift Makefile
#
# 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
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
.htaccess
example.htaccess
_.htaccess
sample.htaccess
a.htaccess
.git/config
.cig
.git
htaccess_for_page_not_found_redirects.htaccess
debug
@menzow
menzow / just-read-dark-system-fonts.css
Created April 9, 2018 17:04
Simple just read! (chrome extension) theme. Uses no external fonts or resources.
* {
-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;
@menzow
menzow / slurp-test.sh
Created May 7, 2018 07:57
Run slurp and grep time_wait sockets. Works on both linux as macos.
#!/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 / whois.sh
Created May 24, 2018 03:06
JSON whois cli [https://jsonwhois.io/] [bash]
#!/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 / alexa-top-1m-tlds-counted.txt
Created July 12, 2018 15:36
Counted the top level domains of Alexa top 1 million sites. ( Counted in July 2018 )
49373 com
5323 net
3819 org
3699 ru
2761 jp
2714 cn
1697 de
1581 br
1474 in
1056 fr
@menzow
menzow / get_gcp_ip_ranges.sh
Created October 13, 2018 02:53
Recursively fetch all google cloud platform (gcp) ip address ranges. Outputs both ipv4 and ipv6 ranges in parsable format.
#!/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-