Skip to content

Instantly share code, notes, and snippets.

echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.3 postgresql-server-dev-9.3 postgresql-contrib-9.3 -y
sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS hstore;'"
sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";'"
sudo su - postgres -c "service postgresql stop"
sudo su - postgres -c '/usr/lib/postgresql/9.3/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.3/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.3/main/ -O "-c config_file=/etc/postgresql/9.3/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf"'
@ahmadsoe
ahmadsoe / backup_mysql.sh
Created December 24, 2013 21:14
Backup MySQL database(s) to local or remote server.
#!/bin/bash
# Backup MySQL database(s) to local and/or remote server.
# databases=( 'DB_1' 'DB_2' 'DB_3')
databases=( )
db_host="localhost"
db_user=""
db_pass=""
#!/bin/bash
echo "Enter the name of the domain you wish to create"
read a
echo "Create DocumentRoot directory..."
if [ ! -d /var/www/$a ]; then
mkdir -p /var/www/$a/public_html
mkdir -p /var/www/$a/logs