MySQL optimize, repair, and analyze

Years ago I had the following script running as a cron job, but then I lost it somewhere.  It took me a few minutes to find it again, but just in case I need it in the future, I’m saving it here.

#!/bin/bash
mysqlcheck --all-databases
mysqlcheck --all-databases -o
mysqlcheck --all-databases --auto-repair
mysqlcheck --all-databases --analyze

Found it here this time.

Nginx Performance Tuning – Tips & Tricks

Here are a whole lot of “Performance Tuning – Tips & Tricks” directly from the Nginx team.  I’m sure you’ve seen bits and pieces of these all over the place, but it’s nice to have them all together and from the credible source as well.

The 2018 Guide to Building Secure PHP Software

The 2018 Guide to Building Secure PHP Software” is an excellent guide to writing modern PHP applications with security in mind.  It covers a bunch of the usual topics, but provides fresher solutions than most other similar guides.

Replaying JavaScript errors from the userland

I came across this interesting dive into monitoring, troubleshooting, and replaying JavaScript errors from the userland – “A user encounters a JavaScript error. You’ll never guess what happens next!!“.

This is not something immediately applicable for my projects at work, but gives me a lot to think about.

rector – reconstruct legacy PHP codebase to modern standards

rector looks like an excellent tool for those days when you need to rewrite large chunks of legacy code for the modern coding standards and best practices.  Of course, there are IDEs that can help a lot with refactoring, but they are usually complex and slow.  Regular expressions have always been a poor man’s choice for replacing old code with new code.  But life can be easier and better.  rector helps you find and replace things like namespaces, class names, method names and property names; change type hints and values of parameters; replace magic methods with their real implementations, and much more.

I’m sure I’ll be trying it out Real Soon Now ™, with the upcoming release of CakePHP 3.6.