Skip to content

Instantly share code, notes, and snippets.

# the man page for tmutil
man tmutil
# calculate drift on backups (cpu / io intensive)
tmutil calculatedrift backup_folder
# list backups
tmutil listbackups
# set backup destination
# the man page for tmutil
man tmutil
# calculate drift on backups (cpu / io intensive)
tmutil calculatedrift backup_folder
# list backups
tmutil listbackups
# set backup destination
@chrisbranson
chrisbranson / gke_deploy.sh
Created April 30, 2020 07:59 — forked from archonic/gke_deploy.sh
Google Kubernetes Engine (GKE) Rails deploy script
# gke_deploy.sh
# Make sure we're in the right project and authenticated
gcloud config set project your-project
# Needed this on first run https://github.com/kubernetes/kubernetes/issues/30617
# gcloud config set container/use_client_certificate True
# Regional cheaper than zonal and acceptable for staging
gcloud container clusters get-credentials staging \
--zone northamerica-northeast1-a --project your-project
@chrisbranson
chrisbranson / rvm-amazon-linux.bash
Last active February 13, 2018 11:07 — forked from kainam00/rvm-amazon-linux.bash
Install RVM on Amazon Linux
#!/bin/bash
# Install prerequisites
yum install -y gcc openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel ruby-devel gcc-c++ jq git
# Import key
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
# Install RVM
curl -sSL https://get.rvm.io | bash -s stable --ruby
module DefaultValues
def has_default_values(default_values = {})
cattr_accessor :default_values
self.default_values = default_values
after_initialize :assign_default_values
include InstanceMethods

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:
#!/bin/bash
# Script to backup git repo to S3
# Set bucket, dir, password and account to use for the backup. I keep mine in local env vars
# These are set by localrc which lives on an encrypted home directory and is executed by my bashrc
bucket=$GITHUB_BACKUP_BUCKET
dir=$GITHUB_BACKUP_DIR
password=$GITHUB_BACKUP_PASSWORD
account=$GITHUB_ACCOUNT
@chrisbranson
chrisbranson / main.cs
Created October 4, 2011 07:56
Xibless Monotouch example
using System;
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace XibLess
{
public class Application
{
@chrisbranson
chrisbranson / maps.cs
Created September 8, 2011 13:13 — forked from anonymous/maps.cs
map annotations
using System;
using MonoTouch.UIKit;
using MonoTouch.Dialog;
using MonoTouch.CoreLocation;
using System.Threading;
using MonoTouch.CoreFoundation;
using MonoTouch.Foundation;
using MonoTouch.MapKit;
using System.Drawing;
using System.Collections.Generic;