Skip to content

Instantly share code, notes, and snippets.

View pjfanning's full-sized avatar

PJ Fanning pjfanning

View GitHub Profile
@arcenet
arcenet / gist:24015f4e34a00bbaa8f3bcc64c1745e6
Created August 13, 2017 08:55
Installing haveged on Debian/Ubuntu
apt-get install haveged
nano /etc/default/haveged # Setup DAEMON_ARGS="-w 1024"
update-rc.d haveged defaults
cat /dev/random | rngtest -c 1000 # Testing Availability of Entropy & Quality of Random Data
cat /proc/sys/kernel/random/entropy_avail # To test the amount of available entropy
@EmmanuelOga
EmmanuelOga / IterateCodepoints.java
Last active September 16, 2021 22:34
Iterating over the "letters" (codepoints, not chars) of a string.
package com.emmanueloga.cracking.arrays;
import java.util.Iterator;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
class StringCodepointsIterable implements Iterable<String> {
public class StringCodepointsIterator implements Iterator<String> {
private int index = 0;
@yanns
yanns / gist:f7da61c582ab1da3535d
Created October 9, 2014 13:23
SLF4J MDC propagation in Play
package monitoring
import java.util.concurrent.TimeUnit
import akka.dispatch._
import com.typesafe.config.Config
import org.slf4j.MDC
import scala.concurrent.ExecutionContext
import scala.concurrent.duration.{Duration, FiniteDuration}