rootfs/home/andre/.bashrc aktualisiert
This commit is contained in:
@@ -16,20 +16,20 @@ alias ll='ls -haltr'
|
||||
alias ppm="sudo perl -MCPAN -e 'shell'"
|
||||
alias RDPC='__RDP 10.101.0.236'
|
||||
|
||||
alias __activate_bashrc='set +o history; source <(curl -k https://tools.andregeissler.de/bashrc) ; set -o history ; history -c'
|
||||
alias __backup_bashrc='set +o history; scp -P 2222 $HOMEDIR/.bashrc andregeissler@vesta.agserver.de:$HOMEDIR/web/tools.andregeissler.de/public_html/bashrc ; set -o history'
|
||||
alias __restore_bashrc='set +o history; scp -P 2222 andregeissler@vesta.agserver.de:$HOMEDIR/web/tools.andregeissler.de/public_html/bashrc $HOMEDIR/.bashrc ; set -o history'
|
||||
#alias __activate_bashrc='set +o history; source <(curl -k https://tools.andregeissler.de/bashrc) ; set -o history ; history -c'
|
||||
#alias __backup_bashrc='set +o history; scp -P 2222 $HOMEDIR/.bashrc andregeissler@vesta.agserver.de:$HOMEDIR/web/tools.andregeissler.de/public_html/bashrc ; set -o history'
|
||||
#alias __restore_bashrc='set +o history; scp -P 2222 andregeissler@vesta.agserver.de:$HOMEDIR/web/tools.andregeissler.de/public_html/bashrc $HOMEDIR/.bashrc ; set -o history'
|
||||
|
||||
alias __backup_ssh_host_config='set +o history; scp -P 2222 $HOMEDIR/.ssh/config andregeissler@vesta.agserver.de:$HOMEDIR/web/tools.andregeissler.de/public_html/ssh_host_config ; set -o history'
|
||||
alias __restore_ssh_host_config='set +o history; scp -P 2222 andregeissler@vesta.agserver.de:$HOMEDIR/web/tools.andregeissler.de/public_html/ssh_host_config $HOMEDIR/.ssh/config ; set -o history'
|
||||
alias __ssh_host_config=__restore_ssh_host_config
|
||||
#alias __backup_ssh_host_config='set +o history; scp -P 2222 $HOMEDIR/.ssh/config andregeissler@vesta.agserver.de:$HOMEDIR/web/tools.andregeissler.de/public_html/ssh_host_config ; set -o history'
|
||||
#alias __restore_ssh_host_config='set +o history; scp -P 2222 andregeissler@vesta.agserver.de:$HOMEDIR/web/tools.andregeissler.de/public_html/ssh_host_config $HOMEDIR/.ssh/config ; set -o history'
|
||||
#alias __ssh_host_config=__restore_ssh_host_config
|
||||
alias __ssh_h='egrep "^# " .ssh/config'
|
||||
alias ßh=ssh
|
||||
alias TS='ts "%Y-%m-%d %H:%M:%S"'
|
||||
|
||||
alias __clear_history="history -c && history -w && clear"
|
||||
alias clear_history="history -c && history -w && clear"
|
||||
|
||||
alias __extip='echo $(curl --connect-timeout 5 -s https://ipinfo.io/ip)'
|
||||
alias extip='echo $(curl --connect-timeout 5 -s https://ipinfo.io/ip)'
|
||||
alias grep='grep --line-buffered'
|
||||
alias egrep='egrep --line-buffered'
|
||||
alias sudo='sudo bash --rcfile $HOMEDIR/.bashrc'
|
||||
@@ -82,7 +82,7 @@ shopt -s interactive_comments
|
||||
shopt -s expand_aliases
|
||||
shopt -s extglob
|
||||
|
||||
cark-ssh() {
|
||||
cy-ssh() {
|
||||
set -euo pipefail
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
@@ -161,7 +161,7 @@ cark-ssh() {
|
||||
"${CMD[@]}"
|
||||
}
|
||||
|
||||
__RDP() {
|
||||
RDP() {
|
||||
if [ "$1" == "" ]
|
||||
then
|
||||
echo 'call with __RDP <IP>'
|
||||
@@ -170,7 +170,7 @@ __RDP() {
|
||||
fi
|
||||
}
|
||||
|
||||
__prompt_confirm() {
|
||||
prompt_confirm() {
|
||||
while true; do
|
||||
read -r -n 1 -p "${1:-Weiter?} [j/n]: " REPLY
|
||||
case $REPLY in
|
||||
@@ -182,17 +182,7 @@ __prompt_confirm() {
|
||||
}
|
||||
# prompt_confirm "Overwrite File?" || return 0
|
||||
|
||||
__my_versions() {
|
||||
files='$HOMEDIR/.bashrc $HOMEDIR/.ssh/config'
|
||||
for file in `echo $files`
|
||||
do
|
||||
cmd="grep '### Version' $file | grep -v grep | tr -d '#'"
|
||||
version=`eval $cmd`
|
||||
printf "%-20s :%s\n" "$file" "$version"
|
||||
done
|
||||
}
|
||||
|
||||
__conv_owi() {
|
||||
conv_owi() {
|
||||
IMG=$1
|
||||
PNG=${IMG}.png
|
||||
|
||||
@@ -237,7 +227,7 @@ __conv_owi() {
|
||||
fi
|
||||
}
|
||||
|
||||
__arg_help() {
|
||||
arg_help() {
|
||||
echo "
|
||||
Aliases
|
||||
ll ppm grep egrep
|
||||
@@ -251,16 +241,13 @@ Funktionen
|
||||
arg_help svncom screen_h sudo_h iptables_h ssh_h
|
||||
init.d_h delete_files_older logrotate rotate
|
||||
ssh_perconal_environment ssh_personal_config eping
|
||||
sysinfo pw update_git my_versions prompt_confirm conv_owi
|
||||
|
||||
sysinfo pw update_git prompt_confirm conv_owi
|
||||
cy-ssh ßh TS sudo
|
||||
wetter
|
||||
zeigt Wettervorhersagen an
|
||||
wi
|
||||
startet vi und erstellt zuvor Sicherungsdatei
|
||||
|
||||
ssh_host_config
|
||||
schreibt Verbindungs-Parameter in .ssh/config
|
||||
|
||||
install_ssh_keypair_files
|
||||
speichert Schlüsselpaar in $HOMEDIR/.ssh/id_ed25519[.pub]
|
||||
|
||||
@@ -273,8 +260,6 @@ ssh_env
|
||||
4. bei erfolg wird beim anmelden die zuvor angelegte datei ausgeführt und
|
||||
durch einen rm am Ende dieses bashrc gelöscht
|
||||
|
||||
ssh -o \"ProxyJump HOST\" user@server
|
||||
ssh via JumpHost HOST der kann in $HOMEDIR/.ssh/config vordefiniert werden
|
||||
"
|
||||
}
|
||||
|
||||
@@ -492,7 +477,7 @@ print "$s";
|
||||
}
|
||||
|
||||
|
||||
__sysinfo() {
|
||||
sysinfo() {
|
||||
if [ "$USER" != "root" ]; then
|
||||
echo -e $C_RED$BG_WHITE"Not root"$C_NO
|
||||
return
|
||||
@@ -540,7 +525,7 @@ __sysinfo() {
|
||||
echo -n "free "; free -m | grep Swap | awk '{ print $4 }'
|
||||
}
|
||||
|
||||
__screen_h() {
|
||||
screen_h() {
|
||||
echo "
|
||||
Ctrl+a c(reate)
|
||||
Ctrl+a n(ext)
|
||||
@@ -558,14 +543,14 @@ __screen_h() {
|
||||
"
|
||||
}
|
||||
|
||||
__sudo_h() {
|
||||
sudo_h() {
|
||||
echo "
|
||||
/etc/sudoers
|
||||
andre ALL=(ALL) NOPASSWD: ALL
|
||||
"
|
||||
}
|
||||
|
||||
__iptables_h() {
|
||||
iptables_h() {
|
||||
echo "
|
||||
# Policy fÃŒr Chain setzen
|
||||
iptables -P INPUT ACCEPT
|
||||
@@ -621,7 +606,7 @@ COMMIT
|
||||
}
|
||||
|
||||
|
||||
__delete_files_older() {
|
||||
delete_files_older() {
|
||||
if [ "$4" == "" ]; then
|
||||
echo ""
|
||||
echo "$0 <Pfad> <Tage> <d|f> <r|n>"
|
||||
@@ -658,12 +643,12 @@ __delete_files_older() {
|
||||
fi
|
||||
}
|
||||
|
||||
__delete_old_logs() {
|
||||
delete_old_logs() {
|
||||
find /var/log -name "*.gz" -o -name "*.1" -o -name "*.2" -o -name "*.old" | xargs rm
|
||||
find /var/log -mtime +7 | xargs rm
|
||||
}
|
||||
|
||||
__ssh_personal_environment() {
|
||||
ssh_personal_environment() {
|
||||
if [ $# -gt 0 -a "$1" = "--debug" ] ; then
|
||||
export SSH_PERS_ENV_DEBUG=1
|
||||
shift
|
||||
@@ -681,7 +666,7 @@ __ssh_personal_environment() {
|
||||
fi
|
||||
}
|
||||
|
||||
__ssh_personal_config() {
|
||||
ssh_personal_config() {
|
||||
echo "append to /etc/ssh/ssh_config on ssh client"
|
||||
echo "# this content comes from the ssh-personal-environment package"
|
||||
echo "SendEnv SSH_PERS_ENV_DATA SSH_PERS_ENV_FILES SSH_PERS_ENV_DEBUG"
|
||||
@@ -713,7 +698,7 @@ __ssh_personal_config() {
|
||||
echo ""
|
||||
}
|
||||
|
||||
__logrotate() {
|
||||
logrotate() {
|
||||
if [ "$1" == "" ]
|
||||
then
|
||||
echo ""
|
||||
@@ -740,7 +725,7 @@ __logrotate() {
|
||||
popd
|
||||
}
|
||||
|
||||
__e1ping() {
|
||||
e1ping() {
|
||||
while (( "$#" ))
|
||||
do
|
||||
ping -W 1 -O -i 1 -c 1 $1 >/dev/null
|
||||
@@ -757,7 +742,7 @@ __e1ping() {
|
||||
echo
|
||||
}
|
||||
|
||||
__eping() {
|
||||
eping() {
|
||||
P=""
|
||||
while (( "$#" ))
|
||||
do
|
||||
@@ -780,22 +765,22 @@ __eping() {
|
||||
done
|
||||
}
|
||||
|
||||
__find_local_port() {
|
||||
find_local_port() {
|
||||
N=$(($RANDOM + 10000))
|
||||
echo $N
|
||||
}
|
||||
|
||||
__find_local_ip() {
|
||||
find_local_ip() {
|
||||
I=$(($RANDOM % 250))
|
||||
echo $I
|
||||
}
|
||||
|
||||
__find_session_id() {
|
||||
find_session_id() {
|
||||
S=`date +"%s"`
|
||||
echo $S
|
||||
}
|
||||
|
||||
__update_git() {
|
||||
update_git() {
|
||||
echo "Gehe durch Unterverzeichnisse für git pulls"
|
||||
for DIR in `ls`
|
||||
do
|
||||
@@ -807,7 +792,7 @@ __update_git() {
|
||||
done
|
||||
}
|
||||
|
||||
__pw() {
|
||||
pw() {
|
||||
printf "\n B_uchstaben S_onderzeichen W_orte Z_iffern\n"
|
||||
B='a b c d e f g h j k m n p q r s t u v w x y z A B C D E F G H J K L M N P Q R S T U V W X Y Z'
|
||||
Z='1 2 3 4 5 6 7 8 9'
|
||||
@@ -927,7 +912,7 @@ rm ziffern
|
||||
|
||||
}
|
||||
|
||||
__rotate () {
|
||||
rotate () {
|
||||
file=$1
|
||||
if [ "$file" == "" ]
|
||||
then
|
||||
@@ -957,12 +942,12 @@ __rotate () {
|
||||
fi
|
||||
}
|
||||
|
||||
__wetter () {
|
||||
wetter () {
|
||||
c=$1
|
||||
curl wttr.in/$c
|
||||
}
|
||||
|
||||
__wi () {
|
||||
wi () {
|
||||
f=$1
|
||||
d=$(date "+%Y-%m-%d")
|
||||
rotate $f.bu.$d > /dev/null 2>&1
|
||||
@@ -970,7 +955,7 @@ __wi () {
|
||||
vi -c ":syntax on" -c "set number" $f
|
||||
}
|
||||
|
||||
__ssh_env () {
|
||||
ssh_env () {
|
||||
u=$1
|
||||
s=$2
|
||||
|
||||
@@ -980,11 +965,11 @@ __ssh_env () {
|
||||
ssh -q -X -oStrictHostKeyChecking=no $u@$s
|
||||
}
|
||||
|
||||
__crossword () {
|
||||
crossword () {
|
||||
grep -hi "^$1\$" /usr/share/dict/* | sort | uniq
|
||||
}
|
||||
|
||||
__install_ssh_keypair_files () {
|
||||
install_ssh_keypair_files () {
|
||||
mkdir $HOMEDIR/.ssh/
|
||||
echo "-----BEGIN OPENSSH PRIVATE KEY-----
|
||||
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
|
||||
@@ -1031,7 +1016,7 @@ udFwOoIdCrLECMaAOCtOrObBwy7wSQH3RTbxn8Fn4tvFfD0FJKOtch+NuwtSbIC5buqrF/
|
||||
chmod 0600 $HOMEDIR/.ssh/ansible_id_rsa.pub
|
||||
}
|
||||
|
||||
__install_ssh_authorized_key () {
|
||||
install_ssh_authorized_key () {
|
||||
if [ "$1" == "" ]
|
||||
then
|
||||
echo "Installiert ssh-ed25519 in $HOMEDIR/.ssh/authorized_keys"
|
||||
|
||||
Reference in New Issue
Block a user