Debugging Stuck PHP-FPM Process With Strace

For most of the times, debugging is easy – a silly logical error or an oversight, quick to correct and move on but some problems are hard – because you don’t know where it is wrong. The bigger the involved stack is, the higher are your chances of getting stuck at them. In such cases, tools like strace can be of great aid as they can help you give a hint about where things are getting screwed up.

My Perfect Reason to Avoid PHP: Type Juggling

If there was an award for the most hated language, the unanimous winner would be PHP. Lots of write-ups criticize it for its nonsensical function naming conventions, inconsistent parameters, sheer absence of what we call, “a well thought design”. However, people on the other side, suggest that writing good code is upto the programmer. Showcasing “Zend Framework”, they assert, PHP is a reasonable language to write clean code with. They say it’s easy to ignore the inconsistencies with a good editor or IDE and adopting best practices. I believed them—until, I encountered something which is completely inexcusable, an ugly case of type juggling.

Reading MP3 ID3 Tags in Native PHP

This week I went crazy about file formats. I tried to understand specifications of many popular formats like MP3, FLV, PDF. Its amazing to see that no matter how complex these technologies are or the algorithms they use to store media efficiently, at the lower level it is just a clever arrangement of bits that makes sense and with a bit of experimentation and hacking around MP3 format (a Hex Editor is a invaluable tool in this), I was able to read them in PHP without using any extension. The source has been put on GitHub.