This is an old revision of the document!
Table of Contents
Configs
Install Script
For a new install, I built a bash script to tweak a new system out of the box for how I like things:
- Builds and installs a color prompt (user and root)
- Updates sources.list for a standard Debian Testing install (optional)
- Downloads and installs my custom .vimrc file
- Downloads and installs my gman1.vim colorscheme
- Download here: configure_me.sh | Full URL
Full URL:
https://nix.kedrovsky.net/_media/config_script/configure_me.sh
.bashrc
Old Kali PS1 color prompts (which are pretty cool).
root:
PS1='\[\e[0;36m\]\t \[\e[0;33m\][\[\e[0;31m\]\u\[\e[0;33m\]] \[\e[0;32m\]\h \[\e[0;31m\][\w]\e[0m\]\$\[\e[m\]\[\e[0;32m\] '
user:
PS1='\[\e]0;\u@\h: \w\a\]\[\e[0;36m\]\t \[\e[0;33m\][\[\e[0;37m\]\u\[\e[0;33m\]] \[\e[0;32m\]\h \[\e[0;31m\][\w]\e[0m\]\$\[\e[m\]\[\e[0;37m\] '
user
## Add additional dirs to my path export PATH="$PATH:$HOME" # add home dir to path # export PATH="$PATH:$HOME/bin" # I put poweroff, reboot, ifconfig here ## User-defined aliases alias ls='ls --color --group-directories-first' PS1='\[\e[1;33m\]' # set color (yellow) PS1+='[' # opening bracket PS1+='\[\e[1;34m\]' # set color (blue) PS1+='\u' # user PS1+='\[\e[1;31m\]' # set color (red) PS1+='@' # separator PS1+='\[\e[1;33m\]' # set color (yellow) PS1+='\h' # host PS1+='\[\e[1;37m\]' # set color (white) PS1+=':' PS1+='\[\e[1;36m\]' # set color (cyan) PS1+='\w' # working directory PS1+='\[\e[1;33m\]' # set color (yellow) PS1+=']' # closing bracket PS1+='\[\e[0m\]' # end ch (text reset) PS1+='$ ' # $ for normal user export PS1 ## Reference: # Codes: # https://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html # Colors: # https://unix.stackexchange.com/questions/124407/what-color-codes-can-i-use-in-my-ps1-prompt#124408
root
# GAK root .bashrc ## User-defined aliases alias ls='ls --color --group-directories-first' PS1='\[\e[1;33m\]' # set color (yellow) PS1+='[' # opening bracket PS1+='\[\e[1;31m\]' # set color (red) PS1+='\u' # user PS1+='\[\e[1;37m\]' # set color (white) PS1+='@' # separator PS1+='\[\e[1;33m\]' # set color (yellow) PS1+='\h' # host PS1+='\[\e[1;37m\]' # set color (white) PS1+=':' # separator PS1+='\[\e[1;36m\]' # set color (cyan) PS1+='\w' # working directory PS1+='\[\e[1;33m\]' # set color (yellow) PS1+=']' # closing bracket PS1+='\[\e[0m\]' # end ch (text reset) PS1+='# ' # hash (#) for root export PS1 ## Reference: # Codes: # https://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html # Colors: # https://unix.stackexchange.com/questions/124407/what-color-codes-can-i-use-in-my-ps1-prompt#124408
Boot to CLI
In Debian:
systemctl set-default multi-user.target # boot to cli (runlevels 2,3,4) systemctl set-default graphical.target # boot to graphical (runlevel 5)
sources.list
The entries in this file normally follow this format (example only).
deb http://site.example.com/debian distribution component1 component2 component3 deb-src http://site.example.com/debian distribution component1 component2 component3
The distribution can be either the release code name (stretch, buster, bullseye, sid) or the release class name (old stable, stable, testing, unstable). If you mean to be tracking a release class then use the class name, if you want to track a Debian point release, use the code name.
- That means, if you always want to be on stable, even when the current testing (Bullseye) becomes stable, then use stable. If you always want to be on testing, even when Bullseye moves to stable, then use testing.
- But, if you get on testing (Bullseye) and want to keep it even when it moves to stable, then use the code name, bullseye.
At the time I'm writing this…
Stable is exactly what it means. Testing has been 80-90% okay for me over the years… but it's a pain the sphincter when it's not.
Source.list Generator: https://debgen.simplylinux.ch/index.php?generate
source.list for stable:
#-------------------------------------------------------------------# # OFFICIAL DEBIAN REPOS - STABLE # #-------------------------------------------------------------------# deb http://deb.debian.org/debian stable main contrib non-free deb-src http://deb.debian.org/debian stable main contrib non-free deb http://deb.debian.org/debian-security/ stable/updates main contrib non-free deb-src http://deb.debian.org/debian-security/ stable/updates main contrib non-free deb http://deb.debian.org/debian stable-updates main contrib non-free deb-src http://deb.debian.org/debian stable-updates main contrib non-free
source.list for Bullseye (testing, for now):
#-------------------------------------------------------------------# # OFFICIAL DEBIAN REPOS - TESTING / BULLSEYE # #-------------------------------------------------------------------# deb http://deb.debian.org/debian/ bullseye main contrib non-free deb-src http://deb.debian.org/debian/ bullseye main contrib non-free deb http://deb.debian.org/debian/ bullseye-updates main contrib non-free deb-src http://deb.debian.org/debian/ bullseye-updates main contrib non-free deb http://deb.debian.org/debian-security bullseye-security main contrib non-free deb-src http://deb.debian.org/debian-security bullseye-security main contrib non-free
.vimrc
"" Greg's .vimrc " Ideas: http://vim.wikia.com/wiki/Example_vimrc " Enable syntax highlighting syntax on " Better command-line completion set wildmenu " Show partial commands in the last line of the screen set showcmd " Display line numbers on the left set number " Enable smart handling of the tab key set smarttab " Use spaces instead of tabs set expandtab " 1 tab == 4 spaces set shiftwidth=4 set tabstop=4 " Change the color scheme " install color scheme in /usr/share/vim/vim[##]/colors/ set t_Co=256 colorscheme gman1 " Disable autocomment character insertion autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o " End
vim colorscheme
Create a text file named gman1.vim (for example) and paste in the text below.
- Copy your colorscheme file (gman1.vim) into: /usr/share/vim/vim[##]/colors/
- Set the colorescheme in your .vimrc file (see above)
" Vim colorscheme -- gman1 " " Created specifically for Python " Based on PyChimp by Pratheek <pratheek.i@gmail.com> " " This colorscheme is specifically created, to work in a translucent " background provided by terminal and supports 256 color terminals " Tip -- add <t_Co=256> in your ~/.vimrc to utilize the theme well. let g:colors_name = "gman1" " The Basic (Normal) Text Style hi Normal ctermfg=253 ctermbg=NONE cterm=NONE " All the Python related stuff hi Number ctermfg=141 ctermbg=NONE cterm=NONE hi Float ctermfg=141 ctermbg=NONE cterm=NONE hi Statement ctermfg=226 ctermbg=NONE cterm=NONE hi Function ctermfg=35 ctermbg=NONE cterm=NONE hi Conditional ctermfg=208 ctermbg=NONE cterm=NONE hi Operator ctermfg=226 ctermbg=NONE cterm=NONE hi Todo ctermfg=253 ctermbg=NONE cterm=bold hi Comment ctermfg=69 ctermbg=NONE cterm=NONE hi Special ctermfg=81 ctermbg=NONE cterm=NONE hi String ctermfg=169 ctermbg=NONE cterm=NONE hi Include ctermfg=118 ctermbg=NONE cterm=bold hi Constant ctermfg=178 ctermbg=NONE cterm=bold hi Error ctermfg=88 ctermbg=172 cterm=bold hi PreProc ctermfg=81 ctermbg=NONE cterm=NONE hi Boolean ctermfg=38 ctermbg=NONE cterm=bold hi Character ctermfg=142 ctermbg=NONE cterm=NONE "Vim Stuff hi Visual ctermfg=253 ctermbg=235 cterm=NONE hi VertSplit ctermfg=232 ctermbg=244 cterm=NONE hi ErrorMsg ctermfg=88 ctermbg=172 cterm=bold hi MatchParen ctermfg=16 ctermbg=215 cterm=bold hi Folded ctermfg=67 ctermbg=16 cterm=bold hi FoldColumn ctermfg=67 ctermbg=16 cterm=NONE hi LineNr ctermfg=102 ctermbg=NONE cterm=NONE hi NonText ctermfg=58 ctermbg=NONE cterm=NONE hi Pmenu ctermfg=81 ctermbg=16 cterm=NONE hi PmenuSel ctermfg=202 ctermbg=16 cterm=NONE hi PmenuSbar ctermfg=81 ctermbg=16 cterm=NONE hi PmenuThumb ctermfg=81 ctermbg=16 cterm=NONE hi Search ctermfg=253 ctermbg=66 cterm=NONE hi IncSearch ctermfg=253 ctermbg=66 cterm=NONE hi TabLine ctermfg=3 ctermbg=NONE cterm=NONE hi TabLineSel ctermfg=14 ctermbg=NONE cterm=bold hi TabLineFill ctermfg=46 ctermbg=NONE cterm=NONE
Reinstall GRUB
I triple boot O/Ss… so once in a while one will update and over-write my MBR. To get the correct GRUB into the MBR, boot into the preferred O/S and run (as root):
# grub-install /dev/sda ## Assuming sda contains the MBR
Then:
# update-grub
Done.
fstab NTFS
Options and setup for NTFS partition (sharing / data partition) in Linux. You will likely need to do run the id
command from the command line to find your uid and gid.
UUID=[use blkid to find it] /mnt/data ntfs-3g user,big_write,uid=1000,gid=1000,dmask=0022,fmask=0011 0 0
Kali: root
Kali made the spectacular decision to drop the default root policy and then not even allow you to configure a root password (i.e., log in as root) when you install.
- When you install Kali Linux, you’ll be asked to create non-root user that will have admin privileges. Tools and commands that require root access will be run with sudo.
- So you have to type sudu… sudo… sudo… sudo… (really, guys??).
To configure password-less root rights for your normal user (but you still have no access to applications that are only in root's PATH):
sudo apt install kali-grant-root sudo dpkg-reconfigure kali-grant-root
Better: Unlock the root login. Just give root a password, log out, then log in as root:
sudo su - # do this as a normal user, give your password; you become root passwd # add a password to root's account; log out, log in, shiny
Ah… happiness again in the land of hacker penguins…
Fluxbox
For a quick, lite Debian install…
- Install a base Debian system without any desktop environment.
- After you can boot to the command line…
- Install xorg, then fluxbox (good how-to, except I installed xorg before flux).