Skip to content

Instantly share code, notes, and snippets.

View k-oguma's full-sized avatar
:octocat:
( ̄(工) ̄)

oguma k-oguma

:octocat:
( ̄(工) ̄)
View GitHub Profile
@syucream
syucream / httpbench.rst
Last active August 29, 2015 13:56
HTTPベンチマークツール調査

既存のHTTPベンチマークツールについて調査する。 いかにして性能を測定するのかなど調査。 ついでに SPDY, WebSocket, HTTP/2 のベンチマークできそうな余地とか探ってみる。

既存のベンチマークツール(随時更新)

  • apache bench
  • Apache JMeter (?)
  • http_load
#!/usr/bin/perl
use strict;
use warnings;
use JSON;
sub cap_cmd {
my ($cmdref) = @_;
pipe my $logrh, my $logwh
or die "Died: failed to create pipe:$!\n";
my $pid = fork;
@jimeh
jimeh / sudome.rb
Created November 20, 2009 23:30
sudome — A simple Ruby method which checks if the current script is running as root, and if not, re-invokes itself by using the sudo command.
# A simple Ruby method which checks if the current script
# is running as root, and if not, re-invokes itself by
# using the sudo command.
def sudome
if ENV["USER"] != "root"
exec("sudo #{ENV['_']} #{ARGV.join(' ')}")
end
end
@sechiro
sechiro / ec2-user-data-sample.yml
Created September 2, 2014 17:09
AnsibleのEC2モジュールで、user_dataを指定するときのメモ
---
- hosts: localhost
gather_facts: no
tasks:
- name: Create EC2 Instance with user-data
local_action:
module: ec2
region: ap-northeast-1
image: ami-efbe98ee # Ubuntu 12.04 LTS, hvm:ebs, 20140829.2
instance_type: t2.micro
@Oneiroi
Oneiroi / Check server
Created March 4, 2015 16:37
SSL FREAK tests
openssl s_client -cipher EXPORT -connect domain.com:443 < /dev/null 2>/dev/null | grep SSL-Session | wc -l
// (c) 2017 Yami Odymel
// This code is licensed under MIT license.
package main
import (
"fmt"
"html"
"strconv"
)
@masquaremo
masquaremo / str_num_sample.rb
Last active May 30, 2021 06:56
Rubyで文字列と数値を相互に変換するメソッドとかのまとめ
#!/usr/bin/ruby
#数値を16進数文字列に
p 65.to_s(16) #=> "41"
#数値をASCII文字に
p 65.chr #=> "A"
#文字列を16進数とみなして数値に
p "41".hex #=> 65
@tcnksm
tcnksm / docker_cheat.md
Last active August 5, 2021 03:59 — forked from wsargent/docker_cheat.md
Docker 虎の巻

Docker 虎の巻

何故Dockerを使うべきか

Why Should I Care (For Developers)

"Dockerが面白いのはシンプルな環境に隔離性と再現性をもたらしてくれることだ.ランタイムの環境を一度作れば、パッケージにして別のマシンでも再利用することできる.さらに,すべてはホスト内の隔離された環境で行われる(VMのように).最も素晴らしい点は,シンプルかつ高速であることだ."

# bash <(curl -s https://gist.github.com/drye/5387341/raw/ec72cddfe43ec3d39c91a3c118cb68ab14a049f8/enable_dnsmasq_on_osx.sh)
# ----------------------
# installing dnsmasq and enable daemon
# ----------------------
brew install dnsmasq
sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons
# ----------------------
# adding resolver for vbox domain
# ----------------------
@sonots
sonots / out_forward.conf
Last active November 2, 2021 06:14
ログの欠損をできるだけ避ける Fluentd の out_forward 設定サンプル cf. http://blog.livedoor.jp/sonots/archives/44690980.html
<source>
type in_tail
# ...
tag raw.eventlog
</source>
<match raw.**>
type forward
log_level "#{ENV['DEBUG'] ? 'debug' : 'info'}"