Compare commits

..

9 commits

Author SHA1 Message Date
Jakobus Schürz
129c3b0210 fix aliases 2024-01-29 21:00:59 +01:00
Jakobus Schürz
9a3b100378 Merge branch 'master' of git.schuerz.at:jakob/myshellconfig 2024-01-20 02:46:46 +01:00
Jakobus Schürz
607f3f7e16 add aliases for fixing ssh connections 2024-01-19 08:25:45 +01:00
Jakobus Schürz
d95e03bf64 add alias for deploy pvp and do not run jra/cnf again 2024-01-19 08:24:32 +01:00
Jakobus Schürz
eacb28b712 Merged detached head into master 2024-01-11 10:24:38 +01:00
Jakobus Schürz
f8e4764feb add vimwiki plugin for vim 2024-01-11 10:24:38 +01:00
Jakobus Schürz
92e6633e97 Merged detached head into master 2023-11-17 14:05:59 +01:00
Jakobus Schürz
255fbf0907 add possibility to run db-statement on connectdb 2023-11-16 15:40:29 +01:00
Jakobus Schürz
797e4da5d1 add functions and aliases 2023-10-12 17:24:36 +02:00
4 changed files with 39 additions and 4 deletions

View file

@ -8,6 +8,8 @@ alias apv="ansible-playbook --ask-vault-pass"
alias fuck='sudo $(history -p \!\!)'
alias wosis='which $(history -p \!\!)'
alias fix='reset; stty sane; tput rs1; clear; echo -e "\033c"' # Fix terminal aber binary output
alias fixbmi='ssh -Oexit svras' # Fix terminal aber binary output
alias fixtoken='sudo systemctl restart pcscd.service' # Fix terminal aber binary output
# Source https://www.digitalocean.com/community/tutorials/how-to-use-bash-history-commands-and-expansions-on-a-linux-vps
alias vilastcatfile='vim $(history -p \!cat:$:t)'
alias vio='vim $(history -p \!less:$:t)'

4
aliases_remote Normal file
View file

@ -0,0 +1,4 @@
alias deploypvp='getatsvc; TARGETDIR=/opt/atlassian/${APP_NAME}/${APP_INST_NAME}/WEB-INF/lib; COMCSV=$(ls -t /root/INSTALL/commons-csv* |head -n1); SETTINGS=$(ls -t /root/INSTALL/at.gv.bmi.atlassian.pvp.settings* |head -n1); PVP=$(ls -t /root/INSTALL/at.gv.bmi.atlassian.pvp.authenticator.*${SVC}* |head -n1); echo "Deploy $SETTINGS $PVP $COMCSV"; systemctl stop ${APP_NAME}.service ;rm ${TARGETDIR}/at.gv.bmi.* ${TARGETDIR}/$(basename $COMCSV); cp ${SETTINGS} ${PVP} ${COMCSV} ${TARGETDIR}/.; systemctl restart ${APP_NAME} --no-block ;tailatpvp'
alias deploypvpandstop='getatsvc; TARGETDIR=/opt/atlassian/${APP_NAME}/${APP_INST_NAME}/WEB-INF/lib; COMCSV=$(ls -t /root/INSTALL/commons-csv* |head -n1); SETTINGS=$(ls -t /root/INSTALL/at.gv.bmi.atlassian.pvp.settings* |head -n1); PVP=$(ls -t /root/INSTALL/at.gv.bmi.atlassian.pvp.authenticator.*${SVC}* |head -n1); echo "Deploy $SETTINGS $PVP $COMCSV"; systemctl stop ${APP_NAME}.service ;rm ${TARGETDIR}/at.gv.bmi.* ${TARGETDIR}/$(basename $COMCSV); cp ${SETTINGS} ${PVP} ${COMCSV} ${TARGETDIR}/.'
alias getpvpversion='for base in $(find /opt/atlassian -type d -name "WEB-INF"); do echo search in "$base"; find "${base}/lib" -name "*pvp*" -exec basename {} \; ; echo "---";done'

View file

@ -1201,18 +1201,31 @@ function connectdb () {
getdbcreds_cnf $2
;;
*)
echo "wrong argument"
echo "wrong argument" >&2
return 1
;;
esac
cat << EOF
cat << EOF >&2
connect to ${DB_HOST}:${DB_PORT}/${DB_NAME}
with user: ${DB_USER}
and passwd: ${DB_PWD}
and passwd: ${DB_PWD:+********}
EOF
if [ $# -gt 0 ]
then
case $1 in
-c)
shift
PGPASSWORD=$DB_PWD psql -h $DB_HOST -p $DB_PORT -U $DB_USER $DB_NAME -c "$@"
;;
*)
PGPASSWORD=$DB_PWD psql -h $DB_HOST -p $DB_PORT -U $DB_USER $DB_NAME $@
;;
esac
else
PGPASSWORD=$DB_PWD psql -h $DB_HOST -p $DB_PORT -U $DB_USER $DB_NAME
fi
}
@ -1434,6 +1447,21 @@ EOF
shopt -u extglob
}
checkkernel () {
for i in /vmlinuz /boot/vmlinuz
do
[ -e "${i}" ] || continue
if [ $(basename $(readlink -f "${i}")) = vmlinuz-$(uname -r) ]
then
printf "%s\n" "Kein Upgrade notwendig. Kernel aktuell"
else
printf "%s\n" "Reboot notwendig!!"
res=1
fi
return ${res:-0}
done
}
#EOF

View file

@ -5,5 +5,6 @@ $(getbashrcfile)
${HOME}/.aliases
${HOME}/.bash_aliases
${MSC_BASE}/aliases
${MSC_BASE}/aliases_remote
${MSC_BASE}/PS1
${MSC_BASE}/bash_completion.d/*