Skip to content

Instantly share code, notes, and snippets.

View blalor's full-sized avatar

Brian Lalor blalor

View GitHub Profile
@blalor
blalor / keybase.md
Last active February 13, 2016 03:49
keybase.md

Keybase proof

I hereby claim:

  • I am blalor on github.
  • I am blalor (https://keybase.io/blalor) on keybase.
  • I have a public key ASBJhMUPPLE8Bt4qb6oj2khV8Xkz6ylOlVerdzNBi3r0Xgo

To claim this, I am signing this object:

@blalor
blalor / README.md
Created November 7, 2015 11:04
Bulk move messages from All Mail to Trash

I hate GMail, but sometimes you gotta. They're notoriously awful at deleting lots of messages at once, as their own search engine will tell you. I had more than 1,000,000 messages I needed to purge and couldn't do it using their own tools. So I wrote my own.

@blalor
blalor / consul_handler.rb
Created July 2, 2015 14:03
Chef report handler for Consul
## chef report handler for Consul
## depends on a chef-client check being registered with the agent
## • pings TTL-style check with ok/warning status on chef run pass/fail
## • stores run report and node attributes in chef/reports/<datacenter>/<consul_node_name>
require "chef/handler"
require "rest_client"
class ConsulHandler < Chef::Handler
attr_reader :config
@blalor
blalor / bb_create_pr.sh
Created March 20, 2015 17:24
Bitbucket shell tools
#!/bin/bash
set -e -u
title="$1"
username=$( jq -r .user $HOME/.bitbucket_creds )
password=$( jq -r .passwd $HOME/.bitbucket_creds )
# get repo name from the current repo
@blalor
blalor / README.md
Created July 18, 2014 11:21
OS X Docker dev env with Vagrant that doesn't suck entirely

This'll suffice until boot2docker get their shit together and give me VirtualBox shared folder support.

On OS X, just export DOCKER_HOST=tcp://172.28.128.3:4243 and off you go. All exposed ports can be accessed via 172.28.128.3 (assuming that's the IP you get from VirtualBox).

Your entire home directory is mounted under the same path, so from OS X you can do docker run -i -t -v $HOME/devel/some-project:/srv/some-project image /bin/bash and the volume will be mounted as you'd expect. With a caveat: filesystem notifications (inotify and friends) don't get passed along.

@blalor
blalor / gist:c325d500818361e28daf
Created May 2, 2014 04:37
redhat init script for consul
#!/bin/bash
#
# consul Manage the consul agent
#
# chkconfig: 2345 95 95
# description: Consul is a tool for service discovery and configuration
# processname: consul
# config: /etc/consul.conf
# pidfile: /var/run/consul.pid
@blalor
blalor / README.md
Last active August 29, 2015 13:57
generic nginx proxy for docker
@blalor
blalor / README.md
Created March 13, 2014 13:35
ssh to ec2 instances by Name tag

Log into EC2 instances naturally without having to figure out their public hostname ahead of time!

$ ssh ec2-user@web-prod-1.ec2
Last login: Wed Mar 12 22:06:27 2014
[ec2-user@ip-10-158-37-24 ~]$ 
@blalor
blalor / 00README.md
Last active January 1, 2016 16:19
Public Yum repository in S3

serving a public yum repo via s3

Steps for creating one or more public Yum repositories served via S3 with write access for the owner only. Don't put the repository in the root of the bucket; you won't be able to serve multiple repositories, and if you choose to enable logging you'll expose those publicly, as well.

The only magic here is the S3 bucket policy.

GPG-signed packages and repo metadata are left as an exercise to the reader.

how to do it

@blalor
blalor / Gruntfile.js
Created October 4, 2013 02:50
Grunt task to update a Node.js dependency referenced by git URL.
/* jshint -W064 */
"use strict";
var path = require("path");
var url = require("url");
var assert = require("assert");
var semver = require("semver");
var Q = require("q");
module.exports = function(grunt) {