From 95a44b0647e71683048cdada1fa6903bb86f5ccd Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Sun, 17 Mar 2019 20:48:21 +0200 Subject: [PATCH] Added genpass shell function for generating random passwords. --- .bashrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.bashrc b/.bashrc index d07b780..bc357a8 100644 --- a/.bashrc +++ b/.bashrc @@ -111,6 +111,11 @@ alias color='less --raw-control-chars -p' alias pip2='python2 -m pip' alias pip3='python3 -m pip' +genpass () { + bytes="${1:-32}" + head --bytes="$bytes" /dev/urandom | base64 --wrap=0 +} + sudome () ( eval "$(declare -F | sed 's/^declare/export/g')" sudo -E "$SHELL" -c "$@" -- GitLab