Skip to content

Instantly share code, notes, and snippets.

View Jacajack's full-sized avatar
🦄

Jacek Wieczorek Jacajack

🦄
View GitHub Profile
@metacollin
metacollin / ltspice.md
Last active April 30, 2022 10:28
LTSpice color scheme - Twilight After Dawn

screenshot

LTSpice color scheme - Twilight After Dawn

                |  R    |  G    |  B    |
Wires           |  138  |  154  |  149  |
Junctions       |  152  |  205  |  255  |
Component body  |  207  |  106  |  76   |
Graphic Flag | 218 | 239 | 163 |
@leoloobeek
leoloobeek / get_gists.py
Created April 26, 2017 21:34
Download all gists for a specific user
# first: mkdir user && cd user && cp /path/to/get_gists.py .
# python3 get_gists.py user
import requests
import sys
from subprocess import call
user = sys.argv[1]
r = requests.get('https://api.github.com/users/{0}/gists'.format(user))
@bloc97
bloc97 / TwoMethods.md
Last active May 14, 2024 03:15
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

@da-n
da-n / usb-unlock-luks.md
Created August 24, 2019 13:11
Unlock LUKS full disk with USB stick

Configuration for passwordless root filesystem

Source: https://www.howtoforge.com/tutorial/passwordless-encryption-of-linux-root-partition/

The process of entering the passphrase at boot time will now be automated using an USB memory stick. Instead of using a passphrase , the secret key on the USB will decrypt the encrypted volumes. Connect an USB stick to the VM and locate it using the dmesg command. It is detected as /dev/sdb in my VM.

The secret key of 8192 random byte is extracted from the usb stick using the dd command.

dd if=/dev/sdb of=/root/secret.key bs=512 skip=4 count=16
/* So how does this work?
I'm using ANSI escape sequences to control the behavior of the terminal while
cat is outputting the text. I deliberately place these control sequences inside
comments so the C++ compiler doesn't try to treat them as code.*/
//
/*The commands in the fake code comment move the cursor to the left edge and
clear out the line, allowing the fake code to take the place of the real code.
And this explanation uses similar commands to wipe itself out too. */
//
#include <cstdio>
@jeffamstutz
jeffamstutz / get_imgui.cmake
Created February 8, 2021 14:35
CMake FetchContent to get ImGui
FetchContent_Populate(imgui
URL https://github.com/ocornut/imgui/archive/docking.zip
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/imgui
)
set(OpenGL_GL_PREFERENCE "LEGACY")
find_package(OpenGL 2 REQUIRED)
find_package(glfw3 REQUIRED)
add_library(imgui_glfw STATIC