Skip to content

Instantly share code, notes, and snippets.

# dmesg
ew driver cdc_acm
drivers/usb/class/cdc-acm.c: v0.23:USB Abstract Control Model driver for USB modems and ISDN adapters
hso: /home/snapshot/snapshot/snapshot_CS_Products/1.96_1.01_2013-07-25-05-28-JST_WZR-300HP-AP93/linux-2.6.15-ath-ap93/src/hso_26/hso.c: 1.12-Option Option Wireless
usbcore: registered new driver hso
SGI XFS with large block numbers, no debug enabled
change fat_tz_minuteswest = -540
OK1OK2mcsnoop: flush all snoop entry
mcsnoop: Bridge Multicast Snooping module Ver0.1/20070912
debug : Enter [BRCTL_ADD_RULE_IF]
@hkwi
hkwi / openflow14_updates.diff
Last active December 23, 2015 19:18
openflow 1.3.2 -> 1.4 struct, enum diffs.
--- hoge132__s.c 2013-09-27 16:58:14.221425200 +0900
+++ hoge14__2s.c 2013-09-24 15:33:20.416477600 +0900
@@ -2,9 +2,13 @@
struct ofp_action_experimenter_header {
uint16_t type; /* OFPAT_EXPERIMENTER. */
uint16_t len; /* Length is a multiple of 8. */
- uint32_t experimenter; /* Experimenter ID which takes the same
- form as in struct
- ofp_experimenter_header. */
+ uint32_t experimenter; /* Experimenter ID. */

hostapd.conf VLAN

現時点の hostapd HEAD での動作例

  • vlan_bridge - いつでも有効
  • dynamic_vlan, vlan_file, vlan_naming - CONFIG_NO_VLAN でなければ有効
  • vlan_tagged_interface - CONFIG_NO_VLAN でない、かつ CONFIG_FULL_DYNAMIC_VLAN の場合に有効

Example 1

ebtables

NAME

ebtables (v2.0.10-1) - Ethernet bridge frame table administration

DESCRIPTION

ebtables は (Linux kernel 内にある) Ethernet フレームの検査ルールを設定管理するプログラムである。iptables に類似しているが、 Ethernet プロトコルは IP プロトコルよりもずっと単純なので、それほど込み入ってはいない。

trema-edge 改修ポイント

  • timer を秒刻み(あるいは 0.5 秒)で一つ動かす。
  • match を大きな構造体にまとめる。
    • mask するものと完全一致のものを分離する ワイルドカード指定もマスクで処理してしまいたいので、全てvalue/maskで
    • union にして int32_t で比較やマスク操作する
    • 内部表現とプロトコル表現を分けて持つ
  • コンテナクラスを最適なものに置き換える
  • 末尾挿入の速度

Fedora 20

# yum install docker-io
# systemctl start docker

Add myself to group docker.

The protocol over /var/run/docker.sock or the INET socket is the RESTful HTTP API.

@hkwi
hkwi / ubuntu.md
Last active August 29, 2015 13:59

Windows XPのサポート切れで騒いでいるのに便乗してPCをUbuntuにしてしまう試み。

  • せっかくなので Ubuntu 14 (Trusty Tahr) で行く。
  • Canon EOS Utility は shotwell で代用できそう
  • iPad との接続は libimobiledevice で対処できそう
    • wine + iTunes.exe は UI まわりのエミュレーションが足りてなさそうで使い物にならず。
  • 家庭内ファイルサーバはなんとか接続できそう
    • nautilus の cifs はセッションタイムアウトを頻繁に起こす
    • cifs-utils に入っている mount.cifs でマウントして操作すれば比較的安定?
  • Fedora 20 Desktop も試してみたけれど、次の点で上手くいかなかった
  • h.264 codec が標準に無いので、Canon EOS movie が再生できない
# apt-get install postgres-xc
# /etc/init.d/postgres-xc start
# su postgres-xc -c createdb testdb

ごちゃごちゃ言われることがある。/etc/init.d/postgres-xc で restart を 2 回やれば回復するだろう。

createdb: database creation failed: ERROR:  No Datanode defined in cluster
HINT:  You need to define at least 1 Datanode with CREATE NODE.
@hkwi
hkwi / ovs_tips.md
Created June 10, 2014 01:03
Open vSwitch Tips

Open vSwitch tips

ovs-ofctl is a genral tool for openflow protocol. It can handle not only ovs, but also communicate with the other openflow switch implementation.

ovs-ofctl flow rule delimiter is not only "," in some places. For example strtok_r second arg is "=, \t\r\n" in parse_ofp_str__() in ofp-parse.c

@hkwi
hkwi / go_cpu_bound.go
Created July 15, 2014 01:42
go performs badly on windows (gc)
package main
func main(){
buf := make([]byte, 10000)
length := len(buf)
for i:=0; i<100000; i++ {
for j:=0; j<100000; j++ {
buf[(i+j)%length] = buf[j%length]
}
}