Skip to content

Instantly share code, notes, and snippets.

@kbrgl
Last active April 9, 2016 07:29
Show Gist options
  • Save kbrgl/99e98d5f1368d4b0ffc9 to your computer and use it in GitHub Desktop.
Save kbrgl/99e98d5f1368d4b0ffc9 to your computer and use it in GitHub Desktop.
Kabir's Installation Tool
#!/bin/bash
# Elevate priviliges
sudo echo "Welcome to Kabir's Installation Tool."
echo "At any point during the installation, you can enter 'e' as your answer to exit."
echo
# Ask user whether they want to install a given program
function yn {
while true; do
read -pr "${1}? [y/n] " yn
case $yn in
[Yy]* ) return 0; break;;
[Nn]* ) return 1; break;;
[Ee]* ) exit;;
* ) echo "Invalid input; try again: ";;
esac
done
}
function install_check {
yn "Install ${1}";
}
# Make cache directory
mkdir -p ~/.cache/kite && cd "$_" || exit
mkdir -p ~/src
mkdir -p ~/bin
echo "export PATH=$HOME/bin:$PATH" >> ~/.bashrc
# Install build-essential
printf "Installing build-essential... "
sudo apt-get -qq install build-essential
printf "done.\n"
# Install gdebi
printf "Installing gdebi... "
sudo apt-get -qq install gdebi
printf "done.\n"
# Install version control systems
printf "Installing common version control systems (Git, SVN, Mercurial)..."
sudo apt-get -qq install git subversion mercurial
printf "done.\n"
# Install GNU Emacs
if install_check "GNU Emacs"; then
printf "Installing GNU Emacs... "
sudo apt-get -qq install emacs
printf "done.\n"
# I'm told Spacemacs is not compatible with the apt-get version of slime
if install_check "Spacemacs"; then
mv ~/.emacs.d ~/.emacs.d.bak
mv ~/.emacs ~/.emacs.bak
git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d
elif install_check "SLIME for GNU Emacs"; then
printf "Installing SLIME for GNU Emacs... "
sudo apt-get -qq install slime
printf "done.\n"
fi
fi
# Install Racket
if install_check "Racket"; then
printf "Installing Racket... "
sudo apt-get -qq install racket
printf "done.\n"
fi
# Install Spotify
if install_check "Spotify"; then
printf "Installing Spotify... "
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys BBEBDCB318AD50EC6865090613B00F1FD2C19886
if install_check "the testing version of Spotify"; then
echo deb http://repository.spotify.com testing non-free | sudo tee /etc/apt/sources.list.d/spotify.list
else
echo deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/spotify.list
fi
sudo apt-get update
sudo apt-get -qq install spotify-client
printf "done.\n"
fi
# Install Steel Bank Common Lisp
if install_check "Steel Bank Common Lisp"; then
printf "Installing Steel Bank Common Lisp... "
sudo apt-get -qq install sbcl
printf "done.\n"
fi
# Install Clozure Common Lisp
if install_check "Clozure Common Lisp"; then
printf "Installing Clozure Common Lisp... "
sudo svn co http://svn.clozure.com/publicsvn/openmcl/release/1.11/linuxx86/ccl /usr/local/src/ccl
sudo ln -s /usr/local/bin/ccl /usr/local/src/ccl/scripts/ccl64
sudo ln -s /usr/local/bin/ccl32 /usr/local/src/ccl/scripts/ccl32
printf "done.\n"
fi
# Install GNU Clisp
if install_check "GNU Clisp"; then
printf "Installing GNU Clisp... "
sudo apt-get -qq install clisp
printf "done.\n"
fi
# Install Google Chrome
if install_check "Google Chrome"; then
printf "Installing Google Chrome... "
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo gdebi google-chrome-stable_current_amd64.deb
printf "done.\n"
fi
if install_check "Chromium Browser"; then
printf "Installing Chromium Browser... "
sudo apt-get -qq install chromium-browser
printf "done.\n"
fi
# Install Ruby
if install_check "Ruby"; then
printf "Installing Ruby... "
# We need ruby-dev for gem to work properly
sudo apt-get -qq install ruby ruby-dev
printf "done.\n"
fi
# Install Golang
if install_check "Golang"; then
printf "Installing Golang... "
sudo apt-get -qq install golang
printf "done.\n"
fi
# Install Sublime Text
if install_check "Sublime Text"; then
printf "Installing Sublime Text... "
wget https://download.sublimetext.com/sublime-text_build-3103_amd64.deb
sudo gdebi sublime-text_build-3103_amd64.deb
printf "done.\n"
fi
if install_check "Java"; then
printf "Installing Java... "
sudo apt-get install openjdk-8-jdk
printf "done.\n"
if install_check "Clojure"; then
printf "Installing Clojure... "
wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
chmod +x ./lein
mv ./lein ~/bin/lein
lein
printf "done.\n"
fi
fi
if install_check "NodeJS"; then
printf "Installing NodeJS... "
wget https://nodejs.org/dist/v5.9.1/node-v5.9.1-linux-x64.tar.xz
tar xf node-v5.9.1-linux-x64.tar.xz -C ~/src
mv ~/src/node-v5.9.1-linux-x64 ~/src/nodejs
echo "PATH=$HOME/src/nodejs/bin:$PATH" >> ~/.bashrc
nodejs=0
printf "done.\n"
fi
if install_check "Fish shell"; then
printf "Installing Fish... "
sudo apt-get -qq install fish
if yn "Set Fish as your default login shell"; then
chsh -s "$(which fish)"
fi
if $nodejs; then
echo "set PATH $HOME/src/nodejs/bin $PATH" >> ~/.config/fish/config.fish
fi
echo "set PATH $HOME/bin $PATH" >> ~/.config/fish/config.fish
printf "done.\n"
fi
if install_check "Haskell"; then
if install_check "the entire Haskell Platform (otherwise only GHC will be installed)"; then
sudo apt-get install haskell-platform
else
sudo apt-get install ghc
fi
fi
echo "All done. :)"
if yn "Restart"; then
echo "Rebooting... "
sudo reboot
fi
@kbrgl
Copy link
Author

kbrgl commented Mar 8, 2016

About KIT

KIT installs my favourite programs and utilities:

  • gdebi
  • Version control systems [Git, SVN, Mercurial]
  • GNU Emacs
  • Spacemacs (external)
  • SLIME
  • GNU Clisp
  • Clozure Common Lisp (external)
  • Steel Bank Common Lisp
  • Golang
  • Ruby
  • Java
  • NodeJS (external)
  • Clojure (external)
  • Chromium
  • Haskell
  • Fish shell
  • Sublime Text (proprietary, external)
  • Spotify (proprietary, external)
  • Google Chrome (proprietary, external)

KIT will most probably only work on Ubuntu. It may or may not work on Debian but it's not been tested on it.
If Ubuntu is not the latest version, then packages may be outdated or fail to install.

How to use KIT

  1. Download the gist
  2. Open a terminal window in the folder where the gist is located
  3. Run ./kit.sh in your terminal
  4. Follow onscreen instructions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment