snippets

device IP addresses

my PC changes its internal address frequently, which can cause problems when interacting with my servers. this function also prints the external address, because if i’m checking my IP then i might as well see if that’s changed again too.

the text is piped to lolcat because i like rainbows and cute things. you can take that out if you want.

	# print internal & external IPs
function whatip() {
	echo -n "internal IP: " | lolcat -p 0.7; hostname -I | awk '{print $1}'
	echo -n "external IP: " | lolcat -p 0.7; curl -4 icanhazip.com
}