Skip to content

Instantly share code, notes, and snippets.

@noxan
Last active December 19, 2015 05:59
Show Gist options
  • Save noxan/5908659 to your computer and use it in GitHub Desktop.
Save noxan/5908659 to your computer and use it in GitHub Desktop.
Script to setup a fresh installed debian based linux installation.
#!/bin/sh
#
# A simple sh script to setup a fresh installed debian based unix system.
# by <Richard Stromer> noxan@byteweaver.org
WORKSPACE_FOLDER=$HOME/workspace
DOTFILES_FOLDER=$WORKSPACE_FOLDER/dotfiles
echo "Installing default packages..."
echo "This may prompt for your password."
sudo apt-get install -y vim python-virtualenv git chromium-browser thunderbird
echo "Setting vim as default editor..."
sudo update-alternatives --set editor /usr/bin/vim.basic
sudo pip install pyflakes
set -e
echo "Creating workspace folder..."
mkdir -p $WORKSPACE_FOLDER
echo "Cloning default settings (dotfiles) repo..."
if [ ! -e "$DOTFILES_FOLDER" ]; then
git clone https://github.com/noxan/dotfiles $DOTFILES_FOLDER
cd $DOTFILES_FOLDER
git submodule init
git submodule update
fi
echo "Creating symbolic link for gitconfig..."
[ ! -e "$HOME/.gitconfig" ] && ln -s $DOTFILES_FOLDER/gitconfig $HOME/.gitconfig
echo "Creating symbolic links for vimrc and vim folder..."
[ ! -e "$HOME/.vimrc" ] && ln -s $DOTFILES_FOLDER/vimrc $HOME/.vimrc
[ ! -e "$HOME/.vim" ] && ln -s $DOTFILES_FOLDER/vim/ $HOME/.vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment