Skip to content

Instantly share code, notes, and snippets.

@medington
medington / rsync_clonedir
Last active December 28, 2015 14:28 — forked from necolas/rsync_backup
Script to clone / backup a directory excluding certain files that may not be of interest for pure archival backups that aren't intended to serve as full fidelity backups of the original.
#!/bin/sh
# Script to clone / backup a directory using rsync excluding certain files that may not be of
# interest for pure archival backups that aren't intended be full fidelity. The intention is
# that the exclude file will be populated with cached data or uninteresting metadata.
# Use sudo to call this script if you need to copy directories where you don't have permissions.
# rsync options:
# -a archive mode; equals -rlptgoD (no -H,-A,-X)
# -x don't cross device boundaries (ignore mounted volumes)
@medington
medington / nginx.conf
Created July 12, 2017 12:32 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@medington
medington / ramdisk.sh
Created July 16, 2017 21:08 — forked from rxin/ramdisk.sh
ramdisk create/delete on Mac OS X.
#!/bin/bash
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/
#
ARGS=2
E_BADARGS=99
if [ $# -ne $ARGS ] # correct number of arguments to the script;
then