Skip to content

Instantly share code, notes, and snippets.

@frullah
Last active March 6, 2022 16:35
Show Gist options
  • Save frullah/ed68eca0bd75c1d52d4413d6cf18ba12 to your computer and use it in GitHub Desktop.
Save frullah/ed68eca0bd75c1d52d4413d6cf18ba12 to your computer and use it in GitHub Desktop.
My debian/ubuntu linux setup
sudo apt update
sudo apt install -y fzf git kitty-terminfo screen wget xclip zsh
# enable scrolling in screen terminal
echo "termcapinfo xterm* ti@:te@" >> ~/.screenrc
##### Install Oh My ZSH #####
echo Y | sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# install zsh-autosuggestions plugin
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# add plugin into .zshrc
sed -ri "s/(^plugins=\((.+)\)$)/plugins=(\2 fzf zsh-autosuggestions)/" ~/.zshrc
# change shell to zsh
sudo chsh $(whoami) -s /bin/zsh
##### Software Installation #####
distro=$(cat /etc/os-release | grep -m 1 -o -P "(?<=NAME=\")(Ubuntu|Debian)" | tr '[:upper:]' '[:lower:]')
# --- Install docker ---
if [ ! -x "$(command -v docker)" ]; then
# Install Docker dependencies
sudo apt install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
# Add docker debian repository to apt
curl -fsSL https://download.docker.com/linux/${distro}/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/${distro} \
$(lsb_release -cs) \
stable"
# Install docker
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
# Add current user to docker group
sudo usermod -aG docker $(whoami)
fi
# Install docker-compose
if [ ! -x "$(command -v docker-compose)" ]; then
install_location=/usr/local/bin/docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o $install_location
sudo chmod +x $install_location
which docker-compose &> /dev/null || sudo ln -s $install_location /usr/bin/docker-compose
fi
if [ ! -x "$(command -v gitlab-runner)" ]; then
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash
sudo apt install -y gitlab-runner
fi
sudo apt update
sudo apt install -y fzf git kitty-terminfo screen wget xclip zsh
# enable scrolling in screen terminal
echo "termcapinfo xterm* ti@:te@" >> ~/.screenrc
##### Install Oh My ZSH #####
echo Y | sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# install zsh-autosuggestions plugin
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# add plugin into .zshrc
sed -ri "s/(^plugins=\((.+)\)$)/plugins=(\2 fzf zsh-autosuggestions)/" ~/.zshrc
# change shell to zsh
sudo chsh $(whoami) -s /bin/zsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment