Skip to content

Instantly share code, notes, and snippets.

View JaciBrunning's full-sized avatar

Jaci Brunning JaciBrunning

View GitHub Profile
@JaciBrunning
JaciBrunning / usbiommu.rb
Last active August 18, 2024 06:31
USB -> PCIe -> IOMMU viewer for linux
lsusb = `lsusb`.split("\n").reject { |x| x.include?("root") }.map do |e|
ar = e.scan(/Bus (\d+) Device \d+: ID [0-9a-f:]+ (.*)/).flatten
ar[0] = "usb#{ar[0].to_i}"
ar
end
sysbus = `ls -l /sys/bus/usb/devices`.split("\n").map do |e|
e.scan(/(usb\d+) -> .+\/([0-9a-f:\.]+)\/usb\d+/).flatten
end.reject { |x| x.empty? }
@JaciBrunning
JaciBrunning / taskgraph.gradle
Created October 21, 2018 09:34
Gradle TaskGraph to DOT
gradle.taskGraph.whenReady { graph ->
new File("tasks.graph").withWriter { writer ->
writer.write("digraph Tasks {\n")
graph.allTasks.each { t ->
graph.getDependencies(t).each { t2 ->
writer.write("\t\"${t2.name}\" -> \"${t.name}\"\n")
}
}
writer.write("}")
}
event match_level match_key week red_plates blue_plates
2018alhu Finals 2018alhu_f1m1 2 RLR RLR
2018alhu Finals 2018alhu_f1m2 2 LRL LRL
2018alhu Finals 2018alhu_f1m3 2 LRL LRL
2018alhu Quarters 2018alhu_qf1m1 2 RLR RLR
2018alhu Quarters 2018alhu_qf1m2 2 LLL LLL
2018alhu Quarters 2018alhu_qf2m1 2 LLL LLL
2018alhu Quarters 2018alhu_qf2m2 2 RLR RLR
2018alhu Quarters 2018alhu_qf2m3 2 RLR RLR
2018alhu Quarters 2018alhu_qf3m1 2 LLL LLL
require 'json'
require 'open-uri'
require 'digest'
require 'fileutils'
KEY = "g3t_uR-0wN-K3y"
CACHEFILE = '_cache'
def query path
JSON.parse open("http://www.thebluealliance.com/api/v3/#{path}?X-TBA-Auth-Key=#{KEY}").read
#include "Vision.h"
#include <iostream>
#include <vector>
using namespace cv;
static VisionSystem::tp_millis last_time;
static void _vision_thread_func() {
#include "WPILib.h"
#include "Talon.h"
#include "Simulation/Model.h"
#include "Simulation/Mutator.h"
#include "Simulation/Data/PWMData.h"
#include <cstdio>
#include <cmath>
@JaciBrunning
JaciBrunning / after.gradle
Created October 1, 2017 19:13
Gradle PR: Only adding 32 and 64 bit intel architectures for default toolchains
// After #1
model {
// No user-defined toolchains have been added.
// Default toolchain gcc(Gcc) has been created and responds to Intel 32 and 64 bit architectures by default
toolChains { }
}
// After #2
model {
// User-defined toolchain is added.
@JaciBrunning
JaciBrunning / config.ru
Last active September 15, 2017 11:41
Rackup Config for Subdomains and Virtual Servers
# config.ru
require 'rack'
$:.unshift File.dirname(__FILE__)
class SubdomainMiddleware
def initialize(app, sub, mod)
@app = app
@sub = sub
@mod = mod.new
end
#include <string.h>
#include <stdio.h>
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <assert.h>
typedef struct {
char *test_string;
} Config;
=======================
ALL MATCHES
=======================
Match Points:
total: 5798594 (231.02)
auto: 1181982 ( 47.09)
teleop: 4423922 (176.25)
foul: 199165 ( 7.93)
adjust: -6475 ( -0.26)