Skip to content

Instantly share code, notes, and snippets.

View timmc's full-sized avatar

Tim McCormack timmc

View GitHub Profile
timmc / gist:9059052
Last active August 29, 2015 13:56
Sourdough starter history file format specification
View gist:9059052

History file format

A history file is a series of lines that are either comments (lines where the first non-whitespace character is a #) or log entries. Log entries are JSON arrays consisting of a sequence of strings (this sequence being called a "tag") followed optionally by some other data structure (called the "payload".) For instance, an entry might take the form of:

View gist:9315809
22:49 < timmc> I'm getting odd behavior trying to proxy my feed reader (liferea)
for debugging.
22:51 < timmc> I have some HTTP Basic Auth RSS feeds from Livejournal, and
liferea is apparently sending the username as the userinfo
portion of the URL, e.g.
22:51 < timmc> mitmproxy then responds with "← 502: Error connecting to
"": [Errno -5] No address associated
with hostname"
23:03 < timmc> Any clues on whether this is liferea being weird, or a bug in
timmc / lastpass.js
Created June 10, 2014 13:56
Unminified version of lastpass.js from version 3.1.1, presented for research purposes only.
View lastpass.js
This file has been truncated, but you can view the full file.
var nsILastPass = Components.interfaces.nsILastPass,
nsISupports = Components.interfaces.nsISupports,
CLASS_ID = Components.ID("{89cfce0b-8110-11dd-ad8b-0800200c9a66}"),
CLASS_NAME = "LastPass Javascript XPCOM Component",
LP = null,
LastPassFactory = {
createInstance: function(Zc, Yb) {
if (null != Zc) throw Components.results.NS_ERROR_NO_AGGREGATION;
null == LP && (LP = new LastPassContainer);
timmc / gist:264d5c0d033b6b62d6e5
Last active August 29, 2015 14:02
LastPass brute-forcing for master password recovery
View gist:264d5c0d033b6b62d6e5

Below is a script I used to recover a LastPass master password from Firefox's Browser Console (not Firebug or the Web Console, this is in the Tools -> Web Developer menu.)


  • Be sure to disable your internet connection before running this, or LastPass will lock your account for too many attempts! Yes, this probably means there is something wrong with their security model, since it's all supposed to be done offline.
  • I do not know whether there is a chance the Browser Console might log what you enter (and therefore your password) to some file. You probably want to change your password after this, thus beginning anew the cycle of forgetting.
  • This script only works for single-character substitutions. It should be easy to modify for other ways of walking through a keyspace.


View gist:d78ac17dcec759742d04
### Keybase proof
I hereby claim:
* I am timmc on github.
* I am timmc ( on keybase.
* I have a public key whose fingerprint is C669 006E D008 22BA 968F 799D 5503 5417 3BBF 4E12
To claim this, I am signing this object:
timmc / gist:a2b9c58e97e96352e103
Created June 25, 2014 19:59
nginx can't even
View gist:a2b9c58e97e96352e103
$ pathoc -r sp443 options:*
<< HTTP Error: Invalid server response: '<html>\r\n'
<< Response (unprintables escaped):
timmc /
Last active August 29, 2015 14:04
Haven't tested this. Beware.
package rx.operators;
import java.util.concurrent.atomic.AtomicBoolean;
import rx.Observable;
import rx.Observer;
import rx.Subscription;
import rx.subjects.ReplaySubject;
timmc / gist:b74ee7307377d38a842b
Created July 30, 2014 14:12
View gist:b74ee7307377d38a842b
# Monitor autodetection. $1 may be once, loop, stop, or resume.
function autoupdate() {
xrandr -q | grep '^VGA1 connected ' > /dev/null
if [ $? -eq 0 ]; then
xrandr --output LVDS1 --off --output VGA1 --auto
timmc /
Created August 14, 2014 21:10
Solution to JSafe JCE class initialization error

Trying to load com.rsa.cryptoj.j.hE from inside an uberjar (combined jars of all dependencies):

java.lang.ExceptionInInitializerError, compiling:(NO_SOURCE_PATH:0:0)
	at clojure.lang.Compiler.analyze(
	at clojure.lang.Compiler.analyze(
	at clojure.lang.Compiler.eval(
	at clojure.lang.Compiler.eval(
	at clojure.core$eval.invoke(core.clj:2927)
	at clojure.main$repl$read_eval_print__6625$fn__6628.invoke(main.clj:239)