Skip to content

Instantly share code, notes, and snippets.

View stevendborrelli's full-sized avatar

Steven Borrelli stevendborrelli

View GitHub Profile
val a = ('a', 2) //> a : (Char, Int) = (a,2)
val b = ('b', 2) //> b : (Char, Int) = (b,2)
val c = ('c', 3) //> c : (Char, Int) = (c,3)
val d = ('d', 1) //> d : (Char, Int) = (d,1)
val list = List(a, b, c, d) //> list : List[(Char, Int)] = List((a,2), (b,2), (c,3), (d,1))
val sub = List(('a', 1), ('b', 4), ('c', 3)) //> sub : List[(Char, Int)] = List((a,1), (b,4), (c,3))
def combo(sub: Occurrences): List[Occurrences] = {
val acc: List[Occurrences] = List(List())
sub match {
@stevendborrelli
stevendborrelli / deviceInfo.cu
Created December 14, 2012 16:49
Get Information about CUDA cards on your system. Compile with: nvcc deviceInfo.cu -o deviceInfo
#include <cuda.h>
#include <stdio.h>
void cudasafe(int error, char* message, char* file, int line) {
if (error != cudaSuccess) {
fprintf(stderr, "CUDA Error: %s : %i. In %s line %d\n", message, error, file, line);
exit(-1);
}
}
@stevendborrelli
stevendborrelli / boot2docker.json
Last active December 31, 2015 02:08
Packer.io json template for boot2docker
{
"builders": [{
"type": "virtualbox",
"guest_os_type": "Linux",
"iso_url": "https://github.com/steeve/boot2docker/releases/download/v0.3.0/boot2docker.iso",
"iso_checksum": "e03670ed349c54848e20d9043a90f2df8df70d82e674b84a7083301193745b19",
"iso_checksum_type": "sha256",
"ssh_username": "docker",
"ssh_password": "tcuser",
"shutdown_command": "sudo poweroff"
{
"id": "elasticsearch",
"instances" : "1",
"mem": "1024",
"cpus": "1",
"executor": "/var/lib/mesos/executors/docker",
"cmd": "'relateiq/elasticsearch'",
"env": {
},
"ports": [ 9200, 9300 ]
@stevendborrelli
stevendborrelli / gist:8101862
Created December 23, 2013 18:07
Compiling mesos on OSX 10.9.x
#Using homebrew
# gcc 4.9 build fails on template warnings
# clang not supported yet
brew tap homebrew/versions
brew install gcc47
@stevendborrelli
stevendborrelli / gist:8361147
Created January 10, 2014 19:39
Oracle 7 Java Dockerfile for ubuntu 12.0r
FROM ubuntu:12.04
MAINTAINER Quinten Krijger < qkrijger [at] gmail {dot} com>
# make sure the package repository is up to date
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update && apt-get -y install python-software-properties
@stevendborrelli
stevendborrelli / consul.md
Last active December 20, 2015 22:01
Consul

###How we use consul We're big fans of consul at aster.is. How do we use it?

####Service discovery We feel that service discovery is a fundamental building block upon which we can build more flexible systems. With consul, service discovery is part of every node.

Consul makes it easy to register services that run on a server. For example by adding a file like zookeeper.json to the consul configuration directory, we can register static services across the cluster. This means that any node can just connect to zookeeper.service.consul instead of a hardcoded list of ips. We use this pattern quite a bit to reduce the amount of automation code we need to write.

In addition to the API, consul exposes service discovery available via DNS so that clients don't need to have additional libraires installed to find components.

This file has been truncated, but you can view the full file.
TF_LOG=1 terraform apply 2>&1 | tee terraform.out
2016/05/10 13:27:39 [WARN] Invalid log level: "1". Defaulting to level: TRACE. Valid levels are: [TRACE DEBUG INFO WARN ERROR]
2016/05/10 13:27:39 [INFO] Terraform version: 0.6.15 0c5c54e7b6a59d77e89ce24057509503639d8d3d
2016/05/10 13:27:39 [DEBUG] Detected home directory from env var: /Users/steve
2016/05/10 13:27:39 [DEBUG] Discovered plugin: atlas = /Users/steve/terraform/terraform-provider-atlas
2016/05/10 13:27:39 [DEBUG] Discovered plugin: aws = /Users/steve/terraform/terraform-provider-aws
2016/05/10 13:27:39 [DEBUG] Discovered plugin: azure = /Users/steve/terraform/terraform-provider-azure
2016/05/10 13:27:39 [DEBUG] Discovered plugin: azurerm = /Users/steve/terraform/terraform-provider-azurerm
2016/05/10 13:27:39 [DEBUG] Discovered plugin: chef = /Users/steve/terraform/terraform-provider-chef
2016/05/10 13:27:39 [DEBUG] Discovered plugin: clc = /Users/steve/terraform/terraform-provider-clc
variable name {
default = "terraform"
description = "Name of the virtual network"
}
variable location {
default = "Central US"
description = "Geographic location of the virtual network"
}
kind: DaemonSet
metadata:
name: traefik-ingress-controller
labels:
k8s-app: traefik-ingress-lb
spec:
template:
metadata:
labels:
k8s-app: traefik-ingress-lb