Logging best practices

Logging, I think, is one of the least debated subjects in the software development. Everyone does it at least to some degree. Everyone agrees that good logs are important. But beyond that, there’s enough debate on what are the best practices, tools, and options. We need more of blog posts like this one and slides like these.

ISO-8601, YYYY, yyyy, and why your year may be wrong

Erica Sadun blog post goes into details of the difference between ‘YYYY’ and ‘yyyy’ when formatting dates. Remember to add a few unit tests to your application to make sure you are using the correct format.

We’ve recently seen this issue at work and it was a pain in the butt to troubleshoot.

Dephpugger – PHP debugger for the command line


DePHPugger is an easy to use debugger for PHP, which works from the command line and can also be integrated with any IDE or editor.  Here is a GIF screencast that demonstrates the functionality:

There are more demos in the project’s GitHub repository. You can also read this article and watch this video.

WTF with Amazon and TCP


Here goes the story of me learning a few new swear words and pulling out nearly all my hair.  Grab a cup of coffee, this will take make a while to tell…

First of all, here is a diagram to make things a little bit more visual.

wtf

As you can see, we have an office network with NAT on the gateway.  We have an Amazon VPC with NAT on the bastion host.  And then there’s the rest of the Internet.

The setup is pretty straight forward.  There are no outgoing firewalls anywhere, no VLANs, no network equipment – all of the involved machines are a variety of Linux boxes.  The whole thing has been working fine for a while now.

A couple of weeks ago we had an issue with our ISP in the office.  The Internet connection was alive, but we were getting extremely high packet loss – around 80%.  The technician passed by, changed the cables, rebooted the ADSL modem, and we’ve also rebooted the gateway.  The problem was fixed, except for one annoying bit.  We could access all of the Internet just fine, except our Amazon VPC bastion host.  Here’s where it gets interesting.

Continue reading “WTF with Amazon and TCP”