Skip to content

Instantly share code, notes, and snippets.

View wataash's full-sized avatar

Wataru Ashihara wataash

View GitHub Profile
@wataash
wataash / linux-esp-decryption.hs
Last active September 1, 2020 06:36
linux L2TP/IPsec ESP decryption
$ sudo ip xfrm state
↓ info for local→remote direction IPsec tunnel(ESP)
src 192.168.0.2 dst 10.0.0.1
proto esp spi 0xaaaaaaaa reqid 1 mode transport
replay-window 0
auth-trunc hmac(sha1) 0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 96
enc cbc(aes) 0xcccccccccccccccccccccccccccccccccccccccccccccccccccccccc
encap type espinudp sport 4500 dport 4500 addr 0.0.0.0
anti-replay context: seq 0x0, oseq 0xaab, bitmap 0x00000000
sel src 192.168.0.2/32 dst 10.0.0.1/32
@wataash
wataash / parser_warth2007_2.py
Last active August 10, 2021 02:07
A Python implementation of "Packrat Parsers Can Support Left Recursion" by Alessandro Warth, James R. Douglass, and Todd Millstein. http://www.vpri.org/pdf/tr2007002_packrat.pdf
# SPDX-License-Identifier: Apache-2.0
"""
https://gist.github.com/wataash/dc9f8352dc147b223382def86c3a592b
A Python implementation of "Packrat Parsers Can Support Left Recursion" by
Alessandro Warth, James R. Douglass, and Todd Millstein.
http://www.vpri.org/pdf/tr2007002_packrat.pdf
2. An Overview of Packrat Parsing
@wataash
wataash / systemd-analyze-dot-only-n.rb
Last active December 29, 2022 08:19
systemd-analyze dot (only the top 30 units with the most appearances)
require "set"
unless ARGV.length == 1
warn("usage: systemd-analyze dot | systemd-analyze-dot-only-n N")
exit(1)
end
n = ARGV.shift.to_i(10)
txt = ARGF.read
pairs_unit_count = Hash.new(0)
@wataash
wataash / teams.md
Last active February 13, 2024 14:48
Microsoft Teams incoming webhook example

Heading

  • list 1
    • list 1.1
  • Italic
  • Bold
  • Strike-through (not work)
  • link
  • inline code