Last active
August 30, 2015 14:49
-
-
Save zeusintuivo/887484beed93593654b5 to your computer and use it in GitHub Desktop.
Desktop Automated Setup. This script allows you to setup your working environment with what I consider to be minimum requirements version on Ubuntu 15.04 LTS or Ubuntu 14.04 LTS or Debian wheezy/sid
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
#!/bin/bash | |
# @author Zeus Intuivo (zeus AT intuivo DOT com) | |
# | |
# intoostation_vivid_setup.sh | |
# This script allows you to setup your working environment with what I consider to be minimum requirements | |
# version on | |
# Ubuntu 15.04 LTS or Ubuntu 14.04 LTS or Debian wheezy/sid | |
# | |
# Optional Requires: | |
# install_sublime_text.sh -> https://gist.github.com/askmatey/c4fcbf37b598aee180bb | |
# for sublime. | |
# | |
# To execute the script: | |
# 1. Open Terminal | |
# 2. Change to the download folder | |
# 3. Make the script executable with chmod +x ( chmod +x intoostation_vivid_setup.sh ) | |
# 4. Run it with ./nineteen.sh | |
# | |
# Feel free to use this script as you see fit. | |
# VARIABLES | |
bld="\e[1m" # Bold text. | |
bdr="\e[1;31m" # Bold red text. | |
bdg="\e[1;32m" # Bold green text. | |
bdy="\e[1;33m" # Bold yellow text. | |
off="\e[0m" # Turn off ansi colors. | |
msg_bold () { | |
printf "\n${bld}%s ${off}%s\n" "$@" | |
} | |
msg_red () { | |
printf "\n${bdr}%s ${off}%s\n" "$@" | |
} | |
msg_green () { | |
printf "\n${bdg}%s ${off}%s\n" "$@" | |
} | |
msg_yellow () { | |
printf "\n${bdy}%s ${off}%s\n" "$@" | |
} | |
trap '{ msg_red " KEYBOARD INTERRUPT."; exit 130; }' INT | |
PREFIX="/usr/local" | |
export PATH="${PREFIX}/bin:${PATH}" | |
export PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" | |
export LD_LIBRARY_PATH="${PREFIX}/lib:${LD_LIBRARY_PATH}" | |
export CFLAGS="-O2 -ffast-math -march=native -g -ggdb3" | |
export CPPFLAGS="-I/usr/local/include -I${PREFIX}/include" | |
export LDFLAGS="-L/usr/local/lib -L${PREFIX}/lib" | |
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:${PREFIX}/lib/pkgconfig" | |
export CC="ccache gcc" | |
export CXX="ccache g++" | |
NCPU=$(getconf _NPROCESSORS_ONLN) | |
NJOBS=$((NCPU*2)) | |
export MAKE="make -j ${NJOBS}" | |
DOWNLOADS="${HOME}/Downloads/" | |
TITLE="wmctrl -r :ACTIVE: -N" | |
GEN="./autogen.sh --prefix=${PREFIX}" | |
RELEASE="$(lsb_release -sc)" | |
CODE="$(locale | grep 'LANG=' | cut -d= -f2 | cut -d_ -f1)" | |
DROPB="https://dl.dropboxusercontent.com/u/" | |
NO_NLS=0 | |
DOCUDIR="$(test -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && \ | |
source ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs | |
echo ${XDG_DOCUMENTS_DIR:-$HOME})" | |
DEPS_EN="aspell-${CODE} manpages git ruby gawk ack-grep \ | |
silversearcher-ag tree rlwrap xbacklight \ | |
mysql-server libapache2-mod-auth-mysql php5-mysql gksu gedit \ | |
sni-qt:i386 linux-tools-common linux-tools-generic | |
" | |
TRIM_EN="${DEPS_EN:46}" | |
DEPS="aspell-${CODE} manpages.${CODE} git ruby gawk ack-grep \ | |
silversearcher-ag tree rlwrap xbacklight \ | |
mysql-server libapache2-mod-auth-mysql php5-mysql gksu gedit \ | |
sni-qt:i386 linux-tools-common linux-tools-generic | |
" | |
TRIM="${DEPS:48}" | |
ALTSQL="git clone git://github.com/ewaters/altsql-shell.git" | |
tmp_count=0 | |
EPROG_COUNT=$(for i in $(echo ${EPROG}); do tmp_count=$((tmp_count+1)); done && echo ${tmp_count}) | |
unset tmp_count | |
# Enable this option to force messages to display in English | |
# during the build process (bug reporting): | |
# export LC_ALL=C | |
# TESTS | |
msg_bold "SYSTEM REQUIREMENTS CHECK..."; sleep 1 | |
if [ "${RELEASE}" == "trusty" ]; then | |
msg_green "Ubuntu ${RELEASE}... OK"; sleep 1 | |
elif [ "${RELEASE}" == "vivid" ]; then | |
msg_green "Ubuntu ${RELEASE}... OK"; sleep 1 | |
elif [ "${RELEASE}" == "sid" -o "${RELEASE}" == "wheezy" ]; then | |
msg_green "Debian ${RELEASE}... OK"; sleep 1 | |
else | |
msg_red " UNSUPPORTED VERSION." | |
exit 1 | |
fi | |
dpkg -l | egrep 'google-chrome' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " google-chrome INSTALLED." | |
else | |
msg_red " NEED TO INSTALL google-chrome." | |
msg_red " MORE INFO: http://askubuntu.com/questions/79280/how-to-install-chrome-browser-properly-via-command-line " | |
msg_red " PRESS ENTER." | |
sudo apt-get install libxss1 libappindicator1 libindicator7 | |
deb http://dl.google.com/linux/deb/ stable non-free main | |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - | |
sudo apt-get update -y | |
//wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
//sudo dpkg -i google-chrome*.deb -fy &>/dev/null | |
sudo apt-get install google-chrome-stable -fy &>/dev/null | |
if [ $? == 0 ]; then | |
sudo apt-get install -fy | |
//sudo dpkg -i google-chrome*.deb -fy | |
sudo apt-get install google-chrome-stable -fy | |
fi | |
fi | |
ls ~/.dropbox-dist/dropboxd | egrep 'dropboxd' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " dropbox INSTALLED." | |
else | |
msg_red " NEED TO INSTALL dropbox." | |
msg_red " MORE INFO: https://www.dropbox.com/en/install?os=lnx " | |
msg_red " PRESS ENTER." | |
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf - | |
~/.dropbox-dist/dropboxd | |
echo fs.inotify.max_user_watches=100000 | sudo tee -a /etc/sysctl.conf; sudo sysctl -p | |
dropbox stop | |
dropbox status | |
dropbox start | |
dropbox starttus | |
fi | |
dpkg -l | egrep ' curl ' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " curl INSTALLED." | |
else | |
msg_red " NEED TO INSTALL curl." | |
msg_red " PRESS ENTER." | |
sudo apt-get install curl -fy | |
fi | |
dpkg -l | egrep ' grc ' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " grcat INSTALLED." | |
else | |
msg_red " NEED TO INSTALL grcat." | |
msg_red " PRESS ENTER." | |
sudo apt-get install grc -fy | |
fi | |
dpkg -l | egrep ' scite ' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " scite INSTALLED." | |
else | |
msg_red " NEED TO INSTALL scite." | |
msg_red " PRESS ENTER." | |
sudo apt-get install scite -fy | |
fi | |
dpkg -l | egrep ' apt-file ' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " apt-file INSTALLED." | |
else | |
msg_red " NEED TO INSTALL apt-file." | |
msg_red " PRESS ENTER." | |
sudo apt-get install apt-file -fy | |
apt-file update | |
fi | |
dpkg -l | egrep 'libcurses' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " libcurses INSTALLED." | |
else | |
msg_red " NEED TO INSTALL libcurses." | |
msg_red " PRESS ENTER." | |
sudo apt-get install -fy lib32ncurses5-dev | |
sudo apt-get install -fy libcurses-ocaml-dev | |
sudo apt-get install -fy libncurses5-dev | |
sudo apt-get install -fy libx32ncurses5-dev | |
fi | |
ls ~/bin/cpanm | egrep 'cpanm' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " cpanm INSTALLED." | |
else | |
msg_red " NEED TO INSTALL cpanm." | |
msg_red " MORE INFO: http://search.cpan.org/~miyagawa/App-cpanminus-1.7039/lib/App/cpanminus.pm#INSTALLATION " | |
msg_red " PRESS ENTER." | |
mkdir -p ~/bin | |
cd ~/bin | |
#curl -LO http://xrl.us/cpanm | |
#chmod +x cpanm | |
curl -L https://cpanmin.us/ -o cpanm | |
chmod +x cpanm | |
# ~/bin/cpanm --local-lib=~/perl5 local::lib | |
#eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) | |
#echo 'eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)' >> ~/.bashrc | |
#perl -I$HOME/perl5/lib/perl5 -Mlocal::lib >> ~/.cshrcx cpanm | |
fi | |
ls /usr/local/bin/altsql | egrep 'altsql' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " altsql INSTALLED." | |
else | |
msg_red " NEED TO INSTALL altsql." | |
msg_red " MORE INFO: https://github.com/ewaters/altsql-shell/blob/master/INSTALL " | |
msg_red " PRESS ENTER." | |
# ERROR ! Configure failed for DBD-mysql-4.031. See /home/user/.cpanm/work/1437441176.14856/build.log for details. | |
# ! Installing the dependencies failed: Module 'DBD::mysql' is not installed | |
# ! Bailing out the installation for App-AltSQL-0.05. | |
# Fix with this update first | |
sudo apt-get install -fy libdbd-mysql-perl | |
# Then install | |
cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) | |
sudo ~/bin/cpanm App::AltSQL | |
fi | |
ls /usr/local/bin/phpunit | egrep 'phpunit' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " phpunit INSTALLED." | |
else | |
msg_red " NEED TO INSTALL phpunit." | |
msg_red " MORE INFO: https://phpunit.de/manual/current/en/installation.html " | |
msg_red " PRESS ENTER." | |
wget https://phar.phpunit.de/phpunit.phar | |
chmod +x phpunit.phar | |
sudo mv phpunit.phar /usr/local/bin/phpunit | |
sudo apt-get install phpunit -fy | |
phpunit --version | |
fi | |
dpkg -l | egrep 'filezilla' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " filezilla INSTALLED." | |
else | |
msg_red " NEED TO INSTALL filezilla." | |
sudo apt-get install -fy filezilla | |
fi | |
dpkg -l | egrep 'sublime' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " sublime INSTALLED." | |
else | |
msg_red " NEED TO INSTALL sublime." | |
msg_red " PRESS ENTER." | |
ls install_sublime_text.sh | egrep 'install_sublime_text' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_yellow " INSTALL BASED ON: http://www.simonewebdesign.it/install-sublime-text-3-on-linux/ " | |
curl -L git.io/sublimetext | sh | |
else | |
msg_yellow " INSTALL BASED ON: http://www.simonewebdesign.it/install-sublime-text-3-on-linux/ " | |
./install_sublime_text.sh | |
fi | |
# if still it did not install | |
dpkg -l | egrep 'sublime' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " sublime HAS BEEN INSTALLED." | |
else | |
msg_yellow " INSTALL WITH REPO MORE INFO: https://gist.github.com/kuhnroyal/36255e1cd206fd683549 " | |
sudo add-apt-repository ppa:webupd8team/sublime-text-3 | |
sudo apt-get update -y | |
sudo apt-get install -fy sublime-text-installer | |
fi | |
fi | |
dpkg -l | egrep ' git ' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " git INSTALLED." | |
else | |
msg_red " NEED TO INSTALL git." | |
msg_red " MORE INFO: https://gist.github.com/kuhnroyal/36255e1cd206fd683549 " | |
msg_red " PRESS ENTER." | |
sudo add-apt-repository ppa:git-core/ppa | |
sudo apt-get update -y | |
sudo apt-get install -fy git | |
fi | |
dpkg -l | egrep 'xclip' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " xclip INSTALLED." | |
else | |
msg_red " NEED TO INSTALL xclip" | |
msg_red " PRESS ENTER." | |
sudo apt-get install -fy xclip | |
fi | |
dpkg -l | egrep ' gimp ' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " gimp INSTALLED." | |
else | |
msg_red " NEED TO INSTALL gimp." | |
msg_red " MORE INFO: https://gist.github.com/kuhnroyal/36255e1cd206fd683549 " | |
msg_red " PRESS ENTER." | |
sudo apt-get install -fy gimp | |
fi | |
dpkg -l | egrep 'nodejs' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " npm (NODEJS) INSTALLED." | |
else | |
msg_red " NEED TO INSTALL npm (NODEJS)." | |
msg_red " MORE INFO: https://gist.github.com/kuhnroyal/36255e1cd206fd683549 " | |
msg_red " PRESS ENTER." | |
curl -sL https://deb.nodesource.com/setup | sudo bash - | |
sudo apt-get install -fy nodejs build-essential | |
fi | |
dpkg -l | egrep 'npm' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " npm INSTALLED." | |
else | |
msg_red " NEED TO INSTALL npm." | |
# msg_red " MORE INFO: " | |
msg_red " PRESS ENTER." | |
sudo apt-get install -fy npm | |
sudo npm install -g bower yo grunt-cli jasmine octopus | |
sudo npm install --global gulp | |
fi | |
dpkg -l | egrep 'skype' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " skype INSTALLED." | |
else | |
msg_red " NEED TO INSTALL skype." | |
msg_red " MORE INFO: https://help.ubuntu.com/community/Skype " | |
msg_red " PRESS ENTER." | |
msg_red " Users of 64-bit Ubuntu, should enable MultiArch if it isn't already enabled by running the command." | |
sudo dpkg --add-architecture i386 | |
sudo add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner" | |
sudo apt-get update -y | |
sudo apt-get install skype pulseaudio:i386 -fy | |
msg_red " Instal Skype Applet for Ubuntu 64 bits." | |
sudo apt-get install -fy sni-qt:i386 | |
fi | |
dpkg -l | egrep 'gpg' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " gpg INSTALLED." | |
else | |
msg_red " NEED TO INSTALL gpg." | |
# msg_red " MORE INFO: " | |
msg_red " PRESS ENTER." | |
sudo apt-get install -fy gpg | |
fi | |
ls ~/.rvm/scripts/rvm | egrep 'rvm' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " rvm INSTALLED." | |
else | |
msg_red " NEED TO INSTALL rvm." | |
msg_red " MORE INFO: https://rvm.io/rvm/install" | |
msg_red " PRESS ENTER." | |
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 | |
\curl -sSL https://get.rvm.io | bash -s stable --ruby --rails | |
fi | |
ls ~/.nvm/nvm.sh | egrep 'nvm' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " nvm INSTALLED." | |
else | |
msg_red " NEED TO INSTALL nvm." | |
msg_red " MORE INFO: https://github.com/creationix/nvm" | |
msg_red " PRESS ENTER." | |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.26.1/install.sh | bash | |
fi | |
dpkg -l | egrep 'postgresql' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " postgresql INSTALLED." | |
else | |
msg_red " NEED TO INSTALL postgresql." | |
msg_red " MORE INFO: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-14-04 " | |
msg_red " PRESS ENTER." | |
sudo apt-get install -fy postgresql postgresql-contrib | |
sudo -i -u postgres | |
fi | |
which composer | egrep 'composer' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " composer INSTALLED." | |
else | |
msg_red " NEED TO INSTALL composer." | |
msg_red " MORE INFO: https://getcomposer.org/doc/00-intro.md#using-the-installer " | |
msg_red " PRESS ENTER." | |
mkdir -p ~/bin | |
cd ~/bin | |
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer | |
fi | |
ls ~/.composer/vendor/bin/laravel | egrep 'laravel' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " laravel 5.0 INSTALLED." | |
else | |
msg_red " NEED TO INSTALL laravel 5.0." | |
msg_yellow " MORE INFO: http://laravel.com/docs/5.0/install " | |
msg_red " PRESS ENTER." | |
msg_red " NEED TO INSTALL ext-gmp" | |
# Fix for composer global require "ext-gmp" | |
sudo apt-get --reinstall install php5-gmp -fy | |
composer global require "laravel/installer=~1.1" | |
composer global require "symfony/event-dispatcher" | |
composer global require "symfony/dependency-injection" | |
composer global require "symfony/http-kernel" | |
composer global require "symfony/yaml" | |
composer global require "symfony/config" | |
composer global require "symfony/proxy-manager-bridge" | |
composer global require "psr/log" | |
# Fix to get ext-curl working | |
msg_red " NEED TO INSTALL ext-curl" | |
msg_yellow " MORE INFO: http://stackoverflow.com/questions/19335305/composer-install-error-requires-ext-curl-when-its-actualy-enabled " | |
# http://stackoverflow.com/questions/19335305/composer-install-error-requires-ext-curl-when-its-actualy-enabled | |
sudo apt-get --reinstall install -fy php5-curl | |
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer | |
composer global require "ext-curl" | |
composer global require "symfony/browser-kit" | |
composer global require "symfony/css-selector" | |
composer global require "symfony/class-loader" | |
composer global require "symfony/config" | |
composer global require "symfony/finder" | |
composer global require "symfony/var-dumper" | |
composer global require "zendframework/zend-serializer" | |
composer global require "zendframework/zend-servicemanager" | |
composer global require "zendframework/zend-filter" | |
composer global require "doctrine/common=~2.1" | |
composer global require "ocramius/generated-hydrator" | |
composer global require "zendframework/zend-xmlrpc" | |
composer global require "zendframework/zend-json" | |
composer global require "zendframework/zend-soap" | |
composer global require "ircmaxell/random-lib" | |
composer global require "zendframework/zend-http" | |
composer global require "zendframework/zend-server" | |
composer global require "zendframework/zendxml" | |
composer global require "zendframework/zend-di" | |
msg_red " mcrypt support => enabling " | |
msg_red " You need Apache for mcrypt extension to work " | |
msg_yellow " Installing Apache2 " | |
sudo apt-get -fy install apache2 php5-fpm php-pear php5-dev dh-make | |
sudo apt-get --reinstall install mcrypt php5-mcrypt -fy | |
sudo unlink /etc/php5/cli/conf.d/20-mcrypt.ini | |
sudo unlink /etc/php5/apache2/conf.d/20-mcrypt.ini | |
cd /etc/php5/mods-available | |
sudo unlink mcrypt.ini | |
sudo mv mcrypt.ini.dpkg-new mcrypt.ini | |
# Create symbol links now | |
sudo php5enmod mcrypt | |
# This process ^ has to have created the following symlinks | |
# | |
# ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/cli/conf.d/20-mcrypt.ini | |
# ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/apache2/conf.d/20-mcrypt.ini | |
sudo service php5-fpm restart | |
# Checking | |
ls -al /etc/php5/cli/conf.d/20-mcrypt.ini | |
ls -al /etc/php5/apache2/conf.d/20-mcrypt.ini | |
ls -al /etc/php5/cli/conf.d/20-mcrypt.ini | egrep 'mcrypt' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " mcrypt support => Enabled ! " | |
else | |
msg_red " mcrypt support => FAILED ! -- /etc/php5/cli/conf.d/20-mcrypt.ini missing " | |
printf "\n%s\n\n" " Check that there is this file there ... /etc/php5/mods-available/mcrypt.ini " | |
printf "\n%s\n\n" " then restart this process again." | |
exit 1 | |
fi | |
ls -al /etc/php5/apache2/conf.d/20-mcrypt.ini | egrep 'mcrypt' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " mcrypt support => Enabled ! " | |
else | |
msg_red " mcrypt support => FAILED ! --/etc/php5/apache2/conf.d/20-mcrypt.ini missing " | |
printf "\n%s\n\n" " Check that there is this file there ... /etc/php5/mods-available/mcrypt.ini " | |
printf "\n%s\n\n" " then restart this process again." | |
exit 1 | |
fi | |
php -i | egrep mcrypt | egrep 'mcrypt' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " php show mcrypt support => Enabled ! " | |
else | |
msg_red " php DOES NOT show mcrypt support => FAILED ! " | |
printf "\n%s\n\n" " php -i | egrep mcrypt " | |
printf "\n%s\n\n" " Fix ... then restart this process again." | |
php -i | egrep mcrypt | |
exit 1 | |
fi | |
composer global require "zendframework/zend-crypt" | |
composer global require "zendframework/zend-i18n" | |
composer global require "zendframework/zend-uri" | |
composer global require "zendframework/zend-db" | |
composer global require "zendframework/zend-i18n-resources" | |
msg_red " NEED TO INSTALL ext-apcu" | |
sudo apt-get --reinstall install php5-apcu -fy | |
msg_red " NEED TO INSTALL ext-memcache" | |
sudo apt-get --reinstall install php5-memcache -fy | |
msg_red " NEED TO INSTALL ext-memcached" | |
sudo apt-get --reinstall install php5-memcached -fy | |
msg_red " NEED TO INSTALL ext-mongo" | |
sudo apt-get --reinstall install php5-mongo -fy | |
# composer global require "mongofill/mongofill" | |
msg_red " NEED TO INSTALL ext-redis" | |
sudo apt-get --reinstall install php5-redis -fy | |
msg_red " NEED TO INSTALL ext-wincache -This is only for windows " | |
msg_yellow " GOTO: http://www.microsoft.com/web/gallery/install.aspx " | |
msg_yellow " If you are on windows and if you need it " | |
msg_red " NEED TO INSTALL ext-xcache " | |
sudo apt-get --reinstall install php5-xcache -fy | |
# Fix for composer global require "ext-gmp" | |
composer global require "zendframework/zend-cache" | |
composer global require "zendframework/zend-session" | |
# Check for the composer execuatble in the PATH | |
cat ~/.bashrc ~/.bash_profile | egrep 'composer' &>/dev/null | |
if [ $? == 0 ]; then | |
export PATH=~/.composer/vendor/bin:$PATH | |
msg_green " Composer Bin the PATH -- CORRECT " | |
else | |
# Not Found then add it | |
msg_red " Composer Bin the PATH -- NOT FOUND !... Fixing " | |
echo "export PATH=~/.composer/vendor/bin:$PATH" >> ~/.bashrc | |
echo "" >> ~/.bashrc | |
# Check again | |
cat ~/.bashrc | egrep 'composer' &>/dev/null | |
if [ $? == 0 ]; then | |
export PATH=~/.composer/vendor/bin:$PATH | |
msg_green " Composer Bin the PATH -- FIXED " | |
else | |
msg_red " Composer Bin the PATH -- CANT'T FIX " | |
printf "\n%s\n\n" " Please add this to your /.bash_profile (or ~/.bashrc) like this: " | |
printf "\n%s\n\n" " export PATH=~/.composer/vendor/bin:$PATH ." | |
printf "\n%s\n\n" " Fix ... then restart this process again." | |
exit 1 | |
fi | |
fi | |
fi | |
dpkg -l | egrep 'mysql-common' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " mysql INSTALLED." | |
else | |
msg_red " NEED TO INSTALL mysql." | |
msg_red " MORE INFO: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu " | |
msg_red " PRESS ENTER." | |
ifconfig eth0 | grep inet | awk '{ print $2 }' | |
sudo apt-get --reinstall install mysql-server libapache2-mod-auth-mysql php5-mysql -fy | |
sudo mysql_install_db | |
sudo /usr/bin/mysql_secure_installation | |
fi | |
dpkg -l | egrep 'php5' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " php5 INSTALLED." | |
else | |
msg_red " NEED TO INSTALL php5." | |
msg_red " MORE INFO: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu " | |
msg_red " PRESS ENTER." | |
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt -fy | |
apt-cache search php5- | egrep 'php5' | |
fi | |
dpkg -l | egrep 'touchpad-indicator' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " touchpad-indicator INSTALLED." | |
else | |
msg_red " NEED TO INSTALL touchpad-indicator." | |
msg_red " MORE INFO: http://askubuntu.com/questions/58584/can-i-automatically-deactivate-my-touchpad-when-a-usb-mouse-is-connected " | |
msg_red " PRESS ENTER." | |
sudo add-apt-repository ppa:atareao/atareao | |
sudo apt-get update -y | |
sudo apt-get install touchpad-indicator -fy | |
fi | |
dpkg -l | egrep 'oracle-java|jdk' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " JAVA INSTALLED." | |
else | |
msg_red " NEED TO INSTALL JAVA ORACLE." | |
msg_red " PRESS ENTER." | |
sudo add-apt-repository ppa:webupd8team/java | |
sudo apt-get update -y | |
sudo apt-get install oracle-java7-installer -fy | |
fi | |
#http://www.webupd8.org/2013/10/install-nemo-with-unity-patches-and.html | |
dpkg -l | egrep 'nemo' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " NEMO INSTALLED." | |
else | |
msg_red " NEED TO INSTALL NEMO T W E A K E D FOR UBUNTU." | |
msg_red " MORE INFO: http://www.webupd8.org/2013/10/install-nemo-with-unity-patches-and.html " | |
msg_red " PASSWORD THEN PRESS ENTER, THEN ENTER." | |
sudo add-apt-repository ppa:webupd8team/nemo | |
sudo apt-get update -y | |
sudo apt-get install nemo nemo-fileroller -fy | |
sudo apt-get install nemo-compare nemo-dropbox nemo-media-columns nemo-pastebin nemo-seahorse nemo-share nemo-emblems nemo-image-converter -fy | |
sudo apt-get install nemo-terminal -fy | |
fi | |
#http://www.webupd8.org/2014/04/prevent-your-laptop-from-overheating.html | |
cat /etc/default/grub | egrep 'intel_pstate' &>/dev/null | |
if [ $? == 0 ]; then | |
msg_green " intel_pstate INSTALLED." | |
msg_yellow " CHECKING IT. " | |
msg_yellow " This should return 'intel_pstate'. " | |
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver | |
else | |
msg_red " NEED TO INSTALL intel_pstate ." | |
msg_red " MORE INFOR: http://www.webupd8.org/2014/04/prevent-your-laptop-from-overheating.html " | |
msg_red " And for GRUB_CMDLINE_LINUX_DEFAULT= (it's on line 11 on my system), add \"intel_pstate=enable\", like this:" | |
msg_red " GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash intel_pstate=enable\"" | |
#gksu gedit /etc/default/grub | |
sudo sed -i 's/^.*\bGRUB_CMDLINE_LINUX_DEFAULT\b.*$/GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash intel_pstate=enable\"/' /etc/default/grub | |
sudo update-grub | |
fi | |
# FUNCTIONS | |
warn () { | |
zenity --no-wrap --info --text " | |
If you proceed with the installation,\n\ | |
nearly 100MB of additional disk space\n\ | |
will be used.\n | |
Bear in mind that running other applications\n\ | |
during the build process will affect\n\ | |
compilation time." | |
sleep 1 | |
} | |
should_we_disable_nls () { | |
if [ ${NO_NLS} -eq 1 ]; then | |
GEN=${GEN} --disable-nls | |
msg_green "Building with NLS disabled!" | |
else | |
msg_green "Building with NLS enabled!" | |
fi | |
} | |
bin_deps () { | |
# sudo apt-get update && sudo apt-get dist-upgrade --yes | |
if [ ! -f "${DOCUDIR}/installed.txt" ]; then | |
dpkg --get-selections > "${DOCUDIR}/installed.txt" | |
sed -i '/linux-headers*/d' "${DOCUDIR}/installed.txt" | |
sed -i '/linux-image*/d' "${DOCUDIR}/installed.txt" | |
sed -i '/linux-generic*/d' "${DOCUDIR}/installed.txt" | |
sed -i '/linux-signed*/d' "${DOCUDIR}/installed.txt" | |
fi | |
if [ "${CODE}" == "en" ]; then | |
sudo apt-get install --yes ${DEPS_EN} | |
sleep 1 | |
else | |
sudo apt-get install --yes ${DEPS} | |
sleep 1 | |
fi | |
} | |
ls_ppa () { | |
local PPA="$(awk '$1 == "Package:" { print $2 }' \ | |
/var/lib/apt/lists/*ppa*Packages)" | |
for i in $(echo ${PPA} | xargs -n1 | sort -u); do | |
dpkg-query -Wf'${db:Status-abbrev}' ${i} &>/dev/null | |
if [ $? == 0 ]; then | |
sed -i "/${i}/d" "${DOCUDIR}/installed.txt" | |
fi | |
done | |
} | |
msg_bold "Proceeding to install All kinds of Needed libraries ..." | |
if grep -q ppa /var/lib/apt/lists/*ppa* &>/dev/null; then | |
bin_deps | |
ls_ppa | |
else | |
unset -f ls_ppa | |
bin_deps | |
fi | |
#REINTALL MYSQL | |
#irst remove MySQL: | |
#udo apt-get remove --purge mysql-server mysql-client mysql-common | |
#udo apt-get autoremove | |
#udo apt-get autoclean | |
#hen reinstall: | |
#udo apt-get update | |
#udo apt-get install mysql-server | |
#udo mysql_install_db | |
#udo /usr/bin/mysql_secure_installation | |
# | |
# | |
# | |
# END | |
# | |
# | |
# | |
printf "\n%s\n\n" " You need to reboot your system..." | |
printf "\n%s\n\n" " do " | |
printf "\n%s\n\n" " shutdown -r now " | |
printf "\n%s\n\n" " or " | |
printf "\n%s\n\n" " systemctl reboot " | |
printf "\n%s\n\n" " That's All Folks..." | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment