Compiling PHP 5.6 on Fedora

Here's the dependencies and configuration I use to compile PHP 5.6 on Fedora.

First Download PHP 5.6 to `/usr/local/src` and extract it.

Next, install all the devel libraries required to configure and compile PHP:

dnf install  libxml2-devel openssl-devel bzip2-devel \
libcurl-devel libjpeg-turbo-devel libpng-devel gmp-devel  \
libmcrypt-devel libtidy-devel libxslt-devel

Now create a file named `configure.sh` in the PHP source directory and add the contents below:

React Native Live Templates for PhpStorm or WebStorm

When creating a new react native component, there's a bit of boilerplate code to start off with.

With PhpStorm or WebStorm, you can create a live template to knock out the boilerplate code pretty easily.

The goal is to create a new file and type rncf+TAB for a functional component with a name based on the file name, or rncc+TAB for a class component.

1) Go to: Preferences -> Editor -> Live Templates.

2) Click the + button and add a new Live Template Group named React Native.

MySQL Query with Lowercase Flag

I recently needed to provide an export of string values in a MySQL table that began with a lower case letter.

This query will produce 3 columns: id, name, and lowercase. Rows that begin with a lower case letter will have a 1 in the lowercase column.

SELECT id, name, 
    IF ((BINARY UPPER(SUBSTRING(name, 1, 1 )) = BINARY (SUBSTRING(name, 1, 1))) , "", "1") AS lowercase
  From mytable 
  WHERE name;

Slow PWM for heating liquids with Arduino

I've been preparing to dive into electric home brewing, where the kettles are heated with an electric heating element rather than a gas fire.

The purpose is so I can control the heating element, making it much easier to automate and maintain specific temperatures.

My goal with this exercise was to define a frequency (in milliseconds) and a duty cycle as a percentage (defined as a float, 0.0 to 1.0), then blink an LED to simulate a heating element firing.

Simple AWS Backup/Retention Solution in NodeJS

I needed a tool which would create snapshots and remove them based on a per-volume retention period. There's plenty of scripts out there but I found nothing ideal, so I decided to write a utility from scratch utilizing NodeJS and the aws-sdk module.

I didn't want to maintain config files outside of AWS to define what should be backed up and how long they should be retained. I decided to leverage the AWS resource tagging to define what volumes should be managed with this automated backup management tool.

PostGIS Query for a Point Within a Polygon

I've started digging deep into PostgreSQL and PostGIS for a very geo centric project I'm working on.

PostGIS is an extension that provides geo spatial functionality to PostgreSQL.

Let's say you have a table of neighborhoods, where each record contains an id and a list of coordinates that make up the boundary of each neighborhood.

The following query would return the id of the neighborhood the coordinates -117.289 33.949 exists within.

Proxy Jira 7 Over https with Nginx

I run self-hosted atlassian products and wanted to serve Jira, Stash, and Fisheye on the same server over https.

Users would connect securely to Nginx, and Nginx would proxy Jira locally over standard http. I'm using AWS and the security group (firewall) has all incoming ports locked down except ports 80 and 443.

Java configs & AJAX requests ended up making this a little more complicated than anticipated so I thought I would document the details.

The Goal

Serve the apps at the following addresses:

Why Kalabox V2 Matters to Project Owners

Project Owners?

By project owners, I am referring to individuals such as consultants, team leads, and technology directors. If you make the decision on what goes into the repo, you can spend a little time setting up a Kalabox profile, and your developers have the option to run your application stack as it is intended, with minimal effort, on their OS of choice.

Restify OAUTH Token via Query Parameter

It's probably not a "best practice", but I had a need to support a client sending an OAUTH token via a query string instead of in the request header.

The restify-oauth2 module needs the token to be in an `authorization` header of the request.

I was able to utilize `server.pre` to set the header accordingly if `token=` is detected in the query string.