3 ms·
I was inspired to write a small bash script to let you know which ip exactly to go to. It is hackish due to my limited knowledge of sed but it works on my Mac a
by scottrogowski 14y ago
I was inspired to write a small bash script to let you know which ip exactly to go to. It is hackish due to my limited knowledge of sed but it works on my Mac at least
#!/bin/bash
ip=`ifconfig -r en0 inet | sed -E '/en0/d;s/inet[ \t]([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).+/\1/'`
ip=`echo $ip | tr -d '[:space:]'`
echo "Go to $ip:8000 in a browser on your local network. When you are done, use ctrl-c to exit"
python -m SimpleHTTPServer 8000