Skip to content

Instantly share code, notes, and snippets.


Wataru Ashihara wataash

View GitHub Profile
Packrat Parsers Can Support Left Recursion
import dataclasses
import enum
import typing as t
View compile_commands.json
"arguments": [
wataash / linux-esp-decryption.hs
Last active Sep 1, 2020
linux L2TP/IPsec ESP decryption
View linux-esp-decryption.hs
$ sudo ip xfrm state
info for localremote direction IPsec tunnel(ESP)
src dst
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
anti-replay context: seq 0x0, oseq 0xaab, bitmap 0x00000000
sel src dst
wataash / dragon.c
Created Jun 27, 2020
Compilers: Principles, Techniques, and Tools, 1st Edition (1986) Section 2.9
View dragon.c
// Compilers: Principles, Techniques, and Tools, 1st Edition (1986)
// by Alfred V. Aho, Ravi. Sethi, Jeffrey D. Ullman
// Section 2.9
/* global.h */
#include <stdio.h> /* include declarations for i/o routines */
#include <ctype.h> /* ... and for character test routines */
# MIT License
# Copyright (c) 2020 Wataru Ashihara
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# based on
# Pythonのスタックとキューには何を使えばいいのか(各データ構造の速度比較)
# by @saba (
from collections import deque
import logging
from queue import Queue
import time
import typing as t
View bison2.3_ada-exp.c
/* A Bison parser, made by GNU Bison 2.3. */
/* Skeleton implementation for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
wataash /
Last active Dec 4, 2020
Microsoft Teams incoming webhook example


  • list 1
    • list 1.1
  • Italic
  • Bold
  • Strike-through (not work)
  • link
  • inline code
View loop_hello.c
#include <stdio.h>
#define loop() do { \
fprintf(stderr, "\x1b[36m %s loop \x1b[0m\n", __func__); \
_loop(); \
fprintf(stderr, "\x1b[36m %s exit loop \x1b[0m\n", __func__); \
} while (0)
void _loop(void);
wataash /
Last active Sep 13, 2019
Juniper SRX日本語マニュアル 05.ポリシーベース IPsec VPNのCLI設定 の正誤