This file contains hidden or 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 -eux | |
# | |
# This is a simple cloud-init script to install Mesos and Marathon in a Ubuntu machine. | |
# | |
# AWS cli usage: | |
# aws ec2 run-instances --image-id ami-4ae27e22 --key-name my-key --instance-type m3.medium --subnet-id "subnet-00000000" --associate-public-ip-address --user-data "$(cat user-data.sh)" --region us-east-1 | |
# | |
# Install Docker | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 |
This file contains hidden or 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 main | |
import ( | |
"fmt" | |
"github.com/go-redis/redis" | |
) | |
func main() { | |
cli := redis.NewTCPClient(&redis.Options{ | |
Addr: "127.0.0.1:6379", |
This file contains hidden or 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
#!/usr/bin/env python | |
# | |
# This is a simple script to set the local IP to an Route53 zone | |
# | |
# Dependencies: | |
# pip install boto netifaces | |
# | |
# Usage: | |
# host-ip-to-route53.py wlan1 machine1.domain.net | |
# |
This file contains hidden or 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 main | |
import ( | |
"bufio" | |
"fmt" | |
"github.com/gorilla/websocket" | |
"io" | |
"log" | |
"net/http" | |
"os/exec" |
This file contains hidden or 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
// | |
// Read and parse an Procfile of a tar stream from stdin | |
// | |
// example: git archive HEAD | list-app-processes | |
// | |
// | |
package main | |
import ( | |
"archive/tar" |
This file contains hidden or 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
from django.db import models | |
class Twt(models.Model): | |
txt = models.CharField(max_length=140) |
This file contains hidden or 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
{ | |
"AWSEBDockerrunVersion": "1", | |
"Image": { | |
"Update": "false" | |
}, | |
"Ports": [ | |
{"ContainerPort": "8080"} | |
], | |
} |
This file contains hidden or 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
daemon off; | |
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
access_log /dev/stdout; | |
error_log /dev/stdout info; |
This file contains hidden or 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
ubuntu@ip-10-13-0-67:~$ bash -xe test.sh | |
+ docker version | |
Client version: 1.1.1 | |
Client API version: 1.13 | |
Go version (client): go1.2.1 | |
Git commit (client): bd609d2 | |
Server version: 1.1.1 | |
Server API version: 1.13 | |
Go version (server): go1.2.1 | |
Git commit (server): bd609d2 |
This file contains hidden or 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
// md-server is a simple web server to render Markdown files through HTTP | |
// this was just a quick "hack" so I could show some docs I was working on to a friend | |
// since the lack of styles and links, this ended up being completely unuseful | |
// if you want a serious Markdown renderer server, take a look at: http://www.mkdocs.org/ | |
package main | |
import ( | |
"flag" | |
"fmt" | |
"github.com/russross/blackfriday" |