Posted on

netstat macos Show Listening Ports TCP Sockets with Grep

If you’re looking to list open network ports the Mac equivalent to the linux command netstat -Walntpc might be what you’re after. You are not alone, I get about 6,000 unique visitors per year here!

Realtime list of all open connections and listening sockets:


watch netstat -Walnt
(No DNS much faster)
watch netstat -Walt
(with DNS lookups)

The beauty of this command is that it gets you past that over long list of (non-internet surely?) unix sockets and kexts, why Apple put this into netstat I have no idea, perhaps the blame is with Darwin BSD kernel. But it should be more like Linux netstat in my opinion! That’s because I can even see the process names and get continuous updates my adding pc with

Pipe netstat Into Grep To Remove Junk From The End

Listening socket / server processes ports macOS quickly:

netstat -Waltn | grep tcp

Every internet port fast with no DNS lookups:

netstat -Waltn | grep -E “(tcp|udp)(4|6)”

Like above but with DNS lookups but takes literally forever up to minutes:

netstat -Walt | grep -E “(tcp|udp)(4|6)”

Show only servers – that is ports that are listening waiting for an inbound connection:

netstat -Waltn | grep LISTEN

The Little Snitch Command – Who’s phoning home?

How to use LSOF to discover which app or process is listening to which ports:

lsof -Pnl +M -i -cmd | grep -E “LISTEN|TCP|UDP”

I prefer to use -n to speed up the listing of netstat results by turning off DNS lookups ip to name resolution. The l is used to also show ipv6. To show all internet connections, whether ipv4 or ipv6, tcp or udp, listening, connected or closing – the lot:

netstat -Waltn | grep p[46]

Show only TCP connections:

netstat -anp tcp

To see which apps have listening sockets open:

sudo lsof  -n -P | grep LISTEN

Some other good linux ones here: http://www.commandlinefu.com/commands/matching/netstat/bmV0c3RhdA==/sort-by-votes

Show Process ID in Netstat Mac

Actually, you can’t but you can use LSOF which lists open files and sockets:

lsof -Pnl +M -i

Use -i4 for ip4 and -i6 for ip6. -i seems to work for all internet traffic. Handy for tracking down what program is running a server on your machine.

Linux

This one is good for checking ssh tunnels:

sudo netstat -tulpn

Posted on

Bye Snap, Hello Orcon

UPDATE: It’s June 9 now and I’m still with Snap but some really awful throttling has kicked in – granted we did just push through 606 GB in the month – but it’s the way it’s implemented that sucks, this graph speaks volumes: Quite house in Ponsonby on Fibre at 2:37pm I’m the only person home I reckon:

 

Well it was nice Snap  – sorry it had to end like this. Heck maybe it’s KGOVPS.com’s fault not yours? But it’s still happening.

I sincerely hope changing ISPs fixes this issue below. I guess either way is bad for Snap (my current / soon to be ex ISP) because if a) it wasn’t their fault then they lost a customer for no good reason and b) if it was their fault then bad look for them and time to sort out the issue!

Routing Bug Between Ponsonby and Albany

My VPS in Albany is at akl.tomachi.co and my home IP I have obscured for privacy reasons.

How come Albany to Ponsonby is 4 Hops

[[email protected] ~]$ traceroute [home ip]
traceroute to [home ip] (202.124.XXX.XXX), 30 hops max, 60 byte packets
 1 103.25.59.200 (103.25.59.200) 0.038 ms 0.018 ms 0.017 ms
 2 snap1.ape.nzix.net (192.203.154.120) 1.364 ms 1.326 ms 1.289 ms
 3 55.32.69.111.static.snap.net.nz (111.69.32.55) 4.006 ms 3.510 ms 4.272 ms
 4 XXX.XXX.124.202.static.snap.net.nz (202.124.XXX.XXX) 5.025 ms !X 4.997 ms !X 4.983 ms !X
[[email protected] ~]$

But the other way is 7 Hops?

ponsonby:~ tom$ traceroute akl.tomachi.co
 traceroute to akl.tomachi.co (103.25.59.201), 64 hops max, 52 byte packets
 1 fritz.box (10.0.0.1) 1.611 ms 1.452 ms 1.592 ms
 2 XXX.XXX.69.111.static.snap.net.nz (111.69.XXX.XXX) 3.775 ms 7.208 ms 3.906 ms
 3 54.32.69.111.static.snap.net.nz (111.69.32.54) 3.735 ms 3.427 ms 3.769 ms
 4 hdnetltd.ape.nzix.net (192.203.154.165) 4.996 ms 7.482 ms 8.186 ms
 5 103.6.146.97 (103.6.146.97) 8.080 ms 7.498 ms 7.875 ms
 6 103.25.59.200 (103.25.59.200) 7.885 ms 15.961 ms 10.614 ms
 7 103.25.59.201 (103.25.59.201) 4.583 ms 4.916 ms 7.839 ms
 ponsonby:~ tom$

Well whatever it is it makes using a shell session pretty annoying – it freezes for about 5 seconds at a time!

UPDATE: 

Here are some new trace and pings from 13 May.

They said they have fixed and it does seem a little better, but I still see a difference in the number of hops…. and then just now the mother of all drops:

[[email protected] .ssh]$ traceroute 27.funk.co.nz
traceroute to 27.funk.co.nz (202.124.119.97), 30 hops max, 60 byte packets
1 103.25.59.200 (103.25.59.200) 0.079 ms 0.019 ms 0.023 ms
2 snap1.ape.nzix.net (192.203.154.120) 1.096 ms 1.176 ms 1.128 ms
3 55.32.69.111.static.snap.net.nz (111.69.32.55) 2.166 ms 2.276 ms 2.356 ms
4 97.119.124.202.static.snap.net.nz (202.124.119.97) 4.492 ms !X 4.444 ms !X 4.404 ms !X
[[email protected] .ssh]$
[[email protected] .ssh]$
[[email protected] .ssh]$
[[email protected] .ssh]$
[[email protected] .ssh]$
[[email protected] .ssh]$
[[email protected] .ssh]$ free -m
total used free shared buffers cached
Mem: 192 79 112 3 0 34
-/+ buffers/cache: 44 147
Swap: 192 81 110
[[email protected] .ssh]$ ping 202.124.119.97
PING 202.124.119.97 (202.124.119.97) 56(84) bytes of data.
64 bytes from 202.124.119.97: icmp_seq=1 ttl=59 time=6.02 ms
64 bytes from 202.124.119.97: icmp_seq=2 ttl=59 time=4.93 ms
64 bytes from 202.124.119.97: icmp_seq=3 ttl=59 time=15.8 ms
64 bytes from 202.124.119.97: icmp_seq=4 ttl=59 time=5.82 ms
64 bytes from 202.124.119.97: icmp_seq=5 ttl=59 time=3.89 ms
64 bytes from 202.124.119.97: icmp_seq=6 ttl=59 time=5.84 ms
64 bytes from 202.124.119.97: icmp_seq=7 ttl=59 time=3.79 ms
64 bytes from 202.124.119.97: icmp_seq=8 ttl=59 time=5.87 ms
64 bytes from 202.124.119.97: icmp_seq=9 ttl=59 time=4.24 ms
64 bytes from 202.124.119.97: icmp_seq=11 ttl=59 time=2.94 ms
64 bytes from 202.124.119.97: icmp_seq=12 ttl=59 time=6.03 ms
64 bytes from 202.124.119.97: icmp_seq=13 ttl=59 time=5.62 ms
64 bytes from 202.124.119.97: icmp_seq=14 ttl=59 time=3.94 ms
64 bytes from 202.124.119.97: icmp_seq=15 ttl=59 time=2.76 ms
64 bytes from 202.124.119.97: icmp_seq=16 ttl=59 time=4.96 ms
64 bytes from 202.124.119.97: icmp_seq=17 ttl=59 time=3.90 ms
64 bytes from 202.124.119.97: icmp_seq=18 ttl=59 time=2.94 ms
64 bytes from 202.124.119.97: icmp_seq=19 ttl=59 time=5.83 ms
64 bytes from 202.124.119.97: icmp_seq=20 ttl=59 time=5.33 ms
64 bytes from 202.124.119.97: icmp_seq=21 ttl=59 time=2.45 ms
64 bytes from 202.124.119.97: icmp_seq=22 ttl=59 time=13.8 ms
64 bytes from 202.124.119.97: icmp_seq=23 ttl=59 time=2.77 ms
64 bytes from 202.124.119.97: icmp_seq=24 ttl=59 time=5.00 ms
64 bytes from 202.124.119.97: icmp_seq=25 ttl=59 time=3.91 ms
64 bytes from 202.124.119.97: icmp_seq=26 ttl=59 time=5.84 ms
64 bytes from 202.124.119.97: icmp_seq=27 ttl=59 time=4.02 ms
^C
— 202.124.119.97 ping statistics —
136 packets transmitted, 26 received, 80% packet loss, time 135600ms
rtt min/avg/max/mdev = 2.452/5.324/15.815/2.987 ms
[[email protected] .ssh]$
That above is from my VPS to home. Here is from my host in the ***USA*** to my home and has 0% packet loss weird huh?:

