Skip to content

Instantly share code, notes, and snippets.

View syncom's full-sized avatar

Ning Shang syncom

View GitHub Profile
@syncom
syncom / mutt-with-gmail-gpg-macosx.md
Last active January 30, 2025 05:47
Configure Mutt to work with Gmail + GPG on MacOS X and Linux

Mutt (or NeoMutt) with Gmail and GPG, Mutiple Accounts

This note describes how to set up the Mutt or NeoMutt email client to work for Gmail and GnuPG, for two Gmail accounts. The method can be trivially extended to more than two accounts. The configuration should work for both macOS and Linux.

Software versions

How to Distribute Password Halves for Separation of Duty

Problem:

We have 5 passwords: a, b, c, d, e. It needs exactly two distinct passwords to open a safe. Each of the passwords is split into two halve - a prefix and a suffix. Let them be

    a1, a2; b1, b2; c1, c2; d1, d2; e1, e2
@syncom
syncom / trunc_hash_collision_sim.md
Last active May 28, 2021 19:36
Simulate Truncated MD5 Digest Collisions for a Data Set

Simulate Truncated MD5 Digest Collisions for a Data Set

On a single core

#!/usr/bin/env python3

'''Simulate the number of truncated hash (MD5) collisions for a data set.

data set size: num_records
@syncom
syncom / k3s-on-rpi4-ubuntu.md
Last active June 20, 2025 05:02
Set up k3s for kubernetes on Ubuntu on Raspberry Pi 4

Steps for setting up k3s on Ubuntu 20.04.2 on Raspberry Pi 4 Cluster

We use three Raspberry Pi 4's (RPI4's) for the setup. One of them is used as the control plane, and the other two are used as workers.

  1. On all three RPI4's, snstall Ubuntu server 20.04.

    • Follow these instructions
    • Assign static IPs to these RPI4s (via router's DHCP settings), call them rpi4-k8s-ctrl, rpi4-k8s-wkr00, and rpi4-k8s-wkr01, respectively, and add them to /etc/hosts for all three RPI4s as well as the PC used for the setup
  2. On all three RPI4's, enable cgroup (reference)