Skip to content

Instantly share code, notes, and snippets.

@shoaibali
Last active May 3, 2017 23:31
Show Gist options
  • Save shoaibali/46f95633eeddff19e5df to your computer and use it in GitHub Desktop.
Save shoaibali/46f95633eeddff19e5df to your computer and use it in GitHub Desktop.
Sets up ntp, DNSMasq, Git, SilverStripe, MySQL, phpMyAdmin, ATOM, SublimeText, HipChat, Google Chrome, Meld, NPM, NodeJS, yarn, Tools and other system tweaks
#!/bin/bash
echo "---- INSTALLING SYSTEM TOOLS ---"
sudo apt-get update
sudo apt-get install build-essential htop figlet dos2unix dnsmasq curl wget nodejs npm memcached debconf-utils mailutils sendmail sshfs graphviz ntp -y
sudo sh -c 'echo "deb https://atlassian.artifactoryonline.com/atlassian/hipchat-apt-client $(lsb_release -c -s) main" > /etc/apt/sources.list.d/atlassian-hipchat4.list'
wget -O - https://atlassian.artifactoryonline.com/atlassian/api/gpg/key/public | sudo apt-key add -
sudo add-apt-repository ppa:webupd8team/sublime-text-3 -y
sudo add-apt-repository ppa:webupd8team/atom -y
sudo add-apt-repository ppa:fossfreedom/indicator-sysmonitor -y
sudo apt-get update
sudo apt-get install sublime-text-installer atom -y
sudo apt-get install hipchat4 -y
sudo apt-get install indicator-sysmonitor -y
sudo apt-get install flashplugin-installer -y
echo "If hipchat fails to install on Ubuntu 16.04 you can do this "
echo "wget https://atlassian.artifactoryonline.com/atlassian/hipchat-apt-client/pool/HipChat4-4.0.1517-Linux.deb && sudo dpkg -i HipChat4-4.0.1517-Linux.deb"
echo "---- PERFORMANCE TWEAKS -------"
# optimize swap usage
sudo apt-get install bleachbit -y
sudo apt-get install zram-config -y
sudo apt-get install preload -y
sudo cat /proc/sys/vm/swappiness
sudo sysctl vm.swappiness=10
echo "vm.swappiness=10" | sudo tee --append /etc/sysctl.conf
# disable error reporting
sudo sh -c 'echo "enable=0" > /etc/default/apport'
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
\curl -sSL https://get.rvm.io | bash -s stable --ruby
source ~/.rvm/scripts/rvm
gem install compass
echo "--- SETTING UP DNSMASQ ----"
sudo mv /usr/sbin/dnsmasq /usr/sbin/dnsmasq.bin
sudo curl \
-o /usr/sbin/dnsmasq \
https://gist.githubusercontent.com/anonymous/482c1a8173dcade5fd4b/raw/71d792029b297834a51f644453e3b23dd084b452/dnsmasq.sh
sudo chmod a+x /usr/sbin/dnsmasq
sudo service network-manager restart
#sudo mkdir /etc/NetworkManager/dnsmasq.d
#sudo touch /etc/NetworkManager/dnsmasq.d/dev-tld
#echo "address=/dev/127.0.0.1" | sudo tee --append /etc/NetworkManager/dnsmasq.d/dev-tld
#sudo service network-manager restart
ping google.dev -c 4
clear
figlet "DEVELOPMENT"
cd /tmp
echo "---- INSTALLING GOOGLE CHROME ----"
sudo apt-get install libxss1 libappindicator1 libindicator7
wget "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
sudo dpkg -i --force-all google-chrome*.deb
echo "---- INSTALLING GIT TOOLS ----"
sudo apt-get install git git-flow git-extras meld -y
sudo apt-get install intltool itstool gir1.2-gtksource-3.0 libxml2-utils -y
git config --global merge.tool meld
git config --global core.filemode false
git config --global http.postBuffer 524288000
git config --global credential.helper cache
git config --global credential.helper 'cache --timeout=66600'
git config --global user.name `whoami`
echo "Please provide email address and press [ENTER]:"
read emailaddress
git config --global user.email "$emailaddress"
git config --global help.autocorrect 10
git config --global push.default simple
git config --global alias.slog "log --pretty=oneline --abbrev-commit"
git config --global alias.dlog "log --decorate"
curl \
-o /tmp/bashrc \
https://gist.githubusercontent.com/shoaibali/30bd81344f3e4ed1a64d/raw/f236d0b1fd7e3a8858af00201c7e18b402df6ab2/.bashrc
cat /tmp/bashrc >> ~/.bashrc
source ~/.bashrc
echo "---- INSTALLING LAMP STACK ----"
sudo npm -g install npm@latest
sudp npm -g install yarn
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password password'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password password'
sudo apt-get install apache2 mysql-server -y
sudo apt-get install php5 php5-cli php5-cgi php5-fpm php5-memcache php5-mcrypt php5-gd php5-tidy php5-xsl php5-curl php5-xdebug -y
sudo apt-get install php5-pgsql php5-mysql php5-sqlite -y
sudo apt-get install apache2 libapache2-mod-php5 -y
sudo apt-get install phpmyadmin -y
sudo a2enmod rewrite
echo "---- INSTALLING SILVERSTRIPE TOOLS -----"
curl -sS https://silverstripe.github.io/sspak/install | sudo php -- /usr/local/bin
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
echo "---- SETTING UP A SILVERSTRIPE INSTALL ----"
sudo composer create-project silverstripe/installer:3.2 /var/www/silverstripe
sudo curl \
-o /etc/apache2/sites-available/silverstripe.conf \
https://gist.githubusercontent.com/shoaibali/d99542f8952724865363/raw/538d92622914817a85eac9c60c51243424b6aa88/apache-vhost-template.conf
sudo a2ensite silverstripe
sudo service apache2 restart
echo "Installing sake"
cd /var/www/silverstripe
sudo ./framework/sake installsake
echo "----- FIXING PERMISSIONS ------"
sudo usermod -a -G www-data `whoami`
sudo usermod -a -G `whoami` www-data
groups `whoami`
groups www-data
sudo chown -R www-data:`whoami` /var/www
sudo chmod -R g+w /var/www
echo "---- DEVELOPMENT SETUP COMPLETE -----"
echo "MySQL database username: root and password is : password"
cd /var/www/silverstripe
subl /var/www/silverstripe &
firefox "http://silverstripe.dev" &
firefox "http://phpmyadmin.dev/phpmyadmin &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment