Skip to content

Instantly share code, notes, and snippets.

@robinmonjo
robinmonjo / understanding.md
Created December 2, 2016 17:55
Understanding networking in kubernetes

How network works in docker

Docker create a bridge docker0 with a subnet.

For example:

docker0   Link encap:Ethernet  HWaddr 02:42:d0:45:a7:3d  
 inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
@robinmonjo
robinmonjo / es6-higher-order-component.md
Last active March 14, 2019 17:27
ES6 Higher Order Components

Redux higher order components

Sometimes we need to share props and behaviour between multiple components/containers. For that we can do a higher order component. Example:

Decorator component

Higher Order Component that will decorate other component:

@robinmonjo
robinmonjo / custom_image_marker.md
Created August 6, 2015 20:20
Custom image marker

Les markers ne peuvent être que des UIImage

Nous on veut une couleur dynamique et un label dynamique. Donc pour ça on a besoin d'une methode static (genre dans un fichier swift ADMarkerGenerator):

func generateMarkerWithColor(color: UIColor, andText text: String) -> UIImage

Et dans cette méthode, on aura un code comme ça: (écrit en obj-c, pas testé mais ça devrait fonctionner):

#import  //a ajouter dans le bridging header, pas sur que ça soit necessaire cependant

#cargo, docker hub without docker, how to

18 Jan 2015

###Background

I have been using linux containers for almost 2 years now. It started during an internship at Applidget, a startup in Paris. My job was to integrate linux containers technology in their private PaaS. At this time, there where no doubt, the technology to use was LXC. One week or so after I started digging into LXC, one of my co-worker talked to me about this new thing called docker. He told me "isn't it what you are supposed to do during your internship ?". And it was kind of it.

At this time I already highlighted a big challenge of containers in PaaS: creation time. Waiting for bundle install to complete is already long enough to have to wait for another 40 secondes to create a container :). Docker landed just in time !

@robinmonjo
robinmonjo / main.go
Created July 27, 2014 15:03
Go pty setup for interactive shell
package main
import (
"code.google.com/p/go.crypto/ssh/terminal"
"github.com/kr/pty"
"io"
"os"
"os/exec"
)
@robinmonjo
robinmonjo / Makefile
Created July 24, 2014 19:41
psdoc makefile
# make .
# make -C path/dir
build: psdock
$(info ==> psdock binary in $(GOPATH)/bin/psdock (tip: add the $(GOPATH)/bin to your PATH))
psdock: lib_psdock
go install ./cmd/psdock/
lib_psdock: check_env
@robinmonjo
robinmonjo / minibian-setup.md
Last active December 7, 2017 02:24
Install + configure minibian from Mac

Prepare SD card

  • Download MiniBian
  • extract MiniBian .img
  • insert SD Card
  • use disk utility to format the card with fat32
  • check from terminal (OSX) which disk the SD Card is using diskutil list
  • unount SD Card: diskutil unmountDisk /dev/diskX where X is what you found out last step
  • copy image to SD Card: sudo dd bs=1m if=<path to the .img file> of=/dev/rdiskX
  • wait until dd is finished
set -e
sudo apt-get update
echo "Installing base stack"
packagelist=(
curl
build-essential
bison
#user nginx;
# TODO(0): Changer welcome to nginx par Welcome to your app et si l'app n'exsite pas faire une erreur 500
user root root;
error_log /var/log/nginx.error.log;
pid /var/run/nginx.pid;
#Config changes found here: http://stackoverflow.com/questions/7325211/tuning-nginx-worker-process-to-obtain-100k-hits-per-min
worker_processes 4; # 2*number of cpus
@robinmonjo
robinmonjo / nginx
Last active December 28, 2015 18:59
Upstart script for nginx
# nginx
description "nginx http daemon"
author "George Shammas <georgyo@gmail.com>"
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
env DAEMON=/usr/sbin/nginx
env PID=/var/run/nginx.pid