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 'net/http' | |
require 'sham_rack' | |
require 'excon' | |
class Middleware | |
def initialize(app) | |
@app = app | |
end | |
def call(env) |
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 'fb_graph' | |
require 'webmock' | |
require 'dotenv' | |
require 'nenv' | |
include WebMock::API | |
Dotenv.load | |
class MyRackApp | |
def call(env) |
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 'webmock' | |
require 'httpclient' | |
require 'excon' | |
require 'net/http' | |
module Mock | |
include WebMock::API | |
WebMock.allow_net_connect! | |
extend self |
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
user nobody; | |
worker_processes 4; | |
error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; | |
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 boto3 | |
from datetime import datetime | |
def lambda_handler(event, context): | |
AWS_REGION = "ap-northeast-1" | |
INSPECTOR_TEMPLATE_ARN = "arn:aws:inspector:ap-northeast-1:************:target/**********/template/**********" | |
INSPECTOR_RUN_NAME = "RUN-" + datetime.now().strftime("%Y%m%d%H%M") | |
client = boto3.client('inspector', region_name=AWS_REGION) | |
response = client.start_assessment_run( |
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
# -*- coding: utf-8 -*- | |
import boto3 | |
from datetime import datetime | |
import json | |
AWS_REGION = "ap-northeast-1" | |
INSPECTOR_TEMPLATE_ARN = "arn:aws:inspector:ap-northeast-1:************:target/**********/template/**********" | |
S3_BUCKET_NAME = "inspector" |
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
# -*- coding: utf-8 -*- | |
import boto3 | |
import json | |
import base64 | |
import urllib | |
import urllib2 | |
import pdb | |
## lambdaへアップロードする前に書き換えて下さい |
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
def hoge | |
"hogehoge" | |
end | |
hoge #=> "hogehoge" |
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
# grep | |
git grep -e 'hoge' -e 'fuga' | |
git grep -- ':!node_modules/' | |
# cherry-pick | |
git cherry-pick COMMIT_ID | |
git cherry-pick -m 1 MERGE_COMMIT_ID | |
git cherry-pick COMMIT_ID_A..COMMIT_ID_B # Aは該当IDの一つ前 | |
# create branch from tag |
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
jq -r .foo hoge.json # 出力の""を削除 | |
jq '.foo."bar/baz"' # /を含むキーをクエリ | |
jq '. | keys' hoge.json # キーを取得 | |
jq '.bar[] | select(.name=="baz")' hoge.json # 検索 |
OlderNewer