Skip to content

Instantly share code, notes, and snippets.

View hucsmn's full-sized avatar
💭
I may be slow to respond.

hucsmn hucsmn

💭
I may be slow to respond.
View GitHub Profile
@hucsmn
hucsmn / Cargo.toml
Last active March 4, 2020 07:43
Performance of suffix array contruction algorithms available in rust.
[package]
name = "rustsatest"
version = "0.1.0"
edition = "2018"
[dependencies]
suffix_array = { version = "0.4", default-features = false, features = ["parallel"] }
cdivsufsort = "*"
divsufsort = "*"
suffix = "*"
@hucsmn
hucsmn / gen_table_rustc_cfg.py
Last active April 11, 2020 05:02
Generate a table of rustc cfg (require nightly toolchain)
#!/usr/bin/python3
import re
import argparse
from subprocess import Popen, PIPE
YES = "\u2714"
NO = "\u2716"
NA = "N/A"
@hucsmn
hucsmn / Makefile
Created April 23, 2020 10:06
SDU EAPoL Client for OpenWrt
.PHONY: all clean
all: sdu-eapol
clean:
rm sdu-eapol
sdu-eapol: sdu-eapol.c
$(CC) -Os -static -s -o $@ $^
@hucsmn
hucsmn / wsl2.md
Last active July 5, 2024 19:20
A collection of WSL2 hacks

Notes on configuring ArchWSL on WSL2.

Basic setup

Edit %UserProfile%\.wslconfig:

[wsl2]
swap=0
localhostForwarding=true
@hucsmn
hucsmn / build_pika.sh
Created December 5, 2020 07:50
Build script for Qihoo360/pika on CentOS 8 (gcc 8.3.1)
#!/bin/bash
PIKA_VERSION=3.2.9
fetch_pika() {
if [[ ! -d pika ]]; then
git clone https://github.com/Qihoo360/pika.git && cd pika
fi
}
@hucsmn
hucsmn / 10-udisks2.rules
Created March 13, 2021 03:19
PolicyKit udisk2 rules that allows auto mounting
/*
* Allow partition auto mounting for desktop environments.
* Put this file in /etc/polkit-1/rules.d/ then add user to the storage or disk group.
*/
// allowed actions
var udisks2_actions = [
'org.freedesktop.udisks2.filesystem-mount-system',
'org.freedesktop.udisks2.filesystem-mount',
];
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hucsmn
hucsmn / k8s-notes.md
Last active September 26, 2022 06:43
Kubernetes installation notes

Kubernetes installation notes

All nodes are running Debian 11 cloud image, architect x86_64, hypervisor kvm (libvirt), kernel 5.10.0-18, kubelet version 1.25.2.

Basic setup (on each node)

  1. Install packages
@hucsmn
hucsmn / jetbrains_jdk.py
Last active October 2, 2023 05:57
batch configuring JDK for JetBrains productions
#!/usr/bin/env python3
import os
import argparse
profile_jdk_mapping = {
'IntelliJIdea': 'idea.jdk',
'WebStorm': 'webstorm.jdk',
'PyCharm': 'pycharm.jdk',
'CLion': 'clion.jdk',
@hucsmn
hucsmn / 10-ip-forwarding.conf
Last active April 25, 2023 05:11
NetworkManager dispatcher script for wireguard server ip forwarding
# enable ipv4 forwarding, under /etc/sysctl.d
net.ipv4.ip_forward=1