Skip to content

Instantly share code, notes, and snippets.

View bparanj's full-sized avatar

Bala Paranj bparanj

View GitHub Profile
@hartfordfive
hartfordfive / verify_s3_file.rb
Created November 1, 2016 17:47
Check if file exists in S3 bucket with Ruby aws-sdk gem
require 'aws-sdk'
s3 = Aws::S3::Resource.new(
region: 'us-east-1',
credentials: Aws::InstanceProfileCredentials.new()
)
bucket = s3.bucket('my-daily-backups')
file = (DateTime.now).strftime("%Y.%m.%d-backup")
if bucket.object(file).exists?
@mm53bar
mm53bar / Gemfile
Created March 26, 2012 18:41
Automagically launch an EC2 image and then provision it using sunzi
source 'http://rubygems.org'
gem 'sunzi'
gem 'rake'
gem 'fog'