diff --git a/dot_bashrc.d/08.alias b/dot_bashrc.d/08.alias new file mode 100755 index 0000000..87a3b2a --- /dev/null +++ b/dot_bashrc.d/08.alias @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# navigation +alias +='pushd .' +alias -='popd' +alias ..='cd ..' +alias ...='cd ../..' + +# tail alias +alias tailer="tail --follow=name --retry" diff --git a/dot_bashrc.d/09.functions b/dot_bashrc.d/09.functions new file mode 100755 index 0000000..f4f2b4b --- /dev/null +++ b/dot_bashrc.d/09.functions @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# +# Bash Functions sourced by .bashrc / .sshrc +# + +# Get SSL Certificate information +# Based on https://serverfault.com/questions/661978/displaying-a-remote-ssl-certificate-details-using-cli-tools +function getCertInfo() { + local myServer=${1:?a Servername is required} + local myPort=${2:-443} + + echo | openssl s_client -showcerts -servername $myServer -connect $myServer:$myPort 2>/dev/null | openssl x509 -inform pem -noout -text +} diff --git a/dot_bashrc.d/bashrc.init b/dot_bashrc.d/bashrc.init new file mode 100644 index 0000000..da4465a --- /dev/null +++ b/dot_bashrc.d/bashrc.init @@ -0,0 +1,11 @@ +# This churns through files in $HOME/.bashrc.d if they are executable. +if [ -d $HOME/.bashrc.d ]; then + for x in $HOME/.bashrc.d/* ; do + if [[ "${x##*/}" != "bashrc.init" ]]; then + test -f "$x" || continue + test -x "$x" || continue + . "$x" + fi + done +fi +