Compare commits

..

4 Commits

6 changed files with 30 additions and 8 deletions

View File

@ -1,5 +1,6 @@
# Lazygit #/bin/bash
if ( which lazygit &> /dev/null )
if (command -v lazygit &> /dev/null)
then then
alias lg='lazygit' alias lg=lazygit
fi fi

View File

@ -1,5 +1,6 @@
# LSD #!/bin/bash
if ( command -v lsd &> /dev/null )
if (command -v lsd &> /dev/null)
then then
alias ls='lsd' alias ls=lsd
fi fi

View File

@ -14,8 +14,10 @@ genpasswd() {
[ "$l" == "" ] && l=12 [ "$l" == "" ] && l=12
local password_clear=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs) local password_clear=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs)
local password_md5hash=$(openssl passwd -1 $password_clear) local password_md5hash=$(openssl passwd -1 $password_clear)
local password_sha1=$(echo -n $password_clear | openssl dgst -sha1) local password_sha1=$(echo -n "$password_clear" | openssl dgst -sha1)
local password_base64=$(echo -n "$password_clear" | base64)
echo "Password : $password_clear" echo "Password : $password_clear"
echo "Base64 : $password_base64"
echo "MD5HASH : $password_md5hash" echo "MD5HASH : $password_md5hash"
echo "SHA1 : $password_sha1" echo "SHA1 : $password_sha1"
} }

9
libs/path.bash Normal file
View File

@ -0,0 +1,9 @@
#!/bin/bash
_path_add() {
if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
PATH="${PATH:+"$PATH:"}$1"
fi
}
# Source : https://superuser.com/questions/39751/add-directory-to-path-if-its-not-already-there

9
libs/prompt_command.bash Normal file
View File

@ -0,0 +1,9 @@
#!/bin/bash
_prompt_command_add() {
if [ -n "$1" ] && [[ ":$PROMPT_COMMAND:" != *":$1:"* ]]; then
PROMPT_COMMAND="${PROMPT_COMMAND:+"$PROMPT_COMMAND;"}$1"
fi
}
export PROMPT_COMMAND

View File

@ -13,7 +13,7 @@ if [ "${POWERLINE}" = "powerline-go" ]; then
PS1=$($POWERLINE -jobs "$(jobs -p | wc -l)" -error $? -modules "ssh,host,wsl,user,cwd,direnv,venv,perms,git,jobs,exit,root" -modules-right "docker,docker-context,kube,terraform-workspace,termtitle" -newline) PS1=$($POWERLINE -jobs "$(jobs -p | wc -l)" -error $? -modules "ssh,host,wsl,user,cwd,direnv,venv,perms,git,jobs,exit,root" -modules-right "docker,docker-context,kube,terraform-workspace,termtitle" -newline)
} }
if [ "$TERM" != "linux" ]; then PROMPT_COMMAND="$PROMPT_COMMAND; _update_ps1"; fi if [ "$TERM" != "linux" ]; then _prompt_command_add "_update_ps1" ; fi
elif [ "${POWERLINE}" = "powerline" ]; then elif [ "${POWERLINE}" = "powerline" ]; then