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 / nixos-rustdesk-systemd-service-working.nix
Created October 17, 2023 19:17
nixos rustdesk systemd service configuration
networking.firewall = {
# 8000 = Rustdesk?
# 21115-21117 = Rustdesk https://rustdesk.com/docs/en/self-host/
# 21118 and 21119 = Rustdesk Web Client
allowedUDPPorts = [ ... 22 21116 ... ];
allowedTCPPorts = [ ... 22 8000 21115 21116 21117 21118 21119 ... ];
};
systemd.tmpfiles.rules = [
"d /opt/rustdesk 0700 root root"
@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
#!/usr/bin/env bash
# A NixOS partition scheme with UEFI boot, root on tmpfs, everything else
# on encrypted ZFS datasets, and no swap.
# This script assumes two target drives is already formatted with two partitions:
# 1. 1GB FAT32 UEFI boot partition (each Nix generation consumes about 20MB on
# /boot, so size this based on how many generations you want to store)
# 2. the remainder of the disk formatted for ZFS.
# This script creates the following:
@byrongibson
byrongibson / configuration-boot-section.nix
Last active July 13, 2021 19:56
boot section of configurtion.nix, troubleshooting mirroredBoots with / on tmpfs
# Use EFI boot loader with Grub.
# https://nixos.org/manual/nixos/stable/index.html#sec-installation-partitioning-UEFI
boot = {
supportedFilesystems = [ "vfat" "zfs" ];
initrd = {
network.ssh.enable = true;
supportedFilesystems = [ "vfat" "zfs" ];
};
zfs = {
requestEncryptionCredentials = true; # enable if using ZFS encryption, ZFS will prompt for password during boot
@byrongibson
byrongibson / nixos-rebuild-snapshot.sh
Last active July 7, 2021 18:37
Rebuild Nixos with ZFS snapshot
#!/usr/bin/env bash
# Rebuild NixOS. Snapshots system before rebuilds that are not dry-run,
# dry-activate, or rollback. Expects one required argument to nixos-rebuild:
# 'switch', 'boot', 'test', 'build',
# 'build-vm', 'build-vm-with-bootloader'
# 'dry-rebuild', 'dry-activate'
# optional arguments begin with --. Ex: --upgrade, --upgrade-all, --rollback, etc.
#error handling on
set -e
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/hardware/network/broadcom-43xx.nix")
(modulesPath + "/installer/scan/not-detected.nix")
];
@byrongibson
byrongibson / configuration.broken.nix
Last active June 29, 2021 06:01
NixOS configuration.nix with Nvidia drivers causing boot failure
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
################################################################################
# System