Skip to content

Instantly share code, notes, and snippets.

View Lupus's full-sized avatar

Konstantin A. Olkhovskiy Lupus

View GitHub Profile
@Lupus
Lupus / wsl2-custom-kernel-rancher-desktop-cilium.md
Created September 18, 2025 07:19
WSL2 Custom Kernel Build Guide for Cilium with Rancher Desktop

WSL2 Custom Kernel Build Guide for Cilium with Rancher Desktop

Overview

This guide documents the complete process of building a custom WSL2 kernel with Cilium support and integrating it with Rancher Desktop's K3s distribution. The custom kernel enables full Cilium functionality including L7 proxy features, eBPF acceleration, and advanced networking capabilities.

Prerequisites

  • Windows 11 22H2 or later
  • WSL2 installed and updated to latest version
@Lupus
Lupus / train_data.lua
Created July 22, 2025 08:56
Get train data via FicsIt Networks mod
-- Get train information from station
function getTrainData()
local trains = {}
-- Get the track graph from the station
local success, trackGraph = pcall(function() return station:getTrackGraph() end)
if success and trackGraph then
-- Get all trains in the track graph
local success2, trainList = pcall(function() return trackGraph:getTrains() end)
@Lupus
Lupus / lwt_echo_post2.ml
Last active October 2, 2019 22:00
lwt_echo_post2.ml
open Base
open Lwt.Infix
module Arg = Caml.Arg
open Httpaf_lwt_unix
module Reqd = Httpaf.Reqd
module Request = Httpaf.Request
module Headers = Httpaf.Headers
module Response = Httpaf.Response
module Body = Httpaf.Body
@Lupus
Lupus / lwt_echo_post.ml
Created August 2, 2019 10:38
Sample app illustrating httpaf chunked encoding issue
open Base
open Lwt.Infix
module Arg = Caml.Arg
open Httpaf_lwt_unix
module Reqd = Httpaf.Reqd
module Request = Httpaf.Request
module Headers = Httpaf.Headers
module Response = Httpaf.Response
module Body = Httpaf.Body
@Lupus
Lupus / Image_utils.re
Last active June 15, 2019 11:47
Some simple set of functions to manipulate RGB images in ReasonML (only PPM output format is supported)
module Image = {
type channel_t =
Bigarray.Array2.t(char, Bigarray.int8_unsigned_elt, Bigarray.c_layout);
type t = {
width: int,
height: int,
r_channel: channel_t,
g_channel: channel_t,
b_channel: channel_t,
};
module Errors: {
type t;
type baseError = {
name: string,
info: string,
message: string
};
type noHostAvailableError = {
name: string,
info: string,
module Errors = {
type t;
type errors = {
.
"_NoHostAvailableError": t,
"_ResponseError": t,
"_DriverInternalError": t,
"_AuthenticationError": t,
"_ArgumentError": t,
"_OperationTimedOutError": t,
// Generated by BUCKLESCRIPT VERSION 1.9.2, PLEASE EDIT WITH CARE
'use strict';
var Caml_missing_polyfill = require("stdlib/caml_missing_polyfill");
function foo (x) {
if (x == 0) return null;
else if (x == 1) return 0;
return "bar";
module EventEmitter = {
module Event = {
type t('e, 'v) = ..;
type t(_, _) +=
| NewListener : t([>`EventEmitter], string)
| RemoveListener : t([>`EventEmitter], string);
type pkg =
| Pkg(t('e, 'v)): pkg;
};
module Listener = {
@Lupus
Lupus / ssl_test2.c
Created October 18, 2017 09:11 — forked from roxlu/ssl_test2.c
Compact example of how to use openSSL with self signed (no password) keys/certificates, DTLS and memory BIOs
/*
Create server/client self-signed certificate/key (self signed, DONT ADD PASSWORD)
openssl req -x509 -newkey rsa:2048 -days 3650 -nodes -keyout client-key.pem -out client-cert.pem
openssl req -x509 -newkey rsa:2048 -days 3650 -nodes -keyout server-key.pem -out server-cert.pem
*/
#include <stdio.h>