Archived
1
0
Fork 0
This repository has been archived on 2023-08-09. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/install/common.sh

68 lines
1.3 KiB
Bash
Raw Normal View History

2022-05-10 01:25:44 +02:00
#!/bin/bash
set -e
2022-05-10 01:25:48 +02:00
if [ "$(id -u)" = "0" ]; then
echo "You probably don't want to run this as root!"
echo "Do this first:"
echo "adduser caspervk"
echo "adduser caspervk sudo"
exit 1
fi
2022-05-10 01:25:44 +02:00
# Packages
sudo apt update
2022-05-10 01:25:48 +02:00
sudo apt upgrade -y
2022-05-10 01:25:44 +02:00
sudo apt install -y \
openssh-server \
git \
curl \
wget \
dnsutils \
rsync \
htop \
tmux \
ufw \
vnstat \
ntp \
pwgen \
fish \
2022-05-22 23:49:32 +02:00
fzf \
fd-find \
bat \
2022-05-10 01:25:44 +02:00
source-highlight
# Shell
chsh -s /usr/bin/fish
2022-05-23 22:16:59 +02:00
# Fish fzf
2022-05-22 23:49:32 +02:00
curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher
fisher install PatrickF1/fzf.fish
alias --save fd=fdfind
alias --save bat=batcat
echo "fzf_configure_bindings --directory=\cf --git_log=\cg" >> ~/.config/fish/config.fish
2022-05-23 22:16:59 +02:00
# Fish Pure
rm ~/.config/fish/functions/fish_prompt.fish
fisher install pure-fish/pure
2022-05-10 01:25:44 +02:00
# SSH
2022-05-10 01:25:48 +02:00
sed -i 's/#Port 22/Port 222/'
sudo systemctl restart sshd
2022-05-10 01:25:44 +02:00
ssh-keygen -t ed25519
ln -sr authorized_keys ~/.ssh/authorized_keys
ln -sr ssh_config ~/.ssh/config
2022-05-10 01:28:00 +02:00
# Git
ln -sr .gitconfig ~/
read -p "Git email: " email # avoid web scraping of email address
sed -i "s/<EMAIL>/$email/" .gitconfig
2022-05-10 01:25:44 +02:00
# Firewall
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 222/tcp comment "sshd"
2022-05-21 16:35:47 +02:00
sudo ufw enable