Using “free” wi-fi on Linux

I recently found myself at a train station that claimed to offer “free super-fast wi-fi”; but when I connected to it, I was stuck with a little question mark in the gnome toolbar, and the chrome dinosaur.

I’m not the first person to note this, but I did manage to get it working… eventually.

I opened up a terminal, and even though the browser was sad, I could ping:

$ ping google.com
PING google.com (216.58.214.14) 56(84) bytes of data.
From _gateway (10.102.0.5) icmp_seq=1 Destination Net Prohibited

Sort of. DNS was working, anyway. So I tried curl:

$ curl -vL "https://www.google.com"
* Rebuilt URL to: https://www.google.com/
*   Trying 172.217.19.196...
* TCP_NODELAY set
* Connected to www.google.com (172.217.19.196) port 443 (#0)
... snip ...

And it looked like I was getting the actual Google homepage, not a hijacked page, which was interesting.

At that point I took the IP address from that request, and stuck it directly in the browser, hoping to skip straight there; and now the browser decided to show me the T&C page I needed. Once I’d ticked the right box, I was online.

“Trouble parsing json”

We use Bunyan┬áin our node apps, for “structured logging”. The output json string is passed to syslog, by systemd, and then fed into ELK.

{
    "name":"foo-service",
    "hostname":"app-01",
    "pid":30988,
    "ip":"1.19.24.8",
    "requestId":"1c11f448-73f2-4efa-bc63-3de787618d49",
    "level":50,
    "err": {
        "message":"oh noes!"
    }
}

Unfortunately, if that string is longer than 2048 chars (usually a stacktrace, or html returned from a web service instead of json), then the json blob ends up split over 2 lines in syslog.

This causes ELK to barf when attempting to parse the broken lines (assuming you are parsing as json), and means you won’t see those errors in Kibana.

It is possible to detect the error parsing the error, by searching for the string “Trouble parsing json”, but that’s not really a solution.

I would prefer to see a truncated error, than have the current situation, but that means either wrapping or patching Bunyan itself.