Advertisement
c0d3dsk1lls

ROOT .zshrc

Jun 27th, 2022 (edited)
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 13.30 KB | None | 0 0
  1. # .zshrc FILE FOR ROOT DIRECTORY.
  2.  
  3. # ~/.zshrc file for zsh interactive shells.
  4. # see /usr/share/doc/zsh/examples/zshrc for examples
  5. #NOTE, THIS IS BEING USED ON KALI LINUX
  6.  
  7. setopt autocd              # change directory just by typing its name
  8. #setopt correct            # auto correct mistakes
  9. setopt interactivecomments # allow comments in interactive mode
  10. setopt magicequalsubst     # enable filename expansion for arguments of the form ‘anything=expression’
  11. setopt nonomatch           # hide error message if there is no match for the pattern
  12. setopt notify              # report the status of background jobs immediately
  13. setopt numericglobsort     # sort filenames numerically when it makes sense
  14. setopt promptsubst         # enable command substitution in prompt
  15.  
  16. WORDCHARS=${WORDCHARS//\/} # Don't consider certain characters part of the word
  17.  
  18. # hide EOL sign ('%')
  19. PROMPT_EOL_MARK=""
  20.  
  21. # configure key keybindings
  22. bindkey -e                                        # emacs key bindings
  23. bindkey ' ' magic-space                           # do history expansion on space
  24. bindkey '^U' backward-kill-line                   # ctrl + U
  25. bindkey '^[[3;5~' kill-word                       # ctrl + Supr
  26. bindkey '^[[3~' delete-char                       # delete
  27. bindkey '^[[1;5C' forward-word                    # ctrl + ->
  28. bindkey '^[[1;5D' backward-word                   # ctrl + <-
  29. bindkey '^[[5~' beginning-of-buffer-or-history    # page up
  30. bindkey '^[[6~' end-of-buffer-or-history          # page down
  31. bindkey '^[[H' beginning-of-line                  # home
  32. bindkey '^[[F' end-of-line                        # end
  33. bindkey '^[[Z' undo                               # shift + tab undo last action
  34.  
  35. # enable completion features
  36. autoload -Uz compinit
  37. compinit -d ~/.cache/zcompdump
  38. zstyle ':completion:*:*:*:*:*' menu select
  39. zstyle ':completion:*' auto-description 'specify: %d'
  40. zstyle ':completion:*' completer _expand _complete
  41. zstyle ':completion:*' format 'Completing %d'
  42. zstyle ':completion:*' group-name ''
  43. zstyle ':completion:*' list-colors ''
  44. zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
  45. zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
  46. zstyle ':completion:*' rehash true
  47. zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
  48. zstyle ':completion:*' use-compctl false
  49. zstyle ':completion:*' verbose true
  50. zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
  51.  
  52. # History configurations
  53. HISTFILE=~/.zsh_history
  54. HISTSIZE=1000
  55. SAVEHIST=2000
  56. setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
  57. setopt hist_ignore_dups       # ignore duplicated commands history list
  58. setopt hist_ignore_space      # ignore commands that start with space
  59. setopt hist_verify            # show command with history expansion to user before running it
  60. #setopt share_history         # share command history data
  61.  
  62. # force zsh to show the complete history
  63. alias history="history 0"
  64.  
  65. # configure `time` format
  66. TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P'
  67.  
  68. # make less more friendly for non-text input files, see lesspipe(1)
  69. #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
  70.  
  71. # set variable identifying the chroot you work in (used in the prompt below)
  72. if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
  73.     debian_chroot=$(cat /etc/debian_chroot)
  74. fi
  75.  
  76. # set a fancy prompt (non-color, unless we know we "want" color)
  77. case "$TERM" in
  78.     xterm-color|*-256color) color_prompt=yes;;
  79. esac
  80.  
  81. # uncomment for a colored prompt, if the terminal has the capability; turned
  82. # off by default to not distract the user: the focus in a terminal window
  83. # should be on the output of commands, not on the prompt
  84. force_color_prompt=yes
  85.  
  86. if [ -n "$force_color_prompt" ]; then
  87.     if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
  88.         # We have color support; assume it's compliant with Ecma-48
  89.         # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
  90.         # a case would tend to support setf rather than setaf.)
  91.         color_prompt=yes
  92.     else
  93.         color_prompt=
  94.     fi
  95. fi
  96.  
  97. configure_prompt() {
  98.     prompt_symbol=
  99.     # Skull emoji for root terminal
  100.     [ "$EUID" -eq 0 ] && prompt_symbol=💀
  101.     case "$PROMPT_ALTERNATIVE" in
  102.         twoline)
  103.             PROMPT=$'%F{%(#.blue.red)}┌──${debian_chroot:+($debian_chroot)─}${VIRTUAL_ENV:+($(basename $VIRTUAL_ENV))─}(%B%F{%(#.red.green)}%n'$prompt_symbol$'%m%b%F{%(#.blue.red)})-[%B%F{reset}%(6~.%-1~/…/%4~.%5~)%b%F{%(#.blue.yellow)}]\n└─%B%(#.%F{red}#.%F{blue}$)%b%F{reset} '
  104.             # Right-side prompt with exit codes and background processes
  105.             RPROMPT=$'%(?.. %? %F{red}%B⨯%b%F{reset})%(1j. %j %F{yellow}%B⚙%b%F{reset}.)'
  106.             ;;
  107.         oneline)
  108.             PROMPT=$'${debian_chroot:+($debian_chroot)}${VIRTUAL_ENV:+($(basename $VIRTUAL_ENV))}%B%F{%(#.red.red)}%n@%m%b%F{reset}:%B%F{%(#.blue.green)}%~%b%F{reset}%(#.#.$) '
  109.             RPROMPT=
  110.             ;;
  111.         backtrack)
  112.             PROMPT=$'${debian_chroot:+($debian_chroot)}${VIRTUAL_ENV:+($(basename $VIRTUAL_ENV))}%B%F{red}%n@%m%b%F{reset}:%B%Fblue}%~%b%F{reset}%(#.#.$) '
  113.             RPROMPT=
  114.             ;;
  115.     esac
  116.     unset prompt_symbol
  117. }
  118.  
  119. # The following block is surrounded by two delimiters.
  120. # These delimiters must not be modified. Thanks.
  121. # START KALI CONFIG VARIABLES
  122. PROMPT_ALTERNATIVE=twoline
  123. NEWLINE_BEFORE_PROMPT=yes
  124. # STOP KALI CONFIG VARIABLES
  125.  
  126. if [ "$color_prompt" = yes ]; then
  127.     # override default virtualenv indicator in prompt
  128.     VIRTUAL_ENV_DISABLE_PROMPT=1
  129.  
  130.     configure_prompt
  131.  
  132.     # enable syntax-highlighting
  133.     if [ -f /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ] && [ "$color_prompt" = yes ]; then
  134.         . /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  135.         ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern)
  136.         ZSH_HIGHLIGHT_STYLES[default]=none
  137.         ZSH_HIGHLIGHT_STYLES[unknown-token]=fg=red,bold
  138.         ZSH_HIGHLIGHT_STYLES[reserved-word]=fg=cyan,bold
  139.         ZSH_HIGHLIGHT_STYLES[suffix-alias]=fg=green,underline
  140.         ZSH_HIGHLIGHT_STYLES[global-alias]=fg=magenta
  141.         ZSH_HIGHLIGHT_STYLES[precommand]=fg=green,underline
  142.         ZSH_HIGHLIGHT_STYLES[commandseparator]=fg=blue,bold
  143.         ZSH_HIGHLIGHT_STYLES[autodirectory]=fg=green,underline
  144.         ZSH_HIGHLIGHT_STYLES[path]=underline
  145.         ZSH_HIGHLIGHT_STYLES[path_pathseparator]=
  146.         ZSH_HIGHLIGHT_STYLES[path_prefix_pathseparator]=
  147.         ZSH_HIGHLIGHT_STYLES[globbing]=fg=blue,bold
  148.         ZSH_HIGHLIGHT_STYLES[history-expansion]=fg=blue,bold
  149.         ZSH_HIGHLIGHT_STYLES[command-substitution]=none
  150.         ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter]=fg=magenta
  151.         ZSH_HIGHLIGHT_STYLES[process-substitution]=none
  152.         ZSH_HIGHLIGHT_STYLES[process-substitution-delimiter]=fg=magenta
  153.         ZSH_HIGHLIGHT_STYLES[single-hyphen-option]=fg=magenta
  154.         ZSH_HIGHLIGHT_STYLES[double-hyphen-option]=fg=magenta
  155.         ZSH_HIGHLIGHT_STYLES[back-quoted-argument]=none
  156.         ZSH_HIGHLIGHT_STYLES[back-quoted-argument-delimiter]=fg=blue,bold
  157.         ZSH_HIGHLIGHT_STYLES[single-quoted-argument]=fg=yellow
  158.         ZSH_HIGHLIGHT_STYLES[double-quoted-argument]=fg=yellow
  159.         ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]=fg=yellow
  160.         ZSH_HIGHLIGHT_STYLES[rc-quote]=fg=magenta
  161.         ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]=fg=magenta
  162.         ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]=fg=magenta
  163.         ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]=fg=magenta
  164.         ZSH_HIGHLIGHT_STYLES[assign]=none
  165.         ZSH_HIGHLIGHT_STYLES[redirection]=fg=blue,bold
  166.         ZSH_HIGHLIGHT_STYLES[comment]=fg=black,bold
  167.         ZSH_HIGHLIGHT_STYLES[named-fd]=none
  168.         ZSH_HIGHLIGHT_STYLES[numeric-fd]=none
  169.         ZSH_HIGHLIGHT_STYLES[arg0]=fg=green
  170.         ZSH_HIGHLIGHT_STYLES[bracket-error]=fg=red,bold
  171.         ZSH_HIGHLIGHT_STYLES[bracket-level-1]=fg=blue,bold
  172.         ZSH_HIGHLIGHT_STYLES[bracket-level-2]=fg=green,bold
  173.         ZSH_HIGHLIGHT_STYLES[bracket-level-3]=fg=magenta,bold
  174.         ZSH_HIGHLIGHT_STYLES[bracket-level-4]=fg=yellow,bold
  175.         ZSH_HIGHLIGHT_STYLES[bracket-level-5]=fg=cyan,bold
  176.         ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]=standout
  177.     fi
  178. else
  179.     PROMPT='${debian_chroot:+($debian_chroot)}%n@%m:%~%# '
  180. fi
  181. unset color_prompt force_color_prompt
  182.  
  183. toggle_oneline_prompt(){
  184.     if [ "$PROMPT_ALTERNATIVE" = oneline ]; then
  185.         PROMPT_ALTERNATIVE=twoline
  186.     else
  187.         PROMPT_ALTERNATIVE=oneline
  188.     fi
  189.     configure_prompt
  190.     zle reset-prompt
  191. }
  192. zle -N toggle_oneline_prompt
  193. bindkey ^P toggle_oneline_prompt
  194.  
  195. # If this is an xterm set the title to user@host:dir
  196. case "$TERM" in
  197. xterm*|rxvt*|Eterm|aterm|kterm|gnome*|alacritty)
  198.     TERM_TITLE=$'\e]0;${debian_chroot:+($debian_chroot)}${VIRTUAL_ENV:+($(basename $VIRTUAL_ENV))}%n@%m: %~\a'
  199.     ;;
  200. *)
  201.     ;;
  202. esac
  203.  
  204. precmd() {
  205.     # Print the previously configured title
  206.     print -Pnr -- "$TERM_TITLE"
  207.  
  208.     # Print a new line before the prompt, but only if it is not the first line
  209.     if [ "$NEWLINE_BEFORE_PROMPT" = yes ]; then
  210.         if [ -z "$_NEW_LINE_BEFORE_PROMPT" ]; then
  211.             _NEW_LINE_BEFORE_PROMPT=1
  212.         else
  213.             print ""
  214.         fi
  215.     fi
  216. }
  217.  
  218. # enable color support of ls, less and man, and also add handy aliases
  219. if [ -x /usr/bin/dircolors ]; then
  220.     test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
  221.     export LS_COLORS="$LS_COLORS:ow=30;44:" # fix ls color for folders with 777 permissions
  222.  
  223.     alias ls='ls --color=auto'
  224.     alias dir='dir --color=auto'
  225.     alias vdir='vdir --color=auto'
  226.  
  227.     alias grep='grep --color=auto'
  228.     alias fgrep='fgrep --color=auto'
  229.     alias egrep='egrep --color=auto'
  230.     alias diff='diff --color=auto'
  231.     alias ip='ip --color=auto'
  232.  
  233.     export LESS_TERMCAP_mb=$'\E[1;31m'     # begin blink
  234.     export LESS_TERMCAP_md=$'\E[1;36m'     # begin bold
  235.     export LESS_TERMCAP_me=$'\E[0m'        # reset bold/blink
  236.     export LESS_TERMCAP_so=$'\E[01;33m'    # begin reverse video
  237.     export LESS_TERMCAP_se=$'\E[0m'        # reset reverse video
  238.     export LESS_TERMCAP_us=$'\E[1;32m'     # begin underline
  239.     export LESS_TERMCAP_ue=$'\E[0m'        # reset underline
  240.  
  241.     # Take advantage of $LS_COLORS for completion as well
  242.     zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
  243.     zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
  244. fi
  245.  
  246. # some more ls aliases
  247. alias ll='ls -l'
  248. alias la='ls -A'
  249. alias l='ls -CF'
  250. alias rtf='libreoffice'
  251. alias txt='mousepad'
  252. alias img='ristretto'
  253. alias pdf='atril'
  254. alias rootuser='su'
  255. alias base='cd /'
  256. alias root='cd /root/'
  257. alias sys='cd /sys/'
  258. alias boot='cd /boot/'
  259. alias var='cd /var/'
  260. alias etc='cd /etc/'
  261. alias run='cd /run/'
  262. alias dev='cd /dev/'
  263. alias srv='cd /srv/'
  264. alias anon='su anonymous'
  265. alias desktop='cd /home/anonymous/Desktop'
  266. alias public='cd /home/anonymous/Public'
  267. alias school='cd /home/anonymous/Schooling'
  268. alias desk='cd /home/anonymous/Desktop'
  269. alias downloads='cd /home/anonymous/Downloads'
  270. alias dloads='cd /home/anonymous/Downloads'
  271. alias rfm='sudo exo-open --launch FileManager'
  272. alias fm='exo-open --launch FileManager'
  273. alias down='cd /home/anonymous/Downloads'
  274. alias documents='cd /home/anonymous/Documents'
  275. alias pictures='cd /home/anonymous/Pictures'
  276. alias pics='cd /home/anonymous/Pictures'
  277. alias gallery='cd /home/anonymous/Pictures'
  278. alias photos='cd /home/anonymous/Pictures'
  279. alias docs='cd /home/anonymous/Documents'
  280. alias docu='cd /home/anonymous/Documents'
  281. alias home='su anonymous'
  282. alias music='cd /home/anonymous/Music'
  283. alias musi='cd /home/anonymous/Music'
  284. alias bin='cd /bin'
  285. alias usr='cd /usr'
  286. alias mnt='cd /mnt'
  287. alias tmp='cd /tmp'
  288. alias upgrade='sudo apt upgrade'
  289. alias update='sudo apt update'
  290. alias d='pwd'
  291. alias chdir='cd'
  292. alias show='cat'
  293. alias rename='mv'
  294. alias move='mv'
  295. alias delete='rm'
  296. alias del='rm'
  297. alias new='touch'
  298. alias sniffer='cd /home/anonymous/Documents/python_projects/packet_sniffer'
  299. alias sniff='sudo python Packet_Sniffer.py'
  300. alias psamp='cd /home/anonymous/Documents/python_projects/completed_samples/'
  301. alias bfpin='python brute_pin_dnt.py'
  302. alias bfascii='python brute_ascii_dnt.py'
  303. alias calcu='python calculator_dnt.py'
  304. alias calc='python calculator_dnt.py'
  305. alias calc2='python calculator_dnt_V2.py'
  306. alias cal='python calculator_dnt.py'
  307. alias cal2='python calculator_dnt_V2.py'
  308. alias pscan='python port_scanner.py'
  309. alias supscan='sudo python port_scanner.py'
  310. alias pscanner='cd /home/anonymous/Documents/python_projects/port_scanner/'
  311.  
  312. alias py='python3'
  313.  
  314. # enable auto-suggestions based on the history
  315. if [ -f /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then
  316.     . /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
  317.     # change suggestion color
  318.     ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=#999'
  319. fi
  320.  
  321. # enable command-not-found if installed
  322. if [ -f /etc/zsh_command_not_found ]; then
  323.     . /etc/zsh_command_not_found
  324. fi
  325. # -- START ACTIVESTATE INSTALLATION
  326. export PATH="/home/anonymous/.local/ActiveState/StateTool/release/bin:$PATH"
  327. # -- STOP ACTIVESTATE INSTALLATION
  328. # -- START ACTIVESTATE DEFAULT RUNTIME ENVIRONMENT
  329. export PATH="/home/anonymous/.cache/activestate/bin:$PATH"
  330. # -- STOP ACTIVESTATE DEFAULT RUNTIME ENVIRONMENT
  331.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement