Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
ssh() { case "${1}" in (-h|--help) command ssh -h 2>&1 | grep -v "^unknown" printf -- '%s\n' "Overlay options:" printf -- '\t %s\n' "dotfiles: syncs dotfiles to a remote host" \ "nokeys: Forces password based authentication" \ "raw: Runs ssh in its default, noisy state" return 0 ;; (dotfiles) # Inspired by # https://github.com/cdown/sshrc/blob/master/sshrc # https://github.com/fsquillace/kyrat # https://github.com/BarbUk/dotfiles/blob/master/bin/ssh_connect remote_host="${2:?Remote Host not defined}" for dotfile in .bashrc .exrc .inputrc .pwords.dict .vimrc; do if ! [[ -r ~/"${dotfile}" ]]; then printf -- '%s\n' "Local copy of ${dotfile} missing" >&2 continue fi local_sum=$(cksum ~/"${dotfile}" | awk '{print $1}') remote_sum=$(command ssh -q "${remote_host}" cksum "${dotfile}" 2>/dev/null | awk '{print $1}') if [[ "${local_sum}" = "${remote_sum}" ]]; then printf -- '%s\n' "${remote_host}:~/${dotfile} matches the local version" else printf -- '%s\n' "${remote_host}:~/${dotfile} appears outdated, updating..." scp ~/"${dotfile}" "${remote_host}:" || return 1 fi done ;; (nokeys) command ssh \ -o PubkeyAuthentication=no \ -o StrictHostKeyChecking=no \ -q \ "${@:2}" ;; (raw) command ssh "${@:2}" ;; (*) command ssh -o StrictHostKeyChecking=no -q "${@}" ;; esac }
ssh() { case "${1}" in (-h|--help) command ssh -h 2>&1 | grep -v "^unknown" printf -- '%s\n' "Overlay options:" printf -- '\t %s\n' "dotfiles: syncs dotfiles to a remote host" \ "nokeys: Forces password based authentication" \ "raw: Runs ssh in its default, noisy state" return 0 ;; (dotfiles) # Inspired by # https://github.com/cdown/sshrc/blob/master/sshrc # https://github.com/fsquillace/kyrat # https://github.com/BarbUk/dotfiles/blob/master/bin/ssh_connect remote_host="${2:?Remote Host not defined}" for dotfile in .bashrc .exrc .inputrc .pwords.dict .vimrc; do if ! [[ -r ~/"${dotfile}" ]]; then printf -- '%s\n' "Local copy of ${dotfile} missing" >&2 continue fi local_sum=$(cksum ~/"${dotfile}" | awk '{print $1}') remote_sum=$(command ssh -q "${remote_host}" cksum "${dotfile}" 2>/dev/null | awk '{print $1}') if [[ "${local_sum}" = "${remote_sum}" ]]; then printf -- '%s\n' "${remote_host}:~/${dotfile} matches the local version" else printf -- '%s\n' "${remote_host}:~/${dotfile} appears outdated, updating..." scp ~/"${dotfile}" "${remote_host}:" || return 1 fi done ;; (nokeys) command ssh \ -o PubkeyAuthentication=no \ -o StrictHostKeyChecking=no \ -q \ "${@:2}" ;; (raw) command ssh "${@:2}" ;; (*) command ssh -o StrictHostKeyChecking=no -q "${@}" ;; esac }
ssh() { case "${1}" in (-h|--help) command ssh -h 2>&1 | grep -v "^unknown" printf -- '%s\n' "Overlay options:" printf -- '\t %s\n' "dotfiles: syncs dotfiles to a remote host" \ "nokeys: Forces password based authentication" \ "raw: Runs ssh in its default, noisy state" return 0 ;; (dotfiles) # Inspired by # https://github.com/cdown/sshrc/blob/master/sshrc # https://github.com/fsquillace/kyrat # https://github.com/BarbUk/dotfiles/blob/master/bin/ssh_connect remote_host="${2:?Remote Host not defined}" for dotfile in .bashrc .exrc .inputrc .pwords.dict .vimrc; do if ! [[ -r ~/"${dotfile}" ]]; then printf -- '%s\n' "Local copy of ${dotfile} missing" >&2 continue fi local_sum=$(cksum ~/"${dotfile}" | awk '{print $1}') remote_sum=$(command ssh -q "${remote_host}" cksum "${dotfile}" 2>/dev/null | awk '{print $1}') if [[ "${local_sum}" = "${remote_sum}" ]]; then printf -- '%s\n' "${remote_host}:~/${dotfile} matches the local version" else printf -- '%s\n' "${remote_host}:~/${dotfile} appears outdated, updating..." scp ~/"${dotfile}" "${remote_host}:" || return 1 fi done ;; (nokeys) command ssh \ -o PubkeyAuthentication=no \ -o StrictHostKeyChecking=no \ -q \ "${@:2}" ;; (raw) command ssh "${@:2}" ;; (*) command ssh -o StrictHostKeyChecking=no -q "${@}" ;; esac }
Anyway, I did some more digging, and found exactly what I wanted - thought maybe you would be interested too: https://yadm.io/