Skip to content

Instantly share code, notes, and snippets.

View chez-shanpu's full-sized avatar

Tomoki Sugiura chez-shanpu

View GitHub Profile
@chez-shanpu
chez-shanpu / GSoC_final_report.md
Last active April 16, 2023 17:06
Google Summer of Code 2021 Final Report

GSoC 2021 Explicit Allow-Listing for ICMP @Cilium

Introduction

Kubernetes is a container orchestration platform and it has emerged as the de-facto tool for managing a large number of containers. In Kubernetes, networking functions, such as managing communication between applications and network policies, are delegated to CNI plugins.

Cilium is a CNI plugin for Kubernetes which provides secure network connectivity and load-balancing between applications using eBPF. Cilium can manage network access by using network policy functions, called “CiliumNetworkPolicy” (CNP). Users can allow or deny specific traffic by applying a CNP.
However, currently, any traffic except for TCP/UDP (including ICMP) is denied if an L4 CNP is present, and there is no way for users to explicitly allow ICMP traffic. Therefore, my project aims to implement a CNP for explicitly allowing ICMP traffic.

@chez-shanpu
chez-shanpu / matmul.cpp
Last active December 17, 2020 13:08 — forked from keichi/matmul.cpp
#include <chrono>
#include <iostream>
#include <random>
const int N = 1000;
const int TRIALS = 10;
// [memo] When "N" equals 1000, # of flops is 2000000000
const double nFlops = 2.0 * 1000 * 1000 * 1000;
@chez-shanpu
chez-shanpu / bpm.go
Created July 20, 2020 03:55
BipartiteMatching
// refer https://www.geeksforgeeks.org/maximum-bipartite-matching/
package main
import "fmt"
func BPM(graph [][]bool, m, n int) []int {
matchR := make([]int, n)
matchR, _ = fill(matchR, -1, 0, len(matchR))
for u := 0; u < m; u++ {
@chez-shanpu
chez-shanpu / avl.go
Last active June 1, 2020 06:57
AVL木
package main
import (
"fmt"
"math"
)
type binaryTree struct {
root *node
}
@chez-shanpu
chez-shanpu / bst.go
Last active May 31, 2020 15:25
二分探索木
package main
import "fmt"
type binaryTree struct {
root *node
}
type node struct {
value int
@chez-shanpu
chez-shanpu / bf.go
Last active May 31, 2020 15:25
Bloom Filter
package main
import "fmt"
type bloomFilter struct {
bits uint
hashFunctions []hashFunction
}
type hashFunction struct {
@chez-shanpu
chez-shanpu / bug-shooting-challenge-pre-2.rb
Created February 7, 2019 09:10
bug-shooting-challenge-pre-2
class UsersController < ActionController
def show
user = User.find(params[:id].to_i)
render json: user.as_json(except: :crypted_password)
end
end