13inch:~ tom$ ssh [email protected]
[email protected]’s password:

# “”# “”# #
#mmm m m # # mmm mmm # mm
#” “# # # # # #” “# #” ” #” #
# # # # # # # # # # #
##m#” “mm”# “mm “mm “#m#” “#mm” # #
Last login: Mon May 11 09:19:22 2015 from 202.124.119.97
[bulloch]$ ping 27.funk.co.nz
PING hotelvermont.servebeer.com (202.124.119.97) 56(84) bytes of data.
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=1 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=2 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=3 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=4 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=5 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=6 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=7 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=8 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=9 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=10 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=11 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=12 ttl=50 time=236 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=13 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=14 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=15 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=16 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=17 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=18 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=19 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=20 ttl=50 time=269 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=21 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=22 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=23 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=24 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=25 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=26 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=27 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=28 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=29 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=30 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=31 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=32 ttl=50 time=241 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=33 ttl=50 time=246 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=34 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=35 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=36 ttl=50 time=265 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=37 ttl=50 time=244 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=38 ttl=50 time=254 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=39 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=40 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=41 ttl=50 time=257 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=42 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=43 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=44 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=45 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=46 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=47 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=48 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=49 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=50 ttl=50 time=260 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=51 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=52 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=53 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=54 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=55 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=56 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=57 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=58 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=59 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=60 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=61 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=62 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=63 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=64 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=65 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=66 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=67 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=68 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=69 ttl=50 time=237 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=70 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=71 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=72 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=73 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=74 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=75 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=76 ttl=50 time=249 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=77 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=78 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=79 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=80 ttl=50 time=263 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=81 ttl=50 time=236 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=82 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=83 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=84 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=85 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=86 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=87 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=88 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=89 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=90 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=91 ttl=50 time=240 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=92 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=93 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=94 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=95 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=96 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=97 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=98 ttl=50 time=236 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=99 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=100 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=101 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=102 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=103 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=104 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=105 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=106 ttl=50 time=236 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=107 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=108 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=109 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=110 ttl=50 time=266 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=111 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=112 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=113 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=114 ttl=50 time=242 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=115 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=116 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=117 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=118 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=119 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=120 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=121 ttl=50 time=238 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=122 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=123 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=124 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=125 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=126 ttl=50 time=245 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=127 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=128 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=129 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=130 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=131 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=132 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=133 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=134 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=135 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=136 ttl=50 time=243 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=137 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=138 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=139 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=140 ttl=50 time=245 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=141 ttl=50 time=236 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=142 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=143 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=144 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=145 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=146 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=147 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=148 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=149 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=150 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=151 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=152 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=153 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=154 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=155 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=156 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=157 ttl=50 time=236 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=158 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=159 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=160 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=161 ttl=50 time=262 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=162 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=163 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=164 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=165 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=166 ttl=50 time=235 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=167 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=168 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=169 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=170 ttl=50 time=260 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=171 ttl=50 time=264 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=172 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=173 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=174 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=175 ttl=50 time=232 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=176 ttl=50 time=233 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=177 ttl=50 time=234 ms
64 bytes from 97.119.124.202.static.snap.net.nz (202.124.119.97): icmp_req=178 ttl=50 time=234 ms
^C
— hotelvermont.servebeer.com ping statistics —
179 packets transmitted, 178 received, 0% packet loss, time 178122ms
rtt min/avg/max/mdev = 232.067/236.039/269.151/7.053 ms
[bulloch]$
It’s a pity they don’t allow:
[bulloch]$ traceroute 27.funk.co.nz
traceroute to 27.funk.co.nz (202.124.119.97), 30 hops max, 60 byte packets
send: Operation not permitted

