Skip to content

Instantly share code, notes, and snippets.

View include's full-sized avatar
👽
Free Jaffa

Francisco Cabrita include

👽
Free Jaffa
View GitHub Profile
@include
include / Rancher.md
Created December 10, 2016 11:22 — forked from lmmendes/Rancher.md
Running Rancher locally (with two hosts) using MacOS Docker and VirtualBox

Rancher

Rancher is an open source project that provides a complete platform for operating Docker in production. It provides infrastructure services such as multi-host networking, global and local load balancing, and volume snapshots.

This documentation describes how to run Rancher localy for development and evaluation propuses.

I'm using Docker for OSX (native) but even for this to work you will need to install VirtualBox.

Launching Management Rancher Server

@include
include / zombieipsum.txt
Created October 26, 2016 14:01
zombie-ipsum
Zombie ipsum reversus ab viral inferno, nam rick grimes malum cerebro. De carne lumbering animata corpora quaeritis. Summus brains sit​​, morbo vel maleficia? De apocalypsi gorger omero undead survivor dictum mauris. Hi mindless mortuis soulless creaturas, imo evil stalking monstra adventus resi dentevil vultus comedat cerebella viventium. Qui animated corpse, cricket bat max brucks terribilem incessu zomby. The voodoo sacerdos flesh eater, suscitat mortuos comedere carnem virus. Zonbi tattered for solum oculi eorum defunctis go lum cerebro. Nescio brains an Undead zombies. Sicut malus putrid voodoo horror. Nigh tofth eliv ingdead.
Cum horribilem walking dead resurgere de crazed sepulcris creaturis, zombie sicut de grave feeding iride et serpens. Pestilentia, shaun ofthe dead scythe animated corpses ipsa screams. Pestilentia est plague haec decaying ambulabat mortuos. Sicut zeder apathetic malus voodoo. Aenean a dolor plan et terror soulless vulnerum contagium accedunt, mortui iam vivam unlife. Qui tardius m
@include
include / Directory
Created August 22, 2016 16:23
Makefile-kubes
api/
|__service1/
| |_ Dockerfile
| |_ src/
|__service2/
| |_ Dockerfile
| |_ my.cnf
|__kube/
| |_rc.yml
|__Makefile
@include
include / System Design.md
Created July 26, 2016 09:27 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@include
include / only-one-active-instance.py
Created June 2, 2016 13:49 — forked from ketzacoatl/only-one-active-instance.py
Proof of Concept - Docker service orchestration via python consul-lock
import sys
from time import sleep
import consul
import consul_lock
from docker import Client
'''
This is a PoC which uses consul's locking mechanism to ensure only
one instance of the named docker container is running. Requires:

Overview

This gist demonstrates how to run a docker container with nomad, using a wrapper script.

Why would you want to use this?

With the wrapper, we can more easily run the container in the way we need to and without being limited by Nomad's docker driver. For example, while Nomad will have great support for volumes in the future, it has no such support right now, and the driver does not expose a config parameter to tune the volumes mounted in the docker container. This is also a great way to use consul to lookup services before starting your app, or to retrieve credentials from Vault. When running legacy applications with nomad, the wrapper script is the place to put that type of look-up logic.

We use a wrapper script and the raw_exec driver to run the container with the parameters we need.

@include
include / start.pl
Last active October 23, 2015 14:55
lol start
root@e5ded7e1593c:/base# cat start.pl
#!/usr/bin/env perl
use strict;
use warnings;
## Move app into place
mkdir('/runtime') unless -d '/runtime';
system(split(/\s+/, "/usr/bin/rsync -a /build/ /runtime/app"));
@include
include / group_vars__users
Last active September 7, 2015 17:19
manage users/groups with ansible
---
# file: group_vars/all_users
mygroups:
admins:
state: present
users:
- name: include
comment: [email protected]
@include
include / learn_apache2
Last active August 29, 2015 14:25
chef-client
[2015-07-18T18:29:00+00:00] WARN: No config file found or specified on command line, using command line options.
[2015-07-18T18:29:00+00:00] INFO: Auto-discovered chef repository at /home/ubuntu/chef-repo
[2015-07-18T18:29:00+00:00] DEBUG: Sleeping for 0 seconds
[2015-07-18T18:29:00+00:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /home/ubuntu/chef-repo
One version per cookbook
[2015-07-18T18:29:00+00:00] INFO: Forking chef instance to converge...
[2015-07-18T18:29:00+00:00] DEBUG: Fork successful. Waiting for new chef pid: 3879
[2015-07-18T18:29:00+00:00] DEBUG: Forked instance now converging
[2015-07-18T18:29:00+00:00] INFO: *** Chef 12.3.0 ***
@include
include / script.sh
Last active August 29, 2015 14:19 — forked from adnaan/script.sh
ls -la
echo "hello"
tree
adb devices
adb wait-for-device #example of a long running task