Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 56 lines (49 sloc) 2.76 KB
#!/bin/bash
export HISTCONTROL=ignoredups:erasedups # Force ignoredups and erase duplicates across the whole history which is good for desktop and bad for server
export HISTFILESIZE=9999 # Increace history file size
export HISTSIZE=5000
export HISTTIMEFORMAT='%F %T ' # Display TIMESTAMP in history, for auditing purpose
export PROMPT_COMMAND='history -a; history -n; ' # Make sure the history is updated at every command.
alias less="less -IJMW"
alias grep='grep --color'
alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} '
alias t='tail -f'
alias nano='nano -w'
grep -Pzo "Match User $USER\s+PasswordAuthentication no" /etc/ssh/sshd_config > /dev/null || echo -e "\e[100mWARN\e[0m \e[91mPassword login is enabled\e[0m"
set -o notify # Don't wait for job termination notification
set completion-ignore-case on # Set tab-completion to be case-insensitive
set match-hidden-files on
set show-all-if-ambiguous on # Show all tab-completed matches
set show-all-symlinked-directories on # Set all symlinked-directories to be shown
set visible-stats on
set blink-matching-paren on
set mark-directories on # Append "/" to all dirnames
set mark-symlinked-directories on
stty werase undef
bind '"\C-w": unix-filename-rubout'
DEBIAN_FRONTEND=noninteractive apt-get install -yq bash-completion > /dev/null 2>&1 && . /etc/bash_completion > /dev/null 2>&1
cp -f $SSHHOME/.sshrc.d/.nanorc ~ > /dev/null 2>&1
mkdir ~/.nano_backups/ 2> /dev/null
shopt -s autocd
shopt -s cdable_vars # if cd arg is not valid, assumes its a var defining a dir
shopt -s cdspell # Autocorrect typos in path names when using `cd`
shopt -s checkwinsize # check the window size after each command and, if necessary, update the values of LINES and COLUMNS.
shopt -s cmdhist # multiline commands saved in history as oneliners
shopt -s dotglob # files beginning with . to be returned in the results of path-name expansion.
shopt -s execfail # failed execs don't exit shell
shopt -s expand_aliases # expand aliases
shopt -s extglob # bonus regex globbing!
shopt -u force_fignore # Expand to complete an ignored word, if no other words match.
shopt -s histappend # Append to the Bash history file, rather than overwriting it
shopt -s histreedit # allow re-editing of a history command substitution, if the previous run failed
shopt -s histverify # good for double-checking history substitutions
shopt -s hostcomplete # tab-complete words containing @ as hostnames
shopt -u mailwarn # No messages about new e-mail
shopt -s no_empty_cmd_completion # Don't try to find all the command possibilities when hitting TAB on an empty line.
shopt -s nocaseglob # Case-insensitive globbing (used in pathname expansion)
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi