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
function updateOriginRequest(request) { | |
request.origin = { | |
custom: { | |
domainName: 'some-domain.example.com', // this is the origin where you want to route the request | |
port: 80, // or 443 | |
protocol: 'http', // http or https | |
path: '/some-path', // path of the reqest | |
sslProtocols: ['TLSv1', 'TLSv1.1'], // and any other protocols supported by cloudfront | |
readTimeout: 10, //readTimeout in seconds, | |
keepaliveTimeout: 60, // in seconds |
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
query { | |
__schema { | |
types { | |
name | |
fields { | |
name | |
} | |
} | |
} | |
} |
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
class SimpleQueue | |
attr_accessor :queue | |
def initialize | |
@queue = [] | |
end | |
def enqueue obj | |
queue << obj | |
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
Parameters: | |
AppLoadbalancerSslCertArn: | |
Description: SSL certificate for Application load balancer | |
Default: arn:aws:acm:<region>:<account-id>:certificate/<cert-id> | |
Type: String | |
AppCloudfrontSslCertArn: | |
Description: SSL certificate for Cloudfront Asset | |
Default: arn:aws:acm:<region>:<account-id>:certificate/<cert-id> | |
Type: String | |
AppName: |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> | |
<CORSRule> | |
… | |
<AllowedOrigin>https://*</AllowedOrigin> | |
<AllowedOrigin>http://*</AllowedOrigin> | |
… | |
</CORSRule> | |
</CORSConfiguration> |
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
SERVICES=`aws ecs list-services --cluster ABCD` | |
CLUSTER="ABCD" | |
ruby <<EOM | |
require "open3" | |
ecs_service_name = 'abcd-ecs-service-stack-ABCDApplication-XXXXXXXXXXXXX' | |
puts ecs_service_name | |
# sleep 2 | |
task_definition = Open3.popen3("aws ecs describe-services --cluster $CLUSTER --services #{ecs_service_name} --query services[*].taskDefinition --output text"){ |i, o| p o.read } | |
puts "task_definition: #{task_definition}" |
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 'csv' | |
valid_rows = 0 | |
invalid_rows = 0 | |
error_file = File.open("/path/to/invalid.csv", "w") | |
correct_file = File.open("path/to/valid.csv", "a+") | |
File.open("path/to/original.csv").each do |line| | |
begin | |
print "." | |
if CSV.parse_line(line) |
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
All Indices: | |
| eventcount summarize=false index=* index=_* | dedup index | fields index | |
Groupe by source type: | |
| tstats values(sourcetype) where index=* group by index |
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
# 2.2.2 :037 > gzip = 'Hi and hello' | |
# => "Hi and hello" | |
# 2.2.2 :038 > gzip.bytes[0..1] | |
# => [72, 105] | |
# 2.2.2 :039 > gzip.bytes[0..1] == [31,139] | |
# => false | |
# 2.2.2 :040 > gzip = ActiveSupport::Gzip.compress('what is this compress me!') | |
# => "\x1F\x8B\b\x00\x19\x11\x91W\x00\x03+\xCFH,Q\xC8,V(\xC9\x00\x12\xC9\xF9\xB9\x05E\xA9\xC5\xC5\n\xB9\xA9\x8A\x00\x14\x84\x90'\x19\x00\x00\x00" | |
# 2.2.2 :041 > gzip.bytes[0..1] | |
# => [31, 139] |
NewerOlder