Skip to content

Instantly share code, notes, and snippets.

Kazuhiro Homma kazuph

Block or report user

Report or block kazuph

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
@kazuph
kazuph / Gemfile
Last active Aug 29, 2015
積読記事をSlackに流して自分が読みたい記事を他人から教えてもらうライフハック ref: http://qiita.com/kazuph/items/f0ded1fef3127bf236cc
View Gemfile
source "https://rubygems.org"
gem "faraday"
gem "faraday_middleware"
gem "hashie"
View mymemcheck.rb
#!/usr/bin/env ruby
# 1. my.cnf か SHOW VARIABLES の結果を入力にとる
# 2. 入力を解析し、必要なパラメータ値を取得する
# 3. 計算
# 4. 結果を標準出力に出力する
require 'optparse'
require 'bigdecimal'
@kazuph
kazuph / ptqd.txt
Created Aug 5, 2014
pt-query-digestの実行結果の例
View ptqd.txt
# 4.6s user time, 280ms system time, 40.89M rss, 287.59M vsz
# Current date: Tue Aug 5 07:36:47 2014
# Hostname: ip-172-31-23-18
# Files: tmp/mysql-slow.log.20140805-072831
# Overall: 9.98k total, 41 unique, 25.28 QPS, 0.46x concurrency __________
# Time range: 2014-08-05 07:21:41 to 07:28:16
# Attribute total min max avg 95% stddev median
# ============ ======= ======= ======= ======= ======= ======= =======
# Exec time 183s 4us 7s 18ms 95ms 79ms 194us
# Lock time 557ms 0 4ms 55us 185us 85us 42us
@kazuph
kazuph / report.sh
Created Aug 5, 2014
ISUCONでのレポート用シェル。
View report.sh
#!/bin/sh
SEC=`date --iso-8601=seconds`
DATE=`date +'%Y%m%d-%H%M%S'`
## NGINX
echo NGINX REPORT
# LTSVなログ前提
LOG_BASE=/home/isucon/tmp
@kazuph
kazuph / deploy.rb
Created Jul 21, 2014
capistrano 3 をできるだけシンプルにサーバーにコマンドを流し込むツールとして使いこなす ref: http://qiita.com/kazuph/items/deeaa7d3f9889674d7fe
View deploy.rb
lock '3.2.1'
set :pty, true
View mymemcheck.rb
#!/usr/bin/env ruby
# 1. my.cnf か SHOW VARIABLES の結果を入力にとる
# 2. 入力を解析し、必要なパラメータ値を取得する
# 3. 計算
# 4. 結果を標準出力に出力する
require 'optparse'
require 'bigdecimal'
View mymemcheck
#!/usr/bin/env perl
use strict;
use warnings;
my @GLOBAL_BUFFERS = qw(
key_buffer_size
innodb_buffer_pool_size
innodb_log_buffer_size
innodb_additional_mem_pool_size
@kazuph
kazuph / main.yml
Created Jul 16, 2014
ansilbeでnewrelic(サーバーリソース監視)を導入する ref: http://qiita.com/kazuph/items/96caa31fb0004835fca5
View main.yml
# NewRelicのリソース監視ツールを追加
---
- name: get repo
sudo: yes
yum: pkg={{item}} state=present
with_items:
- http://download.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm
- name: yum install
sudo: yes
@kazuph
kazuph / Gemfile
Created Jul 16, 2014
Railsのsession storeをAmazon ElastiCache(memcached) へ変更した ref: http://qiita.com/kazuph/items/c87a20d1c49d5ff9b92a
View Gemfile
+gem 'dalli'
You can’t perform that action at this time.