Skip to content

Instantly share code, notes, and snippets.

View ktemkin's full-sized avatar

Kate Temkin ktemkin

View GitHub Profile
@ktemkin
ktemkin / colorize-dump.rb
Created July 18, 2013 20:41
Quick script to colorize the output of avr-objdump. Install smart_colored first: gem install smart_colored
#!/usr/bin/env ruby
require 'smart_colored/extend'
module Rules
extend self
Rules = []
@ktemkin
ktemkin / udev_enumerator.rb
Created April 17, 2014 02:31
finding beacon boards using udev
# The MIT License (MIT)
#
# Copyright (c) 2014 Kyle J. Temkin <[email protected]>
# Copyright (c) 2014 Binghamton University
#
# 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
#!/usr/bin/env python
#
# Quick script which "captures" a single waveform from the Agilent scopes in the LNG 709/711 labs.
import ivi
import plac
def main(channel: ("The channel to sample on", 'option', 'c') = 1):
""" A simple tool for reading data from the LNG709/711 oscilloscopes."""
@ktemkin
ktemkin / update_ids.rb
Created September 24, 2014 02:09
Simple Watir script for mass updating ID cards.
#!/usr/bin/env ruby
#
# Script to mass override assignment due dates for a given user.
#
#
require 'highline/import'
require 'watir-webdriver'
MAPPINGS = {
@ktemkin
ktemkin / gist:af6ba522b88825dc0f7b
Created November 4, 2014 04:33
fastcgi_params for Moodle
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# A handy function that became available in 0.7.31 that breaks down
# The path information based on the provided regex expression
# This is handy for requests such as file.php/some/paths/here/
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param QUERY_STRING $query_string;
@ktemkin
ktemkin / fizzbuzz.c
Last active April 17, 2024 04:16
As a snark: fizzbuzz as a kernel module. (for extra snark credit: mknod /dev/fizzbuzz1 c <major> 0)
/**
* This is all your fault, Baljem.
*/
#include <linux/version.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/cdev.h>
#include <linux/device.h>
#include <linux/types.h>
=== Overlayed recipes ===
base-files:
xenclient-oe 3.0.14
meta 3.0.14
console-tools:
xenclient-oe 0.3.2
meta 0.3.2
consolekit:
xenclient-oe 0.4.5
meta 0.4.5
@ktemkin
ktemkin / wat
Last active August 29, 2015 14:18 — forked from alexisvl/wat
Open On-Chip Debugger 0.9.0-dev-00358-gd3c2679 (2015-04-02-20:03)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : If you need SWD support, flash KT-Link buffer from https://github.com/bharrisau/busblaster
and use dp_busblaster_kt-link.cfg instead
Warn : Interface already configured, ignoring
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
adapter speed: 500 kHz
adapter_nsrst_delay: 100
From d686351d8ea4a1ea1d755d0a10f6f14d1c870911 Mon Sep 17 00:00:00 2001
From: Kyle Temkin <[email protected]>
Date: Wed, 8 Apr 2015 00:58:24 -0400
Subject: [PATCH] Add thorough reset interface to pciback's sysfs.
--------------------------------------------------------------------------------
SHORT DESCRIPTION:
--------------------------------------------------------------------------------
Adds an interface that allows "more thorough" resets to be performed
on devices which don't support Function Level Resets (FLRs). This
@ktemkin
ktemkin / mockup.py
Last active February 6, 2023 19:49
# Creating a GreatFET object implicitly opens the USB connection to the device.
try:
device = GreatFET() # Optionally accepts serialNo= to select between multiple GreatFETs.
except DeviceNotFoundException:
print("No device found!")
sys.exit()
# Once a connection is made, the board's ID is queried, and used to make the board's peripherals available.
# (This either would be a factory method that produces an appropriate class, or a run-time mixin.)
# For now, this would mean that objects are present on 'device' that allow access to each of the Azalea board's peripherals.