From 722ab732db38d3a96c9a039370e82be2de2b605e Mon Sep 17 00:00:00 2001 From: Marco Grifantini <613559+marcogrifantini@users.noreply.github.com> Date: Sat, 29 Aug 2020 16:59:37 +0200 Subject: [PATCH 1/5] Update .bashrc alias la="ls -laFGh" --- .bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index 1710080..a10537e 100644 --- a/.bashrc +++ b/.bashrc @@ -104,7 +104,7 @@ fi # some more ls aliases alias ll='ls -l' -alias la='ls -A' +alias la='ls -laFGh' alias l='ls -CF' alias em='emacs -nw' alias dd='dd status=progress' From c27838f0a2ef8bbc6a3a836a93545d4de8ce56b0 Mon Sep 17 00:00:00 2001 From: Marco Grifantini <613559+marcogrifantini@users.noreply.github.com> Date: Sat, 19 Dec 2020 08:25:37 +0100 Subject: [PATCH 2/5] 30 Handy Bash Shell Aliases https://www.cyberciti.biz/tips/bash-aliases-mac-centos-linux-unix.html --- .bash_aliases | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.bash_aliases b/.bash_aliases index de1ede0..c355ac1 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -6,3 +6,29 @@ alias dc='cd' alias nethack-online='ssh nethack@nethack.alt.org ; clear' alias tron-online='ssh sshtron.zachlatta.com ; clear' alias glog='git log --oneline --graph --color --all --decorate' + +# 30 Handy Bash Shell Aliases For Linux / Unix / MacOS +# https://www.cyberciti.biz/tips/bash-aliases-mac-centos-linux-unix.html +alias ports='netstat -tulanp' +#16: Add safety nets +# do not delete / or prompt if deleting more than 3 files at a time # +alias rm='rm -I --preserve-root' +# confirmation # +alias mv='mv -i' +alias cp='cp -i' +alias ln='ln -i' +# Parenting changing perms on / # +alias chown='chown --preserve-root' +alias chmod='chmod --preserve-root' +alias chgrp='chgrp --preserve-root' +#21: Control web servers +# also pass it via sudo so whoever is admin can reload it without calling you # +alias nginxreload='sudo /usr/local/nginx/sbin/nginx -s reload' +alias nginxtest='sudo /usr/local/nginx/sbin/nginx -t' +alias lightyload='sudo /etc/init.d/lighttpd reload' +alias lightytest='sudo /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -t' +alias httpdreload='sudo /usr/sbin/apachectl -k graceful' +alias httpdtest='sudo /usr/sbin/apachectl -t && /usr/sbin/apachectl -t -D DUMP_VHOSTS' +#27 Resume wget by default +## this one saved by butt so many times ## +alias wget='wget -c' From c11f48adc401e1f27face7d369dda3bd2ce507bc Mon Sep 17 00:00:00 2001 From: Marco Grifantini Date: Sat, 19 Dec 2020 08:00:37 +0000 Subject: [PATCH 3/5] halt/reboot via sudo aliases --- .bash_aliases | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.bash_aliases b/.bash_aliases index c355ac1..3f9bd01 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -21,6 +21,12 @@ alias ln='ln -i' alias chown='chown --preserve-root' alias chmod='chmod --preserve-root' alias chgrp='chgrp --preserve-root' +#20: Pass halt/reboot via sudo +# reboot / halt / poweroff +alias reboot='sudo /sbin/reboot' +alias poweroff='sudo /sbin/poweroff' +alias halt='sudo /sbin/halt' +alias shutdown='sudo /sbin/shutdown' #21: Control web servers # also pass it via sudo so whoever is admin can reload it without calling you # alias nginxreload='sudo /usr/local/nginx/sbin/nginx -s reload' @@ -32,3 +38,4 @@ alias httpdtest='sudo /usr/sbin/apachectl -t && /usr/sbin/apachectl -t -D DUMP_V #27 Resume wget by default ## this one saved by butt so many times ## alias wget='wget -c' + From ce13fa54993388ed9e440e1d6659fa215f47f63b Mon Sep 17 00:00:00 2001 From: Marco Grifantini Date: Thu, 31 Dec 2020 14:17:27 +0100 Subject: [PATCH 4/5] added .inputrc with case insensitive completion and autocomplete command from history --- .inputrc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .inputrc diff --git a/.inputrc b/.inputrc new file mode 100644 index 0000000..df2a947 --- /dev/null +++ b/.inputrc @@ -0,0 +1,15 @@ +# Start typing than press up / down arrow to autocomplete command from history +"\e[A": history-search-backward +"\e[B": history-search-forward + +# Complete things that have been typed in the wrong case: +set completion-ignore-case on + +# When listing possible file completions, put / after directory names and * after programs: +set visible-stats on + +# List the possible completions when Tab is pressed: +set show-all-if-ambiguous on + +# Make Meta+S cycle through the list: +"\M-s": menu-complete From f8892c099ee4179e6affe6e513bbb32ac0387cda Mon Sep 17 00:00:00 2001 From: Marco Grifantini Date: Sun, 24 Jan 2021 09:57:43 +0100 Subject: [PATCH 5/5] Update .bashrc bash history: increased HIST SIZE, remove duplicates and append history across multiple terminals --- .bashrc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index a10537e..f3187d0 100644 --- a/.bashrc +++ b/.bashrc @@ -12,15 +12,18 @@ export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/share/ # don't put duplicate lines or lines starting with space in the history. # See bash(1) for more options -HISTCONTROL=ignoreboth +HISTCONTROL=ignoredups:erasedups # append to the history file, don't overwrite it shopt -s histappend # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) -HISTSIZE=1000 +HISTSIZE=10000 HISTFILESIZE=2000 +# After each command, append to the history file and reread it +PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r" + # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. shopt -s checkwinsize