Blog Archive

2024

Back to Top ↑

2021

Back to Top ↑

2020

Building Emacs 27.1 on macOS Big Sur

1 minute read

It’s been a while since I posted a Emacs build walk-through, one version of macOS has come and gone and a new major version of Emacs has arrived, let’s get t...

Not Stupid SSH Tricks: Automatic ssh-add

less than 1 minute read

If you password protect your SSH keys (and you should) and you don’t store those passwords in your macOS keychain or Linux equivalent (slightly paranoid, but...

Back to Top ↑

2019

Updated Emacs Open with Line Numbers

1 minute read

Not long ago I shared a Bash function that takes filenames in the form of filename.rb:NNN, where NNN is a line number, opens the file in Emacs, and jumps to ...

Opening Files with Line Numbers in Emacs

1 minute read

Long ago I shared my EmacsClient setup. The short of it was that I always have Emacs running and set $EDITOR in such a way that things like git commit open a...

Back to Top ↑

2018

Building Emacs 25 on macOS High Sierra

1 minute read

macOS High Sierra is out and it’s time once again to build Emacs. Nothing has really changed since my 2017 Sierra update, but let’s put it all together… Bef...

Back to Top ↑

2017

Building Emacs 25 on macOS Sierra 2017 Update

less than 1 minute read

A quick update to Building Emacs on macOS Sierra. I recently had to rebuild Emacs due to brew updating the version of libjpeg. My walk-through almost works, ...

Sleepless Mac

1 minute read

Ever put your Mac to sleep only to come back find it’s still awake? This happens because something is telling the power management subsystem it can’t sleep y...

Creating an S3 Website Redirect from the CLI

2 minute read

A quick one today — creating S3 Static Website Hosting redirects with the AWS CLI. Clients often want to have www.example.com redirect to example.com or vice...

JWT Based “Sessions”

4 minute read

OK, you’re in a situation when you can’t use cookies, specifically you’re in an iframe and Safari will only accept a cookie in an iframe if the browser has a...

When you can’t use cookies

2 minute read

So, I’ve looked at the utility and security of cookies and I’ve at looked the utility and security of sessions. It you’ve been following along, then you know...

Capistrano SSH

2 minute read

A quickie this time. I use Capistrano to deploy my Rails apps. There was a gem for Capistrano 2 that added an ssh command as in:

Rails in Session

4 minute read

Last time I took a reasonably deep dive in cookies. Cookies can keep state information and setting for visitors to a site. However, by default they aren’t se...

C is for (HTTP) Cookies

4 minute read

I’ve been working on a post about using JWTs JSON Web Token (JWT) when you can’t use HTTP cookies for sessions. As I dug into it, I came to realize that unde...

Grabbing SSH Keys from GitHub

1 minute read

A quickie this week. When I’m wearing my Ops Hat (I totally need to make me an “Ops Hat”, something with lights and a grappling hook), I often find myself se...

JWT Basics

2 minute read

JSON Web Token (JWT) have come in to my life. I like them and you will too… Pronounced “jot”, the short version is that they are cryptographically signed blo...

Better Whois

2 minute read

whois is a command line tool to look up registration information for domains, things like owner, location, and contact info. WHOIS (all caps) is a protocol f...

Shell Secrets

1 minute read

Speaking of secrets, here’s how I keep them in the shell. Why do I have secrets in the shell? Typically, they are things like API keys and passwords for web ...

Secret Rails Configurations

2 minute read

Last time, I looked at keeping environment specific configuration using YAML files and Rails.application.config_for. One big issue with this approach is secu...

Back to Top ↑

2016

Custom Configuration for Rails Environments

3 minute read

Previously, I looked at the simply way of creating Rails stages that shared same configuration with Production by simply importing production.rb into the new...

Quick and Dirty Rails Environments

1 minute read

A quick tip — When I’m deploying Rails apps to Staging or Beta I try to keep the configuration as close to Production as possible. I’ve gotten bitten one too...

NGINX SNI

less than 1 minute read

Well, I might as well round out my Server Name Indication (SNI) sort of series by taking a look an nginx. Does your nginx support SNI? You can check by runni...

HAProxy SNI

2 minute read

Last time, I looked at configuring Server Name Indication (SNI) with Apache. It just so happened I needed to set up SNI with the HAProxy Load Balancer last w...

Apache SNI

2 minute read

I covered Server Name Indication (SNI) a while back, but it still surprises me how little people know about it. So, it’s time to look at configuring Apache t...

These Are the Inodes You Are Looking For

2 minute read

Ever gotten a disk full error, only to run df and not see any full disks? After banging you head against the wall for a while, you remember to run du -i and ...

Importing Legacy Data into Your Rails App

3 minute read

Sometimes you have to write a new Rails app for old data. One approach is to keep the old format and carefully craft your ActiveRecord models to work with th...

The iOS Simulator 2016

1 minute read

An update to an older post about using the iOS Simulator from the command line.

Getting the ngrok URL

less than 1 minute read

A quick addendum to my previous ngrok post. If you are not using subdomains, it can be useful for your app to know what ngrok’s dynamically generated URL is....

Autostart ngrok with Rails

2 minute read

I’ve been using ngrok on quite a few projects lately. I’ve written about it before, but in short, it solves to problems for me.

How I Start Rails Projects

3 minute read

Everyone has their patterns, here’s mine for starting a new Rails project:

Cheap SSH VPN

2 minute read

Recently (I seem to start a lot of posts with “Recently”), I was on the road needed to access a server that was behind a firewall. There was no VPN and acces...

Dotfiles II: Choosing BASH Startup Files

3 minute read

A post or two back, I looked at having BASH detect if I was on my “desktop” (for lack of a better word) or a server and decided the best approach was to hard...

Sudo, Rsync, and Authentication Forwarding

2 minute read

rsync will happy copy files between servers and will keep the ownership and permissions the same. However, if you aren’t the owner of all of the files then o...

Dotfile Organization Part I: Local vs. Remote

2 minute read

I’m embarking on a long, long over due project to organize my dotfiles, you know, all those files in your home directory that start with “.” and configure yo...

Invalidate CloudFront and Wait

2 minute read

In my occasional series on waiting for things, I setup a BASH function to wait for AWS CloudFront invalidations. I mentioned it would be possible to invalid ...

Fun with pushd

3 minute read

Here’s about as esoteric a post as I ever write, my love of pushd and it’s little abused directory stack. If you don’t live on the command line, move along, ...

Get the MIME Type of a Random Upload in Rails

1 minute read

It’s surprisingly hard to find info on getting the MIME type of a file in Rails. Rails has MIME::Type (and the confusing and undocumented MIME::Types). You c...

How I Learned to Code Part III

3 minute read

So, first I talked my first programming experience, learning via type-in programs. Then I looked at the shotgun approach my university took. In this final po...

How I Learned to Code Part II

2 minute read

Last time I talked about my first experience with coding, entering and debugging a type-in program on a mainframe. This time, how I learned “Computer Science...

How I Learned to Code Part I

3 minute read

It’s Boulder Startup Week. With so many tech startups in town, there a lot of focus on code and coders. How do you become a developer? What developer career ...

BASH Autocompletion

3 minute read

A couple of posts back, I showed off some functions to pop up notifications when a host became pingable again or when a port became reachable. Today’s (semi)...

Is the Server Up Yet?

5 minute read

I hate waiting, but I have to do a lot of it. Waiting for servers to restart. Waiting for services to come up. Waiting around for a Yes or a No. To that end ...

Using Signals to Display Process Status

1 minute read

A couple of posts back, I wrote about how you can get status info out of a long running dd process by sending it a signal. The functionally is something you ...

Getting Uploaded Data Out of AWS S3

3 minute read

OK, so you know how to get data into AWS S3, what about getting it out? Previously, we uploaded entries from an imagined photo contest into a bucket. We sent...

Uploading Form Data Directly to AWS S3

3 minute read

A couple of posts back, I walked through uploading an image to AWS S3 without the need for a server of your own. This has the advantage of being a fully stan...

Direct to S3 Uploads with AJAX Presigning

3 minute read

Previously, I covered uploading to S3 from a Rails app using a presigned-url. This works just fine, but means the data flows from the visitors computer to yo...

Advanced Ruby IMAP

3 minute read

Previously, I worked through how to get messages from an IMAP server and work with the message headers. Let’s look at extracting data from those messages. A...

Ruby and IMAP

4 minute read

There’s a really solid, tried and true, Internet wide messaging queue. It’s been around for decades and has first class support in Ruby. What is it? Email. T...

Bullet Journal

1 minute read

Here’s something slightly random and the exact opposite of technical, the Bullet Journal.

Stupid ssh-add Tricks

2 minute read

If you are reading my blog, odd are you already know how to use ssh-add to manage you SSH keys. If not, you can read up on it.

Web Storage

4 minute read

Recently, I had the task of speeding up the response time of an app that depended on a remote API. The issue was that the API could take a long time to respo...

Laziness: curl Host Header

1 minute read

For some reason, I can never remember the right command line option for setting the Host HTTP header with curl. It’s actually something I need to do fairly r...

Tunneling to Localhost

4 minute read

When you’re developing Rails apps or pretty much any other framework you can name, you typically work with a server running on localhost. This is all well an...

The Sekrets Gem

2 minute read

I occasionally write about encryption in Ruby, yet somehow I haven’t managed to cover my friend Ara’s Sekrets gem.

Back to Top ↑

2015

Writing is Hard

2 minute read

Writing a blog turns out to be hard. This blog has been around since 2007, but at most, I wrote something three or four times a year. In late 2014 I committ...

Building Emacs on OS X El Capitan

2 minute read

Last week I wrote about my issue with Emacs’ visible-bell on OS X El Capitan. I figured it was about the most esoteric thing I’ve written, but it may have go...

Emacs Visible Bell Work-Around on OS X El Capitan

less than 1 minute read

After I upgraded to OS X El Capitan‎, I started having random display issues with my build from source version of Emacs. After a while I realized that it was...

Client Certificate CA Setup and Signing

2 minute read

Previously, I wrote about the promise of using Client SSL Certificates for authentication. With this post, we start down the road of actually putting this in...

Validating Rails Forms “without” a Model

1 minute read

Sometime I want all of Rails’ form bells and whistles for something that isn’t a database backed model. For example, I use this as a handy way to get form va...

diceware.rb Revisited

2 minute read

A while back I wrote about Diceware, a system for generating password using dice and a word list. I also include a Ruby script that use virtual dice.

UNIX User Management

1 minute read

This is one of the blog posts to set something in my mind that I’m always looking up. Linux has lovely tools for adding and managing users, but I can never r...

xargs

3 minute read

How to you take a list of files and do something with them in the UNIX shell? xargs is the key.

Arguments For Your Shell Aliases

2 minute read

I’ve touched on shell aliases and functions a few times, today I wanted to get in to a little more detail on passing arguments to them.

Another 3D Update

less than 1 minute read

Another progress update on my RepRep 3D Prusa Mendel. After digging into the laying issue, I narrowed it down to a likely slicing issue. And, after a lot of ...

3D Progress

less than 1 minute read

A quick update on the RepRep 3D Prusa Mendel I’m working on. I made a print! Several actually.

FUSE and SSHFS on OS X

3 minute read

There’s a handy tool for Mac users that I rarely see getting use, the SSHFS filesystem. SSHFS is a FUSE filesystem uses the SSH File Transfer Protocol (SFTP)...

Web-Scale HTTP Tail

2 minute read

Previously while talking features of the HTTP Range header I wrote:

More Fun with the Range Header

1 minute read

In my previous post about codeless APIs I made use the HTTP Range header to download only a portion of the file from a web server or cache (byte serving).

Codeless API

4 minute read

What if I told you that you could create a API backend that didn’t require any code? Crazy right? Wrong! Picture a client side Javascript app that displays ...

Renaming Files

2 minute read

A quickie today, renaming a bunch of files in the shell. Unix gives you million ways to do it, here are a few that will help you understand your tools better.

The Map Gem

1 minute read

There’s one Ruby gem that make it into practically every Ruby project I write, my friend Ara’s Map. Really, it’s a coincidence that I know Ara, this gem spee...

Managing SSH Keys

1 minute read

To securely access your servers you use SSH keys. Passwords can be guessed, just look in your logs to see all the people trying. But, you know that. You’ve g...

Legacy Deploy with Capistrano

2 minute read

So, you’re on a rescue project with some legacy code (and by “legacy” I almost always mean PHP). The old developer probably just FTP’ed changes up to the ser...

Patching between Git repos

2 minute read

While the fame and free cars are nice, the reason I blog is to learn, or, as in this case, to help me remember things.

iTerm Tear Off Tabs

2 minute read

I like iTerm 2 (and I can not lie). I use a Mac and spend most of my days in the terminal (and Emacs). When a window system first came into my life, it was X...

Backups With Rsync and launchd

3 minute read

Previously, I wrote about backing up files to Dropbox with rsync. I automated the process with cron the ancient UNIX “time-based job scheduler”. While OS X s...

Debuging RAMPS Stepper Problems

3 minute read

This is a bit of a departure from my usual Ruby, Ops, and Security posts. However, recently I acquired a mostly completed RepRep 3D printer and wanted to doc...

Quick and Dirty Backups with rsync

2 minute read

One simple way to back up files is to copy them to Dropbox. However, manually copying files does not constitute a good backup, you’re going to forget.

Launchy

less than 1 minute read

In my last post about an alias that opened a URL from the command line, I said:

Open Github Repos From the Command Line

less than 1 minute read

If you’re ever sitting in a Git repository in the shell and want to view it on Github, here’s some quick laziness.

(Symmetric) Encryption with Ruby (and Rails)

5 minute read

I wrote and maintain (though not as attentively as I’d like) a Ruby Gem, Strongbox, which adds Public-key Encryption support to Rails’ ActiveRecord. Simply p...

Open the iOS Simulator from the Command Line

1 minute read

When I need to test web apps on an iPhone or iPad, I use the iOS Simulator that ships with Xcode1. The Simulator is intended for developers testing native ap...

Building a Portable Emacs for Mac

2 minute read

A visitor, Rakkesh, stopped by with a question about Building Emacs 24.4 From Source on the Mac. He had an issue that when he built Emacs on one machine (a M...

Diceware for Passwords

2 minute read

Making up passwords is hard. You want something you can remember which is and you need something difficult to guess or brute force.

Laziness with Make

2 minute read

I have lots of shell aliases/functions for repetitive tasks. Copying files to and from servers, removing editor backup files, connecting to specific database...

Back to Top ↑

2014

Working with EmacsClient

3 minute read

Previously, I showed how I set $EDITOR. On my laptop, I actually do something different to take advantage of my favorite Emacs feature EmacsClient. EmacsClie...

Setting $EDITOR with some Smarts

1 minute read

My editor of choice is Emacs. However, in a pinch I can drive vim or vi just fine1. While I prefer Emacs, I can’t think of a UNIX-like operating system that ...

Ban Bad Bots by IP

3 minute read

In the Internet age we live in, it’s not uncommon for web servers to be hit with Unintentional, not so Distributed, Denial of Service (DoS) Attacks. The atta...

Laziness: SCP Alias

less than 1 minute read

I often find myself needing to download files to my local box via SCP. Which means entering the hostname, the path, and the filename in to my terminal window...

Laziness: Remote SSH Usernames

less than 1 minute read

I’m lazy and I’m always looking for ways to avoid any unneeded typing. Here’s a little OpenSSH configuration tip that can save you up to 16 characters (if yo...

Cross-Domain AJAX Request in Development

1 minute read

Sometimes an AJAX request on a page you’re developing needs to hit a server on a different domain. Web browsers’ Same-Origin Policy means (among other things...

Luminate Online Server API Gem

less than 1 minute read

As part of the work Indra did for Stand Up To Cancer’s telethon, I need to make use of Convio/blackbaud’s Luminate Online Server APIs. Luminate Online is a w...

It’s in the Logs, Stupid

less than 1 minute read

Yesterday, I was involved in a fire drill around the launch of a new Rails site on a very tight time frame. The site worked fine in development/staging, but ...

Back to Top ↑

2012

Dynamic Keys for Strongbox

1 minute read

Previously, Strongbox, my gem for using Public Key Encryption with ActiveRecord, allowed only one key pair for encrypting all of the records for a given Acti...

Back to Top ↑

2011

Building Emacs.App From Source on OS X Lion

1 minute read

As always, I like building Emacs for my Mac from source. It lets me live on the cutting edge and have tigher control of the version I’m running. If building ...

Octopress Blog Re-Launch

less than 1 minute read

After years of running on Wordpress, today I’m relaunching my blog using Octopress. Octopress is a blogging framework build on top of Jekyll which in turn is...

Legacy Development with Pow

2 minute read

Pow is a zero-config Rack server that makes developing Rack apps (include Rails apps) a snap on Mac OS X.

Back to Top ↑

2010

Back to Top ↑

2009

Generating RSA Key Pairs in Ruby

1 minute read

I’ve given a number of examples of using Public-key cryptography in blog posts and in the Strongbox documentation, but I’ve always generated the RSA key pair...

Pro Git

less than 1 minute read

Scott Chacon, one of the guys behind GitHub, has released Pro Git, which, as the name suggests, is a new Git book.   He’s made it available under the Creativ...

Introducing Strongbox

6 minute read

Over a year ago I wrote the wildly popular Encrypting Lots of Sensitive Data with Ruby (on Rails). At the end I said: Clearly, this screams for a plugin; w...

Back to Top ↑

2008

Back to Top ↑

2007

Encrypting Sensitive Data with Ruby (on Rails)

2 minute read

In Encrypting Sensitive Data with Perl I wrote about how to use public key encryption to automatically and securely encrypt information with Perl. This allo...

Encrypting Sensitive Data with Perl

4 minute read

It’s not uncommon to have information submitted through a web form that you need to save, but don’t want to have lying around in plain text. Credit card numb...

Back to Top ↑