-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic_setup.sh
More file actions
executable file
·42 lines (32 loc) · 1.12 KB
/
Copy pathbasic_setup.sh
File metadata and controls
executable file
·42 lines (32 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
## Prerequisites
sudo apt-get update
sudo apt-get autoremove -y
sudo apt-get upgrade --with-new-pkgs -y
sudo apt install -y tmux sudo bc
echo ":colorscheme desert" | sudo tee -a /etc/vim/vimrc.local
cat <<EOF>> ~/.bashrc
# Immediatly save bash history
if [ -z "\${PROMPT_COMMAND_SAVE+x}" ]; then
export PROMPT_COMMAND_SAVE="history -a; history -c; history -r"
export PROMPT_COMMAND="\$PROMPT_COMMAND_SAVE; \$PROMPT_COMMAND"
fi
# Start tmux and append session if exists
if command -v tmux &> /dev/null && [ -n "\$PS1" ] && [[ ! "\$TERM" =~ screen ]] && [[ ! "\$TERM" =~ tmux ]] && [ -z "\$TMUX" ] && [ ! -f ~/.no_tmux ]; then
exec tmux new-session -A -s main
fi
EOF
cat <<EOF>> ~/.tmux.conf
set -g mouse on
setw -g alternate-screen on
set-option -g history-limit 10000
EOF
sudo apt install -y git wget curl gpg
git config --global init.defaultBranch main
git config --global core.editor "vim"
git config --global credential.helper 'cache --timeout=3600' # 1 hour
read -t 5 -p "About to reboot. Press CTRL-C to stop, or ENTER to continue immediately." reply
reply=${reply:-Y}
if [[ ${reply^} = Y ]]; then
sudo reboot
fi