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
# install: | |
# wget https://gist.githubusercontent.com/epcim/e488af8be69b616eab3088a14a937e14/raw/salt-trends.sh -O salt-trends.sh; chmod +x *.sh | |
# salt state execution results: (use with/without test=true, -b2, etc..) | |
# apt install -y jq colordiff | |
salt \* state.apply --out=json --static test=true -b15 | jq -r 'to_entries | map({ key:.key, value: { total: [.value[]]|length , | |
succeed: [select(.value>={})|.value[]|select(.result? == true )]|length, | |
failed: [select(.value>={})|.value[]|select(.result? == false)]|length, | |
null: [select(.value>={})|.value[]|select(.result? == null)]|length, | |
changes: [select(.value>={})|.value[]|select(.changes?|length > 0)]|length } }) | from_entries ' |\ |
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
--- | |
systemd: | |
units: | |
- name: etcd2.service | |
enable: true | |
dropins: | |
- name: 40-etcd-cluster.conf | |
contents: | | |
[Service] | |
Environment="ETCD_NAME={{.etcd_name}}" |
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
#!/bin/bash | |
# wget https://gist.githubusercontent.com/epcim/b44b548cadc566fcabc9f6195a19b1dc/raw/byobu-salt.sh -O byobu-salt.sh; chmod +x *.sh | |
# set -x | |
# TODO | |
# on remote host source ~/.${SHELL}rc | |
# auto set -o vi | |
test -n SSH_AGENT || { |
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
#!/bin/bash | |
sudo apt-get update | |
sudo apt-get install apt-transport-https ca-certificates | |
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
sudo echo deb https://apt.dockerproject.org/repo ubuntu-xenial main > /etc/apt/sources.list.d/docker.list | |
sudo apt-get update | |
sudo apt-get purge lxc-docker docker.io | |
sudo apt-get install linux-image-extra-$(uname -r) | |
sudo apt-get install docker-engine |
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
#!/bin/bash | |
test -n SSH_AGENT || { | |
eval $(ssh-agent -s) | |
ssh-add | |
} | |
#create session | |
byobu-tmux new-session -dn $(hostname -f) "sudo -i" | |
# populate from salt-key |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
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
Step 1: Enable tunnel services | |
for example: for an mx480 with two fpcs for redundant logical tunnels | |
fpc 1 { | |
pic 0 { | |
tunnel-services; | |
inline-services { | |
bandwidth 10g; | |
} | |
} | |
pic 1 { |