Skip to content

Instantly share code, notes, and snippets.

@byrongibson
byrongibson / engine.c
Created March 6, 2024 21:08 — forked from druska/engine.c
Quant Cup 1's winning order book implementation
/*****************************************************************************
* QuantCup 1: Price-Time Matching Engine
*
* Submitted by: voyager
*
* Design Overview:
* In this implementation, the limit order book is represented using
* a flat linear array (pricePoints), indexed by the numeric price value.
* Each entry in this array corresponds to a specific price point and holds
* an instance of struct pricePoint. This data structure maintains a list
@byrongibson
byrongibson / stream.sh
Created October 3, 2023 22:42 — forked from digitalsignalperson/stream.sh
xdp screen cast example, modified to pipe to ffmpeg
mkfifo /tmp/gfifo
./xdp-screen-cast-ffmpeg.py & # or run in another terminal
# Note the gstreamer pipeline
# 'pipewiresrc fd=%d path=%u ! videorate ! video/x-raw,framerate=60/1 ! videoconvert ! filesink location=/tmp/gfifo'
# I specified a 60/1 frameerate. You can do other pre-processing here, or offload it to ffmpeg.
# Encode the stream and pipe to netcat
# note: must specify correct resolution here
# we can now use h264_nvenc, mpegts, and anything else ffmpeg has
@byrongibson
byrongibson / settings.jsonc
Created May 15, 2023 16:13 — forked from hyperupcall/settings.jsonc
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{
@byrongibson
byrongibson / zoomsucks.md
Created September 16, 2021 18:02 — forked from typokign/zoomsucks.md
Zoom Sucks

Zoom Sucks

  • Zoom abuses the installer flow on MacOS to bypass permissions dialogs (source)
  • Zoom sends identifying device info to Facebook, even when users don't have a Facebook account (source) (fixed)
  • A bug in Zoom sent identifying information (including email addresses and profile pictures) of thousands of users to strangers (source)
  • Zoom claims that meetings are end-to-end encrypted in their white paper and marketing materials, but meetings are only encrypted in transit, and are available in plaintext to Zoom servers and employees. (source)
  • zoomAutenticationTool can be used to escalat
@byrongibson
byrongibson / encryptedNixos.md
Created June 15, 2021 05:58 — forked from ladinu/encryptedNixos.md
NixOS install with encrypted /boot /root with single password unlock

Requirements

  1. Encrypt everthing including /boot and /root
  2. Enter password once
  3. Support UEFI

Installation media setup

Download NixOS minimal iso and copy to USB stick. For example on Mac OSX

$ diskutil list
$ diskutil unmountDisk /dev/disk1 # Make sure you got right device

Setting up NixOs with LUKS encrypted root

Here are my working notes on getting a system up and running.

WARNING: You can run into a hidden problem that will prevent a correct partition setup and /etc/nixos/configuration.nix from working: if you are setting up a UEFI system, then you need to make sure you boot into the NixOS installation from the UEFI partition of the bootable media. You may have to enter your BIOS boot selection menu to verify this. For example, if you setup a NixOS installer image on a flash drive, your BIOS menu may display several boot options from that flash drive: choose the one explicitly labeled with “UEFI”.

References

I used these resources:

@byrongibson
byrongibson / Readme.md
Created June 13, 2021 03:38 — forked from ixmatus/Readme.md
Nixos with ZFS on encrypted LUKS as root filesystem
@byrongibson
byrongibson / partition-nixos-zfs-swap-luks.sh
Created June 7, 2021 22:29 — forked from timstott/partition-nixos-zfs-swap-luks.sh
discourse.nixos.org/t/nixos-on-luks-encrypted-partition-with-zfs-and-swap/6873 - original script
#!/usr/bin/env bash
# NixOS install with encrypted root and swap
#
# sda
# ├─sda1 BOOT
# └─sda2 LINUX (LUKS CONTAINER)
# └─cryptroot LUKS MAPPER
# └─cryptroot1 SWAP
# └─cryptroot2 ZFS
@byrongibson
byrongibson / install.sh
Created May 23, 2021 05:06 — forked from mx00s/install.sh
NixOS install script based on @grahamc's "Erase Your Darlings" blog post
#!/usr/bin/env bash
#
# NixOS install script synthesized from:
#
# - Erase Your Darlings (https://grahamc.com/blog/erase-your-darlings)
# - ZFS Datasets for NixOS (https://grahamc.com/blog/nixos-on-zfs)
# - NixOS Manual (https://nixos.org/nixos/manual/)
#
# It expects the name of the block device (e.g. 'sda') to partition
@byrongibson
byrongibson / 0build-bitcoin.sh
Created September 23, 2015 18:40 — forked from devrandom/00README.md
Building bitcoin with gitian-builder
# First run:
apt-get install apt-cacher python-vm-builder
vi /etc/default/apt-cacher # ensure autostart is enabled
sudo service apt-cacher start
git clone git://github.com/bitcoin/bitcoin.git
git clone git://github.com/devrandom/gitian-builder.git
mkdir gitian-builder/inputs
wget 'http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.5.tar.gz' -O gitian-builder/inputs/miniupnpc-1.5.tar.gz
wget 'http://downloads.sourceforge.net/project/wxwindows/2.9.1/wxWidgets-2.9.1.tar.bz2' -O gitian-builder/inputs/wxWidgets-2.9.1.tar.bz2