Posts
Engineering
Platforms, infrastructure and the craft underneath — some of it going back to the PHP years.
Configure default datetime format of Symfony Serializer DateTimeNormalizer
The Symfony Serializer happily normalizes DateTimes — until you need milliseconds. How to change the DateTimeNormalizer default format once, globally.
Add disks to a setup with a LUKS container on a LVM volume without losing data
Growing an encrypted LUKS-on-LVM data partition onto freshly bought disks without losing a byte — the exact command sequence, plus the obligatory backup sermon.
Auto deploy a Sculpin website for free
Public repo on GitHub, merge to master, site live on S3 — a zero-cost Travis auto-deploy for a Sculpin static site, as used for rokka.io.
Symfony 2.5 using a new structure
Saying yes to the new 3.0 directory structure in a fresh Symfony 2.5 project: what moves where, and why var and bin make daily life easier.
Alternative location of the symfony2 documentation
When symfony.com goes down mid-task, the entire documentation is still sitting in a GitHub repo — less pretty to navigate, but all there.
One Time Passwords in PHP and Google Authenticator
Two-factor auth for your own app with Google Authenticator: how the one-time-password RFCs work, and the PHP library I published to handle the tricky bits.
Zend Certified Engineer PHP 5.3
After years of owning the study guide, I finally sat the ZCE PHP 5.3 exam — number 95 in Switzerland, with honest notes on the test's fuzzier questions.
Extension '/path/script.php' not present
A PHP script that ran fine by hand but failed in cron with a nonsense error — the culprit was DOS line endings, and dos2unix ended it.
The QuPiD principle
Quality, Performance, Design — pronounced like cupid — a three-question filter for choosing frying pans, software and pretty much everything else.
Testing USB Drive Capacity
Cheap USB sticks that report 16 GB and silently eat your files — how the controller lie works, and how to test a drive before trusting it.
Flattr Statistics of September 2010
Four more months of Flattr numbers, from three-dollar summers to a single click worth 30 cents — small data on whether micro-donations add up.
MS SQL Blob truncated
JPEGs stored as blobs in MS SQL came back truncated at exactly 64'512 bytes — the triple-facepalm hunt that ended in a FreeTDS config default.
Flattr Statistics of May 2010
Full transparency on a month of micro-donations: 24 things, 66 clicks, 11.34 euros — and why more clicks did not mean more money.
Debian Killall Command
The package name I keep forgetting: where killall actually lives on Debian, written down so I never have to look it up again.
Testing missing translations in Zend Framework
Finding untranslated strings in Zend_Translate by swapping in an adapter that answers everything with the same marker — an instant visual map of what you missed.
GoDaddy SSL Certificate and Apache
Support swore the certificate was installed correctly, yet fresh browsers rejected it — a broken intermediate chain, exposed by a free online tester.
Simple wget written in PHP
No wget, no install rights, but a working PHP — a tiny stand-in script that fetches a file from a URL when that is all you need.
(128)Network is unreachable: connect to listener on [::]:80
A cryptic Apache error filling the logs on Solaris 10, and the one-line Listen directive change that silences it for good.
Ant and Zend Studio
Ant mysteriously disabled in Zend Studio, and the trick with a throwaway project wizard that switches it back on.
Making lists easier and more beautiful
Building 'a, b, c' lists without dangling commas or foreach gymnastics — implode was right there all along, and it composes further than you would think.
Creating a MySQL dump in CSV format
mysqldump has no --csv switch, but with the right -T incantation you get clean CSV files that Excel and Calc open without complaint.
Cycling between strings
Cycling through a fixed set of values without counters, resets or static-variable hacks — a small class that keeps its own state does it better.
Mini caching in classes
A method called repeatedly, a result too expensive to recompute, and the five-line private-array cache that beats passing state around.
2009 has 53 weeks
The cronjob was fine, the import was fine — my firm belief that a year has 52 weeks was not. A calendar surprise, and the one-line PHP fix.
Large MySQL Inserts with PHP
A million rows from PHP without trashing the disk or timing out: combine the inserts and the whole job finishes in under thirty seconds.