Skip to content

Instantly share code, notes, and snippets.

View conmame's full-sized avatar

Yutaka Hoshino conmame

  • Amazon Web Services Japan G.K.
  • Tokyo, Japan
View GitHub Profile
@conmame
conmame / open_tco.rb
Created March 20, 2012 08:17
open t.co url
# -*- encoding: utf-8 -*-
require "net/http"
require "uri"
class OpenTcoUrl
def initialize; end
def open_tco_url tco_url
result = []
# -*- coding:utf-8 -*-
class String
def kaibun
self + self[0..-2].reverse
end
end
@conmame
conmame / gist:2555000
Created April 30, 2012 02:29
coderwall team ranking
# -*- encode:utf-8 -*-
require 'mechanize'
agent = Mechanize.new { |a|
a.user_agent_alias = 'Mac Safari'
a.max_history = 0
}
agent.get('http://coderwall.com/teams/4f61c42bdb6418000a000001') do |page|
@conmame
conmame / add_monthly_partition.sh
Created June 12, 2012 05:28
Add Monthly Partition (MySQL 5.5=<)
#!/bin/sh
HOST='localhost'
USER='ID'
PASS='PASS'
DBNAME='DBNAME'
TABLENAME='TABLENAME'
PREVIOUSMONTH=`mysql -h $HOST -u $USER -p$PASS -e 'SHOW CREATE TABLE '$DBNAME'.'$TABLENAME'\G' |
tail -n 2 |
@conmame
conmame / gist:3422225
Created August 22, 2012 04:11
Add UserID Partition (MySQL 5.5=<)
#!/bin/sh
# userバーティションを拡張
HOST='127.0.0.1'
USER='hoge'
PASS='fuga'
DBNAME='piyo'
TABLENAME='oreo'
NUMPERPARTITION=50000 #インクリメントする値
@conmame
conmame / dea.yml
Created September 20, 2012 03:25
CloudFoundry Multi Node Install Setting yml
---
deployment:
name: "dea"
domain: "hoge.com" #使用するドメイン
jobs:
install:
- stager
- dea:
local_route: "192.168.249.44" #自分の環境に合わせる (この設定ファイルが置かれるDEAのIPアドレス)
sub _parse_response
{
my $this = shift;
my $res = shift;
my $req = shift;
my $full_ch_name = $req->{full_ch_name};
$DEBUG and $this->_debug($req, "_parse_response.");
my $result = {
result => undef,
mysqld_safe --skip-grant-tables
======================================================================================================================================================================================================================================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================================================================================================================================================================================================================================