Skip to content

Instantly share code, notes, and snippets.

クライアントに必要なコンフィグのメモ
knife solo cook cheftest.local
Running Chef on cheftest.local...
Checking Chef version...
Installing Berkshelf cookbooks to 'cookbooks'...
Installing td-agent (0.0.1) from git: 'https://github.com/treasure-data/chef-td-agent.git' with branch: 'master' at ref: 'd29d3f78bc2ffe991c63d56cbf8521eda6fdeb35'
Using apt (2.3.4)
Using yum (3.0.4)
Uploading the kitchen...
Generating solo config...
Running Chef...
@nikushi
nikushi / youken.md
Last active January 1, 2016 18:19
父が趣味で作っているホームページに注文フォームを作る私的案件の要件整理

作るもの

  • 注文フォーム
  • 問い合わせフォーム(時間があれば)

優先度

必須

  • 注文フォーム
require 'json'
10000.times do |i|
JSON.parse(open("list.json", 'r').read)
end
$ start_server --path=/tmp/gf.sock -- growthforecast.pl --socket=/tmp/gf.sock
  
15:04:57 3.1        | setsockopt(TCP_NODELAY) failed:Operation not supported on socket at /Users/nikushi.nobuhiro/perl5/perlbrew/perls/perl-5.16.1/lib/site_perl/5.16.1/Starlet/Server.pm line 98.
===== TCP 3way handshake =====

GET / HTTP/1.1
Host: localhost
Connection: Keep-Alive

HTTP/1.0 200 OK

body....

@nikushi
nikushi / test2.md
Last active December 31, 2015 00:29
require 'fluent-logger'
log = Fluent::Logger::FluentLogger.new(nil, :host=>'localhost', :port=>24224)
log.post("myapp.access", {"agent"=>"foo"})
fork do
  log.post("myapp.access", {"agent"=>"foo"})
end
@nikushi
nikushi / homesick-error.md
Created December 6, 2013 09:33
error: unknown option `config'
$ homesick clone niku4i/dotfiles
   git clone  https://github.com/niku4i/dotfiles.git to /home/nikushi/.homesick/repos/dotfiles
error: unknown option `config'
usage: git clone [options] [--] <repo> [<dir>]

    -v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --progress            force progress reporting
 -n, --no-checkout don't create a checkout
@nikushi
nikushi / gist:7819765
Last active December 30, 2015 10:59
SNMPのインタフェースのindex番号は重複するのか?
こういう状態で
$ snmpwalk -c public -v 2c localhost:10161 ifDesc
IF-MIB::ifDescr.1 = STRING: lo
IF-MIB::ifDescr.2 = STRING: eth0
IF-MIB::ifDescr.3 = STRING: eth1
IF-MIB::ifDescr.4 = STRING: veth0
IF-MIB::ifDescr.5 = STRING: veth1
IF-MIB::ifDescr.6 = STRING: eth1.100
veth0,veth0を消した
@nikushi
nikushi / snmpget-vs-snmp-walk.md
Last active December 30, 2015 10:59
indexをキャッシュしたsnmpget、index含めてwalkで取得するsnmpwalk、どっちが早いの? 結論としてはcacheしたgetが早い。
require 'snmp'
require 'benchmark'

puts "creating cache"
indexes = []
SNMP::Manager.open(host: 'localhost', community: 'public') do |manager|
  manager.walk(%w(ifIndex)) { |row| indexes << row[0].value.to_i }
end