Proper LIKE Comparison For MySQL and UUIDs

I recently ran into this issue, and I wasn’t able to find any meaningful information online until I posted on StackOverflow about it, so I’m hoping that this will help someone else in the future.  In an application I’m developing, UUIDv4’s are being used to load up a form from the database to dynamically display to the end-user to fill out.  The hex representation of a UUID is 32 characters long (excluding dashes), and this would simply be too cumbersome to ask an end-user to enter if they needed to manually navigate to a form.  Therefore I decided to use a LIKE comparison, allowing the user to specify the UUID in the URL in 1 byte increments (2 hex characters). Continue Reading…

Beanstalkd on AWS Elastic Beanstalk

If you’re not familiar with Beanstalkd, you probably should be.  It’s an awesomely fast, simple to use, zero-config (configuration is optional) work queue.  I use it with Laravel, but it works equally well for other tasks as well.  We recently deployed a Laravel application to AWS Elastic Beanstalk and needed to run Beanstalkd on the EC2 instances that would be spun up.  Here’s a short gist that will get you up and running with Beanstalkd in no time.  Just add this file to your .ebextensions folder and you’re all set! Continue Reading…

s3fs-fuse and AWS Elastic Beanstalk

If you’re using WordPress or another web application that utilizes uploads in a load balanced and autoscaled environment, you know what a pain it can be to manage the uploads so they don’t disappear when an instance shuts down. Likewise, you need to make sure that every instance would have to have a copy of the resources because a request could go to any of them. Continue Reading…

Mercurial: Autopushing changes from a central repository

When you have hundreds of applications managed via a central repository which are checked out to multiple production and staging servers, it can become burdensome to manage and/or remember where every working copy of that code resides. We recently ran into this issue at my work so we needed a solution that was going to be developer friendly and easy to manage on a per-repository basis. Continue Reading…

Mercurial: GPG Sign Tags

I recently needed to write a pretxnchangegroup hook that would check if any new tags had been pushed, and if so, if they were GPG signed. I had the requirement that the changeset with the tag be signed, not the changeset that added the tag. I’m not a python coder, so I opted to go for a simple bash script to accomplish the task. The only option the script has is whether or not the hook can fail if a changeset does not have a valid signature. If the option is disabled, it will only throw an error, but the hook will still pass. Continue Reading…

Suhosin’s suhosin.perdir directive

In some recent development work, I ran into a brick wall with Suhosin. I have both the patch and extension installed on all of my dev boxes on all PHP versions I test with. I found the need to change a configuration directive, but I did not want to change that value in the suhosin server configuration, I wanted to change it via either .htaccess or PHP’s ‘user.ini’ file. Continue Reading…

L2TP/IPSec in Ubuntu 10.04 et al.

I’ve spent the last week looking through the web at everything I could possibly find in an effort to find some shred of information that made some sort of sense and didn’t take a rocket scientist to configure. I found plenty of instructions on manually installing Openswan, xl2tp and modifying their configuration files and entering a pre-shared key here, or putting a certificate there, blah, blah blah, blah blah. After many failed attempts, I was pretty much ready to give up. Continue Reading…