Skip to content

Instantly share code, notes, and snippets.

View brock's full-sized avatar
😎

Brock Angelo brock

😎
View GitHub Profile
@brock
brock / clearS3Bucket.rb
Created November 8, 2012 02:23
Delete all files in s3 bucket
# Credit to MattLor
# http://stackoverflow.com/questions/27267/delete-amazon-s3-buckets
require 'aws/s3'
AWS::S3::Base.establish_connection!(
:access_key_id => 'your access key',
:secret_access_key => 'your secret key'
)
@brock
brock / upload.rb
Created November 7, 2012 19:48 — forked from thechrisoshow/upload.rb
This script uploads files to a S3 bucket
require 'rubygems'
require 'aws/s3'
# Change the access key and secret to your amazon credentials
AWS::S3::Base.establish_connection!(
:access_key_id => 'ACCESS_KEY_ID',
:secret_access_key => 'SECRET'
)
# Change this to your S3 bucket name
WEBSITE_BUCKET_NAME = "YOUR_BUCKET_NAME"
@brock
brock / export_db.sh
Created September 20, 2012 01:03
Export DB, gzip and domain replacement.
#!/bin/bash
USER=""
PASSWORD=""
if [ -z $1 ]; then
echo -e "ERROR: No database name. Usage: export_db DATABASE_NAME"
exit;
fi
DB=$1
@brock
brock / backup_all_dbs.sh
Created September 20, 2012 01:03
Backup All DB's and transfer to S3 with s3cmd
#!/bin/bash
BACKUP_DIR="~/db_backups"
DBUSER=""
DBPASSWORD=""
BUCKET=""
FROM='"Backups" <backups@localhost>'
TO='"Admin" <admin@localhost>'
SUBJECT='Backup Log'