Skip to content

Instantly share code, notes, and snippets.

@ijin
ijin / gist:e48c8d8ebad157929bd2
Created June 18, 2014 09:35
Vagrantfile for td-agent
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.require_version ">= 1.5.0"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.hostname = 'td-agent'
@ijin
ijin / gist:91e19e2f6e2cf4ba88e8
Last active August 29, 2015 14:03
kitchen test for omnibus td-agent on Ubuntu 14.04
make[2]: Leaving directory `/usr/local/src/ruby-2.1.2/ext/sdbm'
make[2]: Entering directory `/usr/local/src/ruby-2.1.2/ext/socket'
linking shared-object socket.so
installing default socket libraries
make[2]: Leaving directory `/usr/local/src/ruby-2.1.2/ext/socket'
make[2]: Entering directory `/usr/local/src/ruby-2.1.2/ext/stringio'
installing default stringio libraries
make[2]: Leaving directory `/usr/local/src/ruby-2.1.2/ext/stringio'
make[2]: Entering directory `/usr/local/src/ruby-2.1.2/ext/strscan'
installing default strscan libraries
@ijin
ijin / ngx
Last active August 29, 2015 14:06 — forked from vdel26/nginx
#!/bin/sh
#
# chkconfig: 2345 55 25
# Description: Nginx init.d script, put in /etc/init.d, chmod +x /etc/init.d/nginx
# For Debian, run: update-rc.d -f nginx defaults
# For CentOS, run: chkconfig --add nginx
#
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
@ijin
ijin / my.cnf
Created March 31, 2015 04:20
svfes2 my.cnf
[mysqld]
datadir=/fioa/mysql
user=mysql
max_connections = 1000
thread_cache_size = 1000
sort_buffer_size=2M
#innodb_buffer_pool_size = 27G
#innodb_buffer_pool_size = 27000M
innodb_buffer_pool_size = 28150M
@ijin
ijin / makeASUnhealty.js
Created April 17, 2015 01:17
makeASUnhealty
var aws = require('aws-sdk');
aws.config.update({region: 'ap-northeast-1'});
var s3 = new aws.S3({apiVersion: '2006-03-01'});
var autoscaling = new aws.AutoScaling({apiVersion: '2011-01-01'});
exports.handler = function(event, context) {
console.log('Received event:', JSON.stringify(event, null, 2));
var message = JSON.parse(event.Records[0].Sns.Message);
if (message.NewStateValue === 'ALARM') {
@ijin
ijin / ubuntu_images_hvm-ssd_ubuntu-trusty-14.04-amd64-server-20150325.json
Last active August 29, 2015 14:20
aws ec2 describe-images --image-ids ami-e74b60e6 --region ap-northeast-1
{
"Images": [
{
"VirtualizationType": "hvm",
"Name": "ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-20140927",
"Hypervisor": "xen",
"SriovNetSupport": "simple",
"ImageId": "ami-e74b60e6",
"State": "available",
"BlockDeviceMappings": [
@ijin
ijin / pre-push
Last active August 29, 2015 14:22
prevent pushing to master or deploy branch using git hooks
#!/bin/bash
RED=`tput setaf 1`
RESET=`tput sgr0`
while read local_ref local_sha1 remote_ref remote_sha1
do
if [[ "${remote_ref##refs/heads/}" =~ ^(master|deploy) ]]; then
echo "${RED}Do not push to ${remote_ref##refs/heads/} branch!!!${RESET}"
echo
@ijin
ijin / pullreq_from_master.png
Last active August 29, 2015 14:22
pull request
pull request from master
@ijin
ijin / george.jpg
Last active August 29, 2015 14:26
terraformer george
george.jpg
@ijin
ijin / github_sns_hook.json
Created August 11, 2015 17:05
github_sns_hook.json
{
"name": "amazonsns",
"events": [
"push"
],
"supported_events": [
"commit_comment",
"create",
"delete",
"deployment",