And now from home to my VPS:
Connection to direct.funk.co.nz closed.
13inch:~ tom$ traceroute direct.funk.co.nz
traceroute to direct.funk.co.nz (208.113.214.223), 64 hops max, 52 byte packets
1 fritz.box (10.0.0.1) 1.445 ms 1.226 ms 1.213 ms
2 16.17.69.111.static.snap.net.nz (111.69.17.16) 7.481 ms 6.235 ms 6.982 ms
3 54.32.69.111.static.snap.net.nz (111.69.32.54) 6.101 ms 5.283 ms 3.995 ms
4 33.27.69.111.static.snap.net.nz (111.69.27.33) 3.972 ms 3.063 ms 5.035 ms
5 ae5-2.akbr7.global-gateway.net.nz (210.55.202.213) 6.725 ms 5.353 ms
ae2-6.tkbr12.global-gateway.net.nz (122.56.127.17) 4.088 ms
6 203.96.120.142 (203.96.120.142) 130.034 ms
ae1-10.tkbr12.global-gateway.net.nz (202.50.232.37) 6.430 ms
xe7-0-1-10.lebr7.global-gateway.net.nz (202.50.232.162) 159.705 ms
7 ae0-10.lebr8.global-gateway.net.nz (202.50.232.42) 128.273 ms
203.96.120.142 (203.96.120.142) 131.069 ms
xe7-0-1-10.lebr7.global-gateway.net.nz (202.50.232.162) 160.023 ms
8 ae0-10.lebr8.global-gateway.net.nz (202.50.232.42) 131.741 ms 128.850 ms
los-brdr-01.inet.qwest.net (63.235.40.241) 134.280 ms
9 dcx2-edge-01.inet.qwest.net (67.14.28.70) 199.570 ms 199.453 ms
63-235-40-241.dia.static.qwest.net (63.235.40.241) 156.440 ms
10 63-235-40-241.dia.static.qwest.net (63.235.40.241) 161.853 ms
65.125.14.38 (65.125.14.38) 230.097 ms
dcx2-edge-01.inet.qwest.net (67.14.28.70) 200.951 ms
11 65.125.14.38 (65.125.14.38) 234.335 ms 235.367 ms
border10.pc1-bbnet1.wdc002.pnap.net (216.52.127.9) 227.963 ms
12 65.125.14.38 (65.125.14.38) 236.299 ms
border10.pc1-bbnet1.wdc002.pnap.net (216.52.127.9) 341.953 ms 236.391 ms
13 dreamhost-2.border10.wdc002.pnap.net (216.52.125.74) 201.611 ms
ip-208-113-156-4.dreamhost.com (208.113.156.4) 232.052 ms
dreamhost-2.border10.wdc002.pnap.net (216.52.125.74) 201.976 ms
14 ip-208-113-156-4.dreamhost.com (208.113.156.4) 234.124 ms 230.107 ms
dreamhost-2.border10.wdc002.pnap.net (216.52.125.74) 204.988 ms
15 ip-208-113-156-14.dreamhost.com (208.113.156.14) 201.984 ms *
ip-208-113-156-4.dreamhost.com (208.113.156.4) 236.239 ms
^C
13inch:~ tom$

