Skip to content

Instantly share code, notes, and snippets.

View kazuph's full-sized avatar

Kazuhiro Homma kazuph

View GitHub Profile
@kazuph
kazuph / colorize.pl
Created November 12, 2012 01:28 — forked from Cside/colorize.pl
colorize keywords of logs.
#!/usr/bin/env perl
=head1 Examples
$ tail -f access_log | perl colorize.pl
$ plackup app.psgi 2>&1 | perl colorize.pl
=cut
use strict;
package Amon2::Plugin::Model;
use strict;
use warnings;
use Module::Find;
use Try::Tiny;
our $VERSION = '0.01';
sub init {
my ($class, $context_class, $config) = @_;
@kazuph
kazuph / auto_growlnotify.sh
Last active December 15, 2015 21:29 — forked from mirakui/auto_growlnotify.sh
何かのインストールなどの長い処理のときにgrowlで通知してくれるzsh growlが使えるときのみ発動するようにしてみた
# source: http://d.hatena.ne.jp/umezo/20100508/1273332857
local COMMAND=""
local COMMAND_TIME=""
precmd() {
if [ "$COMMAND_TIME" -ne "0" ] ; then
local d=`date +%s`
d=`expr $d - $COMMAND_TIME`
if [ "$d" -ge "30" ] ; then
COMMAND="$COMMAND "
# 競合するgdbがないなら必要ない
# 普通にbrewで入れたらgdbコマンドが使える
alias gdbnew='/usr/local/Cellar/gdb/7.6/bin/gdb'
#!/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
#!/usr/bin/env ruby
# 1. my.cnf か SHOW VARIABLES の結果を入力にとる
# 2. 入力を解析し、必要なパラメータ値を取得する
# 3. 計算
# 4. 結果を標準出力に出力する
require 'optparse'
require 'bigdecimal'
#!/usr/bin/env ruby
# 1. my.cnf か SHOW VARIABLES の結果を入力にとる
# 2. 入力を解析し、必要なパラメータ値を取得する
# 3. 計算
# 4. 結果を標準出力に出力する
require 'optparse'
require 'bigdecimal'
@kazuph
kazuph / AES.c
Last active August 29, 2015 14:10 — forked from bricef/AES.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* MCrypt API available online:
* http://linux.die.net/man/3/mcrypt
*/
#include <mcrypt.h>
// Alamofire.swift
//
// Copyright (c) 2014 Alamofire (http://alamofire.org)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@kazuph
kazuph / github_issues_to_csv.rb
Last active September 9, 2015 06:07 — forked from tkarpinski/github_issues_to_csv.rb
Exports Github issues to CSV (API v3)
#!/usr/bin/env ruby
# coding : utf-8
require 'octokit'
require 'csv'
require 'date'
# Github credentials to access your private project
USERNAME="USER_NAME"
PASSWORD="SEKRIT"
# Project you want to export issues from