2025.12.21 02:20:16 (cachyos)
This commit is contained in:
parent
746f9b8e0d
commit
0a286e4613
5
conda.sh
Normal file
5
conda.sh
Normal file
@ -0,0 +1,5 @@
|
||||
if [ -f /opt/miniconda3/etc/profile.d/conda.sh ]; then
|
||||
source /opt/miniconda3/etc/profile.d/conda.sh
|
||||
fi
|
||||
|
||||
|
||||
55
gitea.sh
Normal file
55
gitea.sh
Normal file
@ -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 <HOST> <EMAIL> <USERNAME> <PASSWORD>"
|
||||
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 <<EOF
|
||||
Subject: Neuer GIT-Account erstellt
|
||||
From: $EMAIL_SENDER
|
||||
To: $email
|
||||
Ihr GIT Account wurde auf "$host" erstellt mit den Nutzernamen "$username" erstellt.
|
||||
Sie können sich dort anmelden.
|
||||
|
||||
Anmedleinformationen:
|
||||
Addresse: https://$host
|
||||
Nutzername: $username
|
||||
Passwort: $password
|
||||
|
||||
Wir freuen uns auf Dich!
|
||||
Dein GIT-Team auf $host
|
||||
EOF
|
||||
)"
|
||||
if [ -n $(which mutt 2>/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
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
4
vim.sh
4
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'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user