Chapter 3.  Minimum config to continue efficiently

This section apply to any system, literal or virtual.

  1. Install headless essentials from repo

    sudo apt install tmux emacs-pgtk ssh

  2. Install tmux configuration

    emacs ~/.tmux.conf And paste from the source listing.

    Note

    ~/.tmux.conf source

    unbind C-b
    set -g prefix `
    bind ` send-prefix
    
  3. Disable Phased updates

    sudo emacs /etc/apt/apt.conf.d/99phased-upgrade And paste from the source listing.

    Note

    /etc/apt/apt.conf.d/99phased-upgrade source

    Update-Manager::Always-Include-Phased-Updates true;
    APT::Get::Always-Include-Phased-Updates true;

    Source: Source

  4. Refresh distribution source

    sudo pkcon update

    sudo apt autoremove -y

  5. Install from standard distribution

    These apply for almost any system. sudo apt install -y auditd autoconf build-essential cabextract console-data curl delta du-dust duf encfs exfat-fuse eyed3 eza git git-delta htop libdbd-pgsql libdbi-dev libdbi1 libtool lm-sensors mercurial net-tools plocate psutils rename ripgrep rust-all sqlite3 ssh ssh-askpass-fullscreen texlive-binaries tidy tmux ubuntu-restricted-extras unattended-upgrades

Procedure 3.1. Configure shells
  1. Copy the files. cp ~/Dropbox/Basic/new_machine/linux/misc/.bash_aliases ~/Dropbox/Basic/new_machine/linux/misc/.bashrc ~/

    Note

    ~/.bashrc source

    # ~/.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 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=1000
    HISTFILESIZE=2000
    
    # check the window size after each command and, if necessary,
    # update the values of LINES and COLUMNS.
    shopt -s checkwinsize
    
    # 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
    
    # 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
    
    # CUSTOMIZATION
    export PYTHONBREAKPOINT='ipdb.set_trace'
    export EDITOR=emacs
    export PATH=$PATH:~/bin:~/Personal/workspace/bin:
    tty -s && export PS1="\t \u@\h:\w\\$ \[$(tput sgr0)\]"
    umask=0002
    

    ~/.bash_aliases source

    # Package Management
    alias aptls='dpkg-query -L'      # list all files in package
    alias aptop='dpkg -l | grep'     # list local status of all packages matching <string>
    alias ass='apt search'           # Search repositories for <string>
    alias ash='apt show'             # Show package info for package named <string>
    alias asshas='echo "dont know how"'     # Show all packages in repository that contain a filename that contains <string>
    alias aptapt="apt update && apt upgrade -y && apt autoremove -y && pkcon update"
    
    alias ..='cd ..'
    alias ...='cd ../../../'
    alias ....='cd ../../../../'
    alias .4='cd ../../../../'
    alias .....='cd ../../../../../'
    alias .5='cd ../../../../../'
    
    alias cp='cp --interactive' # ask before clobbering
    
    alias df='duf'
    
    alias diff='delta'
    
    alias duh='dust -d 1'
    alias duhh='dust -d 2'
    
    alias e='emacs'
    alias elast='emacs $(!!)'
    alias enw='emacs -nw'
    
    alias gimp=~/Downloads/GIMP-3.0.2-x86_64.AppImage 
    
    alias gq='geeqie'
    
    alias grep='rg -S'
    alias grepnocomment='rg ^[^#]' 
    
    alias h=history
    alias hig='history | grep '
    
    alias man='man --pager="less -FX"'
    alias less='less --quit-if-one-screen --no-init'
    alias more='less'
    
    alias exa='exa   --all --binary --changed --group --header --long --time-style=long-iso --tree'
    alias l='exa     --level=1 --sort=changed'
    alias ll='exa    --level=2 --sort=changed'
    alias lll='exa   --level=3 --sort=changed'
    alias llll='exa  --tree --level=4 --sort=changed'
    alias lss='exa   --level=1 --sort=size'
    alias lnn='exa   --level=1 --sort=name'
    
    alias ld="l ~/Downloads/"
    
    # if exa isn't installed:
    #alias l=ls\ -alrt\ --block-size="\'1"
    #alias lss=ls\ -alrS\ --block-size="\'1"
    #alias lnn=ls\ -aln\ --block-size="\'1"
    
    alias m='mpv --fs --osd-level=0'
    alias mountt='mount |column -t'
    alias mv='mv -i'
    
    # Maybe these can be done better with procs but not trivially, and these work already
    alias pf='ps auxf' 
    alias pg='ps aux | grep'
    
    # procs isn't backwards-compatible with ps, so don't use it as such.
    alias prf='procs --tree'
    alias prg='procs --tree | rg'
    
    alias tx='tar xzvf'   # gzip
    alias tj='tar xjvf'   # bzip2
    alias tJ='tar xJvf'   # xz
    
    woo() {
    	  whois "$1" | grep Creation
    }
    
    # quick local network scan
    nmap-24='sudo nmap -sn -oX nmap_sn.csv 192.168.1.1/24'
  2. Repeat for root

    sudo cp ~/Dropbox/Basic/new_machine/linux/misc/.bash_aliases ~/Dropbox/Basic/new_machine/linux/misc/.bashrc /root/

    Repeat for skel. sudo cp ~/Dropbox/Basic/new_machine/linux/misc/.bash_aliases ~/Dropbox/Basic/new_machine/linux/misc/.bashrc /etc/skel/