Skip to content

Instantly share code, notes, and snippets.

View blalor's full-sized avatar

Brian Lalor blalor

View GitHub Profile
@blalor
blalor / gist:5527096
Last active October 9, 2017 14:50
redhat → debian, arch rosetta stone
@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 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 / systemd-nspawn
Created February 25, 2016 18:06
systemd-nspawn replacement [containers/build#162]
#!/usr/bin/env bash
## this is a total hack. acbuild needs systemd-nspawn. initially, I tried
## running the go agent in a rkt container, but failed for reasons I forget
## right now (overlayfs problems?). then I ran into more problems with systemd-
## nspawn on CentOS 7.1, and I forget the origin. we're getting closer: in
## CentOS 7.2 I'm able to run acbuild as root outside of a container. but when
## running within the go agent, systemd-nspawn is killed for no discernable
## reason. so, we're back to faking out acbuild by providing this systemd-
## nspawn-alike.
@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 / 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) {
@blalor
blalor / 00README.md
Last active December 19, 2015 10:59
Vert.x SockJS memory leak diagnosis

Vert.x 1.3.1.final SockJS memory leak reproduction

This gist contains code to reproduce a memory leak in Vert.x when a SockJS client fails to disconnect cleanly. Also provided is a heap dump generated by the JVM on my laptop.

overview

Vert.x has a memory leak in its SockJS implementation. If a SockJS client connects, subscribes to EventBus messages (via the EventBus bridge), and then disappears without closing its connection, Vert.x will continue to accumulate pending writes until memory is exhausted. I have reproduced this with multiple transports. This scenario can happen in the real world if the client has a flaky network connection, or perhaps if the user merely puts their laptop to sleep.

requirements

@blalor
blalor / make_debs.sh
Last active December 17, 2015 10:49
Creates Debian packages for whisper, carbon, graphite-web. sources: * https://github.com/jbraeuer/graphite-debs
#! /bin/bash
#
# requires: fpm, python-pip
# gem install fpm
# apt-get install python-pip
#
set -e