Skip to content

Instantly share code, notes, and snippets.

@atoponce
atoponce / 0-letterblock.js
Last active September 21, 2021 21:57
Improve the password generator security of https://www.draketo.de/english/secure-passwords
/*
Improves the security of https://www.draketo.de/english/secure-passwords:
- Replace the letters with the original proposal at https://www.draketo.de/software/letterblock-diceware
- All bigrams are kept, rather than truncating
- Replace Math.random() with crypto.getRandomValues()
- Replace Math.floor(Math.random() * length) with uniform modulo rejection
- Replace a character count with a minimum security margin
- The HTML "Length" input should be replaced with "Security minimum" (or something similar, in bits)
- Implement the checksum per https://www.draketo.de/software/letterblock-diceware
- Use 6 characters instead of 4 (or 7) for a uniform checksum
@ArneBab
ArneBab / freestream.sh
Last active September 2, 2018 11:04 — forked from bertm/freestream.sh
#!/bin/bash
# This script uses x264 and ffmpeg to recode an input video to low-bitrate MPEG-TS segmented h264
# stream that is suitable for streaming over the web and can be inserted into Freenet.
# Settings have been chosen to strongly prefer quality over encoding speed under conditions of an
# extremely low bitrate, to make the result suitable for direct streaming over Freenet.
#
# (c) bertm, 2014
#
# Prefix for file names in the playlist
@bertm
bertm / freestream.sh
Last active February 8, 2021 20:02
Freenet M3U8 video stream generator
#!/bin/bash
# This script uses x264 and ffmpeg to recode an input video to low-bitrate MPEG-TS segmented h264
# stream that is suitable for streaming over the web and can be inserted into Freenet.
# Settings have been chosen to strongly prefer quality over encoding speed under conditions of an
# extremely low bitrate, to make the result suitable for direct streaming over Freenet.
#
# (c) bertm, 2014
#
# Prefix for file names in the playlist
@rofl0r
rofl0r / init.c
Created August 6, 2013 21:15
minimal init daemon by rich felker, author of musl libc
#define _XOPEN_SOURCE 700
#include <signal.h>
#include <unistd.h>
int main()
{
sigset_t set;
int status;
if (getpid() != 1) return 1;
@st63jun
st63jun / flymake-java.el
Created March 12, 2012 11:59
Fix flymake+ant problem
;; 素のFlymakeでAntを使うとエラー吐くので,いくつか関数を書き換える必要があるっぽい.
(require 'flymake)
(setq flymake-allowed-file-name-masks
'(("\\.\\(?:c\\(?:pp\\|xx\\|\\+\\+\\)?\\|CC\\)\\'" flymake-simple-make-init)
("\\.xml\\'" flymake-xml-init)
("\\.html?\\'" flymake-xml-init)
("\\.cs\\'" flymake-simple-make-init)
("\\.p[ml]\\'" flymake-perl-init)