Skip to content

Instantly share code, notes, and snippets.

Avatar

Jean-Laurent de Morlhon jeanlaurent

View GitHub Profile
View lab-docker-instructions.md

If you plan to attend this workshop in a conference, as network availibility is often flaky, please check you have the following :

  • A laptop + cord
  • Install docker 1.11
    • Install with Toolbox for windows or for Mac
    • If you haven't done it already, register for the Docker for desktop beta at https://beta.docker.com, and give us your hub account name during the session we can probably do something for you.
  • Test your docker installation works fine
    • docker run hello-world and check you see the welcome message
    • docker run -p 8080:80 nginx and open your browser to your machine on port 8080 and check you see nginx default page.
  • Warm up your local docker machine with the following images :
    • docker pull dockerdemos/lab-web
View GITCONFIG
user]
name = Jean-Laurent de Morlhon
email = jeanlaurent@morlhon.net
[alias]
co = checkout
st = status
br = branch
ci = commit
pr = pull --rebase
cia = commit --amend --no-edit
@jeanlaurent
jeanlaurent / .slate
Last active Oct 16, 2017
Slate config file
View .slate
# https://github.com/mattr-/slate
#half left - full - half right
bind 1:alt,cmd move screenOriginX;screenOriginY screenSizeX/2;screenSizeY
bind 2:alt,cmd move screenOriginX;screenOriginY screenSizeX;screenSizeY
bind 3:alt,cmd move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY
#1/3 left - center - right
bind 4:alt,cmd move screenOriginX;screenOriginY screenSizeX/3;screenSizeY
bind 5:alt,cmd move screenOriginX+screenSizeX/3;screenOriginY screenSizeX/3;screenSizeY
@jeanlaurent
jeanlaurent / gist:e65e70a89da3ead4c595
Created Dec 2, 2015
VBoxManage.exe list hostonlyifs
View gist:e65e70a89da3ead4c595
C:\Program Files\Oracle\VirtualBox>VBoxManage.exe list hostonlyifs
Name: VirtualBox Host-Only Ethernet Adapter
GUID: cd53cf39-13e8-40d0-b24d-55b04cf31c82
DHCP: Disabled
IPAddress: 192.168.56.1
NetworkMask: 255.255.255.0
IPV6Address: fe80:0000:0000:0000:2182:a89c:b9de:eabd
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:00
MediumType: Ethernet
View check_bash_version.sh
FULL_BASH_VERSION=`bash --version | head -1 | cut -d' ' -f4 | cut -d'.' -f1-3`
BASH_VERSION=`bash --version | head -1 | cut -d' ' -f4 | cut -d'.' -f1`
echo "Current bash version is $FULL_BASH_VERSION"
if [[ $BASH_VERSION -ge 4 ]]; then
echo "Your BASH version is ok"
else
echo "Your BASH version is too low"
fi
@jeanlaurent
jeanlaurent / check_docker_dns.sh
Created Nov 19, 2015
This check the current dns setting on mac against the current dns settings in the docker machine default
View check_docker_dns.sh
diff <(scutil --dns | grep 'nameserver\[[0-9]*\]' | cut -d' ' -f5 | sort | uniq) <(docker-machine ssh default cat /etc/resolv.conf | cut -d' ' -f2)
View dockerstart.sh
# Docker
isMachineUp=$(docker-machine status default)
if [ $isMachineUp == "Stopped" ]; then
printf "CTRL-C now, to prevent starting default docker machine\n"
read -t 3 -p ""
docker-machine start default
fi
eval $(docker-machine env default)
echo "Active docker machine is $(docker-machine active)"
View keybase.md

Keybase proof

I hereby claim:

  • I am jeanlaurent on github.
  • I am jeanlaurent (https://keybase.io/jeanlaurent) on keybase.
  • I have a public key whose fingerprint is 266E 1750 9C20 0805 AF53 77E9 8985 5228 9C87 6AB0

To claim this, I am signing this object:

View boot2docker-bash-status.sh
#/bin/sh
b2dstatus=$(boot2docker status)
b2dip="$(boot2docker ip 2>/dev/null)"
if [ "$?" -ne 0 ]; then
message=""
else
message="on $b2dip"
fi
echo boot2docker is $b2dstatus $message
View concurrency.go
// https://tour.golang.org/concurrency/8
package main
import (
"fmt"
"golang.org/x/tour/tree"
)
// Walk walks the tree t sending all values
// from the tree to the channel ch.