Skip to content

Instantly share code, notes, and snippets.

View ConnorDoyle's full-sized avatar
💫

Connor Doyle ConnorDoyle

💫
View GitHub Profile
@ConnorDoyle
ConnorDoyle / health-check-example.sh
Last active August 29, 2015 14:01
Health Check Session
$ http GET localhost:8080/v2/apps/my-app/
HTTP/1.1 200 OK
Content-Type: application/json
Server: Jetty(8.y.z-SNAPSHOT)
Transfer-Encoding: chunked
{
"app": {
"cmd": "python -m SimpleHTTPServer $PORT",
"constraints": [],
@ConnorDoyle
ConnorDoyle / toggle.py
Created June 24, 2014 19:35
A web service, made to fail.
import sys
import SimpleHTTPServer
from BaseHTTPServer import BaseHTTPRequestHandler
import SocketServer
import urlparse
PORT = int(sys.argv[1])
healthy = True
@ConnorDoyle
ConnorDoyle / mesos-ls
Created June 27, 2014 18:52
Usage of `mesos ls` -- magic!
connor@iota:marathon (mesos-health-checks) $ mesos cat toggle\.8214d9c7-fe2b-11e3-b172-685b35a05cac toggle.py
import sys
import SimpleHTTPServer
from BaseHTTPServer import BaseHTTPRequestHandler
import SocketServer
import urlparse
PORT = int(sys.argv[1])
healthy = True
@ConnorDoyle
ConnorDoyle / nothing.cpp
Created June 30, 2014 18:32
Seeing into nothing
// "Seeing into nothingness-this is the true seeing, the eternal seeing." ~Shen Hui
Promise<Nothing> promise;
echo "SF: "$(TZ=America/Los_Angeles date) && echo "HH: "$(TZ=Europe/Berlin date)
@ConnorDoyle
ConnorDoyle / STDERR
Created August 27, 2014 19:57
Docker Debug
I0827 19:56:09.255442 7392 exec.cpp:132] Version: 0.20.0
I0827 19:56:09.258818 7410 exec.cpp:206] Executor registered on slave 20140827-191134-16842879-5050-1574-0
#!/bin/bash
search_paths='/usr/lib /usr/local/lib'
echo "MESOS_NATIVE_JAVA_LIBRARY is not set. Searching in $search_paths."
export MESOS_NATIVE_JAVA_LIBRARY=$(find -L $search_paths -name libmesos.dylib -or -name libmesos.so 2>/dev/null | head -n1)
export MESOS_NATIVE_LIBRARY=$MESOS_NATIVE_JAVA_LIBRARY
java -jar target/scala-2.10/marathon-assembly-0.7.0-SNAPSHOT.jar --master 10.141.141.10:5050 --zk zk://10.141.141.10:2181/marathon
POST /v2/apps HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Content-Length: 327
Content-Type: application/json; charset=utf-8
Host: mesos.vm:8080
User-Agent: HTTPie/0.8.0
{
"cmd": "sleep 60",
type Function1[-A,+B]
case class A(x: Int)
case class B(x: Int) extends A(x)
val alpha: A => Unit = { a => ??? }
val beta: B => Unit = { b => ??? }
def gamma(f: B => Unit) = ???
@ConnorDoyle
ConnorDoyle / bridged.json
Created September 10, 2014 06:12
Marathon app definition demonstrating how to run a task inside a docker container with bridged networking.
{
"id": "bridged-webapp",
"cmd": "python3 -m http.server $PORT0",
"cpus": 0.5,
"mem": 64.0,
"instances": 2,
"container": {
"type": "DOCKER",
"docker": {
"image": "python:3",