13inch:~ tom$ traceroute akl.tomachi.co
traceroute to akl.tomachi.co (103.25.59.201), 64 hops max, 52 byte packets
1 fritz.box (10.0.0.1) 1.957 ms 1.207 ms 1.142 ms
2 16.17.69.111.static.snap.net.nz (111.69.17.16) 8.267 ms 6.128 ms 4.021 ms
3 54.32.69.111.static.snap.net.nz (111.69.32.54) 3.648 ms 3.227 ms 3.821 ms
4 hdnetltd.ape.nzix.net (192.203.154.165) 4.975 ms 7.370 ms 4.003 ms
5 103.6.146.97 (103.6.146.97) 4.347 ms 5.482 ms 3.953 ms
6 103.25.59.200 (103.25.59.200) 3.966 ms 4.195 ms 4.069 ms
7 103.25.59.201 (103.25.59.201) 4.277 ms 4.989 ms 4.829 ms
13inch:~ tom$ ping akl.tomachi.co
PING akl.tomachi.co (103.25.59.201): 56 data bytes
64 bytes from 103.25.59.201: icmp_seq=0 ttl=60 time=11.107 ms
64 bytes from 103.25.59.201: icmp_seq=1 ttl=60 time=6.308 ms
64 bytes from 103.25.59.201: icmp_seq=2 ttl=60 time=3.808 ms
64 bytes from 103.25.59.201: icmp_seq=3 ttl=60 time=6.573 ms
64 bytes from 103.25.59.201: icmp_seq=4 ttl=60 time=3.826 ms
64 bytes from 103.25.59.201: icmp_seq=5 ttl=60 time=7.498 ms
64 bytes from 103.25.59.201: icmp_seq=6 ttl=60 time=6.927 ms
64 bytes from 103.25.59.201: icmp_seq=7 ttl=60 time=4.860 ms
64 bytes from 103.25.59.201: icmp_seq=8 ttl=60 time=6.041 ms
64 bytes from 103.25.59.201: icmp_seq=9 ttl=60 time=6.022 ms
Request timeout for icmp_seq 10
64 bytes from 103.25.59.201: icmp_seq=11 ttl=60 time=4.377 ms
64 bytes from 103.25.59.201: icmp_seq=12 ttl=60 time=11.720 ms
64 bytes from 103.25.59.201: icmp_seq=13 ttl=60 time=5.912 ms
64 bytes from 103.25.59.201: icmp_seq=14 ttl=60 time=4.579 ms
64 bytes from 103.25.59.201: icmp_seq=15 ttl=60 time=3.409 ms
64 bytes from 103.25.59.201: icmp_seq=16 ttl=60 time=6.534 ms
64 bytes from 103.25.59.201: icmp_seq=17 ttl=60 time=4.351 ms
64 bytes from 103.25.59.201: icmp_seq=18 ttl=60 time=6.126 ms
64 bytes from 103.25.59.201: icmp_seq=19 ttl=60 time=3.742 ms
64 bytes from 103.25.59.201: icmp_seq=20 ttl=60 time=8.684 ms
64 bytes from 103.25.59.201: icmp_seq=21 ttl=60 time=5.628 ms
64 bytes from 103.25.59.201: icmp_seq=22 ttl=60 time=7.094 ms
64 bytes from 103.25.59.201: icmp_seq=23 ttl=60 time=12.632 ms
64 bytes from 103.25.59.201: icmp_seq=24 ttl=60 time=19.701 ms
64 bytes from 103.25.59.201: icmp_seq=25 ttl=60 time=3.750 ms
64 bytes from 103.25.59.201: icmp_seq=26 ttl=60 time=6.766 ms
64 bytes from 103.25.59.201: icmp_seq=27 ttl=60 time=5.588 ms
64 bytes from 103.25.59.201: icmp_seq=28 ttl=60 time=3.968 ms
64 bytes from 103.25.59.201: icmp_seq=29 ttl=60 time=6.137 ms
64 bytes from 103.25.59.201: icmp_seq=30 ttl=60 time=47.076 ms
64 bytes from 103.25.59.201: icmp_seq=31 ttl=60 time=6.018 ms
64 bytes from 103.25.59.201: icmp_seq=32 ttl=60 time=9.410 ms
64 bytes from 103.25.59.201: icmp_seq=33 ttl=60 time=4.970 ms
64 bytes from 103.25.59.201: icmp_seq=34 ttl=60 time=3.758 ms
64 bytes from 103.25.59.201: icmp_seq=35 ttl=60 time=6.452 ms
64 bytes from 103.25.59.201: icmp_seq=36 ttl=60 time=50.855 ms
64 bytes from 103.25.59.201: icmp_seq=37 ttl=60 time=3.855 ms
^C
— akl.tomachi.co ping statistics —
38 packets transmitted, 37 packets received, 2.6% packet loss
round-trip min/avg/max/stddev = 3.409/8.812/50.855/10.097 ms
13inch:~ tom$

