Skip to content

Instantly share code, notes, and snippets.

@kylekyle
kylekyle / runestone.rb
Created March 24, 2018 22:52
A CLI grader for Runestone Academy assignments
require 'http'
max_points = 30
cutoff_time = Time.local(2018,3,23,10,10)
question = 'IT105_AY182_GradedLab01_01'
base = 'https://runestone.academy/runestone/'
http = HTTP.cookies session_id_runestone: ENV['RUNESTONE_SESSION_ID']
names = JSON.parse http.get(base+'admin/course_students').to_s
names = names.to_a.sort.to_h
@kylekyle
kylekyle / replay.py
Last active May 7, 2018 12:46
A minimal rfcat replay script for a garage door opener
#!/usr/bin/python
import rflib
import bitstring
rfcat = rflib.RfCat()
rfcat.setFreq(314850000)
# AM On/Off Keying
rfcat.setMdmModulation(rflib.MOD_ASK_OOK)
@kylekyle
kylekyle / FIND_OVERALL_SCORE.vba
Last active June 28, 2018 01:37
An excel macro to find the overall score in a spreadsheet given a students test results
Function FIND_OVERALL_SCORE(rng As range) As Integer
Dim score
Dim searchRange, scores As range
Set scores = Worksheets("Master Scores").UsedRange
Set searchRange = scores.Resize(scores.Rows.Count + 1, 4)
For score = 0 To 4
For Each row In searchRange.Rows
If row.Cells(1, 1).Value <> "" Then
If row.Cells(1).Value = rng.Cells(1).Value And row.Cells(2).Value = rng.Cells(2).Value And row.Cells(3).Value = rng.Cells(3).Value And row.Cells(4).Value = rng.Cells(4).Value Then
@kylekyle
kylekyle / edge-matching.py
Created July 27, 2018 15:27
Edge-Matching CSP
pieces = [
('B', 'P', 'O', 'Y'),
('W', 'B', 'P', 'R'),
('Y', 'B', 'G', 'W'),
('Y', 'G', 'B', 'R')
]
variables = [
(0,0), (0,1),
(1,0), (1,1)
@kylekyle
kylekyle / badge.txt
Created August 9, 2018 22:08
DEFCON 26 Badge Stuff
First poster: 2BFC8E2B3561C04FBBC73FA43D5D96540D0AA008B30924CE47DA0EC67530D3
Second poster: 9E1CE2C2F6FBFE198637E6F10B957DDD50A7874177A51E
Together: 2BFC8E2B3561C04FBBC73FA43D5D96540D0AA008B30924CE47DA0EC67530D39E1CE2C2F6FBFE198637E6F10B957DDD50A7874177A51E
@kylekyle
kylekyle / remote_replay.py
Last active October 31, 2018 13:52
An rfcat script to replay an RF relay remote on 315 MHZ
#!/usr/bin/python2.7
import time
import rflib
import bitstring
rfcat = rflib.RfCat()
# center frequency
rfcat.setFreq(314955000)
@kylekyle
kylekyle / section-by-question.js
Created March 28, 2019 15:07
Tampermonkey UserScript to Grade Section by Question
// ==UserScript==
// @name BB Filter to Section
// @namespace https://usma.blackboard.com/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://usma.blackboard.com/webapps/assessment/do/gradeQuestions*
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
// ==/UserScript==
@kylekyle
kylekyle / README.md
Last active March 31, 2019 17:02
Call or Text a Ruby Script

The specific instructions are for Mac OS X, but it should run on any platform that supports Asterisk and Ruby.

$ brew tap preetsethi/homebrew-asterisk
$ cd /usr/local/Homebrew/Library/Taps/leedm777/homebrew-asterisk
$ sed -i .bak 's/EOS.unindent/EOS/g' asterisk.rb turn-wireshark.rb
$ brew install asterisk
@kylekyle
kylekyle / Key Pad Generator.ipynb
Created April 23, 2019 18:25
Use simulated annealing to generate a random keypad
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kylekyle
kylekyle / pogo.rb
Last active May 10, 2019 03:02
Make your pictures compatible with the Polaroid Pogo. And preview what they will look like. And add cute white borders.
# Prep pictures for printing on a Polaroid Pogo
require 'mini_magick'
pogo_path = File.join(Dir.pwd,'pogo')
Dir.mkdir pogo_path unless File.exists? pogo_path
ARGV.each_with_index do |path,i|
next if File.directory? path
puts "Processing #{path} ..."