Skip to content

Instantly share code, notes, and snippets.

Avatar

Takumi Sakamoto takus

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am takus on github.
  • I am takus (https://keybase.io/takus) on keybase.
  • I have a public key ASDcc39Zy8aSz1G8JQhpgJVMgKfe2Ee0ZCR2nuVgOX70Ago

To claim this, I am signing this object:

@takus
takus / ic.coffee
Created Jul 5, 2016
Manage incidents with Incident Commandar System.
View ic.coffee
# 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
EXPOSE 5000
CMD ["plackup", "-p", "5000", "-s", "Starlet", "--max-workers=8", "/oversleep.psgi"]
@takus
takus / fluent.conf
Created Jun 1, 2016
Configuration for monitoring Fluentd by Datadog
View fluent.conf
<match smartnews.user_activity>
type copy
<store>
type flowcounter
count_keys *
unit second
aggregate all
tag fluentd.flowcounter.smartnews.user_activity
@label @dogstatsd
</store>
View td-agent.conf
<source>
type forward
port 24224
</source>
<source>
type monitor_agent
port 24220
</source>
@takus
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
takus / c_trace.txt
Last active Aug 29, 2015
fluent-plugin-dd
View c_trace.txt
#0 0x00007f703ffeb956 in ppoll () from /lib64/libc.so.6
#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
takus / mysql.yml
Last active Aug 29, 2015
embulk error
View mysql.yml
in:
type: mysql
user: xxxx
password: xxxx
database: xxxx
host: xxxx
select: "*"
table: "test"
out:
View emr.sh
#!/bin/sh
JOB_FLOW_ID=`mrjob create-job-flow`
for n in `seq 1 ${LOOP_NUMBER}`
do
python ${MRJOB_SCRIPT} -r emr --conf-path emr.conf --emr-job-flow-id=${JOB_FLOW_ID} ${MRJOB_OPTION} ${INPUT_DIR} > ${OUTPUT_FILE}
done
mrjob terminate-job-flow ${JOB_FLOW_ID}
@takus
takus / fluentd.py
Last active Aug 29, 2015
Fluentd check for Datadog (https://app.datadoghq.com)
View fluentd.py
# stdlib
import re
import urllib2
import urlparse
# project
from util import headers
from checks import AgentCheck
from checks.utils import add_basic_auth
You can’t perform that action at this time.