Recent Posts

Rename S3 Bucket

You cannot rename an S3 bucket directly, but there are various reasons that you might desperately need to make such a change. For instance, if you created bucket "bucket.example.com" years ago with dots, you might need to rename it to "bucket-example-com" to eliminate the dots so that the SSL validates appropriately when accessed as a subdomain of s3.amazonaws.com. Such access methods do not appear to be necessary versus referencing the bucket as the path prefix, but it has been standardized in some software like ec2-upload-bundle.

Technologies: 

Expanding an EBS volume on Ubuntu

Amazon provides a verbose explanation of how to expand the volume. However, as long as the volume is strictly for storage, and the storage can be taken offline for a few minutes, then the process is really pretty easy. The instructions below work on Ubuntu 14.04 when using ext2/ext3/ext4 file systems.

Technologies: 

Drupal and MySQL "Row size too large" Error

I encountered a MySQL bug that intersected in an unfortunate way with how Drupal (D6) functions. The result was a big red box with this message:

User warning: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs query: content_write_record ...

Technologies: 

Key to removing all bookmarks from PDF with PDFtk command-line

Periodically, there is a need to remove all bookmarks from a PDF. Sometimes the bookmarks become unwieldy. Sometimes planned document mergers render the bookmarks superfluous. Other times, you just don't want them. Regardless of the motivation, pdftk seems like an appropriate tool for quick adjustments of this sort. Unfortunately, as its features have evolved, this is a use case of apparently secondary concern.

Technologies: 

Bootstrap Drupal from other scripts

Drupal 7 has an issue discussing some strategies for inclusion. However, I wanted to accomplish a similar task in Drupal 6. One flaw with triggering the standard Drupal bootstrap is that it attempts to handle the request. A strategy that was more successful for me, at least within the context of command-line scripts, was to bootstrap Drupal via Drush to avoid the Drupal FrontController pattern. The code was pretty simple.

Technologies: 

QuipXML

QuipXml is chainable PHP objects for manipulating XML. Unlike other libraries that attempt to replicate jQuery syntax throughout, Quip attempts to provide lightweight extensions to SimpleXML to facilitate cleaner code without imposing JavaScript conventions on a PHP project. The end result is fast and easy to use.

Technologies: 

VPN Error 0x80072afc: The requested name is valid, but no data of the requested type was found.

I encountered this error while working on a SSL (SSTP) VPN setup. The distinctive characteristic was that we defined the VPN host in the computer's hosts file, although the same error could be encountered by an improperly configured DNS entry.

Supporting extremely large file uploads with PHP

Any time you think about "unlimited," you likely think about the cloud, and that is about the only way to do this. With PHP, any standard file upload must remain under the post_max_size and the upload_max_filesize. There are client-side solutions that can chunk a file to make it uploadable without increasing your limits, but even those require you to pay close attention to your disk space and to your temp directory space. Chunking the upload and storing the chunks on cloud-backed storage can address most concerns. However, the combination of Amazon S3, Amazon IAM and Plupload provide a compelling stack that allows for unlimited uploads to a secure cloud-based storage provider without any impact on your web server. Below are some of the keys steps that facilitate leveraging these exciting technologies.

SPLash

The Standard PHP Library (SPL) provides various utility classes and interfaces to address common problems. Some of the most visible solutions center around the SPL Iterators. The ability to iterate over a non-array collection and then to iterate over that iterator creates an interesting design pattern for building with PHP. However, the iterators deprioritize conciseness and therefore (to some degree) readability.

Technologies: 

Get Server's Local IP with PHP

There is an easy way to get the local IP of a server using PHP.

Technologies: 

Pages