This document is publicly accessible at http://bit.ly/ickl-networking-101
Networking 101 with *nix Command Line Tools
$ telnet smtp.gmail.com 25
$ telnet google.com 80
$ lsof -i :PORT_NUMBER
$ dig -t ANY infinite-code.com
$ dig -t ANY www.infinite-code.com
$ traceroute infinite-code.com
$ ping google.com
PING google.com (22.214.171.124): 56 data bytes
64 bytes from 126.96.36.199: icmp_seq=0 ttl=57 time=41.138 ms
64 bytes from 188.8.131.52: icmp_seq=1 ttl=57 time=43.198 ms
64 bytes from 184.108.40.206: icmp_seq=2 ttl=57 time=41.232 ms
64 bytes from 220.127.116.11: icmp_seq=3 ttl=57 time=44.689 ms
--- google.com ping statistics ---
86 packets transmitted, 85 packets received, 1.2% packet loss
round-trip min/avg/max/stddev = 39.464/42.280/78.773/6.608 ms
Has been in standard library for a long time. Instantly host the contents in the folder you can the command, by default port 8000, you can change the port if needed.
# runs on port 8000
$ python -m SimpleHTTPServer
# if you want to run on another port
$ python -m SimpleHTTPServer 8001
Doesn’t really send out the mail. Just print out in stdout/console.
$ python -msmtpd --class DebuggingServer --debug -n
Simple tutorial on SMTP commands:
Print out in stdout/console and relay to real mail server.
$ python -msmtpd --debug -n
This document is created as one of the “Sharing Sessions” that we hold once/twice monthly at Infinite Code mostly on Fridays. We build custom web and mobile apps and we love technology, open source and things geeky.