This file contains 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
# taken from https://misc.flogisoft.com/bash/tip_colors_and_formatting#colors2 | |
# with a blacklist of the hardest colors to see agaist a black or white background | |
blacklist=(0 1 7 9 11 {15..18} {154..161} {190..197} {226..235} {250..255}) | |
#blacklist=() | |
colors=$(printf '%d\n' {0..255} ${blacklist[@]} | sort -n | uniq -u) | |
slot=0 | |
for fgbg in 38 48 ; do # Foreground / Background | |
for color in $colors ; do # Colors |
This file contains 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
#!/usr/bin/env python | |
''' | |
This file is an ansible dynamic inventory script used to help resolve docker | |
containers for ansible. | |
It only considers running docker containers that have the label | |
'ansible_managed_container=true'. Other labels will become host groups. eg. | |
(docker-compose) |
This file contains 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
#!/usr/bin/env python | |
''' | |
This file is an ansible dynamic inventory script used to help discover | |
inventory from environment variables | |
''' | |
import json | |
from os import environ |
This file contains 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
#!/usr/bin/env bash | |
# add colorized echos as functions | |
declare -A colors | |
colors=( | |
# black | |
[bla]='0;30' | |
# red | |
[r]='0;31' |