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
# encoding : utf-8 | |
require 'openssl' | |
require 'digest/sha1' | |
require 'base64' | |
module Aws | |
extend self | |
def signed_url(path, expire_date) | |
digest = OpenSSL::Digest::Digest.new('sha1') | |
can_string = "GET\n\n\n#{expire_date}\n/#{S3_BUCKET}/#{path}" |
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
## | |
# Validates a URL | |
# | |
# If the URI library can parse the value, and the scheme is valid | |
# then we assume the url is valid | |
# | |
require 'addressable/uri' | |
require 'net/http' |
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
#!/bin/bash | |
# Export some ENV variables so you don't have to type anything | |
export AWS_ACCESS_KEY_ID=<your-access-key-id> | |
export AWS_SECRET_ACCESS_KEY=<your-secret-access-key> | |
export PASSPHRASE=<your-gpg-passphrase> | |
GPG_KEY=<your-gpg-key> | |
# The source of your backup, by default the home directory | |
SOURCE=$HOME |
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
# coding: utf-8 | |
require 'rubygems' | |
require 'hpricot' | |
require 'fileutils' | |
require 'time' | |
require 'ya2yaml' | |
require 'nokogiri' | |
require 'cgi' |