Skip to content

Instantly share code, notes, and snippets.

@danielgross
danielgross / mathpix2gpt.py
Last active April 22, 2024 05:19
mathpix2gpt.py
import requests
import time
import os
import sys
import openai
import tiktoken
from termcolor import colored
openai.api_key = open(os.path.expanduser('~/.openai')).read().strip()
@crshmk
crshmk / 11_svelte-file.svelte
Last active November 3, 2022 20:44
Learn Svelte in a gist
<script>
let x
</script>
<p>markup</p>
<style>
body {
background: white;
}
@bloc97
bloc97 / TwoMethods.md
Last active February 20, 2024 12:19
Two Fast Methods of Generating True Random Numbers on the Arduino

Two Fast Methods of Generating True Random Numbers on the Arduino

Arduino true random number generator

B. Peng

December 2017

Abstract

The AVR series microcontrollers are a collection of cheap and versatile chips that are used in many applications ranging from hobbist projects to commercial infrastructure. One major problem for some hobbists is the lack of secure random number generation on the Arduino platform. The included pseudo-random number generator (PRNG) is very easy to defeat and is useless for any crypto-related uses. One recommendation from the Arduino Reference Manual is to use atmospheric noise from the chip's analog sensor pins as seed data[6].
Unfortunately this method is extremely weak and should not be used to emulate a true random number generator (TRNG). Existing methods such as using the internal timer drift or using a dedicated generator are either too slow, requires extensive external hardware or modifications to the microcontroller's internal mech