Skip to content

Instantly share code, notes, and snippets.

{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "(SO0006-CloudFront) - AWS WAF Security Automations v2.1: This AWS CloudFormation template helps you provision the AWS WAF Security Automations stack without worrying about creating and configuring the underlying AWS infrastructure. **WARNING** This template creates an AWS Lambda function, an AWS WAF Web ACL, an Amazon S3 bucket, and an Amazon CloudWatch custom metric. You will be billed for the AWS resources used if you create a stack from this template. **NOTICE** Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Amazon Software License (the License). You may not use this file except in compliance with the License. A copy of the License is located at http://aws.amazon.com/asl/ or in the license file accompanying this file. This file is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
#!/bin/bash
#==============================================================================
# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License"). You may not use
# this file except in compliance with the License. A copy of the License is
# located at
#
# http://aws.amazon.com/asl/
#
{
"schemaVersion": "2.2",
"description": "Scans for or installs patches from a patch baseline to a Linux or Windows operating system.",
"parameters": {
"Operation": {
"type": "String",
"description": "(Required) The update or configuration to perform on the instance. The system checks if patches specified in the patch baseline are installed on the instance. The install operation installs patches missing from the baseline.",
"allowedValues": [
"Scan",
"Install"

Prerequisites

The generated SDK depends on the AWS Mobile SDK for iOS. There are three ways to import it into your project:

  • CocoaPods
  • Frameworks
  • Carthage

You should use one of these two ways to import the AWS Mobile SDK but not both. Importing both ways loads two copies of the SDK into the project and causes compiler errors.

This ObjC package is automatically generated by the Swagger Codegen project:

  • API version:
  • Package version:
  • Build date:
  • Build package:
def get(array, target)
i = 0
j = i + 1
while i < array.length - 1 do
while j < array.length do
sum = array[i] + array[j]
return "index1 = #{i} , index2 = #{j}" if sum == target
j += 1
end
# O(n)
def binarytree(array, target)
right = array[0]
left = array[array.length - 1]
while right != left do
sum = right + left
return "find" if sum == target
if sum > target
left = left - 1
var im = require('imagemagick');
var fs = require('fs');
var postProcessResource = function(resource, fn) {
var ret = null;
if (resource) {
if (fn) {
ret = fn(resource);
}
// Load the SDK and UUID
var AWS = require('aws-sdk');
AWS.config.update({region: 'ap-northeast-1'})
// Create an S3 client
//var s3 = new AWS.S3();
var ec2 = new AWS.EC2();
ec2.describeInstances({}, function(err, data) {
if (err) console.log(err, err.stack);
else {
var https = require('https');
var zlib = require('zlib');
var crypto = require('crypto');
var endpoint = 'search-elb-accesslog-aaaaaaaaaaa.ap-northeast-1.es.amazonaws.com';
exports.handler = function(input, context) {
// decode input from base64
var zippedInput = new Buffer(input.awslogs.data, 'base64');