Last active
March 7, 2024 15:42
-
-
Save iitenkida7/caef141bdc014ee867c2c12501537f4a to your computer and use it in GitHub Desktop.
setup.sh
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
#!/bin/bash | |
GITHUB=iitenkida7 | |
sudo apt-get update | |
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
sudo apt-get install -y docker-ce zsh make vim | |
sudo systemctl start docker | |
sudo systemctl enable docker | |
adduser ${GITHUB} --shell $(which zsh) --disabled-password --gecos "" | |
gpasswd -a ${GITHUB} ${GITHUB} | |
usermod -aG docker ${GITHUB} | |
echo "${GITHUB} ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/${GITHUB} | |
cp -a /etc/zsh/newuser.zshrc.recommended /home/${GITHUB}/.zshrc | |
chown ${GITHUB}:${GITHUB} /home/${GITHUB}/.zshrc | |
sudo su - ${GITHUB} | |
#newgrp docker | |
#chsh -s $(which zsh) | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
mkdir -m 700 .ssh | |
curl "https://github.com/$(whoami).keys" >> /home/$(whoami)/.ssh/authorized_keys | |
chmod 600 ~/.ssh/authorized_keys | |
echo "ServerAliveInterval 30" >> ~/.ssh/config | |
echo "StrictHostKeyChecking no" >> ~/.ssh/config | |
echo "ForwardAgent yes" >> ~/.ssh/config | |
echo "TCPKeepAlive yes" >> ~/.ssh/config | |
chmod 600 ~/.ssh/config | |
git config --global user.name "$(whoami)" | |
git config --global user.email "$(whoami)@users.noreply.github.com" | |
echo "========================================" | |
echo $(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment