Sat, Feb 13, 2016
Ever done a site migration and not been sure which server you were seeing in the browser? Here are a few steps you can do to verify: We’ll assume you’re changing the site at example.com is currently at 10.0.0.10 and you’re moving it to 172.16.0.11. First let’s check that the DNS changes you made are available: $ nslookup example.com should return something like: server: 8.8.4.4 Address: 8.8.4.4#53 Non-authoritative answer: Name: example.com Address: 172.16.0.11 So here we see the new IP address.

Thu, Jan 28, 2016
Amazon’s S3 is a great, cheap way to host your static site. But if you’re moving over an old site, especially if you’re importing a site from a content management system, you might want or need to change your URL scheme. While it’s not as easy to find in the S3 documentation, it’s actually quite easy. Let’s start simple. Say we have a site that has a number of articles that were posted as www.domain.com/posts/this-is-the-slug.

Mon, May 26, 2014
If you have a previous commit that you would like to reapply - if it’s been overwritten by following commit - you can use git cherry-pick. To start, find the commit hash for the commit/s you want to reapply. Next you need to be be up-to-date with HEAD or the branch you want to apply the commit to. git pull git cherry-pick db7a37742c Unless you’re lucky you’ll get a conflict. The error message isn’t terribly helpful: error: could not apply d346377...

Tue, Feb 11, 2014
I started using Stripes for work and side projects a while back and have been impressed with its simplicity. Their Javadoc documentation is solid, but finding workable examples is tough. There’s a great book by Freddie Daoud that walks through creating an application, but it only goes so far. I spent too much time Googling for the proper place for persistence.xml, for example. Lately I’ve had occasions in troubleshooting behavior where it would be beneficial to back out to a dead simple project to test how something should work.

Mon, Feb 10, 2014
When I was starting out as a sysadmin I would hear and read “don’t use kill -9” all the time. But rarely did anyone explain that to do instead. I saw this the other day and liked it. Randal Schwartz, who wrote many of the Perl books those of us who were sysadmins in the 90s and 00s lived by, would post this to lists. No no no. Don’t use kill -9.

Sun, Feb 9, 2014
I run into this every few weeks - how do you format a date / time in Java? I can never remember exactly and have a hard time finding it via search. So I’ve put it here for my reference. Hopefully it helps someone else as well. | Letter |Date or Time component | Presentation | Examples | |———-|—————————————————————-|——————|———————–| | G | Era designator | Text | AD | |

Thu, Jul 18, 2013
My post on installing RVM Multi-user on CentOS has been fairly well received, so I thought I’d do one for Ubuntu. This install was using Ubuntu Precise 12.04 LTS, RVM 1.21.11, Ruby 2.0, and Rails 4, and Phusion Passenger. First things first. This was a fresh install on AWS so let’s get up to date and install some packages needed for Apache2 / Passenger: sudo apt-get update sudo apt-get upgrade sudo ntpdate pool.ntp.org sudo apt-get install apache2-mpm-worker apache2-threaded-dev libapr1-dev libaprutil1-dev libcurl4-openssl-dev gawk g++ gcc make libc6-dev libreadline6-dev zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev With that out of the way, let’s start installing rvm.

Fri, Jul 12, 2013

Are you like me? Did you install Gradle via brew to check it out? Did you enable the bundled Gradle plugin for IntelliJ? Did you then have trouble figuring out what the Gradle home was? Here’s an easy way to get it. Create a build.gradle with:

task getHomeDir << {
	println gradle.gradleHomeDir
}

Then run it with:

gradle getHomeDir

You should see something like:

/usr/local/Cellar/gradle/1.6/libexec

You can use that to populate the Gradle plugin, and you’re off.


Mon, Jun 3, 2013
I’ve done this to myself a few times. After I hit commit I realize I need to cancel. Unfortunately these usually leaves the local subversion copy with a lock, preventing subsequent commits. The message is something along the lines of: Error: svn: E155004 Commit failed (details follow): svn: E155004: Working copy '/path/to/repo' locked svn: E155004: '/path/to/repo' is already locked. Frustrating. I used to fix this by deleting the lock file with a command like this: find .

Mon, Apr 15, 2013
There are two ways to go about backing up a MongoDB database - either taking a snapshot of the underling filesystem or taking a binary dump of the database. For various reasons we needed to go the binary dump route. We use AWS so the logical place to store the dump was in a dedicated S3 bucket. But how to get it there easily? I’ve used S3fuse in the past and that seemed like a decent option.