Skip to content

Instantly share code, notes, and snippets.

View sanyarnd's full-sized avatar

Alexander Biryukov sanyarnd

  • Moscow, Russian Federation
View GitHub Profile
@sanyarnd
sanyarnd / README.md
Last active March 12, 2026 21:03
MikroTik dynamic domain-based routing to containers (Mihomo + ByeDPI)

MikroTik dynamic domain-based routing to containers (Mihomo + ByeDPI)

Route selected domains via containers using DNS-populated address lists and policy routing. LAN keeps normal WAN; chosen domains go either to ByeDPI (DPI-bypass) or Mihomo (VPN).

Based on the article by @wiktorbgu at Habr.

How it works

  • Router DNS resolves domains and fills address-lists (to-dpi, to-mihomo).
@sanyarnd
sanyarnd / EnhancedSourceJarNoForkMojo.java
Created June 19, 2020 10:57
Maven Sources + Delombok
import java.util.List;
import java.util.stream.Collectors;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.source.SourceJarNoForkMojo;
import org.apache.maven.project.MavenProject;
/**
* This goal bundles all the sources into a jar archive, but uses delomboked sources.
@sanyarnd
sanyarnd / automata_utils.py
Created September 1, 2019 00:15
DFA, NFA and Epsilon-NFA implementations
EPS = "eps"
ERROR = "Error"
def get_file_data(filename: str):
with open(filename, "r") as file:
data = file.read()
return data.splitlines()
@sanyarnd
sanyarnd / cgi_smtp.cpp
Created September 1, 2019 00:10
Sample CGI SMTP application
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <cgicc/CgiDefs.h>
#include <cgicc/Cgicc.h>
#include <cgicc/HTTPHTMLHeader.h>
@sanyarnd
sanyarnd / mpl_multiplication_table.cpp
Last active September 1, 2019 00:08
MPL Multiplication Table
#include <iostream>
#include "mult_table.hpp"
int main()
{
std::cout << std::setw(3*N) << "Multiplication Table " << N << "x" << N << ":" << std::endl;
print_table<mult_table>();
return 0;
@sanyarnd
sanyarnd / ProcessExecutor.java
Created July 18, 2019 14:13
Execute native binary and glob stderr/stdout output on JVM
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import org.checkerframework.checker.nullness.qual.NonNull;
@sanyarnd
sanyarnd / Os.java
Created July 14, 2019 11:17
Detect OS on JVM
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.util.Locale;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Operating systems enumeration.
*
* @author Alexander Biryukov