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.

129 lines
3.8 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
  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 -y update || exit 1
  18. sudo apt -y upgrade || 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. meetings() {
  63. mkdir -p "$HOME/repos"
  64. # install skype
  65. curl https://go.skype.com/skypeforlinux-64.deb -LJo "$HOME/repos/skypeforlinux.deb"
  66. sudo apt install "$HOME/repos/skypeforlinux.deb" -y
  67. # install zoom
  68. curl https://zoom.us/client/latest/zoom_amd64.deb -LJo "$HOME/repos/zoomus.deb"
  69. sudo apt install "$HOME/repos/zoomus.deb" -y
  70. # install mt
  71. sudo curl -LJ https://github.com/junikimm717/mt/releases/download/33627ab/mt -o /usr/local/bin/mt
  72. sudo chmod +x /usr/local/bin/mt
  73. }
  74. # neovim must be installed.
  75. plugins() {
  76. # install vim-plug, oh-my-zsh, and zsh-syntax-highlighting
  77. sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
  78. https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  79. sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  80. git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting"
  81. }
  82. dotfiles() {
  83. echo "Adding vim and zsh configs"
  84. if ! test -d "$DIR/dotfiles"; then
  85. echo "$DIR/dotfiles folder not found.";
  86. exit 1;
  87. fi
  88. mkdir -p "$HOME/.config/nvim"
  89. cp "$DIR/dotfiles/.zshrc" "$HOME/.zshrc"
  90. cp "$DIR/dotfiles/init.vim" "$HOME/.config/nvim/init.vim"
  91. nvim --headless +PlugInstall +qa
  92. }
  93. competitiveprogramming() {
  94. echo "CP Compilers..."
  95. sudo apt install clang clang-tools-extra
  96. cd "$HOME" || exit 1;
  97. git clone https://git.junickim.me/junikimm717/linuxcp "$HOME/cp"
  98. }
  99. (usertest && dev && sysinfo && shell && browsers && torbrowser && meetings && plugins && dotfiles) || exit 1
  100. cat <<EOF
  101. Stuff to do:
  102. - Install the coc extensions
  103. - Settle brave key stuff
  104. - Copy over the mt config files
  105. EOF