add linux vps conf

This commit is contained in:
2022-01-09 22:19:02 +00:00
parent 4104f504c6
commit f2657c32c6
14 changed files with 840 additions and 0 deletions

140
linux/deb11-vps/.bashrc Normal file
View File

@@ -0,0 +1,140 @@
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
if [[ -d $HOME/bin ]]; then export PATH=$PATH:$HOME/bin; fi
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=999999
HISTFILESIZE=999999
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
#PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u\[\033[01;33m\]@\[\033[01;36m\]\h \[\033[01;33m\]\w \[\033[01;35m\]\$ \[\033[00m\]'
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# some more ls aliases
alias ll='ls -kahlF'
alias la='ls -A'
alias l='ls -CF'
alias pip3='python3 -m pip'
export TIME_STYLE=long-iso
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
alias bashrc="vim ~/.bashrc && source ~/.bashrc"
alias git-root='cd "$(git rev-parse --show-toplevel)"'
# HSTR configuration - add this to ~/.bashrc
alias hh=hstr # hh to be alias for hstr
export HSTR_CONFIG=hicolor,raw-history-view # get more colors
shopt -s histappend # append new history items to .bash_history
export HISTCONTROL=ignorespace # leading space hides commands from history
# export HISTFILESIZE=10000 # increase history file size (default is 500)
# export HISTSIZE=${HISTFILESIZE} # increase history size (default is 500)
# ensure synchronization between Bash memory and history file
export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}"
# if this is interactive shell, then bind hstr to Ctrl-r (for Vi mode check doc)
if [[ $- =~ .*i.* ]]; then bind '"\C-r": "\C-a hstr -- \C-j"'; fi
# if this is interactive shell, then bind 'kill last command' to Ctrl-x k
if [[ $- =~ .*i.* ]]; then bind '"\C-xk": "\C-a hstr -k \C-j"'; fi

9
linux/deb11-vps/.profile Normal file
View File

@@ -0,0 +1,9 @@
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
mesg n || true

View File

@@ -0,0 +1,3 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC7gBTAl2PB3zDzHp9Hz9P/WGHBNU3+sVYUBPj3WfOc0Dfo0O4+6F2dF697tl57YWwP6SePQQLiIRQJIpU7gYEf97XR9Y+ArrIn3BiZ2wgEbbTO/KQNZnpcGFYKU9oS5QQasp9ziKtpjItu9b9l6Wk4t3HGsM9j18F9AW/XwYBkdpZn41ZokqLWMcvZ/LwDgqkOL3k1YsBLBYnT0QTYTdvPwMO3sDEfYgeaOR5SnKKjeKLFZZIukrjUfrZ86MyyygBEBcak5P+x/6OYc+1Q3IyevG7+wRCIV44Ja92g6x3w8A5N1+LDa/jCrzMt6P3gz31IejwmT+hIbCebM3wcdihBT95hu+pNABBpXSvXZIPbz1F93bs/pScresfCnAMjzfPLxA2O8QOnWIVXDZBXe67wxPJtqA8eL1rRzy3GF01fKHjSVB+sX2YnHAcS+N335z6srQHbg9fZLcmsUXZ26FQNEiYWw/92jiYq4eefv/gFOUpzukWyB0rI5KfAsaZ/ZvGb+ugFqBiO0Jixlyd12qi+ekbLTx4f8oc4P2mtv761F6LFPEU1HDnagfgjf9kwo4sZ6gEYPKDaZVwlQqiTsO/7C8QMFDrKG0mzDqqKf0i7S/NjgYvJIA/o4j5Q3Med3txA8Jq32eN/zOzNIXkJh76Im6Exhfqv0U2MIKnz7XRh4Q== mark@MB12Mark.local
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDMPc5AYRjZxcosRkVbcAHKQe/v/gzhY3v0tfzg/AxfX mark@x1y2deb11
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKkpmRj1aAm6La6wqmmpi5we+IzfAmtjY/kDxPwkX2MV root@turris

View File

@@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHnBOU1gMtpNIK4NfMFgqNg9POAkvH87B1ct7Mx6Z2Xe mark@deb-3vcpu-4gb-80gb-nbg-CPX21

View File

@@ -0,0 +1,25 @@
# set -g default-terminal "tmux-256color"
# Start numbering windows at 1
set -g base-index 1
set-option -g history-limit 125000
set-option -g status-style fg="#cccccc",bg="#444444"
set-option -g message-style fg="#000000",bg="#bfbf40"
set-option -g pane-border-style fg="#777777"
set-option -g pane-active-border-style fg="#bfbf40"
set -g status-interval 1
set -g status-justify centre # center align window list
set -g status-left-length 20
set -g status-right-length 140
set -g status-left '#H • #[default]'
set -g status-right '#(tmux-mem-cpu-load --interval 1) • #(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") • %a %H:%M:%S #[default] %Y-%m-%d'
# Try screen256-color (https://github.com/tmux/tmux/issues/622):
if-shell "test '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -ge 6 \)'" 'set -g default-terminal "screen-256color"'
if-shell "test '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -ge 6 \)'" 'set -ga terminal-overrides ",screen-256color:Tc"'
if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 6\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'set -g default-terminal "screen-256color"'

