Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / badge.txt
Created August 9, 2018 22:08
DEFCON 26 Badge Stuff
First poster: 2BFC8E2B3561C04FBBC73FA43D5D96540D0AA008B30924CE47DA0EC67530D3
Second poster: 9E1CE2C2F6FBFE198637E6F10B957DDD50A7874177A51E
Together: 2BFC8E2B3561C04FBBC73FA43D5D96540D0AA008B30924CE47DA0EC67530D39E1CE2C2F6FBFE198637E6F10B957DDD50A7874177A51E
@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 / 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 / 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 / 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 / pull_posts.rb
Last active March 19, 2018 20:38
Pull all of a friends Facebook posts
require 'json'
require 'watir'
require 'seconds'
if ARGS.empty?
warn 'Please provide the Facebook user number and query string that will appear in every post (first name usually works)'
exit
end
b = Watir::Browser.new
@kylekyle
kylekyle / mypki-xpe.rb
Created January 21, 2018 21:46
How to attach information to a TCPSocket for the OpenSSL context later on
require 'socket'
class TCPSocket
class << self
def new host, *args, &block
socket = super host, *args, &block
# check whitelist, set indicator
socket.instance_variable_set :@mypki, true # or false
# return socket
socket
def cropPicture(picture):
smallPic = makeEmptyPicture(186,100)
smallX = 0
smallY = 0
for x in range(59,244):
smallX +=1
smallY = 0
for y in range(25,125):
pixel = getPixel(picture,x,y)
smallPicPixl = getPixel(smallPic,smallX,smallY)