Skip to content

Instantly share code, notes, and snippets.

View fprieur's full-sized avatar

Fred Prieur fprieur

  • Ubisoft
  • Montreal
View GitHub Profile
@fprieur
fprieur / dnsdock.md
Last active August 30, 2016 21:46
Setup for a local nameserver on mac os with docker and dnsdock
$ docker --version
Docker version 1.9.1, build a34a1d5
$ sudo mkdir -p /etc/resolver >/dev/null 2>&1
$ echo nameserver 172.17.0.1 | sudo tee /etc/resolver/docker > /dev/null
$ sudo route -n delete -net 172.17.0.0
$ sudo route -n add 172.17.0.0/16 $(docker-machine ip default)
$ sudo route -n add 172.17.0.1/32 $(docker-machine ip default)

$ docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy

@fprieur
fprieur / git-force-changes-remote.md
Last active December 1, 2015 12:24
Git - Force remote changes to local branch

fetch from the default remote, origin

git fetch

reset your current branch (master) to origin's master
git reset --hard origin/master

@fprieur
fprieur / gist:6d90389acee1ade2ad20
Created October 30, 2015 18:18 — forked from ehazlett/gist:9241844
OpenShift Origin AWS

OpenShift Origin in AWS

This describes deploying and running OpenShift Origin in Amazon Web Services.

This is based upon the code and installer on 2014-02-26 so YMMV.

We will be using a VPC for deployment in us-east-1 and Route53 for DNS. I will leave the VPC setup as an exercise for the reader.

Prerequisites

  • AWS Account
  • VPC
@fprieur
fprieur / clear-env-docker.sh
Last active August 29, 2015 14:24
add clear command to environnement variable to a docker container
echo "export TERM=xterm" | tee /etc/profile.d/set_term.sh && source /etc/profile
@fprieur
fprieur / untagged.sh
Last active August 29, 2015 14:24
remove force all untagged docker images
docker rmi --force $(docker images | grep "^<none>" | awk "{print $3}")
print "bonjour de github"
@fprieur
fprieur / rancher-server.md
Created June 16, 2015 21:07
setting up rancher server

docker run -d --restart=always -e CATTLE_AGENT_IP='[ip-of-host]' -p 8080:8080 rancher/server

@fprieur
fprieur / change_git_remote.py
Last active August 29, 2015 14:23
find all .git directories and change the remote origin
import os
from subprocess import Popen, PIPE
current_dir = os.path.dirname(os.path.realpath(__file__))
for dirname, dirnames, filenames in os.walk(current_dir):
for subdirname in dirnames:
if '.git' in subdirname:
commands = "cd " + os.path.join(dirname, subdirname) + \
"; git remote -v"
@fprieur
fprieur / check-num-chmod.md
Created May 7, 2015 14:25
checker la valeur numérique d'une fichier ou répertoire linux
stat --format '%a' directory/

stat --format '%a' file

@fprieur
fprieur / readme.md
Last active August 29, 2015 14:16
Make a s3 bucket read-only

Make a s3 bucket readonly for public

Just add the above as bucket policy.

Change bucket/* with the given bucket name.