-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·103 lines (83 loc) · 3.22 KB
/
install.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
#!/bin/bash
#Turn base minimized ubuntu server into useful dev machine
# Get apt to be quiet about restarting services
export DEBIAN_FRONTEND=noninteractive
export SCRIPT_DIR="$(realpath "$0")"
sudo apt update
sudo apt upgrade -y
#Install the basic utils
sudo apt install -y bind9-utils net-tools dnsutils git apt-file file cron \
sway swaylock wayvnc xwayland kitty openssl copyq xsel\
grimshot fonts-jetbrains-mono \
firefox
mkdir ~/Pictures
#Install Jet Brains Unofficial Jetbrains repo
curl -s https://s3.eu-central-1.amazonaws.com/jetbrains-ppa/0xA6E8698A.pub.asc | gpg --dearmor | sudo tee /usr/share/keyrings/jetbrains-ppa-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/jetbrains-ppa-archive-keyring.gpg] http://jetbrains-ppa.s3-website.eu-central-1.amazonaws.com any main" | sudo tee /etc/apt/sources.list.d/jetbrains-ppa.list > /dev/null
sudo apt-get update
sudo apt install goland -y
#Install Golang
mkdir ~/bin
cd ~/bin
git clone https://github.com/udhos/update-golang
cd update-golang
sudo ./update-golang.sh
export UPDATE_GOLANG=$(pwd)
echo "0 4 * * * root ${UPDATE_GOLANG}/update-golang.sh" | sudo tee -a /etc/crontab
echo 'source /etc/profile.d/golang_path.sh' >> ~/.bashrc
source /etc/profile.d/golang_path.sh
cd $SCRIPT_DIR
#Configure sway
mkdir -p ~/.config/{kitty,sway,swaylock}/
ln -s ~/snap/firefox/common/Downloads ~/Downloads
cp anime*.png ~/Downloads
cp -r .config ~/.config
#Do NeoVim
mkdir -p ~/.config/nvim
sudo add-apt-repository -y ppa:neovim-ppa/unstable
sudo apt update -y
sudo apt install -y neovim ripgrep build-essential gcc make
#Add nodejs....
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install node
#Install rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
bash -c "rustup update"
#Setup user lingering
sudo loginctl enable-linger $(whoami)
#Setup vnc service
sudo apt install mesa-utils libegl1 libgl1-mesa-dri xvfb -y
sudo usermod -aG render $(whoami)
sudo cp etc/vncserver\@.service /etc/systemd/system/
sudo cp bin/vnc_st* /usr/local/bin/
sudo systemctl daemon-reload
sudo systemctl enable vncserver@$(whoami)
sudo systemctl restart vncserver@$(whoami)
#Install Kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo cp kubectl /usr/local/bin/
sudo chmod +x /usr/local/bin/kubectl
#Install helm
mkdir /tmp/helm
cd /tmp/helm
curl -OL https://get.helm.sh/helm-v3.14.4-linux-amd64.tar.gz
ls -la
tar -xzvf helm-v3.14.4-linux-amd64.tar.gz
sudo cp linux-amd64/ /usr/local/bin/
sudo cp linux-amd64/helm /usr/local/bin/
chmod +x /usr/local/bin/helm
sudo chmod +x /usr/local/bin/helm
cd -
#Setup last parts of dev enviornment
mkdir ~/git-repos
cd ~/git-repos
git clone git@github.com:daniel-widrick/lineinfile.git
cd lineinfile
go build lineinfile.go
sudo cp ./lineinfile /usr/local/bin/lineinfile
/usr/local/bin/lineinfile ~/.bashrc 'alias cdg="cd ~/git-repos"'
#Auto update neovim stuff
sudo lineinfile /etc/crontab "0 0 * * 5 $(whoami) nvim --headless '+Lazy! sync' +qa"