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.

110 lines
2.8 KiB

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. sudo snap install nvim --classic
  23. sudo apt-get update -y && sudo apt-get install -y nodejs
  24. }
  25. sysinfo() {
  26. echo "Dylan Araps scripts"
  27. cd "$HOME" || exit 1;
  28. mkdir -p repos
  29. git clone https://github.com/dylanaraps/pfetch "$HOME/repos/pfetch"
  30. git clone https://github.com/dylanaraps/neofetch "$HOME/repos/neofetch"
  31. git clone https://github.com/dylanaraps/fff "$HOME/repos/fff"
  32. cd "$HOME/repos/pfetch" || exit 1;
  33. sudo make install || exit 2;
  34. cd "$HOME" || exit 1;
  35. cd "$HOME/repos/neofetch" || exit 1;
  36. sudo make install || exit 2;
  37. cd "$HOME" || exit 1;
  38. cd "$HOME/repos/fff" || exit 1;
  39. sudo make install || exit 2;
  40. cd "$HOME" || exit 1;
  41. }
  42. shell() {
  43. sudo apt install -y zsh
  44. sudo snap install starship
  45. }
  46. browsers() {
  47. sudo apt remove -y firefox
  48. sudo snap install brave
  49. }
  50. torbrowser() {
  51. sudo apt install -y torbrowser-launcher
  52. }
  53. meetings() {
  54. sudo snap install skype zoom-client
  55. sudo curl -LJ https://github.com/junikimm717/mt/releases/download/33627ab/mt -o /usr/local/bin/mt
  56. sudo chmod +x /usr/local/bin/mt
  57. }
  58. # neovim must be installed.
  59. plugins() {
  60. # install vim-plug, oh-my-zsh, and zsh-syntax-highlighting
  61. sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
  62. https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  63. sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  64. git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting"
  65. }
  66. dotfiles() {
  67. echo "Adding vim and zsh configs"
  68. if ! test -d "$DIR/dotfiles"; then
  69. echo "$DIR/dotfiles folder not found.";
  70. exit 1;
  71. fi
  72. mkdir -p "$HOME/.config/nvim"
  73. cp "$DIR/dotfiles/.zshrc" "$HOME/.zshrc"
  74. cp "$DIR/dotfiles/init.vim" "$HOME/.config/nvim/init.vim"
  75. nvim --headless +PlugInstall +qa
  76. }
  77. competitiveprogramming() {
  78. echo "CP Compilers..."
  79. sudo dnf install clang clang-tools-extra
  80. cd "$HOME" || exit 1;
  81. git clone https://git.junickim.me/junikimm717/linuxcp "$HOME/cp"
  82. }
  83. (usertest && dev && sysinfo && shell && browsers && torbrowser && meetings && plugins && dotfiles) || exit 1
  84. cat <<EOF
  85. Stuff to do:
  86. - Install the coc extensions
  87. - Settle brave key stuff
  88. - Copy over the mt config files
  89. EOF