Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Rsync based file backup script, with hard-linking enabled.
#
# Runtime options:
# -n - dry-run; do nothing, just display what is going to happen on a real run
# -v - verbose output; print out what is being backed up
#
# set to your rsync location
# The following commands will download and compile the latest nginx
# from source with the Pagespeed and Cache Purge modules on CentOS 6.5 i386
# I will make this into an executable script when I have the chance.
# This was on a fresh install of CentOS. You might have problems if you try it with an existing nginx install
# Make directories for building
mkdir -p $HOME/build/nginx-modules
cd $HOME/build
# Download dependencies for this script
# Install dependencies
#
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
apt-get install git checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \
mkdir -p ~/sources/ && \
# Compile against OpenSSL to enable NPN
# Run me with:
#
# $ nginx -p /path/to/this/file/ -c nginx.conf
#
# All requests are then routed to authenticated user's index, so
#
# GET http://user:password@localhost:8080/_search?q=*
#
# is rewritten to:
#