|
| 1 | +#!/bin/bash |
| 2 | +RED='\033[0;31m' |
| 3 | +YELLOW='\033[0;33m' |
| 4 | +GREEN='\033[0;32m' |
| 5 | +NC='\033[0m' # No Color |
| 6 | + |
| 7 | +# assuming the system is Debian |
| 8 | +printf "${GREEN}Installing vim, tmux, and git${NC}\n" |
| 9 | +sudo apt-get update |
| 10 | +sudo apt-get install vim -y |
| 11 | +sudo apt-get install tmux -y |
| 12 | +sudo apt-get install git -y |
| 13 | + |
| 14 | + |
| 15 | +printf "${GREEN}Configuring git authorization${NC}\n" |
| 16 | +ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N "" |
| 17 | +printf "${YELLOW}Here is the generated public key: add it to your github account${NC}\n" |
| 18 | +cat ~/.ssh/id_ed25519.pub |
| 19 | +printf "${YELLOW}... then, press [Enter] to continue...${NC}\n" |
| 20 | +read |
| 21 | + |
| 22 | + |
| 23 | +printf "${GREEN}Pulling config files and copying them to home directory${NC}\n" |
| 24 | +# Checkout bootstrap repo in a temp folder |
| 25 | +tmpdir=$(mktemp -d) |
| 26 | +git clone [email protected]:efemarai/sapphire.git $tmpdir |
| 27 | + |
| 28 | +# copy config files to home |
| 29 | +cp $tmpdir/home/.vimrc ~ |
| 30 | +cp $tmpdir/home/.tmux.conf ~ |
| 31 | + |
| 32 | +# Remove the temp folder to clean up |
| 33 | +rm -rf $tmpdir |
| 34 | + |
| 35 | + |
| 36 | +printf "${GREEN}Installing docker${NC}\n" |
| 37 | +sudo apt-get install \ |
| 38 | + ca-certificates \ |
| 39 | + curl \ |
| 40 | + gnupg \ |
| 41 | + lsb-release -y |
| 42 | + |
| 43 | +curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor \ |
| 44 | + -o /usr/share/keyrings/docker-archive-keyring.gpg |
| 45 | + |
| 46 | +echo \ |
| 47 | + "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \ |
| 48 | + $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null |
| 49 | + |
| 50 | +sudo apt-get update |
| 51 | +sudo apt-get install docker-ce docker-ce-cli containerd.io -y |
| 52 | + |
| 53 | + |
| 54 | +printf "${GREEN}Installing docker-compose${NC}\n" |
| 55 | +sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose |
| 56 | + |
| 57 | +sudo chmod +x /usr/local/bin/docker-compose |
| 58 | + |
| 59 | +sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose |
| 60 | + |
| 61 | + |
| 62 | +printf "${GREEN}Removing self${NC}\n" |
| 63 | +rm docker_and_auth-ized_git.sh |
| 64 | + |
| 65 | + |
| 66 | +printf "${GREEN}Starting tmux${NC}\n" |
| 67 | +tmux |
0 commit comments