Skip to content

Instantly share code, notes, and snippets.

@maikwoehl
Last active November 2, 2020 15:18
Show Gist options
  • Save maikwoehl/104c373bce947d3938951628b737e6b3 to your computer and use it in GitHub Desktop.
Save maikwoehl/104c373bce947d3938951628b737e6b3 to your computer and use it in GitHub Desktop.
Debian Linux Development Environment
#!/bin/bash
DRY_RUN=1
# DRY RUN message
if [ "$DRY_RUN" = 1 ]; then
echo "##################################################"
echo "# DRY RUN mode active! No scripts are executed! #"
echo "# Please set DRY_RUN from '1' to '0' to start #"
echo "# the rocket! #"
echo "##################################################"
exit
fi
# Download software
if [ "$DRY_RUN" = 0 ]; then
su -c 'apt install git gpg tmux vim curl'
fi
# Configure tmux
if [ "$DRY_RUN" = 0 ]; then
pushd ~/
git clone https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf
cp .tmux/.tmux.conf.local .
echo "export EDITOR=vim" >> .profile
popd
fi
# Configure vim
if [ "$DRY_RUN" = 0 ]; then
pushd ~/
mkdir -p .vim/autoload .vim/bundle
curl -LSso .vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
echo "set nocompatible" >> .vimrc
echo "set expandtab" >> .vimrc
echo "set tabstop=4" >> .vimrc
echo "set shiftwidth=4" >> .vimrc
echo "set colorcolumn=80" >> .vimrc
echo "set mouse=a" >> .vimrc
echo "execute pathogen#infect()" >> .vimrc
echo "syntax on" >> .vimrc
echo "filetype plugin indent on" >> .vimrc
echo "set nu" >> .vimrc
popd
fi
# Installing vim-airline
if [ "$DRY_RUN" = 0 ]; then
pushd ~/
git clone https://github.com/vim-airline/vim-airline .vim/bundle/vim-airline
popd
fi
# Generating gpg key
echo "######################"
echo "# GPG Key Generation #"
echo "######################"
if [ "$DRY_RUN" = 0 ]; then
gpg --full-generate-key
fi
# Generating ssh key
echo "######################"
echo "# SSH Key Generation #"
echo "######################"
if [ "$DRY_RUN" = 0 ]; then
ssh-keygen -t rsa -b 4096
fi
# User steps
echo "#######################"
echo "# Last steps for you! #"
echo "#######################"
echo "(1/6) Open vim by typing 'vim' and then ':Helptags' to generate help files"
echo ""
echo "(2/6) Quit vim by typing ':q!' and then enter."
echo ""
echo "(3/6) Configure git by typing"
echo " ~$ git config --global user.email 'my@email.com'"
echo " ~$ git config --global user.name 'My Name'"
echo ""
echo "(4/6) Optional: Configure ssh by copying the content of '~/.ssh/id_rsa.pub'"
echo " to your git server."
echo ""
echo "(5/6) Optional: Configure gpg by exporting your key with"
echo " ~$ gpg --export --armor my@email.com > my_key.asc"
echo " And then saving it on your git server"
echo ""
echo "(6/6) Optional: Add your gpg key to git by configuring git with"
echo " ~$ gpg --list-secret-keys --keyid-format=LONG my@email.com"
echo " ~$ git config --global user.signingkey KEY_LONG_ID"
echo ""
echo "Installation finished!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment