Skip to content

Instantly share code, notes, and snippets.

View AaronO's full-sized avatar

Aaron O'Mullan AaronO

View GitHub Profile
@AaronO
AaronO / stress_client.py
Created August 21, 2012 15:02 — forked from bombela/stress_client.py
stress PyZMQ to trigger the 'missing event' problem
#!/usr/bin/env python
import zerorpc.gevent_zmq as zmq
context = zmq.Context()
c = zmq.Socket(context, zmq.XREQ)
c.connect('tcp://127.0.0.1:9998')
print 'running'
@AaronO
AaronO / chef_log_optimizer.py
Last active December 20, 2015 01:09
Finds longest resources in Chef-Solo's output logs (useful for finding long and potentially non idempotent ressources).
import re
import sys
import time
DATE_REGEX = re.compile(r'^\[(.*?)\].*$')
DATE_FORMAT = "%Y-%m-%dT%H:%M:%S+00:00"
# Find tasks longer than 3s
THRESHOLD = 3.0
@AaronO
AaronO / extractor.js
Last active December 20, 2015 21:29
Pull links from site to index
// Utility function
var startsWith = function (str1, str2) {
return str1.indexOf(str2) == 0;
}
// Url of page/domain
var baseUrl = "https://friendco.de";
// Utility functions
var hrefExtractor = function(idx, el) { return el.href; };
if(!Function.prototype.bind) {
Function.prototype.bind = function(newThis) {
var that = this;
return function(){
return that.apply(newThis, arguments);
};
}
}
@AaronO
AaronO / t.py
Last active December 22, 2015 08:09
import os
import time
import gevent
def f(x):
gevent.sleep(1)
def main():
@AaronO
AaronO / pr.md
Created October 28, 2013 19:14 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

Anonymous UUID: 6968E206-554B-42CF-3DCF-5F4050C19A9E
Sat Mar 8 11:55:42 2014
Panic(CPU 2): NMIPI for spinlock acquisition timeout, spinlock: 0xffffff8026b7c988, spinlock owner: 0xffffff8023614b20, current_thread: 0xffffff8023614b20, spinlock_owner_cpu: 0x2
RAX: 0x000000000000004a, RBX: 0x0000000000000001, RCX: 0x000000000000004a, RDX: 0x0000000000000042
RSP: 0xffffff811498bd00, RBP: 0xffffff811498bdb0, RSI: 0xffffff802563e0e8, RDI: 0x0000000000000000
R8: 0x0000000000000000, R9: 0x0000000000000000, R10: 0x0000000000000000, R11: 0xffffffffffffff00
R12: 0x0000000000000000, R13: 0xffffff802563e0a0, R14: 0xffffff8026b7c980, R15: 0xffffff8026b7c900
RFL: 0x0000000000000202, RIP: 0xffffff800d9c3cd5, CS: 0x0000000000000008, SS: 0x0000000000000010
Backtrace (CPU 2), Frame : Return Address
#!/bin/bash
# Download and setup grails for Ubuntu
sudo add-apt-repository ppa:groovy-dev/grails
sudo apt-get update
sudo apt-get install grails-ppa
# Add to each bash shell
echo "export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/" >> ~/.bashrc

Installing

This script below downloads and sets up grails on your codebox VM:

#!/bin/bash

# Download and setup grails for Ubuntu
sudo add-apt-repository ppa:groovy-dev/grails

Install cask that extends the brew command :

brew install phinze/cask/brew-cask

Install calibre using cask :

brew cask install calibre