Handling contact forms on static sites

I originally went the route of rolling my own contact form handler. But instead of setting up my own server (even if mostly already written the way I would want it, see contact-form on GitHub), daemonizing it, proxying requests from Nginx, and then remembering how I set it all up 6 months from now, I found another service. FormKeep look awesome, but their lowest pricing option is way more expensive than I need for a paltry little contact form on a site that barely gets any traffic....

September 3, 2016 · 1 min · Justin Langhorst

Creating and rotating log files from piped input

Say you have an application that sends logs to STDOUT and you want to capture that stream, log it to a file and rotate the files based on time and/or size. rotatelogs is a small utility bundled with Apache’s HTTPD that can do it for you. ...

April 6, 2015 · 1 min · Justin Langhorst

Wiki on BeagleBone Black

I just picked up a Rev 4 BeagleBone Black from Micro Center for ~$40 with the intent of using it as a wiki server for both my own personal notes and those for my home and family. While the BeagleBone comes with an embedded 4GB chip pre-installed with Debian, I need more space to store my notes, so I also picked up a 16GB micro SD card. Since the BeagleBone Black (BBB) is more powerful than the Raspberry Pi, I suppose you could use pretty much any wiki software that runs on the ARM architecture with reasonable performance. But, I wrote software specifically for this purpose: a Git-backed Markdown-based wiki in a single executable - Goiki. This is what I’ll be running. ...

January 3, 2015 · 5 min · Justin Langhorst

Hosting multiple domains with Nginx in Ubuntu 14.04 on Digital Ocean

So I was having problem with my previous server. Now that I’ve rebuilt everything I’ve realized that the problem I was having could have been easily fixed with my previous install. But, it doesn’t matter; it was time to upgrade from Ubuntu 12.04 to 14.04 anyway. The goal of the server is simple: host two domains using Nginx. The problem I was having with the 12.04 install was that I could never get the second domain to serve up the right files; it would always serve up the first domain. This turned out to be a problem with the Nginx configuration. I thought this was the case at the time, but since the install wasn’t doing anything else anyway, I thought it was a good time to rebuild and start from scratch. ...

July 12, 2014 · 3 min · Justin Langhorst

Octopress on S3

I’m currently working on redoing a company website, moving from WordPress to Nanoc. Since the new website will be static, and mostly a single-pager for a while, we now have the option of moving from a traditional host to the Amazon S3 datastore. Before committing a company website to the process, I decided to go ahead and move this blog over to S3 (it uses Octopress) first. Here are a few notes that I jotted down along the way. ...

July 11, 2013 · 2 min · Justin Langhorst

Using AirPort Utility 5.6.1 in Lion

So I’m in the beginning stages of planning a whole-house automation system. Since music is pretty damn important to me, the first part of this system I’d like to get right is whole-house audio. I want to be able to play music in pretty much any room I’m in, all controlled from my phone or tablet. Since I’m already running Apple products everywhere, it just makes since to use an AirPort Express for each zone. ...

January 18, 2013 · 2 min · Justin Langhorst

pbcopy | pbpaste, and opening a new terminal tab in the current working directory

While I try my best to improve all areas of my life continuously (kaizen), sometimes I fail to perform with exemplary status. Countless times a day I have the need to open a new Terminal tab in the same working directory. Before today, I issued a pwd command, copied the output using the mouse, Command-T, and cd Command-V. Ugh. That’s a convoluted mess. ...

October 31, 2011 · 2 min · Justin Langhorst

A Big Smile ... Ruby and Erlang

A big smile appeared on my face tonight after typing the following: -module(math1). -export([factorial/1]). factorial(0) -> 1; factorial(N) -> N * factorial(N-1). def factorial(n) return 1 if n == 0 n * factorial(n-1) end Maybe not so obvious. But check this out: -module(temp). -export([convert/2]). convert({fahrenheit, Temp}, celsius) -> {celsius, 5 * (Temp -32) / 9}; convert({celsius, Temp}, fahrenheit) -> {fahrenheit, 32 + Temp * 9 / 5}; convert({reaumur, Temp}, celsius) -> {celsius, 10 * Temp / 8}; convert({celsius, Temp}, reaumur) -> {reaumur, 8 * Temp / 10}; convert({X, _}, Y) -> {cannot,convert,X,to,Y}....

August 25, 2006 · 3 min · Justin Langhorst

Adding to the Ruby Logger

I’ve been working on some new code at work for a new install. Unfortunately, I’m unable to use the new framework just yet (mainly because it’s not complete), and I needed a workaround for the Ruby Logger to be able to accept .trace calls (we usually use Log4r. Here’s my workaround: require 'logger' # Redefine the Logger to allow for TRACE calls. class Logger module Severity TRACE = -1 end def trace?...

June 23, 2006 · 1 min · Justin Langhorst