Posted on

2015 Linux VPS Hosting in Auckland Price Comparison

The following is a comparison of prices for entry level Linux VPS virtual servers ideally Auckland or NZ. Target setup is a Linux box running Ubuntu for doing backups, web development, VPNs, and SSH file transfers traffic to Auckland clients. 1 GB mem 1 TB disk 100 GB local transfers as a ball park usage figure. Naturally nobody at all is offering anything close to 1 Terabyte of storage

Auckland:

$10 http://www.vpsnine.com/hosting/index.php 256 MB mem 30 GB disk (RAID-10 w/ multi data centres!)

$19.95 https://www.vpscity.co.nz/ 256 MB Mem Unmetered Local Traffic

$20  https://www.affinity.net.nz/ 512 MB Mem 20 GB Disk

$25 http://rimuhosting.com/order/v2orderstart.jsp 2,239 MB mem 4 GB disk (Sounds nice!)

$33.35 http://www.openhost.co.nz/linux-vps/ 512 MB mem 5 GB disk

$34.50 http://fullflavour.nz/hosting/virtual-private-servers 1 GB Mem 25 GB Disk

$34.50 http://www.sitehost.co.nz/hosting/virtual-private-servers

$69 http://www.hostpapa.co.nz/web-hosting-plan/vps-hosting/ 1.5 GB Mem 50 GB Disk

$69.95 http://www.webfarm.co.nz/products_vps/ 256 MB Mem 4 GB Disk

POA http://www.hd.net.nz/company/contact-us/ No pricing info on site probably way over priced therefore

Australian:

$11.68 USD http://aws.amazon.com/ec2/pricing/ 0.6 GB mem t2.micro in Sydney

$21 AUD http://www.exclusivehosting.net/landing/vps-hosting-3/ 1024 Mem 12 GB Disk

International / Cloud Based Providers:

€5 EURO https://www.transip.eu/vps/ PureSSD 1024 MB Mem 50 GB Disk

$7.30 USD https://cloud.google.com/compute/#eu Shared Core f1-micro instance type 0.6 GB Mem

$18.25USD https://cloud.google.com/compute/#eu Shared Core f1-micro instance type 1.7 GB Mem

Helpful facts: 8,760 hours per year / 12 = 730 hours in each month on average

Posted on

How to use WGET to show HTML source code

If you are logged into a Unix shell, say like the Terminal on Mac OS X, or bash in Linux, sometimes you want to show a web pages source code. I use this for checking a pages source code from another location outside my network. This is helpful if you have a strong proxy server that is preventing you from getting the latest copy of a webpage during development.

Display the HTML source code for Google.com:

wget -qO- http://google.com | cat

There you have it.

If you actually want to save the file to a local file and also display it, use this instead:

wget -q -O file "url"; cat file