Skip to content

Instantly share code, notes, and snippets.

View qguv's full-sized avatar
vibing

Quint Guvernator qguv

vibing
View GitHub Profile
@qguv
qguv / pancakes.md
Created August 12, 2023 22:09
Fluffy vegan pancakes

Fluffy vegan pancakes

Prep: 15 minutes. Cooking: a few minutes per round. One batch serves about 3 people.

Tools

  • large mixing bowl
  • griddle (alternatively: several flat frying pans)
  • large, thin spatula
  • soup ladle

20 million digits of pi in under a minute with Julia

I recently discovered a relatively obscure algorithm for calculating the digits of pi: https://en.wikipedia.org/wiki/Gauss–Legendre_algorithm. Well, at least obscure compared to Chudnovsky's. Wikipedia notes that it is "memory-intensive" but is it really? Let's compare to the MPFR pi function:

function gauss_legendre(prec)
    setprecision(BigFloat, prec, base=10)
    GC.enable(false)
@qguv
qguv / static-filters.txt
Last active May 2, 2023 12:54
uBlock Origin static filters
! to keep your filters updated, import this list as:
! https://gist.githubusercontent.com/qguv/0b1def9db429a4caf6a97fd7b48b52b2/raw/static-filters.txt
! 2021-01-18 https://stackoverflow.com
! accessibility: remove dark rabbit-hole distraction links
! to update:
! 1. visit https://stackexchange.com/sites?view=list
! 2. open devtools (F12)
! 3. choose the console tab
! 4. paste the following (without the ! at the beginning)
@equipter
equipter / SAK Switching.md
Last active February 26, 2024 20:34
Explaination of Mifare Classic SAK Swapping anti cloning defense

Mifare Classic - SAK Swapping Explained

What is SAK Swapping

Behaviour has been observered where some system using Mifare Classic credentials will identify with one SAK (0x08/18) on a basic search (Wake up) but when the block 0 is dumped, the SAK appears to be different (0x88)

This is because the SAK reported on a Wake up is not coming from Block 0 but is instead burned into the card, The SAK in Block 0 is merely a Vanity SAK.

If the dump is loaded onto a Magic Mifare Classic that Mirrors the vanity SAK as the actual SAK on Wake up it will tell the system that the credential is a duplicate & to deny access.

@pothos
pothos / systemd-sudo.sh
Created January 26, 2022 12:31
systemd-sudo.sh: a non-setuid sudo-alike using systemd-run
#!/bin/bash
set -euo pipefail
MYNAME=$(basename "${0}")
opts=$(getopt --name "$MYNAME" --options 'hVsEnu:g:D:' \
--longoptions 'help,version,shell,preserve-env,non-interactive,user:,group:,chdir:' -- "${@}")
eval set -- "${opts}"
U=0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Script to calculate possible final standings for "combined climbing" (Olympics 2020 format)
from incomplete in-progress results:
BEST-WORST POSSIBLE FINAL STANDINGS
===================================
A. Gines Lopez: 1-2
@SabinT
SabinT / UnityWaterSinusoidal.hlsl
Last active August 5, 2021 13:59
A water shader in Unity (generates vertex displacement and per-pixel normasl)
#ifndef WaterSineSeries
#define WaterSineSeries
// Based on GPU GEMS, Chapter 1: Effective Water Simulation from Physical Models
// https://developer.download.nvidia.com/books/HTML/gpugems/gpugems_ch01.html
#define TWO_PI 6.2831853
/**
* x,y: coordinates
@binji
binji / LICENSE
Last active January 3, 2024 23:37
pokegb.cc w/o macros
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
@Th3Whit3Wolf
Th3Whit3Wolf / Arch Secure Laptop Install.md
Last active February 23, 2024 16:00
My install instruction for a secure Arch Linux (sway) laptop workstation

What's Cool

  • Encrypted root partition
    • AES-256 bit cipher
    • Argon2id variant for PBKDF
    • Sha3-512 bit hash
  • rEFInd bootloader
    • With dreary theme
    • Optimal Settings (optimized for aesthetics, and boot time)
  • Boot into backups thanks to refind-btrfs
@progandy
progandy / README.md
Last active September 26, 2023 08:27
Sway output mirror and screencast

Sway output mirror and screencast

Mirror

wf-recorder

With wf-recorder it is possible to record one output. When ffmpeg is compiled with sdl support, then it is possible to use "sdl" as the muxer and replay the recorded video instead of writing it to a file.