Skip to content

Instantly share code, notes, and snippets.

@tobyp
tobyp / scheduling.cpp
Last active December 19, 2015 17:19
A smidgen of scheduling madness. Any feedback would be great, especially if you see a problem.
#include <chrono>
#include <condition_variable>
#include <deque>
#include <list>
#include <mutex>
#include <thread>
#include <utility>
#include <vector>
namespace scheduling {
package net.tobyp.bukkit.annoyance;
import org.bukkit.ChatColor;
import org.bukkit.entity.Creeper;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.*;
@tobyp
tobyp / glfw-error.c
Created July 22, 2016 15:53
Minimal test program to reproduce a GLFW/Cairo problem concerning GLX
#include <GLFW/glfw3.h>
#define GLFW_EXPOSE_NATIVE_X11
#define GLFW_EXPOSE_NATIVE_GLX
#include <GLFW/glfw3native.h>
#include <cairo/cairo.h>
#include <cairo/cairo-gl.h>
#include <stdlib.h>
int main(int argc, char * argv[]) {
@tobyp
tobyp / glfw-cairo-xlib.c
Created November 21, 2020 11:40
Minimal GLFW+Cairo+Xlib example
//gcc $(pkg-config --cflags --libs glfw3 cairo) glfw-cairo-xlib.c
#include <math.h>
#include <stdio.h>
#include <cairo/cairo.h>
#include <cairo/cairo-xlib.h>
#include <GLFW/glfw3.h>
#define GLFW_EXPOSE_NATIVE_X11
@tobyp
tobyp / tss-with-tpm2go.md
Created June 30, 2022 18:31
TPM2-TSS with TPM2Go Support

Testing TPM2-TSS for LetsTrust TMP2Go

1. Build TPM2-TSS with necessary patches for LetsTrust TPM2Go

Check out the branch and all tags:

git clone --branch letstrust2go --tags https://github.com/tobyp/tpm2-tss
@tobyp
tobyp / tpm2-lt2go-test.log
Last active January 3, 2023 16:12
Log of tpm2_startup based on https://github.com/tpm2-software/tpm2-tss/pull/2479 at 020c7c397a37627754ad2c81a867cd02241fa938
[~]% TSS2_LOG=all+INFO,tcti+TRACE LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/tpm2_startup -V -T "spi-lt2go" -c
debug:tcti:src/tss2-tcti/tctildr.c:161:tctildr_conf_parse() name_conf: "spi-lt2go"
debug:tcti:src/tss2-tcti/tctildr.c:168:tctildr_conf_parse() TCTI name: "spi-lt2go"
debug:tcti:src/tss2-tcti/tctildr-dl.c:314:tctildr_get_tcti() name: "spi-lt2go", conf: "(null)"
trace:tcti:src/tss2-tcti/tctildr-dl.c:151:tcti_from_file() Attempting to load TCTI file: spi-lt2go
debug:tcti:src/tss2-tcti/tctildr-dl.c:92:handle_from_name() Could not load TCTI file: "spi-lt2go": spi-lt2go: cannot open shared object file: No such file or directory
trace:tcti:src/tss2-tcti/tctildr.c:111:tcti_from_info() Attempting to load TCTI info
trace:tcti:src/tss2-tcti/tctildr.c:118:tcti_from_info() Loaded TCTI info named: tcti-spi-lt2go
trace:tcti:src/tss2-tcti/tctildr.c:119:tcti_from_info() TCTI description: TCTI for communicating with LetsTrust-TPM2Go.
trace:tcti:src/tss2-tcti/tctildr.c:120:tcti_from_info() TCTI config_help: Takes no