This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
VERSION="1.3.1" | |
git clone https://github.com/texane/stlink.git | |
cd stlink | |
git checkout $VERSION | |
sudo apt-get install cmake libgtk-3-dev libusb-1.0-0-dev | |
cd build | |
cmake -DCMAKE_BUILD_TYPE=Release .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |