This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 日本語を使用 | |
export LANG=ja_JP.UTF-8 | |
# パスを追加したい場合 | |
export PATH="$HOME/bin:$PATH" | |
# 色を使用 | |
autoload -Uz colors | |
colors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from bcc import BPF, USDT | |
import argparse | |
import re | |
import ctypes as ct | |
import subprocess | |
examples = """examples: | |
blk_read_pgsql -p 188 # trace specific PostgreSQL processes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
colorscheme hybrid | |
let mapleader = "," | |
set completeopt-=preview | |
call plug#begin('~/.vim/plugged') | |
if has('nvim') | |
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hubs = Userdata.new("hubs").hubs | |
r = Apache::Request.new() | |
if hubs.keys.include?(r.uri[1,r.uri.size-1]) then | |
Apache.rputs(r.uri) | |
r.handler = "proxy-server" | |
r.proxyreq = Apache::PROXYREQ_REVERSE | |
r.filename = "proxy:" + hubs[r.uri] | |
end | |
~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Rack | |
class WebAPI | |
include Rack::R3 | |
def call(env) | |
super({'REQUEST_METHOD' => env["REQUEST_METHOD"], 'PATH_INFO' => env["PATH_INFO"]}) | |
end | |
def run | |
engine = if Object.const_defined?(:Nginx) | |
'nginx' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_mruby.c> | |
mrubyChildInitMiddle /etc/apache2/init.rb | |
<Location /api> | |
mrubyTranslateNameMiddle /etc/apache2/proxy.rb | |
mrubyHandlerMiddle /etc/apache2/requesthub.rb | |
</Location> | |
<Location /hub> | |
mrubyTranslateNameMiddle /etc/apache2/proxy.rb | |
mrubyHandlerMiddle /etc/apache2/requesthub.rb | |
</Location> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Userdata.new("req_#{Process.pid}").hubs = Hash.new() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_mruby.c> | |
<Location /> | |
mrubyHandlerMiddle /etc/apache2/webapi.rb | |
</Location> | |
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyAPI < Rack::WebAPI | |
get "/hoge/{id}" do |id| | |
[ | |
200, | |
{'content-type' => 'text/plain; charset=utf-8'}, | |
["your id is #{id}"] | |
]; | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_mruby.c> | |
<Location /> | |
mrubyHandlerMiddleCode ' \ | |
r = Apache::Request.new ;\ | |
client = Norikra::Client.new("192.168.99.100", "26571") ;\ | |
client.send("access_log", [:time => Time.new.to_s, :method => r.method, :uri => r.uri]) ' | |
</Location> | |
</IfModule> |
NewerOlder