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
<?php | |
ob_start(); | |
require_once(dirname(dirname(__FILE__)).'/twentytwelve/index.php'); | |
header('Content-Length: '.ob_get_length()); | |
ob_end_flush(); |
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
'use strict'; | |
module.exports.hello = (event, context, callback) => { | |
const https = require('https'); | |
const querystring = require('querystring'); | |
const typetalk_talken = process.env.TYPETALK_TOKEN; | |
const typetalk_room = process.env.TYPETALK_ROOM; | |
const options = { | |
hostname: 'typetalk.in', |
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
## IAM Instance Profile | |
resource "aws_iam_instance_profile" "instance_role" { | |
name = "instance_role" | |
role = "${aws_iam_role.instance_role.name}" | |
} | |
## SSH Key | |
resource "aws_key_pair" "deployer" { | |
key_name = "${var.project}" | |
public_key = "${var.ssh_public_key}" |
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
$ npm -g install aws-sdk |
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
var stripe = require('stripe')('STRIPE_API_KEY_HERE'); | |
var userData = {ID: '', email: 'customer@example.com'}; | |
// stripe customer の存在チェック | |
stripe.customers.retrieve(userData.id, function(err, customer) { | |
if (!customer || customer.deleted) { | |
// stripe customer が存在しない時は stripe にcustomerを登録 | |
var params = { | |
email: userData.email | |
}; |
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
#!/bin/bash | |
LANG=C | |
REPOSITORIES="__YUM_REPOSITORIES_HERE__" | |
TOP="__REPOSITORY_DIRECTORY_HERE__" | |
S3_REGION="__S3_REGION__HERE__" | |
S3_BUCKET="__S3_BUCKET_NAME_HERE__" | |
CF_DISTID="__CLOUDFRONT_DISTRIBUTION_ID_HERE__" | |
echo "## `date`: BEGIN MIRRORING" | |
for repository in $REPOSITORIES; do |
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
SetEnvIf CloudFront-Forwarded-Proto "https" HTTPS | |
RequestHeader set X-Forwarded-Proto "https" env=HTTPS |
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
letsencrypt renew --renew-hook '/root/bin/upload-cert.sh' |
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
/* | |
Name: Email Forwarder | |
*/ | |
exports.handler = function(event, context) { | |
var slackConfig = { | |
hostname: "hooks.slack.com", | |
path: "/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX", | |
channel: "#channel", | |
icon_emoji: ":ses:", | |
color: "good" |
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
console.log('Loading event'); | |
var aws = require('aws-sdk'); | |
var s3 = new aws.S3({apiVersion: '2006-03-01'}); | |
exports.handler = function(event, context) { | |
console.log('Received event:'); | |
console.log(JSON.stringify(event, null, ' ')); | |
// Get the object from the event and show its content type | |
var bucket = event.Records[0].s3.bucket.name; | |
var key = event.Records[0].s3.object.key; |