Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "Create an EC2 instance, set up Apache, and create Route53 A records", | |
"Parameters" : { | |
"KeyName" : { | |
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances", | |
"Type" : "String", |
#!/bin/bash | |
# | |
# terraform-app | |
# | |
# This to terraform the servers for the Galleon App | |
# By storing the date now, we can calculate the duration of provisioning at the | |
# end of this script. | |
start_seconds="$(date +%s)" |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
require 'redis' | |
REDIS = Redis.new( url: "..." ) | |
def each_keys_chunk( pattern = nil, &block ) | |
opts = { count: 100 } | |
opts[:match] = pattern if pattern | |
cursor = 0 | |
loop do | |
cursor, keys = REDIS.scan( cursor, opts ) |
$redis = Redis.new | |
class SafeListDelete | |
@queue = :garbage_collection | |
BATCH_SIZE = 100 | |
# Rename the key and queue for deletion | |
def self.delete(key) | |
newkey = "gc:lists:#{$redis.incr("gc:index")}" |
#!/bin/bash | |
# | |
# consul Manage the consul agent | |
# | |
# chkconfig: 2345 95 95 | |
# description: Consul is a tool for service discovery and configuration | |
# processname: consul | |
# config: /etc/consul.conf | |
# pidfile: /var/run/consul.pid |
#!/bin/bash | |
# | |
# git-mv-with-history -- move/rename file or folder, with history. | |
# | |
# Moving a file in git doesn't track history, so the purpose of this | |
# utility is best explained from the kernel wiki: | |
# | |
# Git has a rename command git mv, but that is just for convenience. | |
# The effect is indistinguishable from removing the file and adding another | |
# with different name and the same content. |
(function () { | |
rcversion = '1.0'; | |
load('underscore.min.js') | |
// NOTES | |
// Basics, wrap the whole thing in a function | |
// Set a version for sanity's sake | |
// Load underscore, a must in any javascript environment |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "Create an EC2 instance, set up Apache, and create Route53 A records", | |
"Parameters" : { | |
"KeyName" : { | |
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances", | |
"Type" : "String", |