Skip to content

Instantly share code, notes, and snippets.

View glidenote's full-sized avatar

Akira Maeda glidenote

View GitHub Profile
@glidenote
glidenote / fluent_format_debug.rb
Created July 14, 2012 20:52
fluent_format_debug.rb
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'time'
require 'fluent/log'
require 'fluent/config'
require 'fluent/engine'
require 'fluent/parser'
$log ||= Fluent::Log.new
@glidenote
glidenote / etc_supervisord.conf
Created July 4, 2012 13:07
growthforecast supervisor
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)loglevel=info ; (log level;default info; others: debug,warn,trace)
pidfile=/var/run//supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=false ; (start in foreground if true;default false)
minfds=1024 ; (min. avail startup file descriptors;default 1024)
@glidenote
glidenote / make-rpm.sh
Created July 4, 2012 01:54 — forked from riywo/make-rpm.sh
fluent-agent-liteのrpm作るだけのshell
#!/bin/sh
if [ -z "$1" ]; then
echo "usage: ./make-rpm.sh 0.2"
exit 1
fi
version=$1
cur=`pwd`
rm -f fluent-agent-lite.v$version.tar.gz
rm -fr fluent-agent-lite
--- localConfig.js.dist 2012-06-29 10:08:51.293463302 +0900
+++ localConfig.js 2012-06-29 10:43:45.759470687 +0900
@@ -15,7 +15,7 @@
files: [
{
name: 'web',
- path: ['/var/log/httpd/info.log', '/var/log/httpd/php.log']
+ path: ['/var/log/httpd/info.log', '/var/log/httpd/php.log', '/var/log/httpd/access_log']
// you can also do this
// filter: function (line, config) {
#=============================
# rbenv
#=============================
if [ -d ${HOME}/.rbenv ] ; then
PATH=${HOME}/.rbenv/bin:${PATH}
export PATH
eval "$(rbenv init -)"
fi

ヒューマンエラーを許容する

  • 「きをつけよう」は意味ない
  • 実装、プラクティス、プロセスに落とし込む

バグ、ミスオペの混入を防ぐ

  • コードレビュー
  • 二人で作業
  • テストケース
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
# Basic settings:
# domain - The hostname to SSH to
# deploy_to - Path to deploy into
# repository - Git repo to clone from (needed by mina/git)
# user - Username in the server to SSH to (optional)
@glidenote
glidenote / Rakefile
Created June 9, 2012 19:34
Octopress Rakefile
desc "Generate jekyll site"
task :generate do
raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
puts "## Generating Site with Jekyll"
system "compass compile --css-dir #{source_dir}/stylesheets"
system "jekyll"
end
@glidenote
glidenote / .zshrc
Created June 1, 2012 03:56
.zshrc for macvim
export EDITOR=/Applications/MacVim.app/Contents/MacOS/Vim
alias vi='env LANG=ja_JP.UTF-8 /Applications/MacVim.app/Contents/MacOS/Vim "$@"'
alias vim='env LANG=ja_JP.UTF-8 /Applications/MacVim.app/Contents/MacOS/Vim "$@"'
@glidenote
glidenote / post-merge
Created May 29, 2012 07:48 — forked from hirochachacha/post-merge
git-hook script for vimproc
#!/bin/sh --
set -e
echo ""
echo "START POST-MERGE HOOK"
echo ""
HOOK_DIR=`dirname $0` #git_hooks directory
PROC_DIR="$HOOK_DIR/../.." #vimproc directory