Hacker News new | past | comments | ask | show | jobs | submit login
The best ping story I've ever heard (askapache.com)
125 points by ozh on Jan 9, 2015 | hide | past | favorite | 45 comments



I once recovered a stolen car with ping.

It was 2002 (2003?), and we had just launched Zipcar in New York. Being a naive start-up we had perhaps not the most stringent security measures in place to prevent fraud and theft. Sure enough, a couple of weeks in and one of our cars went missing. Calls to the member went unreturned, and it became clear that the member was not who they claimed to be and had no intention of returning the car.

At the time Zipcar was using the mobile analog CDPD network for vehicle communications, which had a top speed of something like 19.2k/s and cost us around $1/month per KB of data. However, it also had a limited number of data channels, and since it used the old AMPS network broadcast in the 800 - 900 MHz range. I happened to have an amateur radio license and a radio that was able to receive in that band.

Since we were still in contact with the missing car we knew it hadn't been chopped (yet) and I figured we might be able to use some sort of radio direction finding technique to locate the car. My friend and fellow engineer Carl was able to reprogram the firmware of our embedded electronics to tell us which cell tower the car was in contact with, and with that we could look up the FCC id in their database to find the tower's street address.

So my boss Roy and I hopped into his car and drove to Long Island. We drove up to the tower, and I leaned out the window of his minivan with a yagi antenna and my radio (set to scan the 40 or so CDPD channels.) We asked Carl (back in Boston) to start pinging the car. To the radio this sounded like a half-second burst of static, but since it was very regular it was also very easy to identify. Sure enough, after driving around for a few minutes we picked up the signal. pffft pffft pffft

We drove around the tower in a wide circle until the signal was the strongest, got out to scan the area, then used the new bearing to reduce the circle. Eventually we ended up in the parking lot of the Long Island railroad. There in the back corner was our car, luckily unscathed and none the worse for wear.

Ping rocks.


Well, that's impressive! It truly sounds like something out of a bad tv show...


Did you guys get the Cops involved?


Yeah. Once we found the car we couldn't move it or even open it since it had been reported stolen a few days before. My memory is foggy but I recall it taking a couple hours for an officer to show up, and they were really confused that we had found our own car.


This is a good one too, although not strictly ping related.

http://www.ibiblio.org/harris/500milemail.html


There's also this legendary Amazon review, which is strictly ping-related: http://www.amazon.com/review/R2VDKZ4X1F992Q


Good grief, I'd forgotten about that one. Hard to believe it's still up almost 15 years later. A true classic of the Amazon review genre. Who would have thought they would become a cultural repository?


"At the same time each day (I suspect this is scheduled under cron)"

Spectacular.


Didn't know that one! The dry humor is f*ing priceless :)


That's the I thought about too :-)


http://bash.org/?5273

Surely most people reading this will know the quote linked without having to even click it.


It's not as fun as it was >10 years ago. Tablets and smartphones ruined it..


Why did they ruin it? It's due to smartphones that I've had a similar experience on at least one occasion. I couldn't find my phone, but I noticed it was connected to the home Wi-Fi network and, since it was a jailbroken iPhone, I could SSH into it. (It went to sleep aggressively, of course, but I woke it up by dialing the number or something.) While the iPhone has a built-in feature to remotely play a tone on the speaker, I couldn't seem to hear it from anywhere in the house. So I tried using a command-line tool (might have written it actually, don't remember) to activate the cameras and take a picture with each; unfortunately the result was just two dark blurs. Eventually I found it buried in a couch, the soft fabric muffling the speaker...

If I were more sophisticated, I could have measured Wi-Fi RSSIs from it, or tried to bring Bluetooth devices into range. Lots of ways to try to find things nowadays, but none perfect!


Yup, my first thought as soon as I'd read "ping" on this post even


I thought of this one too. Not happened to me yet, but it might ;)


IN particular, that story is about 10Base2, where the topology is not hub-and-spoke but a single cable that snakes from NIC to NIC, with BNC twist-lock connectors and a T-junction at each stop. (And a required termination resistor at the end to stop reflection...)


The linked page appears to be a spammy copy of the original here: http://ftp.arl.army.mil/~mike/ping.html

It doesn't correctly credit the real author of ping: http://en.wikipedia.org/wiki/Mike_Muuss


Thank you webmaster@arl.army.mil for seeing that Mike Muuss's pages have been preserved, going on 15 years now.

Interesting note I hadn't read before: "This Web server was one of the first 50 Web servers on the InterNet, making it a pioneer in its own right."


Do someone know how to run a command for every line emitted in a unix pipe? I tried the oneliner in the linked story using Mac OS X’s `say`, but it doesn’t work with pipes.


In a typical UNIX fashion, there's a program that runs programs:

  ping 127.0.0.1 | sed -e 's/.*/ping/' | xargs -d'\n' -n1 say


-d is a GNU extension, won't work on OSX (short of having installed and running GNU xargs), and it's not needed either in this case.

And `sed -e <command>` is redundant, `-e` is used to specify multiple commands.


xargs -n1 (-n is so it executes the command for each input)

You'll also need sed -l to limit buffering.

    ping <host> | sed -l 's/.*/ping/' | xargs -n1 say


perfect!


  cat input |while read a; do do_something_with $a; done


thank you so much!


ping goodhost | sed -l 's/.*/ping/' | while read line; do echo $line | say; done


Bit of a tangent, but using the voice "Tom" on OS X, saying "ping" says "pling" instead. Fine with other voices but rather curious.


You might want to use "--unbuffered" flag in sed execution.


that option appears to be gnu-specific. -l should make it line-buffered


Note that -l is also an extension, just a BSD one.

The only options in POSIX sed are -e, -f and -n (and -e is usually cargo-culted by people who want -E. -E being a BSD extension enabling extended regular expressions — -r in GNU sed)



After a cross country move to a remote coastal town, my wife and I were left at our destination with only a small portion of our possessions. The rest of our stuff was making its way there with the hired movers.

I got into a strange situation where I needed my Mac Mini for something, but it was still trying to connect to an old wired connection instead of the new wireless one. I didn't have any of my cables or display adapters -- just a keyboard.

Long story short: the Mac Mini has an internal speaker, and OS X comes with a vocoder shell program. I managed to boot into the OS and launch terminal, and blindly typed commands into it, piping the output to the vocoder app until I got things working.


Ping fans, be sure to check out bing! Fun stuff and 97.2% accurate (not really)! :)

> Bing is a point-to-point bandwidth measurement tool (hence the 'b'), based on ping. Bing determines the real (raw, as opposed to available or average) throughput on a link by measuring ICMP echo requests roundtrip times for different packet sizes for each end of the link.

http://fgouget.free.fr/bing/bing_src-readme.shtml


This looks pretty ancient (source files dated 1997), and won't compile here. Any maintained version?


I'm a fan of nttcp, although it's not based on ping.

http://linux.die.net/man/1/nttcp


Is it just my network administrator or do others drop outgoing Ping messages at the corporate firewall? This has cost me and others more time than I would like to admit for some vague "security" reason that he won't or can't explain.


Start with a default-deny policy, the only sensible course. (Google "IP over ICMP".) Note that some sysadmins need to verify external connectivity, so allow ICMP echo reply messages to those IPs (or subnets, more likely).

Result: if your machine isn't in one of those blessed ranges, you never get a response to a ping to an outside address. Most users don't complain, because they don't even know what a ping is.

So, it's not just your company, but it's not general practice everywhere.


Blocking ICMP is a questionable practice in my opinion. It generally just complicates troubleshooting for a marginable gain in "security" and some applications even require it for PMTU discovery.

If you're really worried about user tunneling out through various tricks, you'd probably have to block the whole internet and apply a whitelist of trusted destination hosts.

As a heavy ping user, this blockage always bothered me, so I started working on a similar tool to get around this:

https://github.com/silverwind/tcpie


We once had an Ericsson MSC that only replied to _uneven_ ICMP packets due to some bug.

Made it look like there was 50% packet loss on an otherwise perfectly good Cat 5 cable...

(edit: ICMP instead of IP)


We've had a 3rd party router configured to balance traffic based on even/odd last octet. Add faulty hardware and DHCP to the mix, and here you have really hard to debug problem.


Checksum issue?


IIRC, there was nothing on the logs and they eventually shipped a fix. I was there when it happened and was called over to have a look.


And now, 2015, in my corporate networks ICMP messages are filtered by firewall (they say that's due to security reasons). Is this the beginning of the end of ping?


ping will be the last thing to die before they turn the internet off.


now I'm really tempted to add some voice notification function to pingd [https://github.com/pinggg/pingd]




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: