Last active
April 25, 2023 20:02
-
-
Save henrikcoll/8b3c80cc597f7ffbb55dabb7ceffb168 to your computer and use it in GitHub Desktop.
Setup new server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install packages | |
apt-get update | |
apt-get install -y zsh vim git | |
# Create my user | |
useradd henrik -m -s /usr/bin/zsh | |
# Add my user to the sudoers file | |
echo 'henrik ALL=(ALL:ALL) NOPASSWD: ALL' >> /etc/sudoers | |
## Add my ssh keys | |
mkdir /home/henrik/.ssh | |
echo "$(curl -sSL https://github.com/henrikcoll.keys)" > /home/henrik/.ssh/authorized_keys | |
chown -R henrik:henrik /home/henrik/.ssh | |
# Install oh-my-zsh | |
cd /home/henrik | |
sudo -u henrik sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" --unattended | |
# Change oh-my-zsh theme to ys | |
sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="ys"/' .zshrc | |
# Change ys theme hostname to red | |
sed -i 's/%{$fg\[green\]%}%m/%{$fg[red]%}%m/' .oh-my-zsh/themes/ys.zsh-theme |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
one liner to run script
sh -c "$(curl -sSL https://gist.github.com/henrikcoll/8b3c80cc597f7ffbb55dabb7ceffb168/raw)"