This repository has been archived by the owner on Apr 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
linux-server.sh
executable file
·114 lines (90 loc) · 3.02 KB
/
linux-server.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
#!/bin/sh
set -euo pipefail
set -x
source ./config.sh
sudo ufw --force status
sudo ufw --force default deny
sudo ufw --force limit ssh
sudo ufw --force status
sudo ufw --force enable
# Setup tmux plugin manager for tmux plugin management
mkdir -p $HOME/.tmux/plugins
if [ ! -d $HOME/.tmux/plugins/tpm ]; then
echo "--> Installing tpm..."
git clone https://github.com/tmux-plugins/tpm $HOME/.tmux/plugins/tpm
fi
# Put the tmux config file in place
ln -fs $HERE/tmux/.tmux.conf $HOME/.tmux.conf
# Install the plugins
$HOME/.tmux/plugins/tpm/bin/install_plugins
# Setup vim-plug for plugin management
mkdir -p $HOME/.vim/autoload
if [ ! -d $HOME/.vim/autoload/plug.vim ]; then
echo "--> Installing plug.vim..."
curl -fLo ~/.vim/autoload/plug.vim \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
fi
# bash
ln -fs $HERE/bash/.bash_profile $HOME/.bash_profile
ln -fs $HERE/bash/.bash_prompts $HOME/.bash_prompts
ln -fs $HERE/bash/.bash_logout $HOME/.bash_logout
ln -fs $HERE/bash/.bashrc $HOME/.bashrc
touch $HOME/.bash_history
# oh-my-zsh
[[ -d $HOME/.oh-my-zsh ]] \
|| sh \
-c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# aliases
ln -fs $HERE/aliases.sh $HOME/.aliases
# Install my custom profile(s)
for f in jackb; do
ln -fs $HERE/zsh/$f.zsh-theme $HOME/.oh-my-zsh/themes/$f.zsh-theme
done
# zsh
for f in .zshrc .zshenv; do
ln -fs $HERE/zsh/$f $HOME/$f
done
touch $HOME/.zsh_history
# vim
ln -fs $HERE/vim/.vimrc ~/.vimrc
ln -fs $HERE/gvim/.gvimrc ~/.gvimrc
mkdir -p $HOME/.vim/colors
ln -fs $HERE/vim/.vim/colors/molokai.vim $HOME/.vim/colors/molokai.vim
ln -fs $HERE/vim/.vim/colors/solarized.vim $HOME/.vim/colors/solarized.vim
# neovim
mkdir -p $HOME/.config/nvim
ln -fs $HERE/neovim/init.vim $HOME/.config/nvim/init.vim
# Install neovim plugins. This will run the plugin install, quit that
# buffer, then quit the empty buffer opened by default.
nvim --headless +PlugInst +q +q
# emacs
#mkdir -p $HOME/.emacs.d
#ln -fs $HERE/emacs/init.el $HOME/.emacs.d/init.el
ln -fs $HERE/doom $HOME/.doom.d
[[ -d $HOME/.emacs.d ]] || (
git clone https://github.com/hlissner/doom-emacs $HOME/.emacs.d \
&& $HOME/.emacs.d/bin/doom --yes install)
# git
ln -fs $HERE/git/.git-completion.bash $HOME/.git-completion.bash
ln -fs $HERE/git/.gitconfig $HOME/.gitconfig
ln -fs $HERE/git/.gitignore $HOME/.gitignore
# ruby
ln -fs $HERE/ruby/.irbrc $HOME/.irbrc
touch $HOME/.irb_history
# myvault
sudo wget \
https://raw.githubusercontent.com/brownjohnf/vault/master/bin/vault \
-O /usr/local/bin/myvault
sudo chmod +x /usr/local/bin/myvault
# psql
ln -fs $HERE/.psqlrc $HOME/.
touch $HOME/.psql_history
# Add some customization to the rust installation.
which cargo-udeps || cargo install cargo-udeps
which verto || cargo install --git https://gitlab.com/jack/verto
which copy || cargo install --git https://gitlab.com/jack/copy-rs
# Install some tools with Go
go get github.com/brownjohnf/slit
# Enable the emacs server
systemctl --user enable --now emacs
echo "SUCCESS"