/bootstrap/crouton.sh

https://github.com/cartolari/dotfiles · Shell · 126 lines · 107 code · 17 blank · 2 comment · 8 complexity · f9564200fefbf60c9bfce2176e13eb45 MD5 · raw file

  1. #!/bin/bash
  2. set -xeuo pipefail
  3. FZF_VERSION=0.18.0
  4. RIPGREP_VERSION=11.0.1
  5. WHICH_VERSION=2.21
  6. if [ "$EUID" -eq 0 ]; then
  7. echo This script should not be executed as root
  8. exit 1
  9. fi
  10. DIR="$( cd "$(dirname "$0")" ; pwd -P )"
  11. echo Installing essential packages
  12. sudo apt update
  13. sudo apt install -y \
  14. build-essential \
  15. curl \
  16. wget
  17. echo Building Which
  18. mkdir -p ~/.local/bin
  19. if [[ ! -f ~/.local/bin/which ]]; then
  20. curl -SsL \
  21. http://ftp.gnu.org/gnu/which/which-${WHICH_VERSION}.tar.gz | \
  22. tar zxv -C /tmp
  23. cd /tmp/which-${WHICH_VERSION}
  24. ./configure
  25. make
  26. cp ./which ~/.local/bin/which
  27. fi
  28. echo PostgreSQL repos
  29. [[ -f /etc/apt/sources.lists.d/pgdg.list ]] ||
  30. echo 'deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main' | \
  31. sudo tee /etc/apt/sources.list.d/pgdg.list
  32. curl -SsL https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
  33. sudo apt-key add -
  34. echo Installing packages
  35. sudo apt install -y \
  36. autojump \
  37. cloc \
  38. cmake \
  39. exuberant-ctags \
  40. git \
  41. git-lfs \
  42. golang-go \
  43. homesick \
  44. htop \
  45. inotify-tools \
  46. jq \
  47. libncurses5-dev \
  48. lxc-utils \
  49. lxd \
  50. net-tools \
  51. ocaml-nox \
  52. openconnect \
  53. postgresql-client-10 \
  54. python \
  55. python-pip \
  56. python3 \
  57. python3-pip \
  58. qemu-kvm \
  59. rclone \
  60. rmlint \
  61. ruby \
  62. s3cmd \
  63. shellcheck \
  64. silversearcher-ag \
  65. socat \
  66. sqlite \
  67. sshpass \
  68. tig \
  69. tmux \
  70. tree \
  71. vagrant \
  72. vim-gtk \
  73. zsh \
  74. zsh-syntax-highlighting
  75. echo ZSH Setup
  76. sudo mkdir -p /etc/zsh
  77. sudo touch /etc/zsh/zshrc
  78. if ! grep -q grml /etc/zsh/zshrc; then
  79. sudo curl -SsLo /etc/zsh/zshrc https://git.grml.org/f/grml-etc-core/etc/zsh/zshrc
  80. fi
  81. echo Docker Setup
  82. if ! hash docker; then
  83. curl -SsL https://get.docker.com | sh
  84. fi
  85. if ! hash docker-compose; then
  86. curl \
  87. -L \
  88. "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" | \
  89. sudo install -T /dev/stdin /usr/local/bin/docker-compose
  90. fi
  91. echo FZF
  92. if ! hash fzf; then
  93. curl -SsL https://github.com/junegunn/fzf-bin/releases/download/$FZF_VERSION/fzf-$FZF_VERSION-linux_amd64.tgz | \
  94. sudo tar xzf - -C /usr/local/bin/
  95. fi
  96. if ! hash rg; then
  97. curl -LO https://github.com/BurntSushi/ripgrep/releases/download/$RIPGREP_VERSION/ripgrep_${RIPGREP_VERSION}_amd64.deb
  98. sudo dpkg -i ripgrep_${RIPGREP_VERSION}_amd64.deb
  99. rm ripgrep_${RIPGREP_VERSION}_amd64.deb
  100. fi
  101. mkdir -p ~/.local/share/zsh
  102. if [[ ! -d ~/.local/share/zsh/zsh-autosuggestions ]]; then
  103. git clone https://github.com/zsh-users/zsh-autosuggestions ~/.local/share/zsh/zsh-autosuggestions
  104. fi
  105. sudo cp "$DIR/rc.local" /etc/rc.local
  106. # Clustergit
  107. [[ -f ~/.local/bin/clustergit ]] ||
  108. curl -SsL https://raw.githubusercontent.com/mnagel/clustergit/master/clustergit | \
  109. install -m 0755 /dev/stdin ~/.local/bin/clustergit