Skip to content

Instantly share code, notes, and snippets.

@yasuhito
yasuhito / gist:2289123
Created April 3, 2012 03:41
コントローラの switch_ready を起こすだけのスイッチ
class MinimumSwitch < Switch
def start
info "Started (datapath_id=#{ datapath_id.to_hex })."
end
def controller_connected
info "Connected to a controller."
send_message Hello.new
end
@yasuhito
yasuhito / gist:2411381
Created April 18, 2012 06:00
a patch that fixes linkage problem?
diff --git a/ruby/extconf.rb b/ruby/extconf.rb
index cda078f..2343ba6 100644
--- a/ruby/extconf.rb
+++ b/ruby/extconf.rb
@@ -45,6 +45,10 @@ EOF
end
+unless find_library( "pthread", "pthread_create" )
+ error_exit error_lib_missing( "libpthread", "libc6-dev" )
diff --git a/INSTALL.KVM b/INSTALL.KVM
index 09a8d67..61620e5 100644
--- a/INSTALL.KVM
+++ b/INSTALL.KVM
@@ -58,7 +58,7 @@ Please refer to ovs-vsctl(8) for more details.
Next, we'll start a guest that will use our ifup and ifdown scripts.
- % kvm -m 512 -net nic,maddr=00:11:22:EE:EE:EE -net \
+ % kvm -m 512 -net nic,macaddr=00:11:22:EE:EE:EE -net \
@yasuhito
yasuhito / gist:4335018
Created December 19, 2012 07:15
独りフェースブック
(global-set-key "\C-cc" 'org-capture)
(setq org-capture-templates
(quote
(("f"
"独りFacebook"
entry
(file "~/Dropbox/org/facebook.org")
"* %U\n %?\n - [ ] いいね!"
:prepend t
:unnarrowed t
diff --git a/flow_dumper/flow-dumper.rb b/flow_dumper/flow-dumper.rbindex 40d677c..fdfe0e5 100644--- a/flow_dumper/flow-dumper.rb
+++ b/flow_dumper/flow-dumper.rb
@@ -27,7 +27,7 @@ module Trema
"cookie = #{ cookie }, " +
"idle_timeout = #{ idle_timeout }, " +
"hard_timeout = #{ hard_timeout }, " +
- "duration = #{ duration }, " +
+ "duration = #{ duration_sec }, " +
"packet_count = #{ packet_count }, " +
"byte_count = #{ byte_count }, " +
@yasuhito
yasuhito / gist:4543998
Last active December 11, 2015 04:18
Trema のチュートリアルいろいろ
* Trema in 10 minutes: http://trema-10min.heroku.com/
プログラマ向けの「10 分で分かる Trema」資料です。
* Trema Tutorial: http://trema-tutorial.heroku.com/
* GEC Trema Tutorial: http://trema-tutorial-gec13.heroku.com/
Trema の基本的なチュートリアルです (それぞれ約 3 時間分)
チュートリアル用のファイルは→ https://github.com/trema/tutorial.files
* Test-first OpenFlow Programming with Trema: http://testfirst-trema.heroku.com/
* Trema でテスト駆動 OpenFlow プログラミング: http://trema-tutorial-ja.heroku.com/
@yasuhito
yasuhito / gist:4760689
Created February 12, 2013 06:52
Vote-for-Trema-on-every-packet_in-receive controller
require "rubygems"
require "mechanize"
class VoteForTrema < Controller
def start
info "OK, I'm registered to vote"
end
git clone https://github.com/trema/trema-edge.git
Cloning into 'trema-edge'...
remote: Counting objects: 15697, done.
remote: Compressing objects: 100% (3932/3932), done.
remote: Total 15697 (delta 12073), reused 15309 (delta 11690)
Receiving objects: 100% (15697/15697), 13.43 MiB | 881 KiB/s, done.
Resolving deltas: 100% (12073/12073), done.
@yasuhito
yasuhito / gist:6596629
Created September 17, 2013 16:16
Hello World
$><<[[[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []
@yasuhito
yasuhito / gist:9085031
Last active August 29, 2015 13:56
Trema ハンズオン@沖縄

Trema ハンズオン@沖縄

ハンズオンで使う VM とセットアップ方法を説明します。

当日までに VM にログインできることを確認 しておいてください。

必要なハードウェア