131
linux/deb11-vps/.vimrc Normal file
View File

@@ -0,0 +1,131 @@
syntax enable " Turn on syntax highlighting
set hidden " Leave hidden buffers open
set history=100 "by default Vim saves your last 8 commands. We can handle more
" Enable filetype plugins
filetype plugin on
filetype indent on
"Always show current position
set ruler
" Height of the command bar
set cmdheight=1
""""""""""""""""""""""""""""""
" => Status line
""""""""""""""""""""""""""""""
" Always show the status line
set laststatus=2
" Format the status line
" set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l\ \ Column:\ %c
set statusline=%t "tail of the filename
set statusline+=[%{strlen(&fenc)?&fenc:'none'}, "file encoding
set statusline+=%{&ff}] "file format
set statusline+=%h "help file flag
set statusline+=%m "modified flag
set statusline+=%r "read only flag
set statusline+=%y "filetype
set statusline+=%= "left/right separator
set statusline+=%c, "cursor column
set statusline+=%l/%L "cursor line/total lines
set statusline+=\ %P "percent through file
" https://stackoverflow.com/a/10416234
set statusline=
set statusline+=%7*\[%n] "buffernr
set statusline+=%1*\ %<%F\ "File+path
set statusline+=%2*\ %y\ "FileType
set statusline+=%3*\ %{''.(&fenc!=''?&fenc:&enc).''} "Encoding
set statusline+=%3*\ %{(&bomb?\",BOM\":\"\")}\ "Encoding2
set statusline+=%4*\ %{&ff}\ "FileFormat (dos/unix..)
set statusline+=%5*\ %{&spelllang}\%{HighlightSearch()}\ "Spellanguage & Highlight on?
set statusline+=%8*\ %=\ row:%l/%L\ (%03p%%)\ "Rownumber/total (%)
set statusline+=%9*\ col:%03c\ "Colnr
set statusline+=%0*\ \ %m%r%w\ %P\ \ "Modified? Readonly? Top/bot.
hi User1 ctermfg=15 ctermbg=88 guifg=#ffdad8 guibg=#880c0e "File+path
hi User2 ctermfg=0 ctermbg=173 guifg=#000000 guibg=#F4905C "FileType
hi User3 ctermfg=0 ctermbg=186 guifg=#292b00 guibg=#f4f597 "Encoding
hi User4 ctermfg=0 ctermbg=150 guifg=#112605 guibg=#aefe7B "FileFormat (dos/unix..)
hi User5 ctermfg=0 ctermbg=114 guifg=#051d00 guibg=#7dcc7d "Spellanguage & Highlight on?
hi User7 ctermfg=15 ctermbg=88 guifg=#ffffff guibg=#880c0e gui=bold cterm=bold "buffernr
hi User8 ctermfg=15 ctermbg=62 guifg=#ffffff guibg=#5b7fbb "Rownumber/total (%)
hi User9 ctermfg=15 ctermbg=90 guifg=#ffffff guibg=#810085 "Colnr
hi User0 ctermfg=7 ctermbg=8 guifg=#ffffff guibg=#094afe "Modified? Readonly? Top/bot.
hi StatusLine ctermfg=237 ctermbg=255
function! HighlightSearch()
if &hls
return 'H'
else
return ''
endif
endfunction
" Configure backspace so it acts as it should act
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
" Ignore case when searching
set ignorecase
" When searching try to be smart about cases
set smartcase
" Highlight search results
set hlsearch
" Makes search act like search in modern browsers
set incsearch
" Don't redraw while executing macros (good performance config)
set lazyredraw
" For regular expressions turn magic on
set magic
" Show matching brackets when text indicator is over them
set showmatch
" How many tenths of a second to blink when matching brackets
set mat=2
" No annoying sound on errors
set noerrorbells
set novisualbell
set t_vb=
set tm=500
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Text, tab and indent related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Use spaces instead of tabs
set expandtab
" Be smart when using tabs ;)
set smarttab
" 1 tab == 2 spaces
set shiftwidth=2
set tabstop=2
" Linebreak on 500 characters
set lbr
set tw=500
set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Helper functions
" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" " Returns true if paste mode is enabled
function! HasPaste()
if &paste
return 'PASTE MODE '
endif
return ''
endfunction