This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Acknowledgements | |
# I forked this code from Chris Fidao see: https://gist.github.com/fideloper | |
# May need to run this as sudo! | |
# I have it in /usr/local/bin and run command 'vhost' from anywhere, using sudo. | |
NORMAL=$(tput sgr0) | |
GREEN=$(tput setaf 2; tput bold) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### mysql export with bzip2 | |
mysqldump -u root --routines --triggers db_name | bzip2 > dump.sql.bz2 | |
### mysql import with bzip2 | |
bunzip2 < dump.sql.bz2 | mysql -u root db_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Gracefully reloading haproxy..." | |
sudo haproxy -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid) | |
echo "[done]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker stop $(docker ps -a -q) | |
docker rm $(docker ps -a -q) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get -y install linux-image-generic-lts-raring linux-headers-generic-lts-raring | |
reboot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Lee Robert's Base Ubuntu Installation script for use on Digital Ocean (Or any other ubuntu install really.) | |
# Made and tested with Ubuntu 13.04 64bit | |
# | |
# USAGE: bash hardenUbuntu.sh | |
# | |
# Steps: | |
# 01. Secure Root User | |
# 02. Make .bashrc print out pretty colors (and root's prompt will be red) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Posgresql 9.3 Tuning | |
# RAM = 8GB | |
# http://pgtune.leopard.in.ua/ | |
max_connections = 200 | |
shared_buffers = 2GB | |
effective_cache_size = 6GB | |
work_mem = 10485kB | |
maintenance_work_mem = 512MB | |
checkpoint_segments = 32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Update System | |
echo "System Update" | |
sudo apt-get -y update | |
echo "Update completed" | |
# Dependency Package Install | |
sudo apt-get -y install libssl-dev build-essential pkg-config git | |
sudo apt-get -y install python-software-properties python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
REPO_FILE=/etc/apt/sources.list.d/pgdg.list | |
UBUNTU_VERSION=$(lsb_release -sr) | |
if [[ $UBUNTU_VERSION -eq '12.04' ]]; then | |
echo ' * Using defaults for 12.04 (Precise)' | |
UBUNTU_VERSION='precise' | |
elif [[ $UBUNTU_VERSION -eq '10.04' ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"' | |