Skip to content

Instantly share code, notes, and snippets.

View hideokamoto's full-sized avatar

Hidetaka Okamoto hideokamoto

View GitHub Profile
<?php
/**
* kintone API Shortcode example
*
* License: GNU General Public License v2 or later
**/
add_shortcode ( 'building-list' , 'kintone_building_list');
function kintone_building_list( $atts ) {
$atts = shortcode_atts(
array(
import boto3
cognito = boto3.client('cognito-idp')
UserPoolId='YOUR_USERPOOL_ID'
def getUsers():
response = cognito.list_users(
UserPoolId=UserPoolId,
Filter="cognito:user_status='CONFIRMED'"
)
return response
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "This AWS CloudFormation template helps you provision the AWS WAF reputation list blocking Lambda function. It creates a WebACL, two Rules and two IPSets. If you wish, you can define more WAF Rules and IPSets and add the Rule IDs to the Input defined for the Lambda function. The Lambda function is executed using Amazon CloudWatch Events on a schedule to automate the update of the IPSets. 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 Apache License, Version 2.0 (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/apache2.0/ or in the license file accompanying this file. This file is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific la
#!/bin/bash
APIKEY=${1}
if [ "${APIKEY}" = "" ]; then
echo "Please set recruit api key"
exit 1
fi
AREA=${2}
if [ "${AREA}" = "" ]; then
echo "Please set search keyword"
exit 1
#!/bin/bash
APIKEY=${1}
if [ "${APIKEY}" = "" ]; then
echo "Please set recruit api key"
exit 1
fi
AREA=${2}
if [ "${AREA}" = "" ]; then
echo "Please set search keyword"
exit 1
#!/bin/bash -ex
tmp_json=`mktemp`
amimoto_json='/opt/local/amimoto-managed.json'
json='{"wordpress":{"jinkei_cf":"true"}}'
[ ! -e /opt/local ] && /bin/mkdir -p /opt/local
if [ -f $amimoto_json ]; then
hash jq || /usr/bin/yum install -y jq
/usr/bin/jq -s '.[0] * .[1]' $amimoto_json <(echo $json) > $tmp_json
provider "aws" {
region = "us-west-2"
profile = "YOUR_AWS_CLI_PROFILE"
}
resource "aws_cloudformation_stack" "network" {
name = "STACK_NAME"
parameters {
KeyName = "${aws_key_pair.deployer.id}",
SSHLocation = "0.0.0.0/0"
function buildSource(message, extractedFields) {
if (extractedFields) {
var source = {};
for (var key in extractedFields) {
if (extractedFields.hasOwnProperty(key) && extractedFields[key]) {
var value = extractedFields[key];
if (isNumeric(value)) {
source[key] = 1 * value;
// v1.1.2
var https = require('https');
var zlib = require('zlib');
var crypto = require('crypto');
var endpoint = 'YOUR_AMAZON_ELASTICSEARCH_SEARVICE_ENDPOINT.us-east-1.es.amazonaws.com';
exports.handler = function(input, context) {
// decode input from base64
var zippedInput = new Buffer(input.awslogs.data, 'base64');
@hideokamoto
hideokamoto / index.js
Created October 6, 2016 05:15
CloudFrontの設定を一括でアップデートするJavaScriptを書いてみた ref: http://qiita.com/motchi0214/items/872ef8c67587330dc0bb
var AWS = require('aws-sdk');
var conf = require('./config.js');
var cloudfront = new AWS.CloudFront({
apiVersion: '2016-09-07',
accessKeyId: AWS_ACCESS_KEY,
secretAccessKey: AWS_SECRET_KEY,
});
function updateCloudFrontDistribution( distribution ) {