Skip to content

Instantly share code, notes, and snippets.

View hfm's full-sized avatar

Okumura Takahiro hfm

View GitHub Profile
@monochromegane
monochromegane / 速習Go.md
Created July 4, 2014 09:16
速習Go。Fukuoka.go#1用の資料です。

速習Go

Go環境のつくりかた

MacOSX

homebrewでインストール

$ brew update

modules/foo/manifests/init.pp

class foo {
  define bar() {
    notice("**********************************************")
    notice("Calling: foo::bar")
    notice("module_name: $module_name")
    notice("caller_module_name: $caller_module_name")
  }
@magnetikonline
magnetikonline / README.md
Last active August 27, 2025 06:08
Setting Nginx FastCGI response buffer sizes.
@motemen
motemen / Ojisan-Patterns.md
Last active March 7, 2025 08:19
おじさんパターン集
  • その面白そうな話、私も参加していいよね?なぜなら私は無条件に受け入れられているからおじさん(闖入おじさん) #おじさんパターン
  • 後出し難癖おじさん #おじさんパターン
  • 困難は成長のチャンス!だから君たちに成長の機会をあげようおじさん (成長おじさん) #おじさんパターン
  • あらゆる事案に一般論コメントおじさん #おじさんパターン
  • 俺ってあらゆることに精通してるじゃん?だから力になるよおじさん (精通おじさん) #おじさんパターン
@udzura
udzura / file1.txt
Created March 6, 2014 04:07
クライアントからやってくる本物のHTTPリクエストをダンプする ref: http://qiita.com/udzura/items/db49fc086cff2a8aaea3
$ ruby http-dumper.rb -p 3002
@denji
denji / nginx-tuning.md
Last active November 22, 2025 10:47
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@udzura
udzura / LICENSE
Last active May 8, 2021 14:23
やわらかRuby
やわらかRubyはCC BY 4.0 で提供します。
詳細: https://creativecommons.org/licenses/by/4.0/deed.ja
This work is licensed under a Creative Commons Attribution 4.0 International License.
See also: https://creativecommons.org/licenses/by/4.0/deed
package main
import "fmt"
func main () {
// 見つめ合う
fmt.Println("おっくせんまん!おっくせんまん!!")
defer fmt.Println("ジャパン!!!");
}
@hiboma
hiboma / gist:7251089
Last active December 27, 2015 02:19
array_push と [] との比較

array_push と $array[] = $val って何が違うの

  • array_push で配列の要素足すのと、$array[] = $val で配列の要素足すのと何が違うのかわからんので調べた
  • http://pecl.php.net/package/vld を入れると処理系の OPコードを見れる

環境

[vagrant@localhost ~]$ rpm -q php
php-5.3.3-23.el6_4.x86_64

http://ameblo.jp/principia-ca/entry-11573342807.html

  1. 復帰した旧masterが新masterになるわけじゃないんで「フェイルバック」 ではない感。
  2. sentinel 1台だと誤検知してもFOしちゃうので怖い。別ラックとかで複数sentinel配置すべきじゃないかなぁ。
  3. alias_ip_change.shは非常にまずい気がして、引数全く見てないのでFOが発動したときと完了したときの2回IP Alias切り替えちゃう。つまり元に戻るので落ちたmasterにVIPが付いちゃうんじゃないかなぁ?
  4. あとip addr del/addしたときって他サーバー/スイッチのarpテーブル/FDB更新されるんだっけ? Gratuitous ARP送ったほうがいいような気がするけどどうだろう?
  5. 注意点1はそんなことはなくて、ちゃんと引数をみてroleがleaderでstateがendのときだけVIPの移動処理すればOK 引数の説明はsentinel.confに書いてある