Last active
March 17, 2023 09:44
-
-
Save JohnAZoidberg/ece485515a5c2d2c696ecc22fe18991d to your computer and use it in GitHub Desktop.
Ubuntu fresh install bootstrap script
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
PYTHON_CONFIG_DIR=$1 | |
if [ -z "$PYTHON_CONFIG_DIR" ]; then | |
echo "Python config dir unset - should be somewhere in /usr/lib/python2.7/"; | |
exit 1 | |
fi | |
# update | |
sudo apt-get update | |
# install git | |
sudo apt-get install -y git | |
git config --global user.email "ds@struckmeierfliesen.de" | |
git config --global user.name "Daniel Schäfer" | |
git config --global push.default simple | |
# install xsel - a tool to copy and paste (handy for vim) | |
sudo apt-get install -y xsel | |
# install Ranger (Terminal File Explorer) | |
RANGER="ranger caca-utils highlight atool w3m poppler-utils mediainfo" | |
sudo apt-get install -y $RANGER | |
# install tmux | |
sudo apt-get install -y tmux | |
# install Python | |
PYTHON="python python-pip python-dev" | |
sudo apt-get install -y $PYTHON | |
sudo -H pip install --upgrade pip | |
# install MySQL | |
MYSQL="python-mysqldb mysql-server phpmyadmin php-mbstring php-gettext" | |
sudo apt-get install -y $MYSQL | |
# fix phpmyadmin | |
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf | |
sudo a2enconf phpmyadmin.conf | |
sudo service apache2 reload | |
# install Haskell | |
#HASKELL="haskell-platform cabal-install" | |
#sudo apt-get install -y $HASKELL | |
# install cabal | |
#CABAL_INSTALLS="ghc-mod hlint hdevtools scan" | |
#cabal install $CABAL_INSTALLS | |
#export PATH=$HOME/.cabal/bin:$PATH | |
# install vim with python support | |
VIM_REQUIREMENTS="libncurses5-dev libgnome2-dev libgnomeui-dev \ | |
libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \ | |
libcairo2-dev libx11-dev libxpm-dev libxt-dev" | |
sudo apt-get install -y $VIM_REQUIREMENTS | |
# remove other vim installations | |
sudo apt-get remove -y vim vim-runtime gvim vim-tiny vim-common vim-gui-common vim-nox | |
# actually install now | |
cd ~ | |
git clone https://github.com/vim/vim.git | |
cd vim | |
sudo ./configure --with-features=huge \ | |
--enable-multibyte \ | |
--enable-pythoninterp \ | |
--with-python-config-dir=$PYTHON_CONFIG_DIR \ | |
--enable-gui=gtk2 --enable-cscope --prefix=/usr | |
sudo make VIMRUNTIMEDIR=/usr/share/vim/vim80 | |
sudo make install | |
# install vundle | |
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim | |
# install requirements for some plugins | |
VIM_PLUGIN_REQUIREMENTS="exuberant-ctags" | |
sudo apt-get install -y $VIM_PLUGIN_REQUIREMENTS | |
# set vim as default editor | |
sudo update-alternatives --install /usr/bin/editor editor /usr/bin/vim 100 | |
# get my dotfiles | |
cd ~ | |
git clone https://github.com/JohnAZoidberg/dotfiles.git | |
cd ~/dotfiles | |
chmod +x makesymlinks.sh | |
./makesymlinks.sh | |
# install all vundle plugins | |
vim +PluginInstall +quall | |
# add the aliases to the .bashrc | |
cd ~ | |
BASH_RC='.bashrc' | |
BASH_ALIASES='.bash_aliases' | |
if [ ! -f "$BASH_RC" ]; then | |
touch "$BASH_RC" | |
fi | |
if ! grep -q "$BASH_ALIASES" "$BASH_RC"; then | |
ALIAS_CHECK="if [ -f ~/.bash_aliases ]; then\ | |
. ~/.bash_aliases\ | |
fi" | |
echo "$ALIAS_CHECK" | |
echo "$ALIAS_CHECK" >> "$BASH_RC" | |
fi | |
source "$BASH_RC" | |
# Capslock => ESC & STRG: | |
XCAPE_REQUIREMENTS="gcc pkg-config libx11-dev libxtst-dev libxi-dev" | |
sudo apt-get install $XCAPE_REQUIREMENTS | |
cd ~ | |
git clone https://github.com/alols/xcape.git | |
cd xcape | |
make | |
sudo make install | |
echo "All done! Please restart" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment