Skip to content

Instantly share code, notes, and snippets.

@henrikcoll
Last active April 25, 2023 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henrikcoll/8b3c80cc597f7ffbb55dabb7ceffb168 to your computer and use it in GitHub Desktop.
Save henrikcoll/8b3c80cc597f7ffbb55dabb7ceffb168 to your computer and use it in GitHub Desktop.
Setup new server
# 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
@henrikcoll
Copy link
Author

one liner to run script sh -c "$(curl -sSL https://gist.github.com/henrikcoll/8b3c80cc597f7ffbb55dabb7ceffb168/raw)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment