This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Diagnostics; | |
using Microsoft.Practices.EnterpriseLibrary.Logging; | |
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration; | |
namespace PerformanceTracer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Michael Hamrah | |
require 'rspec' | |
def flatten(input) | |
array = [] | |
input.each { |x| (x.respond_to? :each) ? array.concat(flatten(x)) : array.push(x) } | |
array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dockerfile my.cnf start.sh | |
vagrant@mesos:~/mysql$ more Dockerfile | |
FROM ubuntu:13.10 | |
RUN apt-get update | |
RUN apt-get -y upgrade | |
RUN apt-get install -y mysql-server | |
ADD /my.cnf /etc/mysql/conf.d/my.cnf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Consul Discovery | |
BindsTo=consul@%i.service | |
After=consul@%i.service | |
[Service] | |
EnvironmentFile=/etc/environment | |
ExecStart=/bin/sh -c "while true; do etcdctl mk /services/consul $COREOS_PUBLIC_IPV4 --ttl 60;/usr/bin/docker exec consul consul join $(etcdctl get /services/consul);sleep 45;done" | |
ExecStop=/usr/bin/etcdctl rm /services/consul --with-value %H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.hamrah.akka.persistence.rocksdb | |
package journal | |
import akka.persistence._ | |
import akka.persistence.journal._ | |
import com.typesafe.config._ | |
import scala.collection._ | |
import scala.concurrent.Future | |
import scala.concurrent.duration._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!!window.EventSource) { | |
var source = new EventSource('/messages'); | |
var el = document.querySelector('#sse'); | |
source.addEventListener('published', function(e) { | |
console.log('published: ' + e.data); | |
var p = document.createElement('p'); | |
p.textContent = e.data; | |
el.appendChild(p); | |
}, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# set -eo pipefail | |
export CONSUL_NUM_INSTANCES=${CONSUL_NUM_INSTANCES:-3} | |
echo " => stopping consul" | |
fleetctl stop -block-attempts=10 \ | |
$(eval echo "consul-server@{1..$CONSUL_NUM_INSTANCES}.service") \ | |
consul-agent.service | |
# FIXME: sometimes it takes awhile for systemd to stop things... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FLEET_HOST=http://gotham.gettyimages.io:8080 | |
SERVICE=$1 | |
DESIRED_SIZE=$2 | |
INSTANCES=($(curl -s $FLEET_HOST/fleet/v1/units | jq ".units[].name | select(startswith(\"$SERVICE@\"))" | grep '\w@\d\.service')) | |
CURRENT_SIZE=${#INSTANCES[@]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if !defined(REQUIRE_EQUAL_CONTAINERS_H) | |
#define REQUIRE_EQUAL_CONTAINERS_H | |
#include <boost/version.hpp> | |
#include <utility> | |
#include <vector> | |
#if BOOST_VERSION >= 105900 | |
namespace boost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"fmt" | |
) | |
// use ldflags to set this var at build time: | |
// go build -ldflags "-X main.version=$(git tag)" | |
// go build -ldflags "-X main.version=$(git rev-parse HEAD)" | |
var version string | |
func main() { |
OlderNewer