Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am larsaam on github.
  • I am larsjoo (https://keybase.io/larsjoo) on keybase.
  • I have a public key ASA82snFPbfsabsHubnu9B9-5eIb-nUPSDDMFCfqeSapgwo

To claim this, I am signing this object:

@larsaam
larsaam / block_china_ufw.sh
Created June 4, 2019 15:24 — forked from lewg/block_china_ufw.sh
UFW blocks for China, Korea, Malaysia, Phillipines, Singapore, Thailand and Vietnam netblocks
#!/bin/sh
# UFW blocks for China, Korea, Malaysia, Phillipines, Singapore, Thailand and Vietnam netblocks
# Based on http://www.wizcrafts.net/chinese-iptables-blocklist.html
# Cambodia (KH)
ufw deny from 114.134.184.0/21 to any port 22
# Chinese (CN) IP addresses follow:
ufw deny from 1.192.0.0/13 to any port 22
ufw deny from 1.202.0.0/15 to any port 22
@larsaam
larsaam / hostlookup
Created May 16, 2019 10:12 — forked from amitailanciano/hostlookup
simple host lookup script with reverse dns
#!/bin/sh
if [ $# -eq 0 ]; then
echo "A domain name to look up is required";
exit;
fi
ips=( $(host $1 | grep -Eo 'has address.*' | grep -Eo [0-9\.].*) )
if [ ${#ips[@]} -gt 0 ]; then
for ip in "${ips[@]}"; do