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 / 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 / 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 / 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)
@deeglaze
deeglaze / annulus.rkt
Created September 20, 2013 20:05
A library-grade annulus drawing function.
#lang racket
(require racket/draw pict)
(define (nonneg-real? x) (and (real? x) (>= x 0)))
(define style/c
(one-of/c 'transparent 'solid 'xor 'hilite
'dot 'long-dash 'short-dash 'dot-dash
'xor-dot 'xor-long-dash 'xor-short-dash
'xor-dot-dash))
(define (within-width-and-height w h)
(make-contract #:name (format "within width and height ~a ~a" w h)
@deeglaze
deeglaze / bug-but-not.rkt
Created September 2, 2013 23:48
A small presentation of the generics scoping weirdness, but doesn't exhibit the bug.
#lang racket/load
(module A racket
(provide gen:foo (rename-out [*a a]))
(define *a #t)
(define a #f)
(define-syntax gen:foo (list #'a)))
(module B racket
(require 'A) (provide ga)
(define-syntax (bar stx)
@deeglaze
deeglaze / exercise7.rkt
Created May 16, 2013 19:41
Do the scientific 7 minute workout... with Racket!
#lang racket
(provide main)
(require (planet clements/rsound) 2htdp/universe 2htdp/image)
;; Helpful app to implement the exercise plan in
;; http://well.blogs.nytimes.com/2013/05/09/the-scientific-7-minute-workout/
(define exercises '("Jumping jacks"
"Wall sit"
"Push ups"