Skip to content

Instantly share code, notes, and snippets.

View pascalandy's full-sized avatar
:octocat:
Rocking the git

Pascal Andy pascalandy

:octocat:
Rocking the git
View GitHub Profile
@pascalandy
pascalandy / SwarmModeNetworking.md
Created October 28, 2016 17:14
SwarmModeNetworking.md

Here's a quick tester for Swarm Mode that will work everywhere..

$ docker service create --name nginx1 -p 8080:80 --replicas=5 --mount source=/etc/hostname,target=/usr/share/nginx/html/index.html,type=bind nginx

You effectively bind mount the hostname as the index.html page meaning you can see the round-robin / mesh networking in action.

@pascalandy
pascalandy / install-docker.sh
Created October 28, 2016 17:20 — forked from alexellis/install-docker-master.sh
install docker engine for swarm3k on Ubuntu 16.04. 2 options for installing
#!/bin/sh
# option 2: paste this into user-data to automate install via boot script
# NOTE: update --label=owner=YOURNAME below if you want to easily identify yours
# renames the host to have a suffix of alexellisio
export original=$(cat /etc/hostname)
sudo hostname $original-alexellisio
echo $original-alexellisio | sudo tee /etc/hostname
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
@pascalandy
pascalandy / rename-host.sh
Last active November 8, 2016 01:19
Renames the host to have a suffix of alexellisio
# Renames the host to have a suffix of alexellisio
export NEW_HOST_NAME=N12-AMS1
export ORIGINAL=$(cat /etc/hostname)
echo $NEW_HOST_NAME
echo $ORIGINAL
sudo hostname $NEW_HOST_NAME
echo $NEW_HOST_NAME | sudo tee /etc/hostname
Here is why I won’t «fill» your survey.
When big companies ask me to fill out a quick survey after talking
to a customer service rep, they're not actually doing a survey. What
they're doing is snooping on their customer service people, and me
answers are directly connected back to each rep, so that person can
be scolded (or worse) if they do a bad job. source: http://bit.ly/2f6wUhN
But hey, if you care to have a real conversation, with your real name,
feel free to ask me on Twitter, I’m very easy to find. You see, my experience
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder;
@pascalandy
pascalandy / generate-password.sh
Last active May 21, 2020 22:59
A solid bash script to generate password
#############################################################################
# generate-password.sh
# Source: https://gist.github.com/pascalandy/e08c25c41d05c12f7a7cd89dcac48d33
# License > https://github.com/pascalandy/GNU-GENERAL-PUBLIC-LICENSE/blob/master/README.md
#############################################################################
#
# Here is my crazy ass bash script 🎰 password generator 🎰. Works on Mac and Linux.
# This generates two random passwords at a time:
# The first with some spaces and the other one without spaces.
#
#!/bin/sh
set -e
#
# source - https://raw.githubusercontent.com/docker/docker/master/hack/install.sh
# See this gist as a backup
##
# This script is meant for quick & easy install via:
# 'curl -sSL https://get.docker.com/ | sh'
# or:
# 'wget -qO- https://get.docker.com/ | sh'
@pascalandy
pascalandy / install-docker-test-or-experimental.md
Last active November 21, 2016 23:46
install-docker-test-or-experimental.md
# updated this 2017-05-13_13h06
➜ _infra git:(1.9.22) ✗ scw images
REPOSITORY TAG IMAGE ID CREATED REGION ARCH
Ubuntu_Yakkety latest d53fafe4 6 months [ams1 par1] [arm x86_64]
Mattermost latest 0644b229 10 months [ams1 par1] [x86_64]
Ubuntu_Xenial latest 656de689 12 months [ams1 par1] [arm arm64 x86_64]
Jenkins_Slave latest 181e1ed0 14 months [ams1 par1] [arm]
Centos latest 24d33e48 14 months [ams1 par1] [arm x86_64]
@pascalandy
pascalandy / my-custom.cnf
Last active November 20, 2022 09:30
This mysql config is made to run within the official mysql container.
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
#
# _dockerfile/mysql/conf.d/my.cnf
# Last update: 2017-01-05_10h05
#
# This mysql config is made to run within the official mysql container.
# https://hub.docker.com/_/mysql/
#
# Inspired by:
# https://www.percona.com/blog/2016/10/12/mysql-5-7-performance-tuning-immediately-after-installation/