This morning a discussion with a friend about various shells lead me to think it would be nice if my bash shell could tab complete hostnames from .ssh/known_hosts when I type ‘ssh <tab>’. I soon found this blog post which nicely documents how to do it. I made a directory in $HOME called .bash.completion and then added this to my .profile, which loops round any files in there, sourcing them individually:
if [ -d ${HOME}/.bash.completion ]; then
for file in ${HOME}/.bash.completion/* ; do
source $file
done
fi
All sorted. However, it wasn’t long before I discovered that ‘ssh user@<tab>’ doesnt work, I tend to use this quite a lot so wanted to see if I could fix up the bash function to support that use case. Bit of hacking around and I’ve got it working, the replacement ssh-completion file is shown below:
__ssh_known_hosts() {
if [[ -f ~/.ssh/known_hosts ]]; then
cut -d " " -f1 ~/.ssh/known_hosts | cut -d "," -f1
fi
}
_ssh() {
local cur known_hosts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
known_hosts="$(__ssh_known_hosts)"
if [[ ! ${cur} == - ]] ; then
if [[ ${cur} == @ ]] ; then
COMPREPLY=( $(compgen -W "${known_hosts}" -P ${cur/@/}@ -- ${cur/*@/}) )
else
COMPREPLY=( $(compgen -W "${known_hosts}" -- ${cur}) )
fi
fi
return 0
}
complete -o bashdefault -o default -o nospace -F _ssh ssh 2>/dev/null \
|| complete -o default -o nospace -F _ssh ssh
-
http://usefulthings.org.uk/2013/04/bash-ssh-known_hosts-tab-completion/isolate like docker + service scheduling + health checking
-
http://aurora.incubator.apache.org/Quelques best practice concernant les Dockerfile
On peut se servir de Docker de plein de façon différentes, alors quelques repères ça ne fait pas mal
-
http://crosbymichael.com/dockerfile-best-practices.htmljme garde ça pour plus tard
via arnaudb
-
http://resources.infosecinstitute.com/nmap-cheat-sheet-discovery-exploits-part-2-advance-port-scanning-nmap-custom-idle-scan/Une surcouche à docker pour organiser ses containers et les liens qu'il y a entre eux
-
http://gaudi.io/à tester pour voir.. si ça ne fait que du listing de dir, autant utiliser l'autoindex d'apache.
-
https://github.com/Cakebox/Cakebox-lightDeux patterns pour séparer les data du code dans puppet : "the params class pattern" et Hiera
-
http://garylarizza.com/blog/2013/12/08/when-to-hiera/