Skip to content

Instantly share code, notes, and snippets.

# cat /proc/cpuinfo
Processor       : ARMv7 Processor rev 2 (v7l)
BogoMIPS        : 996.74
Features        : swp half thumb fastmult vfp edsp neon vfpv3
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x3
CPU part        : 0xc08
CPU revision    : 2

hostapd_ctrl_iface_receive

  • PING
  • RELOG
  • STATUS
  • STATUS-DRIVER
  • MIB
  • MIB XXXX
  • STA-FIRST
  • STA XXXX
  • STA-NEXT XXXX
@hkwi
hkwi / mt7610u_3.13.md
Created January 12, 2015 13:38
mt7610u on ubuntu 14.04.1(3.13.0-43-generic #72-Ubuntu SMP x86_64)
 kernel: [13603.180152] usb 2-1: new high-speed USB device number 8 using ehci-pci
 kernel: [13603.336480] usb 2-1: New USB device found, idVendor=04bb, idProduct=0951
 kernel: [13603.336484] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
 kernel: [13603.336487] usb 2-1: Product: WN-AC433U
 kernel: [13603.336489] usb 2-1: Manufacturer: I-O DATA
 kernel: [13603.336490] usb 2-1: SerialNumber: 3476C51C6CF0
 kernel: [13603.337278] 
 kernel: [13603.337278] 
 kernel: [13603.337278] === pAd = ffffc900159c9000, size = 895280 ===

gopacket の不満点

  • パースするたびに構造体をビルドしていくので、オブジェクトの数が多い。 []byteを基底として、タイプコンバージョンだけで行けるようにならないか。
  • タイプをうまく使えていない割に、ポインタを濫用している。
  • 一列にしかデコードできないが、ツリー状にデコードできて欲しい。
  • ビルドがサポートされていないことが多々。
  • プラガブルな構造は継続したい。
  • デコード時にコンテキスト情報を渡せるようにして、デフラグもできるようにしたい。
  • パース時に再帰的にデコーダを呼び出す(ので、deferで締めくくるのが難しくなる)のはやめたい。
import os
import sys
import json
info = []
for root,dirs,files in os.walk(sys.argv[1]):
for dir in dirs:
path = os.path.join(root, dir)
info.append({"path": path, "lstat":str(os.lstat(path)}))
for file in files:
From feea3fc8c93f9615677432680e4e6865b6c0de09 Mon Sep 17 00:00:00 2001
From: Hiroaki KAWAI <[email protected]>
Date: Thu, 26 Mar 2015 16:45:49 +0900
Subject: [PATCH 1/2] Set dot11 payload for InformationElement
---
layers/dot11.go | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/layers/dot11.go b/layers/dot11.go
@hkwi
hkwi / bindata_choice_sample.rb
Last active August 29, 2015 14:24
ruby bindata choice by two fields example
require "bindata"
class D < BinData::Record
endian :big
uint8 :dd
end
class E < BinData::Record
endian :big
uint8 :ee
@hkwi
hkwi / bluez_doc.md
Last active August 29, 2015 14:25
bluez documentation index

bluez 5.31 doc index

file name head -1
assigned-numbers.txt RFCOMM Channels
btmon.txt BTMON(1)
mgmt-api.txt Bluetooth Management API
settings-storage.txt BlueZ settings storage
supported-features.txt Supported features in BlueZ

Thetaシリアル

初代

  • XL00001017
  • THETA001017 - "THETA" + B
  • 00001017

m15

from flask import Flask, request
app = Flask(__name__)
mac2gpio = dict(
"00:00:00:00:00:00": 17,
"00:00:00:00:00:00": 22,
)
if os.path.exists("/sys/class/gpio/gpio17"):
with open("/sys/class/gpio/unexport", "w") as w: