Skip to content

Instantly share code, notes, and snippets.

@mhamrah
mhamrah / [email protected]
Last active September 27, 2020 17:54
FleetCtl Service File for Consul/Docker on CoreOS
[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
@mhamrah
mhamrah / Dockerfile
Created February 5, 2014 03:45
Smple dockerfile for mysql
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
#Michael Hamrah
require 'rspec'
def flatten(input)
array = []
input.each { |x| (x.respond_to? :each) ? array.concat(flatten(x)) : array.push(x) }
array
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