Skip to content

Instantly share code, notes, and snippets.

View cdfpaz's full-sized avatar

bzero cdfpaz

View GitHub Profile
@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@linux-china
linux-china / KetamaConsistentHash.java
Last active February 22, 2022 11:31
Ketama Consistent Hash with Java language implementation
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.List;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
public class KetamaConsistentHash<T> {