Skip to content

Instantly share code, notes, and snippets.

@ZenithalHourlyRate
ZenithalHourlyRate / 1-openssl.md
Last active May 17, 2022 08:08
Benchmark of OpenSSL AES for RISC-V 64
@moesoha
moesoha / generate_ptp_cost.sh
Last active March 17, 2023 18:04
Generate BIRD constants with ping statistics in 10s
#!/bin/sh
# gathering all interfaces with IPv6 link-local address
for with_ll in $(cat /proc/net/if_inet6 | grep "^fe80" | tr -s ' ' | cut -d ' ' -f 6 | sort -u); do
# POINTOPOINT flag is 1 << 4, filter non-PTP interfaces out
if [ $(expr \( $(($(cat /sys/class/net/$with_ll/flags))) / 16 \) % 2) -ne 1 ]; then
continue
fi
cost=65535
ping_rtt=N/A
@daniel-corbett
daniel-corbett / haproxy-portknock.cfg
Last active April 7, 2024 03:03
HAProxy Port Knocking
# Listens on 6000-9000 for a sequence of port knocks.
# Requires an explicit order of port access before opening
# Current defined order is 6001,7001,8001,9000
# If another port is accessed during the sequence it must be started from the beginning
listen portknock
mode tcp
bind *:6000-9000
stick-table type ip size 1m expire 24h store conn_cnt,gpt0
tcp-request connection track-sc0 src
tcp-request connection sc-set-gpt0(0) 1 if { dst_port 6001 } { sc_get_gpt0(0) -m int lt 4 }
@sirkha
sirkha / shell.nix
Last active April 28, 2024 02:53
gem5 shell env
with import <nixpkgs>{};
stdenv.mkDerivation rec {
name = "gem5-git";
env = buildEnv { name = name; paths = buildInputs; };
zlib-dev = lib.getDev zlib;
zlib-lib = lib.getLib zlib;
buildInputs = [
mercurial
git
gcc
@anryko
anryko / Makefile
Created March 29, 2016 20:32
Simple kernel module example. Lists process list and count.
obj-m += lkm_hello1.o
KDIR ?= /lib/modules/$(shell uname -r)/build
all:
make -C $(KDIR) M=$(PWD) modules
clean:
make -C $(KDIR) M=$(PWD) clean