Skip to content

Instantly share code, notes, and snippets.

View keeakita's full-sized avatar
🐶
WOOF

Taylor Osler keeakita

🐶
WOOF
  • @
  • Bay Area, CA
View GitHub Profile
@keeakita
keeakita / 50-GSR.sh
Created October 21, 2021 05:09
/etc/NetworkManager/dispatcher.d/50-GSR.sh
#!/bin/sh
set -e
set -u
if [ "$2" = "up" ]; then
if [ "$CONNECTION_ID" = "GSR-WIFI" ]; then
sleep 3;
curl 'http://guest.grandsierraresort.com/login.html' -X POST -H 'Content-Type: application/x-www-form-urlencoded' -H 'Origin: http://gsr-wifi.com' -H 'Referer: http://gsr-wifi.com/' --data-raw 'buttonClicked=4&redirect_url=https%3A%2F%2Fwww.grandsierraresort.com&err_flag=0' -o /dev/null -s;
fi
@keeakita
keeakita / import.rb
Last active April 17, 2020 05:50
Import Keepass XML to 1Password via the CLI
#!/bin/env ruby
#
# HOW TO USE THIS SCRIPT
#
# From keepass, export an XML file, put it in this directory named "foo.xml"
#
# Then, sign in to the op client: eval $(op signin DOMAIN)
#

Keybase proof

I hereby claim:

  • I am oslerw on github.
  • I am librewulf (https://keybase.io/librewulf) on keybase.
  • I have a public key ASA32GCGkcE0q6Got_sIFj_lp7TA4CEYvP4NdmfQbyw1PQo

To claim this, I am signing this object:

@keeakita
keeakita / stitch.sh
Last active May 30, 2017 22:51
For when you have a one sided-feed scanner, but need to scan a bunch of double sided pages.
#!/bin/bash
#
# For when you have a one sided-feed scanner, but need to scan a bunch of
# double sided pages. To use:
# 1. Scan the pages normally, so that the odd side of page 1 is scanned first.
# 2. Pick up the stack of papers from the tray, *without flipping them*,
# such that the even side of the last page gets scanned first
# 3. Run this script on it
#
# Requires pdftk
@keeakita
keeakita / hill.rb
Created November 10, 2016 23:09
A hill cipher implementation for a CTF
#!/bin/env ruby
require 'matrix'
SUDOKU_FILE = './sudoku/solution.txt'
MATRIX_DIM = 3
COL_OFFSET = 3
ROW_OFFSET = 3
def letter_to_num(letter)
@keeakita
keeakita / distribution.rb
Created November 10, 2016 19:05
Letter distribution counter for a CTF
#!/bin/env ruby
cipher = File.read('ciphertext.txt')
letters = Hash.new do 0 end
cipher.each_char do |c|
letters[c] += 1
end
@keeakita
keeakita / getcoords.rb
Created November 10, 2016 18:41
Sudoku Input Munger for fxn/sudoku
#!/bin/env ruby
input = File.read('./puzzle.txt')
rows = input.split("\n")
rows.each_index do |row|
rows[row].split('').each_index do |column|
if rows[row][column] != '_'
print row + 1
@keeakita
keeakita / cvg-tsa.rb
Created July 13, 2016 16:48
This script checks CVG's website, scraping their TSA checkpoint time estimate so that you can watch it to figure out when to leave to catch a flight.
#!/usr/bin/env ruby
# This script checks CVG's website, scraping their TSA checkpoint time estimate
# so that you can watch it to figure out when to leave to catch a flight.
require 'open-uri'
require 'nokogiri'
while (true)
html = Nokogiri::HTML(open('https://www.cvgairport.com/'))
# contains(string, substring)
#
# Returns 0 if the specified string contains the specified substring,
# otherwise returns 1.
# Taken from https://stackoverflow.com/questions/2829613/how-do-you-tell-if-a-string-contains-another-string-in-unix-shell-scripting/8811800#8811800
contains() {
string="$1"
substring="$2"
if test "${string#*$substring}" != "$string"
then
@keeakita
keeakita / mpris2-bgchange.pl
Last active August 29, 2015 14:21
Perl script for changing background based on currently playing music
#! /usr/bin/perl -w
#
# This script gets the currently playing album via MPRIS2/DBus and then sets
# the wallpaper accordingly. Requires feh to set the background. This may not
# work if your desktop environment manages the background in some special way.
#
# The script searches first for files containing the following (in order):
# - background
# - wallpaper
# - cover