Skip to content

Instantly share code, notes, and snippets.

@nicerobot
Created October 17, 2012 16:22
Show Gist options
  • Save nicerobot/3906498 to your computer and use it in GitHub Desktop.
Save nicerobot/3906498 to your computer and use it in GitHub Desktop.
PostgreSQL OS X
#!/bin/sh
# curl -Lk https://gist.github.com/raw/3906498/db.sh | sh -s mydb myuser
db=${1:-mydb}; shift
us=${1:-auser}; shift
createdb ${db}
psql -d ${db}
createuser -s -e ${us}
#!/bin/sh
# curl -Lk https://gist.github.com/raw/3906498/install.sh | sh -s mydb [myuser]
brew install postgresql
curl -Lk https://gist.github.com/raw/3906498/root.sh | sudo sh
curl -Lk https://gist.github.com/raw/3906498/postgresql.sh | sudo -u _postgres sh -s ${1:-mydb} ${2:-${USER}}
#!/bin/sh
chmod 700 /var/postgres
initdb -D /var/postgres/data
pg_ctl -D /var/postgres/data -l /var/postgres/server.log start
tail /var/postgres/server.log
curl -Lk https://gist.github.com/raw/3906498/db.sh | sh -s ${1} ${2}
#!/bin/sh
mkdir /var/postgres
chown _postgres:_postgres /var/postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment