Algorithm Snowflake

分布式 ID snowflake 算法使用一个 64bits 的正整数作为 ID。64bits 正整数 layout 如下: package stardustman.github.io; public class SnowFlake { // 起始的时间戳 private final static long START_STAMP = 1480166465631L; // sequence number private final static long SEQUENCE_BIT = 12; // machine id bits private final

Master Pki

certificate 目标:绑定 public key 和 name。一切围绕着这个目标来展开。 图解 References 强烈推荐-everything-pki 翻译版-everything-pki ubuntu-trust-store-location decode-an-ssl-certificate c

Java Thread Pool Params

基本策略 关注点分离,任务提交和执行分离。 延迟策略,延迟初始化。 图解 References 你管这破玩意叫线程池

Virtual Memory Address Explore

virtual memory address space layout 代码测试 cargo new vas-explore main.rs use std::{thread,time}; fn main() { println!("Hello, world!"); let sl = time::Duration::from_millis(10000000); thread::sleep(sl); println!("Goodbye, world!"); } cargo build ./target/debug/vas-explore pidof vas-explore /proc/pid/maps stardust@os:x86_64-linux-gnu$ pidof vas-explore 75599 stardust@os:x86_64-linux-gnu$ cat /proc/75599/maps 556a8a831000-556a8a837000 r--p 00000000 08:12 815699 /home/stardust/Desktop/rust/vas-explore/target/debug/vas-explore 556a8a837000-556a8a86e000 r-xp 00006000 08:12 815699 /home/stardust/Desktop/rust/ vas-explore/target/debug/vas-explore # text(code segment) segment 556a8a86e000-556a8a87c000 r--p 0003d000 08:12 815699 /home/stardust/Desktop/rust/vas-explore/target/debug/vas-explore 556a8a87d000-556a8a880000 r--p 0004b000 08:12 815699 /home/stardust/Desktop/rust/vas-explore/target/debug/vas-explore

Linux File Permissions

最近在使用 k8s 过程中,需要给 mount 的文件配置权限。 提起 file 的权限只想到 rwx,是不全面的,完整的权限是 rwxsStT。 权限列表 权限导图 特殊权限 setuid Setuid is