Skip to content

Instantly share code, notes, and snippets.

View doriantaylor's full-sized avatar
🎯
bashing out intertwingler mvp

Dorian Taylor doriantaylor

🎯
bashing out intertwingler mvp
View GitHub Profile

Keybase proof

I hereby claim:

  • I am doriantaylor on github.
  • I am dorian (https://keybase.io/dorian) on keybase.
  • I have a public key whose fingerprint is 4028 9B91 4C4C 03D3 92B0 D87F 8AB1 4A3B 7D8D AFA3

To claim this, I am signing this object:

@doriantaylor
doriantaylor / threadapalooza.pl
Created December 18, 2019 02:24
this is what was used to get @vgr's threadapalooza
#!/usr/bin/perl
use strict;
use warnings FATAL => 'all';
use Storable ();
use Math::BigInt ();
use JSON ();
use Path::Class ();
use Net::Twitter ();
@doriantaylor
doriantaylor / scrape-pool-schedule.rb
Created March 13, 2022 14:45
scrape university of toronto pool schedule
#!/usr/bin/env ruby
require 'date'
require 'time'
require 'mechanize'
# do this or it complains
require 'active_support/isolated_execution_state'
# wah wah wah crybaby
require 'icalendar'
require 'icalendar/tzinfo'
@doriantaylor
doriantaylor / rewrite-proxy.rb
Created April 26, 2022 09:52
script to use in rewrite map for aliased subdomains
#!/usr/bin/env ruby
require 'time'
require 'pathname'
require 'uri'
NULL = 'NULL'.freeze
RECHECK = 5 # how many seconds to wait before stat()
class RewriteProxy
@doriantaylor
doriantaylor / motion-cron.sh
Created August 7, 2022 15:07
cron script to turn your security camera on and off based on the presence of your phone on the wifi
#!/bin/bash
# This assumes you have https://motion-project.github.io/ installed.
# It also assumes this machine is on the same LAN as your phone.
# Put this script in root's crontab; set it to run every minute.
#
# Copyright 2022 <https://doriantaylor.com/person/dorian-taylor#me>
# License Apache-2.0 <https://www.apache.org/licenses/LICENSE-2.0>
# Change this to your phone's mac address
@doriantaylor
doriantaylor / FU.md
Last active September 30, 2022 18:42
IKEv2 stock mac initiator and strongswan responder

Fewer things are more of a pain in the ass to get working than IPSec and the built-in Mac client is no exception. As such I decided to jot down some contemporaneous notes so I didn't forget how much of a pain in the ass it was.

First off, in the networking control panel, authentication by Certificate actually means auth = eap-tls in Strongswan. If you want ordinary pubkey authentication, you select authentication None, and then put your certificate in there. I know, it makes no sense to call an X.509 certificate "not authentication", but that's where it goes. Also—and this is the part that kept me up until 4am—you need something in the preshared key field (can be foo, doesn't matter) even if the radio button is set to the certificate. If you don't do this, the Strongswan side will be happy and complete the connection but on the Mac side you will get hours of "unknown error".

Okay, now the certificates themselves: probably the most

@doriantaylor
doriantaylor / zoom-chat-parser.rb
Last active May 4, 2023 00:12
ruby script to turn a zoom chat into sioc
#!/usr/bin/env ruby
require 'rdf'
require 'rdf/vocab'
require 'rdf/turtle'
require 'pathname'
require 'uuidtools'
require 'date'
class ZoomChatParser
@doriantaylor
doriantaylor / gephi-edges.rq
Created May 4, 2023 00:16
sparql queries for importing into gephi
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT DISTINCT ?Source ?Target ?Label
WHERE {
?Source ?Label ?Target .
FILTER (!isLITERAL(?Target) && ?Label != rdf:type)
}
@doriantaylor
doriantaylor / org-ibis.el
Last active June 29, 2023 15:34
IBIS identifiers for org-mode
;; this is for making identifiers like <<I001>> <<P001>> <<A001> in org-mode and renumbering them
(defun my/org-ibis-targets-before-point (&optional type)
(when (stringp type) (setq type (intern (upcase type))))
(when (not (or (null type) (and (symbolp type) (member type '(I P A)))))
(error "type must be one of symbols 'I 'P 'A"))
;;(message (format "%s" type))
(let ((p (point)) (org (org-element-parse-buffer)))
(remq nil (org-element-map org 'target
(lambda (e)