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.

140 lines
4.0 KiB

2 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. sudo apt install -y libfuse2 fuse
  23. # install neovim through appimage (no snaps)
  24. sudo curl https://github.com/neovim/neovim/releases/download/v0.6.1/nvim.appimage -LJo "/usr/local/bin/nvim"
  25. sudo chmod +x "/usr/local/bin/nvim"
  26. # install nodejs (coc in neovim)
  27. sudo apt-get update -y && sudo apt-get install -y nodejs
  28. }
  29. sysinfo() {
  30. echo "Dylan Araps scripts"
  31. cd "$HOME" || exit 1;
  32. mkdir -p repos
  33. git clone https://github.com/dylanaraps/pfetch "$HOME/repos/pfetch"
  34. git clone https://github.com/dylanaraps/neofetch "$HOME/repos/neofetch"
  35. git clone https://github.com/dylanaraps/fff "$HOME/repos/fff"
  36. cd "$HOME/repos/pfetch" || exit 1;
  37. sudo make install || exit 2;
  38. cd "$HOME" || exit 1;
  39. cd "$HOME/repos/neofetch" || exit 1;
  40. sudo make install || exit 2;
  41. cd "$HOME" || exit 1;
  42. cd "$HOME/repos/fff" || exit 1;
  43. sudo make install || exit 2;
  44. cd "$HOME" || exit 1;
  45. }
  46. shell() {
  47. sudo apt install -y zsh
  48. curl -sS https://starship.rs/install.sh | sh
  49. }
  50. browsers() {
  51. sudo apt remove -y firefox
  52. sudo snap remove firefox
  53. # install brave
  54. sudo apt install apt-transport-https -y
  55. sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
  56. 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
  57. sudo apt update -y
  58. sudo apt install brave-browser -y
  59. }
  60. torbrowser() {
  61. sudo apt install -y torbrowser-launcher
  62. }
  63. popshell() {
  64. mkdir -p "$HOME/repos"
  65. sudo apt install git node-typescript make -y
  66. git clone https://github.com/pop-os/shell.git "$HOME/repos/shell"
  67. }
  68. meetings() {
  69. mkdir -p "$HOME/repos"
  70. # install skype
  71. curl https://go.skype.com/skypeforlinux-64.deb -LJo "$HOME/repos/skypeforlinux.deb"
  72. sudo apt install "$HOME/repos/skypeforlinux.deb" -y
  73. # install zoom
  74. curl https://zoom.us/client/latest/zoom_amd64.deb -LJo "$HOME/repos/zoomus.deb"
  75. sudo apt install "$HOME/repos/zoomus.deb" -y
  76. # install mt
  77. sudo curl -LJ https://github.com/junikimm717/mt/releases/download/33627ab/mt -o /usr/local/bin/mt
  78. sudo chmod +x /usr/local/bin/mt
  79. }
  80. # neovim must be installed.
  81. plugins() {
  82. # install vim-plug, oh-my-zsh, and zsh-syntax-highlighting
  83. sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
  84. https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  85. sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  86. git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting"
  87. }
  88. dotfiles() {
  89. echo "Adding vim and zsh configs"
  90. if ! test -d "$DIR/dotfiles"; then
  91. echo "$DIR/dotfiles folder not found.";
  92. exit 1;
  93. fi
  94. mkdir -p "$HOME/.config/nvim"
  95. cp "$DIR/dotfiles/.zshrc" "$HOME/.zshrc"
  96. cp "$DIR/dotfiles/init.vim" "$HOME/.config/nvim/init.vim"
  97. nvim --headless +PlugInstall +qa
  98. }
  99. competitiveprogramming() {
  100. echo "CP Compilers..."
  101. sudo apt install clang clang-tools-extra
  102. cd "$HOME" || exit 1;
  103. git clone https://git.junickim.me/junikimm717/linuxcp "$HOME/cp"
  104. }
  105. (usertest && dev && sysinfo && shell && browsers && meetings && plugins && dotfiles) || exit 1
  106. #(popshell) || exit 1
  107. cat <<EOF
  108. Stuff to do:
  109. - Install pop-shell (make local-install)
  110. - Install the coc extensions
  111. - Settle brave key stuff
  112. - Copy over the mt config files
  113. - Wallpapers from wallhaven.cc
  114. EOF