Skip to content

Instantly share code, notes, and snippets.

@Shikugawa
Shikugawa / solve.py
Created August 16, 2025 13:18
装甲悪鬼村正 パズルソルバー
cand = [62, 9, 41, 49, 105, 96, 8, 22, 101, 55, 35, 46, 84, 60, 99, 24, 74, 124]
import copy
obj = 315
targets = [obj-(51+15), obj-(78+54), obj-(36+110), obj-(103+3), obj-(113+57), obj-(56+120)]
aaaaa = []
def get_cands(level, arr, seen):
if level == 6 and len(arr) == len(targets):
return copy.copy(arr)
for i in range(len(cand)):

generate large json

import random
import string
import json

def get_random_string():
    r = random.randint(1,100)
    letters = string.ascii_lowercase
    result_str = ''.join(random.choice(letters) for i in range(r))
@Shikugawa
Shikugawa / frr.conf.R0
Last active January 3, 2024 14:16
/32 maintenance mode
int net0
ipv6 nd ra-interval 3
no ipv6 nd suppress-ra
!
int net1
ipv6 nd ra-interval 3
no ipv6 nd suppress-ra
!
package main
import (
"flag"
"fmt"
"math/rand"
"net"
"net/http"
"net/rpc"
"strings"
@Shikugawa
Shikugawa / Dockerfile
Created December 29, 2022 12:46
dockerfile for frr development
FROM ubuntu:18.04
ARG DEBIAN_FRONTEND=noninteractive
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
# Update Ubuntu Software repository
RUN apt update && \
apt-get install -y \
git autoconf automake libtool make libreadline-dev texinfo \
pkg-config libpam0g-dev libjson-c-dev bison flex python3-pip \
libc-ares-dev python3-dev python3-sphinx \
nodes:
- name: R1
image: frr-centos8:latest
docker_run_extra_args: --entrypoint bash
sysctls:
- sysctl: net.vrf.strict_mode=1
- sysctl: net.ipv4.ip_forward=1
- sysctl: net.ipv4.conf.all.rp_filter=0
- sysctl: net.ipv4.conf.default.rp_filter=0
- sysctl: net.ipv6.conf.all.forwarding=1
preinit:
- cmds:
- cmd: modprobe vrf
nodes:
- name: R1
image: nicolaka/netshoot
docker_run_extra_args: --entrypoint bash
sysctls:
- sysctl: net.vrf.strict_mode=1
nodes:
- name: R1
image: slankdev/frr
interfaces:
- { name: net0, type: direct, args: C1#net0 }
- { name: net1, type: direct, args: R2#net1 }
- { name: net2, type: direct, args: R3#net2 }
- name: R2
image: slankdev/frr
interfaces:
nodes:
- name: C1
image: alpine:latest
interfaces:
- { name: net1, type: direct, args: CE#net1 }
- name: CE
image: frrouting/frr:v8.1.0
docker_run_extra_args: --entrypoint bash
interfaces:
make docker-build
kind load docker-image ayamaruyama/markdownviewcontroller:latest
# if we have change of CRD
make install
# deploy controller related resources
make deploy
# restart controller