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…

Easily Extend SMF’s Integration Hooks

With the releases of SMF 2.0 RC4 and RC5, many new integration hooks were added to allow mod authors to extend the code without hacking it up. Previously to this, the primary use of these hooks was for integration with bridges or other systems, no one really used them for modifications. SimpleSEF was the first mod to really exploit these hooks and use them to accomplish some pretty major tasks. What I am presenting here is a simple PHP class that can be used to easily extend SMF using it’s integration hooks with very little effort. If you are fairly new to PHP or new to PHP5’s OOP model, you should turn away now. Continue Reading…