Skip to content

Instantly share code, notes, and snippets.

@scmrus
scmrus / docker-compose.yml
Created June 4, 2016 11:37 — forked from igor-vovk/docker-compose.yml
Docker Compose Consul cluster
consul:
image: progrium/consul:latest
# net: host
ports:
- "8400:8400"
- "8500:8500"
command: "-server -bootstrap -ui-dir /ui"
registrator:
command: -resync 30 -internal consul://consul:8500
image: gliderlabs/registrator:latest
@scmrus
scmrus / consul-docker.md
Created June 4, 2016 11:58 — forked from geku/consul-docker.md
Run Consul in Docker container

Assumptions

Consul Command

docker run -d -h node1 -v /mnt:/data \
    -p <public-IP>:8300:8300 \

-p :8301:8301 \

@scmrus
scmrus / runconsul
Created June 4, 2016 11:59
Service discovery with Docker, Registrator and Consul
#!/bin/sh
docker stop consul
docker rm consul
docker run -d -h node1 --name consul -v /home/fritz/consul:/data \
-p 10.0.2.15:8300:8300 \
-p 10.0.2.15:8301:8301 \
-p 10.0.2.15:8301:8301/udp \
-p 10.0.2.15:8302:8302 \
-p 10.0.2.15:8302:8302/udp \
vault:
container_name: vault
image: dtestops/vault
volumes:
- ./vault.hcl:/etc/vault.hcl
links:
- "mysql:mysql"
ports:
- "8200:8200"
command: "server -config=/etc/vault.hcl"
@scmrus
scmrus / update
Created September 25, 2016 12:54 — forked from willpiner/update
Auto update and upgrade Ubuntu
#!/bin/bash
sudo apt-get update && sudo apt-get -y upgrade
@scmrus
scmrus / docker-compose-coreos.sh
Last active April 7, 2017 07:21 — forked from sourcec0de/docker-compose-coreos.sh
Install docker compose on coreos
sudo su -
mkdir -p /opt/bin
curl -L https://github.com/docker/compose/releases/download/1.12.0/docker-compose-`uname -s`-`uname -m` >/opt/bin/docker-compose
chmod +x /opt/bin/docker-compose
@scmrus
scmrus / debug_recipes.txt
Created August 8, 2017 07:28 — forked from tadas-s/debug_recipes.txt
Debug recipes for Linux
# Quick debug network traffic between nginx and php-fpm
# Got from:
# http://systembash.com/content/simple-sysadmin-trick-using-tcpdump-to-sniff-web-server-traffic/
# Just a flow of everything looking like a string
tcpdump -nl -w - -i eth0 -c 500 port 9090 | strings
# Request heads
sudo tcpdump -nl -w - -i eth0 -c 500 port 9090 | strings | grep -E -A5 "^(GET|PUT|POST) "
# strace processes/sub-processes
@scmrus
scmrus / gcrgc.sh
Created March 4, 2018 17:26 — forked from ahmetb/gcrgc.sh
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@scmrus
scmrus / kubectl.md
Last active June 5, 2018 19:00 — forked from Baargav/kubectl.md
kubectl
@scmrus
scmrus / post-checkout
Created July 1, 2019 15:10 — forked from betorobson/post-checkout
git hook to run a command after `git pull` and `git checkout` if a specified file was change for example, package.json or bower.json
#!/usr/bin/env bash
# fork from https://gist.github.com/jakemhiller/d342ad51505addf78ec628a16fd3280f
changed_files="$(git diff-tree -r --name-only --no-commit-id $1 $2)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
}
check_run package.json "npm prune && npm install"