post install for servers

apt install -y curl && \ curl -s "http://wiki.csgalileo.org/doku.php/tips:ubuntu:locale?do=export_code&codeblock=1" | /bin/bash
apt remove -y unattended-upgrades locale-gen it_IT.UTF-8 locale-gen en_US.UTF-8 update-locale LANG=it_IT.UTF-8 LC_MESSAGES=POSIX grep -q menu-complete /etc/inputrc if [ $? = 1 ]; then cat >> /etc/inputrc <<EOF "\M-s": menu-complete "\e[A": history-search-backward "\e[B": history-search-forward "\M-o": "\C-p\C-a\M-f " EOF fi [ -f /etc/tmux.conf ] || curl -s "http://wiki.csgalileo.org/doku.php/tips:tmux?do=export_code&codeblock=4" > /etc/tmux.conf cat > /etc/vim/vimrc.local <<EOF setlocal ts=4 sts=4 sw=4 expandtab autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab set paste set mouse=r set showcmd " Show (partial) command in status line. set showmatch " Show matching brackets. set ignorecase " Do case insensitive matching set smartcase " Do smart case matching set incsearch " Incremental search set autowrite " Automatically save before commands like :next and :make set hidden " Hide buffers when they are abandoned if has("syntax") syntax on endif set background=dark if has("autocmd") au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif endif if has("autocmd") filetype plugin indent on endif EOF cat > /root/.aliases <<EOF alias l="ls -alh --color" alias ll="ls -alh --color" alias lle="ls -alth --color | head -n30" alias s="ssh -l root" alias sud="sudo su" alias llast="ls -alt | head" alias update="sudo apt-get update; sudo apt-get -y -V upgrade" EOF curl -s "http://wiki.csgalileo.org/doku.php/tips:ubuntu:locale?do=export_code&codeblock=2" > /root/.bashrc update-alternatives --set editor /usr/bin/vim.tiny
# If not running interactively, don't do anything [ -z "$PS1" ] && return HISTCONTROL=ignoredups:ignorespace shopt -s histappend HISTSIZE=5000 HISTFILESIZE=10000 shopt -s checkwinsize [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot) fi case "$TERM" in xterm-color) color_prompt=yes;; esac PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' unset color_prompt force_color_prompt # 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 grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' fi [ -f ~/.aliases ] && . ~/.aliases [ -f ~/.bashrc.local ] && . ~/.bashrc.local if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completion fi # run TMUX [[ $- != *i* ]] && return if which tmux >/dev/null 2>&1; then # if no session is started, start a new session test -z ${TMUX} && tmux # when quitting tmux, try to attach while test -z ${TMUX}; do tmux attach || break done fi ### NOTHING BELOW ###