Skip to content

Instantly share code, notes, and snippets.

Takumi Sakamoto takus

Block or report user

Report or block takus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
takus /
Created Jul 5, 2016
Manage incidents with Incident Commandar System.
# Description:
# Manage incidents with Incident Commandar System.
# Commands:
# bot 110 ic me - Start an incident management and assign 'me' as the Incident Commandar
moment = require('moment')
module.exports = (robot) ->
robot.respond /110 ic me/i, (res) ->
View Dockerfile
FROM perl:latest
RUN cpanm install Starlet
ADD oversleep.psgi /oversleep.psgi
CMD ["plackup", "-p", "5000", "-s", "Starlet", "--max-workers=8", "/oversleep.psgi"]
takus / fluent.conf
Created Jun 1, 2016
Configuration for monitoring Fluentd by Datadog
View fluent.conf
<match smartnews.user_activity>
type copy
type flowcounter
count_keys *
unit second
aggregate all
tag fluentd.flowcounter.smartnews.user_activity
@label @dogstatsd
View td-agent.conf
type forward
port 24224
type monitor_agent
port 24220
takus / riaudit.rb
Last active Sep 17, 2015 — forked from cognusion/riaudit.rb
Simple script to audit AWS EC2 Reserved Instances vs Instances running.
View riaudit.rb
#!/usr/bin/env ruby
# Audits your reserved instances vs your running instances, and reports back.
# If you want to run this from an AWS instance, its IAM Role must be granted at least the following:
# "Statement": [
# {
# "Action": [
# "ec2:DescribeInstances",
takus / c_trace.txt
Last active Aug 29, 2015
View c_trace.txt
#0 0x00007f703ffeb956 in ppoll () from /lib64/
#1 0x00000000004f7d53 in rb_wait_for_single_fd (fd=<optimized out>, events=1, tv=<optimized out>) at thread.c:2862
#2 0x0000000000428a41 in rb_io_wait_readable (f=19) at io.c:907
#3 0x00007f70355be307 in ossl_start_ssl (self=140119728098360, func=0x7f70353891e0 <SSL_connect>, funcname=0x7f70355df60b "SSL_connect", nonblock=0)
at ossl_ssl.c:1146
#4 0x00000000004e4edf in vm_call_cfunc (me=<optimized out>, blockptr=<optimized out>, recv=<optimized out>, num=<optimized out>, reg_cfp=<optimized out>,
th=<optimized out>) at vm_insnhelper.c:404
#5 vm_call_method (th=0x7f702ed6d400, cfp=0x7f702d605818, num=0, blockptr=0x1, flag=0, id=20640, me=0x7f7035c11ae0, recv=140119728098360) at vm_insnhelper.c:530
#6 0x00000000004e7ad0 in vm_exec_core (th=0x7f702ed6d400, initial=<optimized out>) at insns.def:1018
#7 0x00000000004ec706 in vm_exec (th=0x7f702ed6d400) at vm.c:1236
takus / mysql.yml
Last active Aug 29, 2015
embulk error
View mysql.yml
type: mysql
user: xxxx
password: xxxx
database: xxxx
host: xxxx
select: "*"
table: "test"
JOB_FLOW_ID=`mrjob create-job-flow`
for n in `seq 1 ${LOOP_NUMBER}`
python ${MRJOB_SCRIPT} -r emr --conf-path emr.conf --emr-job-flow-id=${JOB_FLOW_ID} ${MRJOB_OPTION} ${INPUT_DIR} > ${OUTPUT_FILE}
mrjob terminate-job-flow ${JOB_FLOW_ID}
takus /
Last active Aug 29, 2015
Fluentd check for Datadog (
# stdlib
import re
import urllib2
import urlparse
# project
from util import headers
from checks import AgentCheck
from checks.utils import add_basic_auth
takus /
Last active Aug 29, 2015
mrjob's unit test example
from mrjob.job import MRJob
from mrjob.step import MRStep
class MRCountingJob(MRJob):
def __init__(self, *args, **kwargs):
super(MRCountingJob, self).__init__(*args, **kwargs)
def steps(self):
# 3 steps so we can check behavior of counters for multiple steps
You can’t perform that action at this time.