installation scripts for servers.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

138 lines
4.0 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. #!/bin/sh
  2. DIR="$(realpath "$(dirname "$0")")"
  3. # script must start at home directory
  4. cd "$HOME" || exit 1;
  5. usertest() {
  6. if test "$(id -u)" -eq 0; then
  7. echo "You cannot run this script as root.";
  8. exit 1;
  9. fi
  10. if ! (type sudo 2>&1) > /dev/null; then
  11. echo "sudo is not installed.";
  12. exit 1
  13. fi
  14. sudo apt install -y make curl
  15. echo "Updating APT and adding PPA's"
  16. curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
  17. sudo apt update -y || exit 1
  18. sudo apt upgrade -y || exit 1
  19. }
  20. dev() {
  21. echo "Developer tools..."
  22. # install neovim through appimage (no snaps)
  23. sudo curl https://github.com/neovim/neovim/releases/download/v0.6.1/nvim.appimage -LJo "/usr/local/bin/nvim"
  24. sudo chmod +x "/usr/local/bin/nvim"
  25. # install nodejs (coc in neovim)
  26. sudo apt-get update -y && sudo apt-get install -y nodejs
  27. }
  28. sysinfo() {
  29. echo "Dylan Araps scripts"
  30. cd "$HOME" || exit 1;
  31. mkdir -p repos
  32. git clone https://github.com/dylanaraps/pfetch "$HOME/repos/pfetch"
  33. git clone https://github.com/dylanaraps/neofetch "$HOME/repos/neofetch"
  34. git clone https://github.com/dylanaraps/fff "$HOME/repos/fff"
  35. cd "$HOME/repos/pfetch" || exit 1;
  36. sudo make install || exit 2;
  37. cd "$HOME" || exit 1;
  38. cd "$HOME/repos/neofetch" || exit 1;
  39. sudo make install || exit 2;
  40. cd "$HOME" || exit 1;
  41. cd "$HOME/repos/fff" || exit 1;
  42. sudo make install || exit 2;
  43. cd "$HOME" || exit 1;
  44. }
  45. shell() {
  46. sudo apt install -y zsh
  47. curl -sS https://starship.rs/install.sh | sh
  48. }
  49. browsers() {
  50. sudo apt remove -y firefox
  51. sudo snap remove firefox
  52. # install brave
  53. sudo apt install apt-transport-https -y
  54. sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
  55. echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main"|sudo tee /etc/apt/sources.list.d/brave-browser-release.list
  56. sudo apt update -y
  57. sudo apt install brave-browser -y
  58. }
  59. torbrowser() {
  60. sudo apt install -y torbrowser-launcher
  61. }
  62. popshell() {
  63. mkdir -p "$HOME/repos"
  64. sudo apt install git node-typescript make -y
  65. git clone https://github.com/pop-os/shell.git "$HOME/repos/shell"
  66. }
  67. meetings() {
  68. mkdir -p "$HOME/repos"
  69. # install skype
  70. curl https://go.skype.com/skypeforlinux-64.deb -LJo "$HOME/repos/skypeforlinux.deb"
  71. sudo apt install "$HOME/repos/skypeforlinux.deb" -y
  72. # install zoom
  73. curl https://zoom.us/client/latest/zoom_amd64.deb -LJo "$HOME/repos/zoomus.deb"
  74. sudo apt install "$HOME/repos/zoomus.deb" -y
  75. # install mt
  76. sudo curl -LJ https://github.com/junikimm717/mt/releases/download/33627ab/mt -o /usr/local/bin/mt
  77. sudo chmod +x /usr/local/bin/mt
  78. }
  79. # neovim must be installed.
  80. plugins() {
  81. # install vim-plug, oh-my-zsh, and zsh-syntax-highlighting
  82. sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
  83. https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  84. sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  85. git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting"
  86. }
  87. dotfiles() {
  88. echo "Adding vim and zsh configs"
  89. if ! test -d "$DIR/dotfiles"; then
  90. echo "$DIR/dotfiles folder not found.";
  91. exit 1;
  92. fi
  93. mkdir -p "$HOME/.config/nvim"
  94. cp "$DIR/dotfiles/.zshrc" "$HOME/.zshrc"
  95. cp "$DIR/dotfiles/init.vim" "$HOME/.config/nvim/init.vim"
  96. nvim --headless +PlugInstall +qa
  97. }
  98. competitiveprogramming() {
  99. echo "CP Compilers..."
  100. sudo apt install clang clang-tools-extra
  101. cd "$HOME" || exit 1;
  102. git clone https://git.junickim.me/junikimm717/linuxcp "$HOME/cp"
  103. }
  104. (usertest && dev && sysinfo && shell && browsers && torbrowser && meetings && plugins && dotfiles) || exit 1
  105. (popshell) || exit 1
  106. cat <<EOF
  107. Stuff to do:
  108. - Install pop-shell (make local-install)
  109. - Install the coc extensions
  110. - Settle brave key stuff
  111. - Copy over the mt config files
  112. EOF