Skip to content

Instantly share code, notes, and snippets.

View asselstine's full-sized avatar

Brendan Asselstine asselstine

View GitHub Profile
@asselstine
asselstine / hotfix.sh
Last active April 3, 2020 12:12
hotfix workflow
# My Heroku git production remote is called 'production'
git remote -v
# Yields:
#
# origin git@github.com:Loft47/loft.git (fetch)
# origin git@github.com:Loft47/loft.git (push)
# production https://git.heroku.com/loft47-prod.git (fetch)
# production https://git.heroku.com/loft47-prod.git (push)
# staging https://git.heroku.com/vey-staging.git (fetch)
When you have a bunch of poorly written Rails migrations that include data migrations, sometimes it is impossible to update very old databases because the migrations required old versions of the code.
How to get around this?
Use git-bisect.
#!/bin/bash
VOL_ID=$1
DESCRIPTION=$2
MAX_BACKUPS=$3
ERROR_EMAIL=test@developer.com
LOG_FILE=~/aws_vol_backup.log
function log {
@asselstine
asselstine / rbenv.yml
Created November 28, 2013 22:42
Ansible script to install rbenv. Intended for CentOS images.
---
# file ruby.yml
- hosts: all
gather_facts: false
sudo: true
vars:
# Where to install rbenv
- rbenv_root: /usr/local/rbenv
# The version of Ruby to install