Skip to content

Instantly share code, notes, and snippets.

View epcim's full-sized avatar

Petr Michalec epcim

View GitHub Profile
@ajayhn
ajayhn / ifmap-server-error-handling
Created September 15, 2016 18:14
ifmap-server-error-handling
1. timeout when publishing to ifmap-server (mapclient.call())
when timeout happens keep retrying
2. ifmap-server code needs to inspect healthcheck object publish and if it misses n of them, exit() OR
config-nodemgr keeps reading healthcheck object from ifmap-server and if it can't read in n secs or value is stale, kill ifmap-server
3. control-node keeps reading healthcheck object from ifmap and it sees stale, move to a new ifmap-server
4. ifmap-publish-greenlet enqueue finds q-full, no change from current
@epcim
epcim / salt-trends.sh
Last active May 20, 2019 21:26
salt states trends jq yq
@Titerote
Titerote / ignition_config.yml
Last active June 29, 2018 13:19
Ignition problem on coreos
---
systemd:
units:
- name: etcd2.service
enable: true
dropins:
- name: 40-etcd-cluster.conf
contents: |
[Service]
Environment="ETCD_NAME={{.etcd_name}}"
@epcim
epcim / byobu-salt.sh
Last active August 10, 2017 12:29
byobu auto create windows from salt-master accepted keys
#!/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 || {
@dsdenes
dsdenes / nvidia-docker-install-ubuntu16.04.sh
Created August 14, 2016 11:22
nvidia-docker install on Ubuntu 16.04
#!/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
@eferro
eferro / _aws_golang_examples.md
Last active July 21, 2023 09:35
golang aws: examples

AWS Golang SDK examples

@epcim
epcim / byobu.sh
Last active August 12, 2016 10:33
byobu with default windows
#!/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
@olih
olih / jq-cheetsheet.md
Last active June 13, 2024 14:04
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// 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