diff options
author | Karel Kočí <karel.koci@nic.cz> | 2017-08-15 13:01:34 +0200 |
---|---|---|
committer | Karel Kočí <karel.koci@nic.cz> | 2017-08-15 13:01:34 +0200 |
commit | 91f745b19d9e38b65103fb22b84fd246d84a5aff (patch) | |
tree | 49042df4e4aa8fc8ca07cd866bb9a326eb4a167b /shellrc | |
parent | e60d83bc996080630961b87d9a4c4d28f91fd1b1 (diff) | |
parent | d4177b26ddef38c6773116c34dfa6cb59c368bb9 (diff) | |
download | myconfigs-91f745b19d9e38b65103fb22b84fd246d84a5aff.tar.gz myconfigs-91f745b19d9e38b65103fb22b84fd246d84a5aff.tar.bz2 myconfigs-91f745b19d9e38b65103fb22b84fd246d84a5aff.zip |
Merge branch 'master' into server
Diffstat (limited to 'shellrc')
-rw-r--r-- | shellrc | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -4,6 +4,9 @@ # Continue only if this is interactive shell [[ $- != *i* ]] && return +################################################################################# +# Aliases + if [ "$(uname -s)" = "FreeBSD" ]; then alias ls='ls -G' else @@ -42,8 +45,21 @@ if pidof systemd >/dev/null 2>/dev/null; then alias ujrn='jrn --user' fi +################################################################################# +# Utility functions + +# Generate random password (optionally takes length of password as first argument) genpasswd() { local l=$1 if [ "$l" = "" ]; then l=16; fi tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs } + +# Run given command every second +dorepeat() { + while true; do + "$@" + sleep 1 + echo + done +} |