Last active
April 9, 2024 11:18
-
-
Save j-martinez-dev/9eab5d7ef58c9ba71a83ddcf8e602519 to your computer and use it in GitHub Desktop.
Development installation
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
echo "Please write your name:" | |
read NAME | |
echo "Please write your personal email:" | |
read PERSONAL | |
echo "Please write your work email:" | |
read WORK | |
init() { | |
sudo apt update | |
sudo apt upgrade -y | |
} | |
fix_dual_boot() { | |
timedatectl set-local-rtc 1 | |
} | |
install_common_utils() { | |
sudo apt install -y curl xclip jq | |
} | |
customize_gnome() { | |
sudo apt install -y gnome-tweak-tool | |
gsettings set org.gnome.desktop.interface font-name 'Ubuntu 10' | |
gsettings set org.gnome.desktop.interface document-font-name 'Sans 10' | |
gsettings set org.gnome.desktop.interface monospace-font-name 'Ubuntu Mono 12' | |
gsettings set org.gnome.nautilus.desktop font 'Ubuntu 10' | |
gsettings set org.gnome.shell favorite-apps "['org.gnome.Nautilus.desktop', 'firefox.desktop', 'org.gnome.Terminal.desktop', 'code_code.desktop', 'intellij-idea-community_intellij-idea-community.desktop', 'org.gnome.Calculator.desktop']" | |
} | |
install_git() { | |
rm -rf ~/workspace | |
rm ~/.gitconfig | |
rm ~/.gitconfig-personal | |
rm ~/.gitconfig-work | |
mkdir ~/workspace | |
mkdir ~/workspace/personal | |
mkdir ~/workspace/work | |
echo '' >> ~/.gitconfig | |
echo '[core]' >> ~/.gitconfig | |
echo ' editor = code --wait' >> ~/.gitconfig | |
echo '[merge]' >> ~/.gitconfig | |
echo ' ff = only' >> ~/.gitconfig | |
echo '[user]' >> ~/.gitconfig | |
echo " name = $NAME" >> ~/.gitconfig | |
echo '[includeIf "gitdir:~/workspace/work/"]' >> ~/.gitconfig | |
echo ' path = ~/.gitconfig-work' >> ~/.gitconfig | |
echo '[includeIf "gitdir:~/workspace/personal/"]' >> ~/.gitconfig | |
echo ' path = ~/.gitconfig-personal' >> ~/.gitconfig | |
echo '' >> ~/.gitconfig | |
echo '' >> ~/.gitconfig-personal | |
echo '[user]' >> ~/.gitconfig-personal | |
echo " email = $PERSONAL" >> ~/.gitconfig-personal | |
echo '' >> ~/.gitconfig-personal | |
echo '' >> ~/.gitconfig-work | |
echo '[user]' >> ~/.gitconfig-work | |
echo " email = $WORK" >> ~/.gitconfig-work | |
echo '' >> ~/.gitconfig-work | |
sudo apt-get install -y git gitk | |
echo '' >> ~/.bashrc | |
echo 'force_color_prompt=yes' >> ~/.bashrc | |
echo 'color_prompt=yes' >> ~/.bashrc | |
echo 'parse_git_branch() {' >> ~/.bashrc | |
echo ' git branch 2> /dev/null | sed -e '\''/^[^*]/d'\'' -e '\''s/* \(.*\)/(\\1)/'\'' ' >> ~/.bashrc | |
echo '}' >> ~/.bashrc | |
echo 'if [ "$color_prompt" = yes ]; then' >> ~/.bashrc | |
echo ' PS1='\''${debian_chroot:+($debian_chroot)}\[\\033[01;32m\]\u@\h\[\\033[00m\]:\[\\033[01;34m\]\w\[\\033[01;31m\]$(parse_git_branch)\[\\033[00m\]\$ '\'' ' >> ~/.bashrc | |
echo 'else' >> ~/.bashrc | |
echo ' PS1='\''${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ '\'' ' >> ~/.bashrc | |
echo 'fi' >> ~/.bashrc | |
echo 'unset color_prompt force_color_prompt' >> ~/.bashrc | |
echo '' >> ~/.bashrc | |
} | |
install_docker(){ | |
sudo apt-get -y install apt-transport-https ca-certificates gnupg-agent software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
sudo apt-get update | |
sudo apt-get -y install docker-ce docker-ce-cli containerd.io | |
sudo groupadd docker | |
sudo usermod -aG docker $USER | |
newgrp docker | |
} | |
install_java(){ | |
rm -rf ~/.m2 | |
sudo apt-get install -y openjdk-17-jdk maven | |
mkdir ~/.m2 | |
mkdir ~/.m2/repository | |
echo '<?xml version="1.0" encoding="UTF-8"?>' >> ~/.m2/settings.xml | |
echo '<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" ' >> ~/.m2/settings.xml | |
echo ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">' >> ~/.m2/settings.xml | |
echo " <localRepository>/home/$USER/.m2/repository</localRepository>" >> ~/.m2/settings.xml | |
echo ' <pluginGroups>' >> ~/.m2/settings.xml | |
echo ' </pluginGroups>' >> ~/.m2/settings.xml | |
echo ' <proxies>' >> ~/.m2/settings.xml | |
echo ' </proxies>' >> ~/.m2/settings.xml | |
echo ' <servers>' >> ~/.m2/settings.xml | |
echo ' </servers>' >> ~/.m2/settings.xml | |
echo ' <mirrors>' >> ~/.m2/settings.xml | |
echo ' </mirrors>' >> ~/.m2/settings.xml | |
echo ' <profiles>' >> ~/.m2/settings.xml | |
echo ' </profiles>' >> ~/.m2/settings.xml | |
echo '</settings>' >> ~/.m2/settings.xml | |
} | |
install_node() { | |
rm -rf ~/.npm-global | |
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - | |
sudo apt-get install -y nodejs | |
sudo apt-get install gcc g++ make | |
mkdir ~/.npm-global | |
npm config set prefix '~/.npm-global' | |
echo '' >> ~/.bashrc | |
echo 'PATH=~/.npm-global/bin:$PATH' | tee -a ~/.bashrc | |
echo '' >> ~/.bashrc | |
npm install -g npm@latest-6 | |
npm install -g @angular/cli | |
} | |
install_ides(){ | |
sudo snap install code --classic | |
sudo snap install intellij-idea-ultimate --classic | |
} | |
install_terraform(){ | |
sudo apt-get update && sudo apt-get install -y gnupg software-properties-common curl | |
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - | |
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | |
sudo apt-get update && sudo apt-get install terraform | |
} | |
create_sh_key() { | |
rm ~/.ssh/id_rsa | |
ssh-keygen -b 4096 -t rsa -P "" -C "$NAME" -f ~/.ssh/id_rsa | |
} | |
install_gcloud() { | |
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list | |
sudo apt-get install apt-transport-https ca-certificates gnupg | |
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - | |
sudo apt-get update && sudo apt-get install google-cloud-sdk | |
} | |
install_kubernates() { | |
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add | |
sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main" | |
sudo apt-get install kubeadm kubelet kubectl | |
} | |
install_helm() { | |
curl https://baltocdn.com/helm/signing.asc | sudo apt-key add - | |
sudo apt-get install apt-transport-https --yes | |
echo "deb https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list | |
sudo apt-get update | |
sudo apt-get install helm | |
} | |
clean() { | |
sudo apt update | |
sudo apt upgrade -y | |
sudo apt autoremove -y | |
gnome-session-quit --force | |
} | |
init | |
fix_dual_boot | |
install_common_utils | |
install_git | |
install_docker | |
install_java | |
install_node | |
install_ides | |
install_terraform | |
create_sh_key | |
customize_gnome | |
clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment