From 0a286e46139366a18c8e601e64244f7b4cfa3372 Mon Sep 17 00:00:00 2001 From: Christian Moser Date: Sun, 21 Dec 2025 02:20:16 +0100 Subject: [PATCH] 2025.12.21 02:20:16 (cachyos) --- conda.sh | 5 +++++ gitea.sh | 55 +++++++++++++++++++++++++++++++++++++++++++++++ password-store.sh | 2 +- vim.sh | 4 ++-- 4 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 conda.sh create mode 100644 gitea.sh diff --git a/conda.sh b/conda.sh new file mode 100644 index 0000000..df10d99 --- /dev/null +++ b/conda.sh @@ -0,0 +1,5 @@ +if [ -f /opt/miniconda3/etc/profile.d/conda.sh ]; then + source /opt/miniconda3/etc/profile.d/conda.sh +fi + + diff --git a/gitea.sh b/gitea.sh new file mode 100644 index 0000000..5c73da7 --- /dev/null +++ b/gitea.sh @@ -0,0 +1,55 @@ +# vim: syn=sh ts=4 sts=4 sw=4 smartindent expandtab + +gitea-add-user() { + if [ $# -ne 4 ]; then + echo $# + echo "gitea-add-user " + return 2 + fi + local host=$1 + local email=$2 + local username=$3 + local password=$4 + + curl --request POST --url https://${host}/user/sign_up \ + --header 'content-type: application/x-www-form-urlencoded'\ + --data user_name=$username \ + --data email=$email \ + --data password=$password \ + --data retype=$password + local retcode=$? + if [ $retcode -ne 0 ]; then + echo "unable to add user $username!" + return 4 + fi + + local mail="$(cat </dev/null) ]; then + mutt -H - $email <<<"$mail" + #elif [ -n $(which send-email 2>/dev/null) ]; then + fi + + retcode=$? + if [ $retcode -ne 0 ]; then + Email not sended! + return 5 + fi + return 0 +} + + diff --git a/password-store.sh b/password-store.sh index e4388cd..265e369 100644 --- a/password-store.sh +++ b/password-store.sh @@ -1,6 +1,6 @@ # vim: syn=sh ts=4 sts=4 sw=4 smartindent expandtab autoindent ff=unix -if [ -n "`which pass`" ]; then +if [ -n "$(which pass 2>/dev/null)" ]; then pass-push-all() { for __pass_remote__ in $(pass git remote); do diff --git a/vim.sh b/vim.sh index 9d0493f..7624bbe 100644 --- a/vim.sh +++ b/vim.sh @@ -1,8 +1,8 @@ -if [ -n "$( which nvim )" ]; then +if [ -n "$( which nvim 2>/dev/null )" ]; then alias vim=nvim alias edit=nvim alias svim='sudo nvim' -elif [ -n "$( which vim )" ]; then +elif [ -n "$( which vim 2>/dev/null )" ]; then alias nvim=vim alias edit=vim alias svim='sudo vim'