Skip to content

Instantly share code, notes, and snippets.

View tsahara's full-sized avatar

Tomoyuki Sahara tsahara

View GitHub Profile
@tsahara
tsahara / setup-tramp.el
Created January 5, 2017 03:43
emacs-tramp
(require 'tramp)
(eval-after-load 'tramp
'(progn
(setenv "SHELL" "/bin/sh") ; tramp expects something on shell...
(setenv "TMPDIR" "/tmp") ; tramp hates long directory name...
(setq vc-handled-backends '()))) ; tramp freezes...
@tsahara
tsahara / Dockerfile-nghttp2
Last active August 29, 2015 14:01
Dockerfile for nghttp2 (without ALPN)
FROM ubuntu:14.04
RUN apt-get update
RUN apt-get install -y autoconf automake autotools-dev libtool pkg-config zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libevent-dev libjansson-dev libjemalloc-dev
RUN apt-get install -y curl make gcc git g++
WORKDIR /root
RUN curl -L https://github.com/tatsuhiro-t/nghttp2/releases/download/v0.4.0/nghttp2-0.4.0.tar.bz2 | tar jxf -
WORKDIR /root/nghttp2-0.4.0
RUN autoreconf -i
@tsahara
tsahara / Dockerfile-nghttp2-alpn
Last active April 20, 2018 02:16
Dockerfile for nghttp2 with ALPN support
FROM ubuntu
RUN apt-get update
RUN apt-get install -y autoconf automake autotools-dev libtool pkg-config zlib1g-dev libcunit1-dev libxml2-dev libjansson-dev libjemalloc-dev libev-dev
RUN apt-get install -y make gcc git g++
RUN apt-get install -y curl
#
# OpenSSL 1.0.2a
#
mrbgem をひとつだけ削ってビルドした mruby が、起動直後に GC.start した後に malloc(3) で確保しているバイト数
bytes diff
mruby-bin-mirb 276481 0
mruby-bin-mruby 276481 0
mruby-toplevel-ext 275703 -778
mruby-time 274895 -1586
mruby-proc-ext 274326 -2155
mruby-string-ext 272463 -4018
mruby-random 270315 -6166
mrbgem をひとつだけ追加してビルドした mruby が、起動直後に GC.start した後に malloc(3) で確保しているバイト数
# gem bytes increase
mruby-bin-mirb 146038 0
mruby-bin-mruby 146038 0
mruby-range-ext 146045 7
mruby-sprintf 146053 15
mruby-numeric-ext 146256 218
mruby-object-ext 146258 220
mruby-print 146679 641

明示的にサポートしている capability は

  • change_host_name
  • configure_networks
  • halt
  • mount_nfs_folder

linux に(のみ)あるのは

  • insert_public_key : 動いた方がいいんだろうな。
@tsahara
tsahara / vagrant-sakura.md
Last active December 20, 2015 07:59
vagrant-sakura 開発メモ

リリース

  • lib/vagrant-sakura/version.rb を書き換える

  • CHANGELOG.md を更新する

  • git commit -a

  • rake release で rubygems.org に上がる

  • gem としてのテスト

    #!/bin/sh
    

rake build

@tsahara
tsahara / a.c
Last active December 17, 2015 06:08
bit representation of ieee 754 floating point numbers
#include <stdio.h>
int
main(int argc, char **argv)
{
float f;
unsigned int i, mask;
f = 1.5;
i = *(unsigned int *)(void *)&f;
for (mask = 1 << 31; mask > 0; mask >>= 1) {