Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
KEYNAME="$1"
SERIAL="$2"
openssl genrsa -des3 -out $KEYNAME.key 4096
openssl req -new -key $KEYNAME.key -out $KEYNAME.csr
openssl x509 -req -days 365 -in $KEYNAME.csr -CA ca.crt -CAkey ca.key -set_serial $SERIAL -out $KEYNAME.crt
openssl pkcs12 -export -clcerts -in $KEYNAME.crt -inkey $KEYNAME.key -out $KEYNAME.p12
#!/usr/bin/env python3
"""
A toy implementation of Shamir's secret sharing scheme in Python
Copyright (c) 2017 Daan Sprenkels <hello@dsprenkels.com>
*Do not use in production code!*
This is a toy implementation. This code is hardened against regular and cache
timing attacks. But Python is a high-level language, and thus not suitable for
#/usr/bin/env bash
alias prev='cd ../"$(ls -F .. | grep '/' | grep -B1 -xF "${PWD##*/}/" | head -n 1)"'
alias next='cd ../"$(ls -F .. | grep '/' | grep -A1 -xF "${PWD##*/}/" | tail -n 1)"'
function cdroot() {
while [[ $PWD != '/' && ! $(basename $(dirname $(pwd))) =~ [A-Za-z0-9]+-Assignment_[0-9]+ ]]; do cd ..; done
}
function ne {
#include "randombytes.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
const size_t size = 1024*1024;
char *buf;
size_t idx;
function cdroot()
{
cd .
}
alias prev='cd ../"$(ls -F .. | grep '/' | grep -B1 -xF "${PWD##*/}/" | head -n 1)"'
alias next='cd ../"$(ls -F .. | grep '/' | grep -A1 -xF "${PWD##*/}/" | tail -n 1)"'
function ne
{
/*
* Arithmetic modulo 2^221 - 3 in radix 2^16 (unsigned)
*
* Authors:
* - Daan Sprenkels <hello@dsprenkels.com>
* - Jordi Riemens <jordi.riemens@student.ru.nl>
*
* This module uses redundant representation. Each number is represented an
* array of 14 int64_t elements.
*/
@dsprenkels
dsprenkels / reading_time.rb
Created June 21, 2017 12:57
A reading time filter for Jekyll templates
# A reading time filter for Jekyll templates
#
# Author: Daan Sprenkels <hello@dsprenkels.com>
#
# This module implements a filter for post content which calculates a range of
# time to display to the user. The filter is made for English text (and will
# display an English message). However, you can modify this script for your
# personal needs.
#!/usr/bin/env python3
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
def set_axes():
axes = plt.gca()
axes.set_xlim([-0.25,6.25])
axes.set_ylim([0,50])
00:29:15 [daan:~/Documents/Code/redox] master(+0/-0,1)* 1h14m28s ± make update all
cd cookbook; \
./update.sh "$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages ../initfs.toml ../filesystem.toml)"
Compiling either v1.1.0
Compiling matches v0.1.6
Compiling unicode-width v0.1.4
Compiling version-compare v0.0.4
Compiling extra v0.1.0 (https://github.com/redox-os/libextra.git#40293208)
Compiling libc v0.2.29
Compiling untrusted v0.5.0