Skip to content

Instantly share code, notes, and snippets.

View johnallen3d's full-sized avatar

John Allen johnallen3d

View GitHub Profile
@johnallen3d
johnallen3d / gist:2923935
Created June 13, 2012 13:04
NOTES: Advanced Git Training by Github.com

General

  • HEAD current commit on current branch

  • git log

    -1 : most recent one (1)

    --stat : shows files changed in commit

@johnallen3d
johnallen3d / deliver_stories.rb
Created November 3, 2012 20:07
A script to connect to tracker, look for finished stories, grep the git log, and mark the finished ones as delivered
#!/usr/bin/env ruby
# gem 'pivotal-tracker'
require 'pivotal-tracker'
TRACKER_TOKEN = "..."
TRACKER_PROJECT_ID = "..."
PivotalTracker::Client.token = TRACKER_TOKEN
PivotalTracker::Client.use_ssl = true
@johnallen3d
johnallen3d / README.md
Created December 18, 2012 17:49
Clean up abandoned Resque workers.

Prune Resque Workers

There is an issue related to running Resque on Heroku and Resque's ability to clean it's state information for workers. This is mostly a cosmetic issue however we got to a point where the Resque Dashboard would timeout because it was trying to display hundreds of workers it thought were sitll running.

This is a heavy handed approach to cleaning up. We are finding any worker that was stared longer than a day ago and manually calling the unregister method. Be advised this will throw DirtyExit errors.

@johnallen3d
johnallen3d / ruote-cleanup.rb
Last active December 9, 2015 23:58
Our Ruote storage has collected some cruft over time. We have a fair number of abandoned (leftover) items in storage that can be killed. In addition because our workers are running on Heroku they are not being cleaned up properly.
# **** grab a reference to the redis instance ****
redis = RuoteKit.dashboard.storage.redis;nil
# **** delete all errors ****
redis.del(redis.keys('*errors*'))
# **** delete all expressions and workitems from march 2013 ****
redis.del(redis.keys('expressions*201303*'))
redis.del(redis.keys('workitems*201303*'))
@johnallen3d
johnallen3d / travis-broken.json
Last active November 7, 2020 16:33
Travis CI example webhook payloads
{
"id": 25418135,
"repository": {
"id": 2372423,
"name": "travis-ci-webhook-receiver",
"owner_name": "connexio-labs",
"url": "https://github.com/connexio-labs/travis-ci-webhook-receiver"
},
"number": "6",
"config": {
@johnallen3d
johnallen3d / notes.md
Created June 9, 2014 17:22
Vagrant Troubleshooting

Delayed Vagrant Up

If after a halt and up vagrant appears to stall at this step...

==> docker: Waiting for HGFS kernel module to load...

run vmware setup and except all defaults and this should saolve the issue.

@johnallen3d
johnallen3d / .rubocop.yml
Created June 17, 2014 17:57
Connexio Labs Standard Rubocop Config
AllCops:
Excludes:
- vendor/**
- bin/**
- config/puma*
Documentation:
# don't require classes to be documented
Enabled: false
@johnallen3d
johnallen3d / delete-vpc.bash
Created April 1, 2015 19:01
Destroy AWS VPC Relies on a docker image with the aws-cli pre-installed
#!/bin/bash
# docker run --rm -t -i -v $(pwd)/.awscreds:/root/.aws alexturek/aws-cli-docker configure
alias aws="docker run --rm -t -i -v $(pwd)/.awscreds:/root/.aws alexturek/aws-cli-docker"
# vpc name
name=Sandbox
# query for vpc idvpc
@johnallen3d
johnallen3d / docker-compose.yml
Created July 23, 2015 22:45
scala-kafka / kafka / zookeeper / schema registry in docker-compose
eventstream:
build: .
command: tail -f /dev/null
volumes:
- .:/usr/src/app
- ./.ivy2:./root/.ivy2/cache
links:
- kafka
- registry
- zookeeper
@johnallen3d
johnallen3d / boot2docker-to-docker-machine.sh
Last active August 28, 2015 19:28
Script to migrate from boot2docker to docker-machine
# update homebrew
brew update
# install cask (if necessary)
brew install caskroom/cask/brew-cask
# or update cask
brew update cask
# create a dev machine that is a copy of the boot2docker image