Skip to content

Instantly share code, notes, and snippets.

View deeglaze's full-sized avatar

Dionna Amalie Glaze deeglaze

View GitHub Profile
@deeglaze
deeglaze / client.go.patch
Created February 3, 2023 17:55
go-sev-guest client modification to work around throttling without sev-guest device patches
@@ func UseDefaultSevGuest() bool {
}
func message(d Device, command uintptr, req *labi.SnpUserGuestRequest) error {
- result, err := d.Ioctl(command, req)
- if err != nil {
- // The ioctl could have failed with a firmware error that
- // indicates a problem certificate length. We need to
- // communicate that specifically.
- if req.FwErr != 0 {
@deeglaze
deeglaze / visualize_signing_material.sh
Created November 22, 2019 22:51
Describes data in SGX sign_tool's gendata output
#!/bin/bash
# A script for explaining different parts of an enclave's signing material
function usage() {
echo >&2
echo "Usage: $(basename "$0") [flags] <path_to_signing_material.dat>" >&2
echo >&2
echo " -c,--color=MODE: MODE is one of always, never, auto [default]." >&2
echo " If in a tty, --color=auto produces color codes." >&2
@deeglaze
deeglaze / repro.sh
Created October 23, 2019 23:58
Reproduces a label_flag bug in bazel
#!/bin/bash
function executable() {
local name="$1"
cat > "${name}.cc" <<EOF
#include <cstdlib>
#include <iostream>
int main(int argc, char *argv[]) {
std::cout << "${name}\n";
@deeglaze
deeglaze / Keybase proof
Created April 26, 2019 22:28
Keybase proof
### Keybase proof
I hereby claim:
* I am deeglaze on github.
* I am deeglaze (https://keybase.io/deeglaze) on keybase.
* I have a public key ASBRdo0rzlQWKjZkWSr39Saz0sooRmEU9KOVfkgmLAwGrgo
To claim this, I am signing this object:
@deeglaze
deeglaze / standard-dog.rkt
Last active October 16, 2017 03:46
working out the math for standard-dog
#lang racket
(require pict racket/draw)
;; Not exported by pict/private/utils.rkt
(define (draw-shape/border w h draw-fun
color [border-color #f] [border-width #f]
#:draw-border? [draw-border? #t]
#:transparent? [transparent? #f])
(dc (λ (dc dx dy)
(define old-brush (send dc get-brush))
@deeglaze
deeglaze / standard-cat.rkt
Last active July 20, 2019 14:11
working out the definition of Racket's to-be standard-cat
#lang racket
(require pict/color)
(provide
(contract-out
[cat-silhouette
(->i ([width positive?] [height positive?])
(#:left-ear-extent [left-ear-extent (>=/c 0)]
#:left-ear-arc [left-ear-arc (real-in 0 (* 2 pi))]
#:left-ear-angle [left-ear-angle (real-in 0 (* 2 pi))]
@deeglaze
deeglaze / op-struct.rkt
Created July 29, 2014 22:04
structs with optional representation
#lang racket
(require (for-syntax racket/syntax
syntax/parse
racket/list
syntax/id-table
racket/match
syntax/struct
racket/struct-info))
(provide mk-op-struct)
@deeglaze
deeglaze / gist:40ec1ee101ee7f316180
Created July 17, 2014 19:16
This destroys abstract garbage collection.
(define (flatten x)
(cond
((pair? x)
(append (flatten (car x)) (flatten (cdr x))))
((null? x) x)
(else (list x))))
(flatten '((1 2) (((3 4 5)))))
@deeglaze
deeglaze / define-struct-comment.rkt
Created July 15, 2014 20:11
probably won't happen (?)
#lang racket
(require (for-syntax racket/struct-info))
(define-values (s:p mkp recp refp setp)
(make-struct-type 'parent #f 1 0 #f))
(define-values (s:c mkc recc refc setc)
(make-struct-type 'child s:p 1 0 #f))
(define (refc0 c) (refc c 0))
(define-syntax P 'gotcha!)
(define-syntax C
(make-struct-info (λ ()
@deeglaze
deeglaze / mini-church.sch
Last active December 29, 2015 11:58
Minimal language CFA problem. Unary untyped lambda calculus. Can you get this is always true?
;; multiplication distributes over addition test: (2 * (1 + 3)) = ((2 * 1) + (2 * 3))
((lambda (plus)
((lambda (mult)
((lambda (pred)
((lambda (sub)
((lambda (church0)
((lambda (church1)
((lambda (church2)
((lambda (church3)
((lambda (true)