iax

init_pi.sh

iax
Dec 7th, 2021 (edited)
813
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.96 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. # Script tested on Debian 12 (bookworm)
  4. # Install date
  5. date +"%A, %d %B %Y %I:%M:%S %P" > ._installed_at && chmod 440 ._installed_at
  6.  
  7. # Passwordless
  8. sudo -u root -H sh -c "echo '$USER ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/$USER"
  9. sudo chmod -v 0440 /etc/sudoers.d/"$USER"
  10.  
  11. # Apps
  12. sudo apt update && sudo apt upgrade -y
  13. apps=(htop curl wget git zsh vim neovim tree nmap tmux jq exa bat fzf fd-find ripgrep \
  14.       btop hstr progress dnsutils lsof ranger sqlite3 figlet nala fail2ban)
  15. sudo apt install -y ${apps[@]}
  16.  
  17. # mise-en-place -- https://mise.jdx.dev/
  18. curl https://mise.run | sh
  19.  
  20. # Packages links
  21. sudo ln -s /usr/bin/batcat /usr/local/bin/bat
  22. sudo ln -s /usr/bin/fdfind /usr/local/bin/fd
  23.  
  24. # Figlet Fonts
  25. cd /usr/share/figlet
  26. sudo wget https://raw.githubusercontent.com/xero/figlet-fonts/master/ANSI%20Shadow.flf
  27.  
  28. # CONFIG ZSH (using https://github.com/z-shell/zi)
  29. # Config files
  30. curl -s https://pastebin.com/raw/NhJ5TsCj | tr -d "\r" > ~/.bash_aliases
  31. curl -s https://pastebin.com/raw/9b1TYMZJ | tr -d "\r" > ~/.gitconfig
  32. curl -s https://pastebin.com/raw/UPsjmrB5 | tr -d "\r" > ~/.tmux.conf
  33. curl -s https://pastebin.com/raw/95Pm8sXi | tr -d "\r" > ~/.vimrc
  34. curl -s https://pastebin.com/raw/tqXJqe8N | tr -d "\r" > ~/.zshrc
  35. . ~/.bash_aliases
  36.  
  37. # Use config files in root (Optional)
  38. ## using cp: sudo cp -v .bash_aliases .bashrc .vimrc /root
  39. sudo find .bash_aliases .bashrc .vimrc -exec ln -s $PWD/{} /root/{} \;
  40.  
  41. # Change default shell to ZSH
  42. chsh -s $(which zsh)
  43.  
  44. # LS_COLORS (Optional) https://raw.githubusercontent.com/trapd00r/LS_COLORS/master/lscolors.sh
  45. lsfile=$HOME/.local/share/zap/plugins/LS_COLORS/lscolors.sh
  46. sed -i -s 's/di=38;5;30/di=38;5;33;1/g' $lsfile  # Directory (blue 33)
  47. sed -i -s 's/ex=38;5;208;1/ex=38;5;40/g' $lsfile # Executable (green 40)
  48.  
  49. # Change prompt
  50. PROMPT="PS1='\[\e[31m\]\u\[\e[m\]\[\e[33m\]@\[\e[m\]\[\e[32m\]\h\[\e[m\]:\[\e[36m\]\w\[\e[m\]\$ '"
  51. grep -q '^PS1=' .bashrc || echo $PROMPT >> .bashrc
  52.  
Advertisement
Add Comment
Please, Sign In to add comment