Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View yano3's full-sized avatar
❄️
NO SNOW, NO LIFE.

Teppei Yano yano3

❄️
NO SNOW, NO LIFE.
View GitHub Profile
@yano3
yano3 / fix_vboxsf.md
Created October 4, 2017 06:09
fix vboxsf error when updating kernal
sudo /opt/VBoxGuestAdditions-5.0.16/init/vboxadd setup

on older box

sudo /etc/init.d/vboxadd setup
@yano3
yano3 / gist:aea70b83a7789479839de0b4c12d7d71
Created February 2, 2017 03:52
brew install docker-machine-driver-xhyve
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
==> 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
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++'
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);
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"
@yano3
yano3 / server.rb
Last active October 31, 2016 03:28
{
nginx_version: Server::server_version,
mruby_version: MRUBY_VERSION,
ngx_mruby_version: Server::module_version,
}
@yano3
yano3 / gist:1033068
Last active February 2, 2016 01:27
Vimium - Options - Key mappings
map l nextTab
map h previousTab
unmap d
map d removeTab
unmap u
map u restoreTab
map <c-u> scrollPageUp
map <c-d> scrollPageDown
@yano3
yano3 / gist:8633751
Created January 26, 2014 14:41
agqr
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 January 2, 2016 22:09
Installing puppet (Ubuntu 12.04 LTS)
# 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