Skip to content

Instantly share code, notes, and snippets.

View manabusakai's full-sized avatar

Manabu Sakai manabusakai

View GitHub Profile
import jsdom from "jsdom";
const { JSDOM } = jsdom;
(() => {
const virtualConsole = new jsdom.VirtualConsole();
virtualConsole.sendTo(console, {
omitJSDOMErrors: true
});
const url = process.argv[2];
#!/bin/bash
usage() {
echo "Usage: $(basename $0) -n NAMESPACE -d DEPLOYMENT" 1>&2
exit 1
}
while getopts n:d: opt
do
case $opt in
import json
import os
import urllib.request
def format_message(data):
severity_level = get_severity_level(data['detail']['severity'])
payload = {
'username': 'GuardDuty Finding',
'icon_emoji': ':guardduty:',
'text': '{} GuardDuty Finding in {}'.format(severity_level['mention'], data['detail']['region']),
version: 0.2
env:
variables:
GO_VERSION: 1.9.2
SRC_DIR: src/github.com/manabusakai/aws-billing
phases:
install:
commands:
@manabusakai
manabusakai / event_handler.sh
Last active January 2, 2016 06:49
kentaro/serf-hosts の Shell Script 版。本家はこっちです → https://github.com/kentaro/serf-hosts
#!/bin/sh
hosts='/etc/hosts'
event=${SERF_EVENT}
read member
name=`echo ${member} | cut -d ' ' -f 1`
addr=`echo ${member} | cut -d ' ' -f 2`
role=`echo ${member} | cut -d ' ' -f 3`