Skip to content

Instantly share code, notes, and snippets.

@stereocat
stereocat / packetgen_tcp.rb
Last active July 13, 2016 09:29
simple-router + udp echo server function using Pio
require_relative 'pio-l4hdr'
dst_mac = "54:52:00:01:00:02"
src_mac = "04:20:9a:44:cf:63"
## test data 1
## tcp syn packet, checksum: 0x08e4
## condition: has options.
src_ip = "192.168.1.16"
dst_ip = "192.168.1.1"
@stereocat
stereocat / rtr1-confg
Last active March 3, 2019 10:18
VPNs in VRF-mode
!
! Last configuration change at 16:30:11 JST Sat Oct 11 2014
! NVRAM config last updated at 16:49:35 JST Sat Oct 11 2014
! NVRAM config last updated at 16:49:35 JST Sat Oct 11 2014
version 15.1
service nagle
no service pad
service tcp-keepalives-in
service tcp-keepalives-out
service timestamps debug datetime msec localtime show-timezone
@stereocat
stereocat / rtr1-confg
Last active August 29, 2015 14:07
VPNs in VRF-mode (2)
!
! Last configuration change at 16:02:19 JST Mon Oct 13 2014
! NVRAM config last updated at 16:28:10 JST Mon Oct 13 2014
! NVRAM config last updated at 16:28:10 JST Mon Oct 13 2014
version 15.1
service nagle
no service pad
service tcp-keepalives-in
service tcp-keepalives-out
service timestamps debug datetime msec localtime show-timezone
@stereocat
stereocat / dot.Xdefaults
Created September 13, 2015 04:11
dotfiles for CygwinX-XTerm
xterm*faceSize: 11
xterm*vt100*geometry: 80x60
xterm*saveLines: 16384
xterm*loginShell: true
xterm*charClass: 33:48,35:48,37:48,43:48,45-47:48,64:48,95:48,126:48
xterm*termName: xterm-color
xterm*eightBitInput: false
!BLK Cursor
#define _color0 #000d18
@stereocat
stereocat / genclass.py
Last active February 25, 2021 12:51
generate plantuml uml definition from python sources
import re
import sys
from os.path import splitext, basename
class UmlClassFigGenerator(object):
def __init__(self, file_list):
self.file_list = file_list
# notice: parent class was like that: "parenet_class.ClassName2"
self.re_class_def = re.compile(r"^class\s+([\w\d]+)\(([\w\d\._]+)\):")
@stereocat
stereocat / flow_data.js
Created May 6, 2017 17:06
Rewrite nettester_flowviewer
"use strict";
function build_flowdata(ssw_textarea, psw_textarea) {
var ssw_flows = build_flowdata_from(ssw_textarea);
var psw_flows = build_flowdata_from(psw_textarea);
var flows = ssw_flows.concat(psw_flows);
console.log(flows);
var nested_flows = nest_flowdata(flows);
@stereocat
stereocat / d3-cluster-layout.html
Last active June 3, 2017 15:28
d3.js(v4) cluster layout basics
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style type="text/css">
circle {
opacity: 0.8;
stroke-width: 2;
stroke : black;
@stereocat
stereocat / commit-count-gh-dotw.rb
Last active March 23, 2019 04:50
github grass parser (per day of the week)
class DayRect
def initialize(line)
@line = line.strip!
@line.gsub!('<rect ', '')
@line.gsub!('/', '')
@line.gsub!('>', '')
@table = {}
set_table
end