Skip to content

Instantly share code, notes, and snippets.

Avatar
❄️
NO SNOW, NO LIFE.

Teppei Yano yano3

❄️
NO SNOW, NO LIFE.
View GitHub Profile
@yano3
yano3 / gist:aea70b83a7789479839de0b4c12d7d71
Created Feb 2, 2017
brew install docker-machine-driver-xhyve
View gist:aea70b83a7789479839de0b4c12d7d71
This driver requires superuser privileges to access the hypervisor. To
enable, execute
sudo chown root:wheel /usr/local/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
sudo chmod u+s /usr/local/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
View brew install bison
==> Downloading https://homebrew.bintray.com/bottles/bison-3.0.4.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring bison-3.0.4.el_capitan.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.
Some formulae require a newer version of bison.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
View build_config.rb.patch
diff --git a/build_config.rb b/build_config.rb
index 13751f2..9faddba 100644
--- a/build_config.rb
+++ b/build_config.rb
@@ -8,6 +8,10 @@ MRuby::Build.new('host') do |conf|
cc.flags << ENV['NGX_MRUBY_CFLAGS'] if ENV['NGX_MRUBY_CFLAGS']
end
+ conf.linker do |linker|
+ linker.option_library << ' -lstdc++'
View ngx_mruby.diff
diff --git src/http/ngx_http_mruby_filter.c src/http/ngx_http_mruby_filter.c
index 91e8e00..e90642d 100644
--- src/http/ngx_http_mruby_filter.c
+++ src/http/ngx_http_mruby_filter.c
@@ -34,7 +34,7 @@ static mrb_value ngx_mrb_set_filter_body(mrb_state *mrb, mrb_value self)
body = mrb_funcall(mrb, body, "to_s", 0, NULL);
}
- ctx->body = (u_char *)mrb_str_to_cstr(mrb, body);
+ ctx->body = (u_char *)RSTRING_PTR(body);
View gist:45daea5f4ead05938b36a8424e816f53
2016/12/16 01:01:37 [error] 3153#3153: *1 mrb_run failed: return 500 HTTP status code to client: error: /etc/nginx/conf.d/filter.rb:3: string contains null byte (ArgumentError), client: 10.0.2.2, server: _, request: "GET /filter HTTP/1.1", host: "localhost:20080"
2016/12/15 11:40:34 [error] 4579#4579: *1 mrb_run failed: return 500 HTTP status code to client: error: /etc/nginx/conf.d/nigari.rb:12: string contains null byte (ArgumentError) while sending to client, client: 10.0.2.2, server: _, request: "GET /nigari?4 HTTP/1.1", upstream: "http://127.0.0.1:80/orig?4", host: "localhost:20080"
View server.rb
{
nginx_version: Server::server_version,
mruby_version: MRUBY_VERSION,
ngx_mruby_version: Server::module_version,
}
@yano3
yano3 / gist:1033068
Last active Feb 2, 2016
Vimium - Options - Key mappings
View gist:1033068
map l nextTab
map h previousTab
unmap d
map d removeTab
unmap u
map u restoreTab
map <c-u> scrollPageUp
map <c-d> scrollPageDown
View gist:8633751
59 18 * * * rtmpdump -r rtmp://fms-base1.mitene.ad.jp/agqr/aandg2 --live -o ~/hoge.flv --stop 1920
@yano3
yano3 / install_puppet.sh
Last active Jan 2, 2016
Installing puppet (Ubuntu 12.04 LTS)
View install_puppet.sh
# see http://docs.puppetlabs.com/guides/puppetlabs_package_repositories.html#for-debian-and-ubuntu
wget https://apt.puppetlabs.com/puppetlabs-release-precise.deb
sudo dpkg -i puppetlabs-release-precise.deb
sudo apt-get update
# puppet-common instead of puppet
# This will install Puppet without the agent init script
sudo apt-get install puppet-common
@yano3
yano3 / gist:4f0d258f260a30992639
Created Dec 16, 2015
brew install elasticsearch
View gist:4f0d258f260a30992639
$ brew install elasticsearch                                                                                                                                                                                  (git)-[master]
==> Downloading https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.1.0/elasticsearch-2.1.0.tar.gz
######################################################################## 100.0%
==> Caveats
Data:    /usr/local/var/elasticsearch/elasticsearch_xxxxxxxxxx/
Logs:    /usr/local/var/log/elasticsearch/elasticsearch_xxxxxxxxxx.log
Plugins: /usr/local/Cellar/elasticsearch/2.1.0_1/libexec/plugins/
Config:  /usr/local/etc/elasticsearch/