Skip to content

Instantly share code, notes, and snippets.

View kuno's full-sized avatar

kuno kuno

View GitHub Profile
@kuno
kuno / openresty.sh
Last active December 31, 2015 17:19
Dowloading, building, installing openresty from source
#!/bin/bash
VERSION=1.4.3.9
echo '[CMD] Install dependencies'
sudo apt-get install -y libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make
echo '[CMD] Downlaod openresty'
wget http://openresty.org/download/ngx_openresty-${VERSION}.tar.gz
echo '[CMD] Build openresty'
# this will install everything as root, so take that into account before you run it
# need cmake, python development headers, ZLib and OpenSSL
sudo apt-get install cmake python2.7-dev zlib1g-dev libssl-dev
mkdir libgit && cd libgit
git clone git://github.com/libgit2/libgit2.git
cd libgit2
// Named constants with unique integer values
var C = {};
// Tokenizer States
var START = C.START = 0x11;
var TRUE1 = C.TRUE1 = 0x21;
var TRUE2 = C.TRUE2 = 0x22;
var TRUE3 = C.TRUE3 = 0x23;
var FALSE1 = C.FALSE1 = 0x31;
var FALSE2 = C.FALSE2 = 0x32;
var FALSE3 = C.FALSE3 = 0x33;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>devops.local.graphite</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
var zmq = require('zmq');
function Majordomo(options)
{
this.requests = zmq.socket('router');
this.requests.identity = 'majordomo:incoming:' + process.pid;
this.responders = zmq.socket('dealer');
this.responders.identity = 'majordomo:outgoing:' + process.pid;
if (options)
this.configure(options);
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>devops.local.graphite</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
@kuno
kuno / goagent.local.proxy.plist
Created May 27, 2013 03:40
osx plist file for goagent local proxy
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>goagent.local.proxy</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
@kuno
kuno / index.js
Last active December 16, 2015 07:58
Embarq development server
var path = require('path');
var debug = require('debug')('devops:index');
// Dependencies
// ---
var carcass = require('carcass-plus');
// Mock.
var amqp = require('amqp');
var connection = amqp.createConnection({ host: '127.0.0.1' });
// Wait for connection to become established.
connection.on('ready', function () {
console.log('connection ready');
//
connection.exchange('devops', {}, function(exchange) {
var amqp = require('amqp');
var connection = amqp.createConnection({ host: '127.0.0.1' });
// Wait for connection to become established.
connection.on('ready', function () {
console.log('connection ready');
// Use the default 'amq.topic' exchange
connection.queue('logger', function(q){