View Dockerfile
FROM ubuntu:xenial
RUN apt-get update
RUN apt-get install \
libbsd-dev \
libedit-dev \
libevent-core-2.0-5 \
libevent-dev \
libevent-extra-2.0-5 \
libevent-openssl-2.0-5 \

How to connect an iOS device to your computer via a SOCKS proxy

Say you're running a virtual machine on your work computer. Say this machine, for whatever reason, can only connect to the internet over NAT - as in, it does not get it's own IP address. Say this VM is running a webserver, and you need a device outside of your computer to connect to it.

If only there was a way to get your work computer to 'share' it's network, so that you could get at that VM… Here's how you do it!

For all instructions, I assume your work computer is a mac

  1. Get your computer's IP address:
$ # testing syro
$ wrk -t12 -c400 -d30s
Running 30s test @
12 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 186.63ms 75.95ms 712.69ms 71.36%
Req/Sec 58.40 66.78 280.00 79.20%
16025 requests in 30.09s, 2.81MB read
Socket errors: connect 0, read 310, write 0, timeout 0
Requests/sec: 532.63
View Rakefile
require 'webruby'
# This file sets up the build environment for a webruby project.
Webruby::App.setup do |conf|
# Entrypoint file name
conf.entrypoint = 'app/app.rb'
# By default, the build output directory is "build/"
conf.build_dir = 'build'
View build.log
(in /Users/rafael/develop/opensource/mruby)
mkdir -p /Users/rafael/develop/opensource/mruby/bin
"gcc" -g -std=gnu99 -O3 -Wall -Werror-implicit-function-declaration -Wdeclaration-after-statement -DMRB_DEBUG -I"/Users/rafael/develop/opensource/mruby/include" -MMD -o "/Users/rafael/develop/opensource/mruby/build/host/src/array.o" -c "/Users/rafael/develop/opensource/mruby/src/array.c"
"gcc" -g -std=gnu99 -O3 -Wall -Werror-implicit-function-declaration -Wdeclaration-after-statement -DMRB_DEBUG -I"/Users/rafael/develop/opensource/mruby/include" -MMD -o "/Users/rafael/develop/opensource/mruby/build/host/src/backtrace.o" -c "/Users/rafael/develop/opensource/mruby/src/backtrace.c"
"gcc" -g -std=gnu99 -O3 -Wall -Werror-implicit-function-declaration -Wdeclaration-after-statement -DMRB_DEBUG -I"/Users/rafael/develop/opensource/mruby/include" -MMD -o "/Users/rafael/develop/opensource/mruby/build/host/src/class.o" -c "/Users/rafael/develop/opensource/mruby/src/class.c"
"gcc" -g -std=gnu99 -O3 -Wall -Werror-implicit-functi
View .vimrc
set nocompatible
syntax on
filetype plugin indent on
set background=dark
colorscheme solarized
set ffs=mac,unix,dos
set encoding=utf-8

We now have reached a corner regarding the development of webruby.Emscripten is now switching to a LLVM-based backend, which eventually will replace the old JS-based backend. However, a bug in clang prevents us to use the new le32-unknown-nacl triple in LLVM/emscripten, it also prevents us from using the new LLVM-based backend of emscripten.

A fix has been developed for LLVM to solve this problem, but as of today, it's neither in the PNaCl fork of clang, nor emscripten-fastcomp-clang. So this prevents us from switching to the latest version of emscripten.

In a meantime, an attempt to fix this problem at mruby side was also rejected, since this would complicate mruby a lot for a small corner case.

We could maintain

View after_clang_and_pnacl_patch.log
$ EMCC_FAST_COMPILER=1 ~/develop/opensource/webruby/modules/emscripten/emcc vatest.c
Warning: Variable __init_array_start not referenced
Warning: Variable __init_array_end not referenced
Warning: Variable __fini_array_start not referenced
Warning: Variable __fini_array_end not referenced
false && "Unsupported type"
/Users/rafael/develop/opensource/emscripten-fastcomp/lib/Target/JSBackend/JSBackend.cpp : 683
Traceback (most recent call last):
File "/Users/rafael/develop/opensource/webruby/modules/emscripten/", line 1347, in <module>
# Suppose the currenct directory is ~/develop
$ git clone
$ cd hiredis
# Set emscripten compiling target
$ export EMCC_LLVM_TARGET=i386-pc-linux-gnu
# Locale the installation path of webruby, for example, on my mac this is:
# ~/.gem/ruby/2.0.0/gems/webruby-0.2.4/
View gist:6258440
$ git co CABLES-68-dev
$ git fetch
$ git rebase origin/CABLES-68
(fix merging...)
$ git co CABLES-68 && git rebase CABLES-68-dev
$ git push origin CABLES-68