This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.4" | |
services: | |
elasticsearch: | |
# Remember to "sysctl -w vm.max_map_count=262144" on swarm nodes | |
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.5 | |
environment: | |
network.host: 0.0.0.0 | |
discovery.zen.ping.unicast.hosts: elasticsearch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ -z "${VAR}" ]; then | |
echo "VAR is unset or set to the empty string" | |
fi | |
if [ -z "${VAR+set}" ]; then | |
echo "VAR is unset" | |
fi | |
if [ -z "${VAR-unset}" ]; then | |
echo "VAR is set to the empty string" | |
fi | |
if [ -n "${VAR}" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/docker/daemon.json | |
# (stop docker before editing et start after) | |
{ | |
"data-root": "/data/docker", | |
"hosts": [ | |
"unix:///var/run/docker.sock", | |
"tcp://0.0.0.0:2376" | |
], | |
"insecure-registries": [ | |
"registry-host:5000" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Interdire les utilisateurs d'installer des extensions | |
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallBlacklist | |
ValueName = 1 | |
Value Type = REG_SZ | |
Value = * | |
# Autoriser certaines extensions | |
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\EnabledPlugin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List of top processes ordered by RAM and CPU use in descendant form | |
ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
vars: | |
docker_machine_version: v0.14.0 | |
tasks: | |
- name: Install Docker Machine | |
get_url: | |
url: "https://github.com/docker/machine/releases/download/{{ docker_machine_version }}/docker-machine-linux-x86_64" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example : waiting for DB and Elasticsearch to be ready before launching a service | |
# The svc docker image must contain the start-when-ready.sh script | |
services: | |
svc: | |
image: svc | |
environment: | |
READINESS_CONDITION: '[ $$(curl --write-out %{http_code} --silent --output /dev/null http://elasticsearch:9200/_cat/health?h=st) = 200 ] && nc -w 1 -z $$DB_HOST $$DB_PORT 2>/dev/null' | |
READINESS_SLEEP: 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from <https://superuser.com/questions/332252/creating-and-formating-a-partition-using-a-bash-script> | |
( | |
echo d # Delete sda2 partition table | |
echo 2 # Default = sda2 | |
echo n # Add a new sda2 partition | |
echo p # Primary partition | |
echo 2 # Partition number | |
echo # First sector (Accept default: 2099200) | |
echo # Last sector (Accept default: varies, e.g 104857599) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script to switch between HTTP and SSH git remote URL | |
gitswitch () { | |
if [[ "$(git remote -v)" == "" ]] | |
then | |
echo "No remote configured. Use 'git remote add' to set one" | |
return | |
fi | |
remoteRoot=$(git remote -v | head -1 | grep root) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./ansible.sh -i inventories/dev -c local -m template -a "src=file.j2 dest=file.txt" 127.0.0.1 | |
# Online tool | |
https://cryptic-cliffs-32040.herokuapp.com/ | |
# https://stackoverflow.com/questions/35407822/how-can-i-test-jinja2-templates-in-ansible |