This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on Glacier's example: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/examples.html#Amazon_Glacier__Multi-part_Upload | |
var fs = require('fs'); | |
var AWS = require('aws-sdk'); | |
AWS.config.loadFromPath('./aws-config.json'); | |
var s3 = new AWS.S3(); | |
// File | |
var fileName = '5.pdf'; | |
var filePath = './' + fileName; | |
var fileKey = fileName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def login_user_programatically | |
# User or whatever the name of the model is that you're trying to authenticate | |
@request.env['devise.mapping'] = Devise.mappings[:user] | |
@resource = FactoryGirl.create(:confirmed_user) | |
# The following two lines are where the magic happens. | |
@auth_headers = @resource.create_new_auth_token | |
@request.headers.merge!(@auth_headers) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'aws' | |
AWS.config(:access_key_id => 'XXXXX', :secret_access_key => 'XXXXX') | |
pipeline_id = 'XXXXXXX' | |
preset_id = 'XXXXXX' | |
s3 = AWS::S3.new | |
bin = s3.buckets['XXXXXX-in'] | |
bout = s3.buckets['XXXXXX-out'] |