Skip to content

Instantly share code, notes, and snippets.

View darrenldl's full-sized avatar

Darren Li darrenldl

View GitHub Profile
{
"stats": {
"writev": 1,
"write": 93145,
"waitid": 19,
"wait4": 3,
"unlink": 200,
"uname": 128,
"umask": 18,
"tgkill": 1,
Simulation at data loss rate of 30.0%, at max redundancy of 100.0%, non-systematic
setup:
systematic: false
systematic scaling factor: 10.000
encode all drops upfront: false
data block count: 100
max drop count: 200
data block size: 1300
max redundancy: 100.000%
data loss rate: 30.000%
@darrenldl
darrenldl / closeboot.md
Last active July 6, 2021 14:21
Hooks for unmounting external USB on Arch

Hooks for unmounting external USB on Arch

Files

  • install_closeboot is the install hook
  • runtime_closeboot is the runtime hook

Instructions

  1. Copy install_closeboot to /usr/lib/initcpio/install/closeboot

Examples

"starting from 2020 Dec, every 2 months, second thursday"

(since_year 2020 (since_start_of_month `Dec (every_nth_month 2 (nth_weekday 2 `Thu entire_day))))

"every other day of year 2020"

@darrenldl
darrenldl / proof-of-attack_vs_proof-of-security.txt
Last active September 16, 2020 15:54
Notes on proof of attack vs proof of security
Proof of attack vs proof of security
Soundness (NO false positives, may false negatives)
- May miss out legitimate cases
- "Conservative" systems normally at least have soundness
Completeness (may false positives, NO false negatives)
- Never miss out legitimate cases, but may grab more than needed
Proof of attack (off sec)
- Under some premises, shows there exists an attack for a given system (e.g. protocol, software)

Cornell CS3110 2019 Chapter 8.2 Streams thought process

Context

This is a document in response to a Discord question on how to go about understanding the definition of nats in the chapter listed in title.

We cannot teach intuition, but giving one a more indepth view on how someone else thinks might allow one to draw inspirations and form intuitions more efficiently than just staring at a (very) abstract object for days.

Following documents some of the ways I dissected/thought about nats, as an attempt of achieving the above goal.

@darrenldl
darrenldl / ubuntu_luks_keyfile_guide.md
Last active July 14, 2023 17:18
Ubuntu keyfile boot

Ubuntu LUKS keyfile guide

Goal

We want to be able to set up an encrypted Ubuntu installation where we can unlock using just an external USB key without entering any passwords

We do not consider evil maid attacks in this case, and are only worried about data leak

We also assume USB key is kept securely, thus we are not concerned with USB key not being encrypted

@darrenldl
darrenldl / status
Created January 19, 2019 12:57
VLC status file text
3.0.6
http://get.videolan.org/vlc/3.0.6/vlc-3.0.6.tar.xz
VideoLAN and the VLC development team present VLC 3.0.6 "Vetinari".
VLC 3.0.6 is a minor update to VLC 3.0 branch, improving hardware decoding, Windows 10 and macOS mojave integration, RTSP, Bluray but also adding the support for a fast AV1 decoding.
let swap (a : int array) (i : int) (j : int) : unit =
let temp = a.(i) in
a.(i) <- a.(j);
a.(j) <- temp
(* Took a while to understand what you're trying to do in this function,
* add comments in future whenever you have a non-trivial piece of code *)
let small_to_front (arr : int array) (start_unsorted : int) : unit =
(* W.r.t aux, see below *)
let rec aux (arr : int array) (start_unsorted : int) (i : int) (index_smallest : int) : unit =