Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am kevinschoon on github.
* I am kevinschoon (https://keybase.io/kevinschoon) on keybase.
* I have a public key ASBAoAt5MndM6xvjPJlKn7zt20wURtpeyDdxc9tEch4Xigo
To claim this, I am signing this object:
@kevinschoon
kevinschoon / iteration.go
Last active February 19, 2016 22:06
search test
package main
import (
"fmt"
"io/ioutil"
"math/rand"
"strings"
"time"
)
@kevinschoon
kevinschoon / routines.go
Last active February 19, 2016 22:01
Demonstration of concurrency using Go routines with shared lock plus error and signal handling.
/*
Demonstration of concurrency using Go routines with shared lock plus error and signal handling.
*/
package main
import (
"fmt"
"io/ioutil"
"math/rand"
"os"
@kevinschoon
kevinschoon / recurse.py
Last active January 8, 2016 13:25
recurse
import sys
def recurse(count=0):
count += 1
if count + 2 < sys.getrecursionlimit():
recurse(count)
else:
answer = raw_input("YOU HAVE REACHED {} DO YOU DARE TO CONTINUE?! [yes/no/whatev]: ".format(count))
if answer == "yes":
@kevinschoon
kevinschoon / main.go
Last active November 20, 2015 00:45
Random Cron Scheduler
package main
import (
"fmt"
"time"
"math/rand"
"bytes"
"gopkg.in/robfig/cron.v2"
)
@kevinschoon
kevinschoon / recurse.py
Created September 13, 2015 20:50
Recursive Dropbox API Call
class FileObject:
def __init__(name, **kwargs):
self.name = name
def get_metadata(path):
resp = client.metadata(path)
for f in resp['contents']:
if f['is_file']:
yield FileObject(**f)
else:
#!/usr/bin/env python
"""
Convert YAML to JSON and JSON to YAML
"""
import yaml
import json
import sys

CI Example

This is a very simplified and hypothetical example of a continuous integration / delivery system.

Major components

  • Apache Mesos cluster configured with a master/slave setup.
  • Marathon Mesosphere's Marathon framework running on Apache Mesos.
@kevinschoon
kevinschoon / gist:5bcc8aa3c193fe420965
Last active August 29, 2015 14:18
Get a PTR record name from a private EC2 instance ip address
ptr = '.'.join(reversed(instance.ip_address.split('.'))) + '.in-addr.arpa.'
@kevinschoon
kevinschoon / Dockerfile
Last active August 29, 2015 14:18
Apache Mesos and Marathon
from mesosphere/mesos-slave:0.22.0-1.0.ubuntu1404
RUN apt-get update && apt-get install -y apt-transport-https
RUN echo deb https://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list
RUN apt-get update && apt-get install -y --force-yes lxc-docker