{"id":44,"date":"2016-07-17T04:51:18","date_gmt":"2016-07-17T04:51:18","guid":{"rendered":"http:\/\/wizardofbots.com\/network\/?p=44"},"modified":"2016-07-17T05:02:50","modified_gmt":"2016-07-17T05:02:50","slug":"how-to-create-linux-bash-scripts-to-automate-installing-dependencies-and-more","status":"publish","type":"post","link":"https:\/\/wizardofbots.com\/network\/how-to-create-linux-bash-scripts-to-automate-installing-dependencies-and-more\/","title":{"rendered":"How to create linux bash scripts to automate installing dependencies and more"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-48\" src=\"http:\/\/wizardofbots.com\/network\/wp-content\/uploads\/2016\/07\/installwizard-243x300.jpg\" alt=\"installwizard\" width=\"243\" height=\"300\" srcset=\"https:\/\/wizardofbots.com\/network\/wp-content\/uploads\/2016\/07\/installwizard-243x300.jpg 243w, https:\/\/wizardofbots.com\/network\/wp-content\/uploads\/2016\/07\/installwizard.jpg 460w\" sizes=\"auto, (max-width: 243px) 100vw, 243px\" \/>Sometimes you just want to make your life easier on deploying a server in seconds with all the dependencies you need to run many languages or maybe a LAMP config easily.<\/p>\n<p>I made this whole compilation guys, but right now I dont feel like finishing it. So I decided to add a github repo so you can just clone and run it very quick. But I will be updating this post frequently. Just make sure to comment in order to report a bug or something that needs to be modified, also there\u00a0https:\/\/github.com\/wizardofbots\/wizardinstall<\/p>\n<p>So I decided to call it <strong>wizardinstall<\/strong> \ud83d\ude09 we will be adding the repos you need in order to have everything ready to start on a $5 cents digitalocean server to have a linux shell on your smartphone doing a realtime connection and executing your scripts!<\/p>\n<p>So check out the code, you will learn how to use it, and understand the logics, will add comments on each line if necessary so you guys understand:<\/p>\n<pre class=\"lang:sh decode:true\" title=\"wizardinstall\">#!\/bin\/bash\r\n# ******************************************\r\n# Program: Dev mode install\r\n# Developer: Wizard of Bots\r\n# Site: http:\/\/wizardofbots.com\/network\r\n# Github: https:\/\/github.com\/wizardofbots\/wizardinstall\r\n# Date: 16-07-2016\r\n# ******************************************\r\n# this line below is checking if the lsb_release -is comment response is \r\n# equal to Ubuntu and also Debian, because we can use apt-get instead of yum.\r\nif [ \"`lsb_release -is`\" == \"Ubuntu\" ] || [ \"`lsb_release -is`\" == \"Debian\" ] \r\nthen\r\n    # save time and install essential and then all libraries\r\n    sudo apt-get install -y build-essential;\r\n    # install git\r\n    sudo apt-get install git; # git is really useful, in fact clone this from: https:\/\/github.com\/wizardofbots\/wizardinstall\r\n    # install python\r\n    sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev;\r\n    sudo apt-get python2.7;\r\n    sudo apt-get install python-software-properties;\r\n    # install php\r\n    sudo apt-get install apache2;\r\n    sudo apt-get install curl;\r\n    sudo apt-get install mysql-server;\r\n    sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql;\r\n    sudo systemctl restart apache2;\r\n    sudo systemctl status apache2;\r\n    sudo apt-get install php-cli;\r\n    # install package manager for PHP: Composer\r\n    sudo apt-get update;\r\n    # install perl\r\n    sudo apt-get install perl;\r\n    # install ruby\r\n    sudo apt-add-repository ppa:brightbox\/ruby-ng\r\n    sudo apt-get update\r\n    sudo apt-get install ruby1.9.3\r\n    # installing nodejs\r\n    sudo apt-get update;\r\n    curl -sL https:\/\/deb.nodesource.com\/setup_6.x | sudo -E bash -;\r\n    sudo apt-get install -y nodejs;\r\n    sudo chmod 777 -R \/var\/www\/;\r\n    sudo printf \"&lt;?php\\nphpinfo();\\n?&gt;\" &gt; \/var\/www\/html\/info.php;\r\n    sudo service apache2 restart;\r\n# then this logic identifies if the release is CentOS or RedHat so we can use yum\r\nelif [ \"`lsb_release -is`\" == \"CentOS\" ] || [ \"`lsb_release -is`\" == \"RedHat\" ]\r\nthen\r\n    # this lines are not working properly right now. So wait for the update\r\n    sudo yum -y install httpd mysql-server mysql-devel php php-mysql php-fpm;\r\n    sudo yum -y install epel-release phpmyadmin rpm-build redhat-rpm-config;\r\n    sudo yum -y install mysql-community-release-el7-5.noarch.rpm proj;\r\n    sudo yum -y install tinyxml libzip mysql-workbench-community;\r\n    sudo chmod 777 -R \/var\/www\/;\r\n    sudo printf \"&lt;?php\\nphpinfo();\\n?&gt;\" &gt; \/var\/www\/html\/info.php;\r\n    sudo service mysqld restart;\r\n    sudo service httpd restart;\r\n    sudo chkconfig httpd on;\r\n    sudo chkconfig mysqld on;\r\n\r\n# we will add pacman for Arch Linux soon\r\nelse\r\n    echo \"Unsupported Operating System\";\r\nfi<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you just want to make your life easier on deploying a server in seconds with all the dependencies you need to run many languages or maybe a LAMP config easily. I made this whole compilation guys, but right now I dont feel like finishing it. So I decided to add a github repo so [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29,15],"tags":[16,30,31,8,32],"class_list":["post-44","post","type-post","status-publish","format-standard","hentry","category-bash","category-linux","tag-bash","tag-installer","tag-script","tag-ssh","tag-wizardinstall"],"_links":{"self":[{"href":"https:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/posts\/44","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/comments?post=44"}],"version-history":[{"count":4,"href":"https:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/posts\/44\/revisions"}],"predecessor-version":[{"id":49,"href":"https:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/posts\/44\/revisions\/49"}],"wp:attachment":[{"href":"https:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/media?parent=44"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/categories?post=44"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/tags?post=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}