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
import cf from 'cloudfront'; | |
const kvsId = '<CloudFrontKeyValueStoreのID>'; | |
// This fails if the key value store is not associated with the function | |
const kvsHandle = cf.kvs(kvsId); | |
// async functionになるので注意! | |
async function handler(event) { | |
// CloudFrontから渡ってくるヘッダからホスト名取得 |
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'; | |
const { Mutex } = require( 'await-semaphore' ); | |
/** | |
* スリープ | |
*/ | |
const _sleep = ( waitSec ) => { | |
return new Promise( function ( resolve ) { | |
setTimeout( function () { resolve(); }, waitSec ); | |
} ); |
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
# | |
# この設定を有効化するには、mod_proxyとmod_proxy_httpが必要です。 | |
# | |
ProxyRequests Off | |
ProxyPreserveHost On | |
Listen 8000 | |
<VirtualHost *:8000> | |
ServerName example.com | |
ProxyPass / http://192.168.XXX.XXX:8000/ | |
# ポートベースのProxyなので、Reverseの設定は不要(転送前後でパスが変わらないので) |
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'; | |
const AWS = require( 'aws-sdk' ); | |
AWS.config.update( { region: 'ap-northeast-1' } ); | |
const ec2 = new AWS.EC2(); | |
const moment = require( 'moment-timezone' ); | |
/** | |
* 起動しているEC2インスタンスIDを返します。 | |
*/ |
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'; | |
/** | |
* 指定した秒数ウエイトします。 | |
* @param {number} waitSec 秒数(ms) | |
*/ | |
const _sleep = ( waitSec ) => { | |
return new Promise( function ( resolve ) { | |
setTimeout( function () { resolve(); }, waitSec ); | |
} ); |
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
# frozen_string_literal: true | |
source "https://rubygems.org" | |
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | |
# gem "rails" | |
gem 'aws-sdk', '~> 3' | |
gem "activesupport" |
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
# Setting for job sequence. | |
# List up for jpb groups. | |
stages: | |
- check_version | |
- test | |
# Jobs | |
testjob: | |
stage: test |
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 | |
# | |
# Cronで動かすときはPATHを設定すること。 | |
# 例:)PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
get_contenner_service_name(){ | |
echo $1 | cut -d"_" -f2- | rev | cut -c 3- | rev | |
} | |
mysql_contenner_backup(){ | |
target_contenner=$1 |
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
version: '2' | |
volumes: | |
knowledge_pgsql_data: | |
driver: local | |
knowledge_data: | |
driver: local | |
services: | |
# knowledge_pgsql | |
knowledge_pgsql: | |
restart: always |
NewerOlder