This file contains hidden or 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
# Copy it to fnordmetric directory and run with | |
# bundle exec ruby -Ilib populate.rb live | |
require "securerandom" | |
require "socket" | |
require "json" | |
class User < Struct.new :username, :avatar | |
def session_id | |
"session_#{username}" |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
## | |
# @example | |
# ruby -rubygems `__FILE__` `source_bucket_name` `target_bucket_name` | |
# | |
# @author @ipoval | |
# | |
# @see https://github.com/ipoval |
This file contains hidden or 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 | |
BACKUP_DIR='/backups/S3 Mirror/' | |
BUCKETS=$(s3cmd ls | grep s3 | awk '{ print $3 }') | |
for i in $BUCKETS; do | |
CURRENT_DIR=$BACKUP_DIR${i//s3:\/\//} | |
echo Mirroring $i to $CURRENT_DIR | |
mkdir -p "$CURRENT_DIR" | |
s3cmd sync $i "$CURRENT_DIR" |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'chef' | |
require 'chef/client' | |
require 'chef/run_context' | |
Chef::Config[:solo] = true | |
Chef::Config[:log_level] = :info | |
Chef::Log.level(:info) |
This file contains hidden or 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
from boto.cloudfront import CloudFrontConnection | |
def update_default_root_object(searched_origin, aws_access_key_id, aws_secret_access_key, default_root_object='index.html'): | |
""" sets default_root_object of an aws cloud front distribution | |
for futher information checkout http://boto.s3.amazonaws.com/ref/cloudfront.html | |
or http://github.com/boto/boto/tree/master/boto/cloudfront | |
""" | |
connection = CloudFrontConnection(aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key) |
NewerOlder