Skip to content

Instantly share code, notes, and snippets.

@tmori3y2
tmori3y2 / WiresharkLuaSample.lua
Last active February 23, 2020 11:53
Wireshark Lua Sample
local my_pattrib = {
abbr = "my_nbns",
description = "My NetBIOS Name Service",
protocol = "NBNS/MyNBNS",
header_size = 12,
base_protocol = "udp",
dissector_table_name = "port",
port = 137,
vendor = "SonyMobi"
}
@tmori3y2
tmori3y2 / labelled-arrows.svg
Created September 2, 2019 00:21
arrows with label
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tmori3y2
tmori3y2 / Vega-lite-transform-legends.json
Last active October 10, 2019 00:20
[vega-lite] Line Chart of radian scale functions using sequence/fold/labelExpr (vega-lite v4.0)
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"description": "Plots radian scale functions using sequence/fold/labelExpr.",
"width": 300,
"height": 150,
"data": {
"sequence": {
"start": -1,
"stop": 1.1,
"step": 0.1,
@tmori3y2
tmori3y2 / SetThreadExecutionStateWindow.linq
Created July 15, 2017 00:07
LinqPad Script to avoid the sleep mode on running DISM command.
<Query Kind="Program">
<Reference>&lt;RuntimeDirectory&gt;\WPF\PresentationCore.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\WPF\PresentationFramework.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\WPF\PresentationUI.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Threading.Tasks.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Xaml.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\WPF\WindowsBase.dll</Reference>
<Namespace>System.ComponentModel</Namespace>
<Namespace>System.Diagnostics</Namespace>
<Namespace>System.Runtime.InteropServices</Namespace>
<Query Kind="Program">
<Output>DataGrids</Output>
<Reference>&lt;RuntimeDirectory&gt;\System.Xml.Serialization.dll</Reference>
<Namespace>System.Globalization</Namespace>
<Namespace>System.IO</Namespace>
<Namespace>System.Linq</Namespace>
<Namespace>System.Text</Namespace>
<Namespace>System.Xml</Namespace>
<Namespace>System.Xml.Linq</Namespace>
<Namespace>System.Xml.Schema</Namespace>
digraph PetriNet {
graph [bgcolor=white label="PetriNet Sample" labeljust=l labelloc=t nodesep=0.5 penwidth=0 rankdir=LR ranksep=0.5 style=filled]
subgraph cluster_net {
graph [bgcolor=white label="PCB Etching Process" labeljust=c labelloc=b penwidth=0 style=filled]
subgraph cluster_pageTop {
graph [bgcolor=white label="PCB Etching Phase" labeljust=c labelloc=b penwidth=1 style=filled]
subgraph cluster_placeCu {
graph [bgcolor=white label="Copper Layer" labeljust=c labelloc=t penwidth=0]
node [color=black fillcolor=white height=1 shape=circle style="solid, filled" width=1]
placeCu [label=1]
@tmori3y2
tmori3y2 / xLabelNode.dot
Created May 28, 2017 00:22
graphviz node with labeled by subgraph.
digraph "XNode Test" {
graph [rankdir=LR]
subgraph cluster_c0 {
graph [bgcolor=white label="Circle Node 0" labeljust=c labelloc=t penwidth=0]
node [color=black fillcolor=white height=2 shape=circle style="solid, filled" width=2]
c0 [label=""]
}
subgraph cluster_b0 {
graph [bgcolor=white label="Bar Node 0" labeljust=c labelloc=b penwidth=0]
node [color=black fillcolor=white height=1 shape=box style="solid, filled" width=0.1]
@tmori3y2
tmori3y2 / petrinet.py
Created May 28, 2017 00:13
Petri Net Class
# Petri Net graph module.
# References
# Petri Nets World: http://www.informatik.uni-hamburg.de/TGI/PetriNets
# (Tutorilas): http://www.informatik.uni-hamburg.de/TGI/PetriNets/introductions/
# pnml.org: http://www.pnml.org
# (Schema): http://www.pnml.org/version-2009/version-2009.php
# import Digraph from graphviz pakage.
# http://graphviz.readthedocs.io/en/latest/manual.html
@tmori3y2
tmori3y2 / SetWim10_JapaneseKeyboardLayout.ps
Created May 27, 2017 02:56
Set Japanese Keyboard Layout for Windows .wim file.
$WimDir = "D:\WIM"
$MountDir = $WimDir + "\Mount"
$Wim = $WimDir + "\install.wim"
$Name = "Windows 10 Pro"
cd /d $WimDir
md $MountDir
Dism /Mount-Image /ImageFile:$Wim /Name:$Name /MountDir:$MountDir
Dism /Image:$MountDir /Set-LayeredDriver:6
@tmori3y2
tmori3y2 / TestXDocWriteTo.linq
Last active May 25, 2017 00:14
TestXDocWriteTo linqpad script
<Query Kind="Program">
<Output>DataGrids</Output>
<Reference>&lt;RuntimeDirectory&gt;\System.Xml.Serialization.dll</Reference>
<Namespace>System.Globalization</Namespace>
<Namespace>System.IO</Namespace>
<Namespace>System.Linq</Namespace>
<Namespace>System.Text</Namespace>
<Namespace>System.Xml</Namespace>
<Namespace>System.Xml.Linq</Namespace>
<Namespace>System.Xml.Schema</Namespace>