Skip to content

Instantly share code, notes, and snippets.

@elithrar
elithrar / wale_postgres_recovery.md
Last active May 3, 2021 15:38
WAL-E + Postgres 9.x (single server + DB) Setup and Recovery

A quick "how to" on what you need to do to both setup AND recover a single-server PostgreSQL database using WAL-E

  • WAL-E: https://github.com/wal-e/wal-e
  • Assuming Ubuntu 12.04 LTS ("Precise")
  • We'll be using S3. Make sure you have an IAM in a group with GetObject, ListBucket and PutObject on the bucket you want to use (and that it's not public).

Setup:

  1. These packages:
@mrflip
mrflip / RUNME-demo_of_async_fibers.log
Created April 25, 2011 20:57
A fully-commented demo showing execution flow in the fibers+eventmachine => linear asynchronous code pattern
>> load './RUNME-demo_of_async_fibers.rb'
/Users/flip/ics/backend/son_of_a_batch/RUNME-demo_of_async_fibers.rb:4: warning: already initialized constant FIBER_IDXS
814e5e90 0 f_0 beg main top level
814e5e90 1 f_0 beg em setup this block sets up the eventmachine execution, but no execution-order shenanigans yet
814e5e90 2 f_0 beg fiber stp the end-the-reactor block won't be called for 1.5s, so we get here immediately.
814e5e90 3 f_0 end fiber stp nothing from inside the Fiber.new{} block has run yet.
814e5e90 4 f_0 end fiber stp kick off the fiber...
80d829a0 5 f_1 beg fiber when my_fiber.resume is called, this runs. Now in a new fiber
80d829a0 6 f_1 beg get_result get_result is called from within fiber_1
80d829a0 7 f_1 setup callback set up some code to run 1.5s from now