Advertisement
c0d3dsk1lls

.zshrc custom aliases

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