-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sh
executable file
·123 lines (103 loc) · 2.92 KB
/
init.sh
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/usr/bin/env bash
export log_file=$HOME/install_progress_log.txt
export repo=$HOME/server-script
println() {
echo -ne "\n\n$1"
echo -ne "\n===========================================\n"
}
println "Disable root password..."
sudo passwd -l root
println "Add user..."
sudo adduser deploy
println "Add user to sudo..."
usermod -aG sudo deploy
sudo cp -r $HOME/.ssh /home/deploy
sudo chown -R deploy:deploy /home/deploy/.ssh
println "Initiating..."
sudo apt -y update
sudo apt -y upgrade
println "Installing utils..."
sudo apt -y install \
apt-transport-https \
autoconf \
automake \
ca-certificates \
cmake \
curl \
dirmngr \
g++ \
git \
gnupg2 \
libncurses5-dev \
libtool \
libtool-bin \
libunibilium-dev \
libunibilium0 \
locate \
make \
pkg-config \
python-pip \
python3-pip \
silversearcher-ag \
software-properties-common \
tig \
ufw \
whois \
wget
println "Enable firewall..."
ufw allow OpenSSH
ufw enable
ufw status
println "Installing nvm..."
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
command -v nvm
println "Installing node..."
nvm install node
println "Installing yarn..."
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn
println "Installing fasd..."
sudo wget -c https://github.com/clvv/fasd/tarball/1.0.1 -O - | tar -xz
cd clvv-fasd-4822024/
make install
cd ../
rm -rf clvv-fasd-4822024/
println "Installing bash-it..."
git clone --depth=1 https://github.com/Bash-it/bash-it.git $HOME/.bash_it
$HOME/.bash_it/install.sh
source $HOME/.bashrc
# enable completion/plugin/alias
bash-it enable completion dirs docker docker-compose git go
bash-it enable alias git docker docker-compose
bash-it enable plugin git docker docker-compose fasd
# add custom alias
sudo cp $repo/aliases/custom.aliases.bash $HOME/.bash_it/aliases/
# use bakke theme
sudo sed -i 's/bobby/bakke/g' /root/.bashrc
println "Installing neovim..."
sudo curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage
sudo chmod u+x nvim.appimage
sudo pip2 install neovim
sudo pip3 install neovim
println "Install color..."
sudo tic -x $repo/color/xterm-256color-italic.terminfo
sudo tic -x $repo/color/tmux-256color-italic.terminfo
println "Update packages..."
sudo apt -y update
println "installing to $HOME/.config"
if [ ! -d $HOME/.config ]; then
echo "Creating $HOME/.config"
sudo mkdir -p $HOME/.config
fi
# configs=$( find -path "$repo/config.symlink" -maxdepth 1 )
for config in $repo/config/*; do
target=$HOME/.config/$( basename $config )
if [ -e $target ]; then
echo "~${target#$HOME} already exists... Skipping."
else
echo "Creating symlink for $config"
sudo ln -s $config $target
fi
done
exit 0