Differences
This shows you the differences between two versions of the page.
| — | tech:linux:etc_skel [2023/09/24 11:30] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Update /etc/skel ====== | ||
| + | Set the default user parameters as follows | ||
| + | ===== dot toprc ===== | ||
| + | Below are the manual settings in the order of | ||
| + | * Refresh every 1 second | ||
| + | * Show individual CPUs | ||
| + | * Color | ||
| + | * Save settings permanently | ||
| + | < | ||
| + | s 1 | ||
| + | 1 | ||
| + | z | ||
| + | SHIFT+W | ||
| + | </ | ||
| + | |||
| + | Setup top to custom specifications by create a .toprc file in /etc/skel | ||
| + | |||
| + | This sets the refresh to 1 second. Also identifies each CPU usage, | ||
| + | |||
| + | < | ||
| + | RCfile for "top with windows" | ||
| + | Id:a, Mode_altscr=0, | ||
| + | Def | ||
| + | winflags=32057, | ||
| + | summclr=1, msgsclr=1, headclr=3, taskclr=1 | ||
| + | Job | ||
| + | winflags=62777, | ||
| + | summclr=6, msgsclr=6, headclr=7, taskclr=6 | ||
| + | Mem | ||
| + | winflags=62777, | ||
| + | summclr=5, msgsclr=5, headclr=4, taskclr=5 | ||
| + | Usr | ||
| + | winflags=62777, | ||
| + | summclr=3, msgsclr=3, headclr=2, taskclr=3 | ||
| + | </ | ||
| + | |||
| + | ===== sudo ===== | ||
| + | Create a small file called isudo in the home directory to help with sudo. Below is the single line content of the isudo file | ||
| + | < | ||
| + | echo "sudo PATH=\$PATH WINDOW=\$WINDOW / | ||
| + | chmod 744 $HOME/isudo | ||
| + | </ | ||
| + | |||
| + | For Debian, root PATH is different hence we are not including PATH | ||
| + | < | ||
| + | echo "sudo WINDOW=\$WINDOW / | ||
| + | chmod 744 $HOME/isudo | ||
| + | </ | ||
| + | |||
| + | |||
| + | End Users can Run this as | ||
| + | < | ||
| + | . ~/isudo | ||
| + | </ | ||
| + | |||
| + | ===== dot screenrc ===== | ||
| + | Below are the settings for screen using .screenrc | ||
| + | |||
| + | As you can see a number of these are commented out but may be useful for someone to enable quickly. | ||
| + | < | ||
| + | defscrollback 20000 | ||
| + | #deflog on | ||
| + | #log on | ||
| + | #logfile flush 60 | ||
| + | #logtstamp on | ||
| + | #logtstamp after 3600 | ||
| + | ignorecase on | ||
| + | </ | ||
| + | |||
| + | ===== dot vimrc ===== | ||
| + | Below are the settings for .vimrc for vim | ||
| + | |||
| + | Make sure the backup directory is updated to the user's home directory + a suitable backup directory under it | ||
| + | |||
| + | < | ||
| + | " Handles the settings for indentation | ||
| + | set expandtab | ||
| + | set tabstop=4 | ||
| + | set softtabstop=4 | ||
| + | set shiftwidth=4 | ||
| + | "set autoindent smartindent | ||
| + | |||
| + | " Turn on line numbering | ||
| + | "set number | ||
| + | |||
| + | " Pattern searches should ignore case | ||
| + | set ignorecase | ||
| + | |||
| + | " Turns on syntax highlighting. | ||
| + | syntax on | ||
| + | |||
| + | " Flash when errors occur | ||
| + | set visualbell | ||
| + | " set errorbells | ||
| + | |||
| + | " | ||
| + | set incsearch | ||
| + | |||
| + | " Cool tab completion stuff | ||
| + | set wildmenu | ||
| + | set wildmode=list: | ||
| + | |||
| + | " Backups | ||
| + | set backup | ||
| + | " Create a suitable directory location for backups | ||
| + | " set backupdir=/ | ||
| + | set backupdir=/ | ||
| + | au BufWritePre * let &bex = ' | ||
| + | |||
| + | " Mappings | ||
| + | " :map <F11> : | ||
| + | " :map <F12> : | ||
| + | :map [[ : | ||
| + | :map ]] : | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== dot bashrc ===== | ||
| + | Customize bash history settings and color prompt. | ||
| + | < | ||
| + | # Custom settings | ||
| + | . ~/ | ||
| + | # | ||
| + | </ | ||
| + | |||
| + | Create new file .bashrc_ext with the below settings. | ||
| + | <code bash> | ||
| + | # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) | ||
| + | HISTSIZE=20000 | ||
| + | HISTFILESIZE=40000 | ||
| + | # | ||
| + | # append to ~/ | ||
| + | # read any new lines that have appeared in ~/ | ||
| + | PROMPT_COMMAND=" | ||
| + | # | ||
| + | # History timestamp | ||
| + | HISTTIMEFORMAT=' | ||
| + | # Multi-line commands in one line | ||
| + | shopt -s cmdhist | ||
| + | shopt -s lithist | ||
| + | # | ||
| + | # Color prompt | ||
| + | # red - date green - host@user | ||
| + | PS1=' | ||
| + | # | ||
| + | export EDITOR=vim | ||
| + | # | ||
| + | #History ignore - does not keep record of rm commands | ||
| + | HISTIGNORE=' | ||
| + | # | ||
| + | alias ls='ls --color=auto' | ||
| + | alias grep=' | ||
| + | alias diff=' | ||
| + | </ | ||
| + | |||
| + | Color Prompt for root user - make this change to / | ||
| + | <code bash> | ||
| + | # Color prompt | ||
| + | # red - date pink/white - host@user | ||
| + | PS1=' | ||
| + | </ | ||
| + | ===== sudo without password ===== | ||
| + | Run '' | ||
| + | |||
| + | Edit file as shown in the below diff: | ||
| + | <code diff> | ||
| + | < %sudo ALL=(ALL: | ||
| + | --- | ||
| + | > %sudo ALL=(ALL: | ||
| + | </ | ||
| + | |||
| + | Add user (e.g. senthil) to sudo group | ||
| + | <code bash> | ||
| + | usermod -a -G sudo < | ||
| + | </ | ||