Skip to content

Commit 2214df5

Browse files
committed
Add initial version of bootstrap script
This version is not tested, so more commits are likely to follow.
1 parent 0ff352a commit 2214df5

File tree

3 files changed

+121
-0
lines changed

3 files changed

+121
-0
lines changed

bootstrap/docker_and_auth-ized_git.sh

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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

home/.tmux.conf

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
set-option -g status-keys vi
2+
set-option -g mode-keys vi
3+
set-option -g prefix C-s
4+
set-option -g history-limit 30000
5+
6+
set -g mouse on
7+
8+
# List of plugins
9+
set -g @plugin 'tmux-plugins/tpm'
10+
set -g @plugin 'tmux-plugins/tmux-sensible'
11+
set -g @plugin 'tmux-plugins/tmux-yank'
12+
13+
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
14+
run '~/.tmux/plugins/tpm/tpm'

home/.vimrc

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
" Don't worry about vi compatibility. See :help nocompatible.
2+
set nocompatible
3+
4+
" Syntax highlighting.
5+
syntax on
6+
7+
" Set filetype indentation, pluging loading, and detection.
8+
filetype indent plugin on
9+
10+
" Set undo persistence.
11+
set undofile
12+
set undodir=~/.vim/undofiles
13+
14+
" Set search lighlighting
15+
set hlsearch
16+
17+
" Enable hidden buffers
18+
set hidden
19+
20+
" Enable mouse
21+
set mouse=a
22+
23+
" Quicker navigation between splits when in normal mode
24+
nnoremap <C-J> <C-W><C-J>
25+
nnoremap <C-K> <C-W><C-K>
26+
nnoremap <C-L> <C-W><C-L>
27+
nnoremap <C-H> <C-W><C-H>
28+
29+
" Open splits on the right and below
30+
set splitbelow
31+
set splitright
32+
33+
" Set expandtab, tabstop, shiftwidth, and textwidth
34+
set expandtab
35+
set tabstop=2
36+
set shiftwidth=2
37+
set textwidth=80
38+
39+
" Configure some F-buttons
40+
nnoremap <F3> :set invpaste<Enter>

0 commit comments

Comments
 (0)