Skip to content

Instantly share code, notes, and snippets.

@Grom-S
Created October 7, 2013 07:30
Show Gist options
  • Save Grom-S/6863834 to your computer and use it in GitHub Desktop.
Save Grom-S/6863834 to your computer and use it in GitHub Desktop.
Ubuntu post install script
#!/bin/bash
# Enable all repositories
sudo sed 's/# deb/deb/' -i /etc/apt/sources.list
# Add repos
sudo add-apt-repository ppa:webupd8team/sublime-text-2
# refresh the software list
sudo apt-get update
# Chromium
sudo apt-get install chromium-browser
sudo apt-get install djview-plugin unity-chromium-extension webaccounts-chromium-extension
sudo apt-get install vlc
sudo apt-get install curl zsh git sublime-text vlc guake filezilla subversion shutter pidgin pidgin-plugin-pack skype meld virtualbox-qt ssh sshfs openssh-server
# Wine
sudo apt-get install wine1.4 cups-bsd gnome-exe-thumbnailer ttf-wqy-microhei
#sudo gpasswd -a $USER fuse
#sshfs -o idmap=user [email protected]:/home /mnt/notebook
# ZSH Config (custom)
# SmartGit
# download from http://www.syntevo.com/smartgithg/index.html
# cd apps/smartgithg-4_5_1/bin/
# ./add-menuitem.sh
# HeidiSQL
# http://www.heidisql.com/download.php
# PHPStorm
# Oh My ZSH
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
# Set zsh as your default shell:
chsh -s /bin/zsh
# configure git
#git config --global user.email "[email protected]"
#git config --global user.name "grom"
# Java
# OpenJDK 7
sudo apt-get install openjdk-7-jre openjdk-7-jdk icedtea-plugin
# OpenJDK 6
# sudo apt-get install openjdk-6-jre openjdk-6-jdk icedtea6-plugin
# Oracle
# sudo add-apt-repository ppa:webupd8team/java
# sudo apt-get update
# sudo apt-get install oracle-java7-installer
# To set default Java version
# sudo update-alternatives --config java
# Dev Env Setup
# Apache 2
sudo apt-get install apache2 libapache2-mod-php5
# PHP
sudo apt-get install php5 php5-cli php5-cgi php5-mysql
# PHP modules
sudo apt-get install php5-mcrypt php5-curl php5-sqlite php5-xsl php5-intl php-apc php5-gd php5-imagick php5-memcache php5-recode php5-tidy php5-xmlrpc php5-json
# PEAR
sudo apt-get install php-pear
# xDebug
sudo apt-get install php5-xdebug
# MySQL
sudo apt-get install mysql-server mysql-client
# PMA
sudo apt-get install phpmyadmin
sudo apt-get install nodejs yui-compressor
#sudo apt-get install ssl-cert
# install ruby gem
sudo apt-get install rubygems
# gem programs
# Configure Apache
# enable modules
sudo a2enmod rewrite vhost_alias
mkdir projects
# add dynamic Virtual Host for all projecfts
echo "
UseCanonicalName Off
# NameVirtualHost *:80
LogFormat \"%V %h %l %u %t \"%r\" %s %b\" vcommon
ServerName localhost
# Projects folder on localhost
<VirtualHost *:80>
DocumentRoot /home/grom/projects
</VirtualHost>
# Dynamic virtual hosts (www subdomain)
<VirtualHost *:80>
ServerName *.local
ServerAlias www.*.local
VirtualDocumentRoot /home/grom/projects/%2/htdocs
<Directory /home/grom/projects>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# php_admin_value auto_prepend_file /home/grom/projects/fixroot.php
</VirtualHost>
# Dynamic virtual hosts
<VirtualHost *:80>
ServerName *.local
ServerAlias *.local
VirtualDocumentRoot /home/grom/projects/%1/htdocs
<Directory /home/grom/projects>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# php_admin_value auto_prepend_file /home/grom/projects/fixroot.php
</VirtualHost>
" | sudo tee /etc/apache2/sites-available/dev
# fix the Document Root
echo '<?php
// http://renebakx.nl/17/fixing-the-documentroot-with-vhost_alias/
$_SERVER["ORG_DOCUMENT_ROOT"] = $_SERVER["DOCUMENT_ROOT"];
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["SCRIPT_NAME"], '''',$_SERVER["SCRIPT_FILENAME"]);
' > /home/$USER/projects/fixroot.php
# Enable VH and restart
sudo a2ensite dev
sudo service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment