Skip to content

Instantly share code, notes, and snippets.

@ffabreti
ffabreti / pg_extract.sh
Created August 7, 2018 11:09 — forked from brock/pg_extract.sh
Extract all databases (or one by name) from a sql file created by pg_dumpall
#!/bin/bash
# extract all postgres databases from a sql file created by pg_dumpall
# this script outputs one .sql file for each database in the original .sql file
# unless you pass the name of a database in the dump
if [ $# -lt 1 ]
then
echo "Usage: $0 <postgresql sql dump> [dbname]" >&2
exit 1
fi
@ffabreti
ffabreti / install-redis.sh
Last active April 6, 2016 01:57 — forked from four43/install-redis.sh
Install Redis
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://gist.githubusercontent.com/ffabreti/0512fb5705926ae7f5ee34536a0e28db/raw/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
function die {