Skip to content

Instantly share code, notes, and snippets.

Avatar

stereocat stereocat

View GitHub Profile
@stereocat
stereocat / commit-count-gh-dotw.rb
Last active Mar 23, 2019
github grass parser (per day of the week)
View commit-count-gh-dotw.rb
class DayRect
def initialize(line)
@line = line.strip!
@line.gsub!('<rect ', '')
@line.gsub!('/', '')
@line.gsub!('>', '')
@table = {}
set_table
end
@stereocat
stereocat / d3-cluster-layout.html
Last active Jun 3, 2017
d3.js(v4) cluster layout basics
View d3-cluster-layout.html
<!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 / flow_data.js
Created May 6, 2017
Rewrite nettester_flowviewer
View flow_data.js
"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 / genclass.py
Last active Apr 5, 2020
generate plantuml uml definition from python sources
View genclass.py
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 / dot.Xdefaults
Created Sep 13, 2015
dotfiles for CygwinX-XTerm
View dot.Xdefaults
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 / rtr1-confg
Last active Aug 29, 2015
VPNs in VRF-mode (2)
View rtr1-confg
!
! 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 / rtr1-confg
Last active Mar 3, 2019
VPNs in VRF-mode
View rtr1-confg
!
! 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 / packetgen_tcp.rb
Last active Jul 13, 2016
simple-router + udp echo server function using Pio
View packetgen_tcp.rb
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"