Skip to content

Instantly share code, notes, and snippets.

View aledbf's full-sized avatar

Manuel Alejandro de Brito Fontes aledbf

View GitHub Profile
@krancour
krancour / gist:c6c10efb1500f54a2607
Created June 18, 2015 13:52
custom deis install
#!/bin/bash
set -e
DEISCTL_VERSION="1.7.0"
deisctl --version | grep $DEISCTL_VERSION || echo "Expected deisctl version (${DEISCTL_VERSION}) not found." && exit 1
echo "Copying Deis units..."

Single Node Kubernetes Cluster

sudo docker run -d --net=host --privileged --name=kubestack \
-v /sys:/sys:ro \
-v /:/rootfs:ro \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/run:/var/run:rw \
-v /var/lib/kubelet/:/var/lib/kubelet:rw \
-v /var/lib/docker/:/var/lib/docker:ro \

Kubernetes on Rocket

API Service

/etc/systemd/system/kube-apiserver.service
[Unit]
@ankurcha
ankurcha / backupStatus.json
Last active October 23, 2015 06:11
Script to backup tokumx database to a directory and/or S3.
{
"percent" : 6.297823041677475,
"bytesDone" : NumberLong("22117130240"),
"files" : {
"done" : 8,
"total" : 166
},
"current" : {
"source" : "/var/lib/mongodb_historical11/local_oplog_rs_p15_id__ddfdbfc0_1_19.tokumx",
"dest" : "/backup11/local_oplog_rs_p15_id__ddfdbfc0_1_19.tokumx",
@kgorman
kgorman / gist:5775530
Created June 13, 2013 17:19
balance_check
var balance_check = function(n) {
if ( n ) {
var output = db.chunks.aggregate([
{ $group : { _id : { "_id":"$ns", "shard":"$shard" }, chunks : { $sum : 1 } }},
{ $match : { "_id._id" : n } },
{ $sort : { "chunks" : 1 } }
]);
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Awesomium.Core;
namespace AwesomiumNewTest
{
docker:
registry: myregistry.com
servers:
- http://mynode01.com:4243
- http://mynode02.com:4243
collection: docker
repository-namespace: tsuru
router: hipache
deploy-cmd: /var/lib/tsuru/deploy
run-cmd:

build

Clone and build Node for analysis:

$ git clone https://github.com/joyent/node.git
$ cd node
$ export GYP_DEFINES="v8_enable_disassembler=1"
$ ./configure
$ make -j4
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com
After=docker.socket early-docker.target network.target
Requires=docker.socket early-docker.target
[Service]
EnvironmentFile=-/run/flannel_docker_opts.env
MountFlags=slave
LimitNOFILE=1048576
@bprashanth
bprashanth / stickysessions.md
Last active July 29, 2016 21:30
sticky sessions

Create a backend service that simply serves the pod name, and a frontend haproxy instance that balances based on client cookies.

# This is the backend service
apiVersion: v1
kind: Service
metadata:
  name: hostname
  annotations:
    # Enable sticky-ness on "SERVERID"
    serviceloadbalancer/lb.cookie-sticky-session: "true"