Skip to content

Instantly share code, notes, and snippets.

@mansurali901
Last active December 23, 2016 09:47
Show Gist options
  • Save mansurali901/68c3e8171ebe2c3a34ba1df56eb3b2fd to your computer and use it in GitHub Desktop.
Save mansurali901/68c3e8171ebe2c3a34ba1df56eb3b2fd to your computer and use it in GitHub Desktop.
IONA Application's dependencies Script
# This Script is written By
# Mansur Ul Hasan (Sr, Network & System Administrator)
# GFK Etilize Pak
# This script will install all dependencies for IONA
# Below Script is Tested on
CheckPoint () {
OS="`head -n1 /etc/issue |awk '{print $1,$2,$3}'`"
case $OS in
'Ubuntu 14.04.4 LTS')
echo "Alert This script will made some changes to your system if this is
production environment please consult first with NASA Department
"
read -rsn1 -p"Press any key to continue";echo
MainFunc
;;
*)
echo "
--------------------------------------------------------------------
| This Script and its packages are well tested on Ubuntu 14.04 LTS |
| If you really wish to proceed please consult with NASA |
| |
|-------------------------------------------------------------------|
exit
"
;;
esac
}
### Main Functions
MainFunc () {
echo "Installing JAVA JDK 8"
echo "adding Java Repository"
sudo add-apt-repository ppa:webupd8team/java
echo "Updating Repository"
sudo apt-get update
echo "Installing JAVA JDK 8"
sudo apt-get install oracle-java8-installer
echo "Your Java Version is"
java -version
echo "Making JAVA JDK8 as default JAVA"
apt-get install oracle-java8-set-default
echo "+++++++ JAVA Installation Finished +++++++"
echo "Installing Mysql Percona 5.7"
echo "Adding Percona Repository"
wget https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release -sc)_all.deb
echo "Installing Mysql Percona 5.7 repository"
dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb
echo "Updating Repository"
apt-get update
echo "Installing Mysql Percona 5.7"
apt-get install percona-server-server-5.7
echo "+++++++ Mysql Installation Finished +++++++"
echo "Installing Mongo Repository"
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
echo "Updating Repository"
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
apt-get update
echo "Installing Mongo Server "
apt-get install -y mongodb-org
echo "Mongo Server has been installed ... :)"
echo "Adding Mongo Service File"
echo "
#!/bin/bash
# This service file is made by
# Mansur Ul Hasan
# Sr, Network & Sys Admin
# GFK Etilize
mongostart () {
echo "Starting Mongo Services.......... "
mongod --fork --dbpath /var/lib/mongodb/ --smallfiles --logpath /var/log/mongodb.log --logappend
echo "Mongo Services has restarted"
echo "For Further assistance please contact NASA Department.."
}
mongostop () {
echo "Stopping Mongo Services........"
mongod --dbpath /var/lib/mongodb --shutdown
echo "Mongo Service as been Stopped"
echo "For Further assistance please contact NASA Department.."
}
case $1 in
start)
mongostart
;;
stop)
mongostop
;;
*)
echo "Invalid Argument
For Further please contact NASA Department
"
esac
" >/etc/init.d/mongod
echo "Adding Permissions"
chmod +x /etc/init.d/mongod
echo "Installing NodeJS"
apt-get install nodejs -y
echo "Installing NPM"
apt-get install npm -y
echo "Preparing to Install Grunt"
add-apt-repository ppa:chris-lea/node.js
apt-get update
apt-get install nodejs
npm install -g grunt-cli
echo "Grunt is installed Now....! :)"
echo "+++++++ Grunt Installation Finished +++++++"
echo " "
echo " "
echo " "
echo "+++++++ Redis Server Installation Started +++++++"
echo "+++++++ Redis Server Dependencies Setup +++++++"
apt-get install build-essential
apt-get install tcl8.5
echo "Downloading Redis Server Binaries ...... "
wget http://download.redis.io/releases/redis-stable.tar.gz
echo "Extracting Source Code"
tar xzf redis-stable.tar.gz
echo "Compilation process started "
cd redis-stable
make
echo "Testing Compiled Binaries"
make test
echo "Installing Binaried"
make install
echo "Now Installing Servers setup"
cd utils/
./install_server.sh
echo "Starting Redis Server"
service redis_6379 start
echo "Setup Has been compelted Now add your Code files
For further Please contact NASA Department...
Happy Cooding .....!
"
}
### Main Function to Check OS
CheckPoint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment