Skip to content

Instantly share code, notes, and snippets.

View tycho's full-sized avatar

Steven Noonan tycho

  • Post Falls, ID, USA
View GitHub Profile
@tycho
tycho / lp2kp
Created March 1, 2018 09:15
LastPass CSV export to KeePass database script
#!/usr/bin/python3
import base64
import codecs
import csv
import getpass
import hashlib
import html
import logging
import os
DNS points to prohibited IP
You've requested a page on a website (art.penny-arcade.com) that is on the CloudFlare network. Unfortunately, it is resolving to an IP address that is creating a conflict within CloudFlare's system.
Ray ID: 31bc9ac5476b2a07
Timestamp: 2017-01-04 06:23:55 UTC
Your IP address: 108.162.246.99
Requested URL: art.penny-arcade.com/photos/646315571_di3Ge/0/XL/646315571_di3Ge-XL.jpg
Error reference number: 1000
Server ID: FL_28F36
@tycho
tycho / gist:a6ec49d03f9e9d03fac3bc1b8b1fef98
Created November 11, 2016 03:17
glGetString override
/*
* Build with: gcc -s -O2 -shared -fPIC -o glgetstring.{so,c} -ldl
*/
/* for RTLD_NEXT */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <dlfcn.h>
#include <GL/gl.h>
@tycho
tycho / blockstack.id
Created August 30, 2016 15:02
Blockstack ID
Verifying that "abacusavenger.id" is my Blockstack ID. https://onename.com/abacusavenger
@tycho
tycho / keybase.md
Last active August 30, 2016 02:39
Keybase identification card

Keybase proof

I hereby claim:

  • I am tycho on github.
  • I am tycho (https://keybase.io/tycho) on keybase.
  • I have a public key ASACJQH0xyMBrTVpSMis37duHeVY55TX8S9ngiALqbjEowo

To claim this, I am signing this object:

@tycho
tycho / build.cmd
Created August 19, 2016 01:46
build script for Synergy on Windows x86_64
rem This works for me at least. Found the Synergy wiki annoying and not descriptive enough about the correct
rem process, so I wrote this script in case I had to do the process more than once (e.g. on new releases)
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
set PATH=%PATH%;C:\Qt\2010.02\qt\bin;C:\Qt\2010.02\bin;C:\Qt\2010.02\mingw\bin;C:\Program Files (x86)\WiX Toolset v3.10\bin
call hm.cmd reset || exit /b
call hm.cmd conf -r --no-prompts -v -g 2 || exit /b
call hm.cmd build -r --no-prompts -v || exit /b
call hm.cmd package win || exit /b
#!/bin/bash
set -ex
if [ "$(type -P pixz)" = "" ]; then
echo "You need pixz installed."
exit 1
fi
if [ "$(type -P gpg)" = "" ]; then
@tycho
tycho / gist:db180fe71d77f89667b4930e88c331e5
Created May 20, 2016 15:34
openssl hash speeds on Haswell
OpenSSL 1.0.2h 3 May 2016
built on: reproducible build, date unspecified
options:bn(64,64) rc4(16x,int) des(idx,cisc,16,int) aes(partial) idea(int) blowfish(idx)
compiler: gcc -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -Wl,-O1,--sort-common,--as-needed,-z,relro -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
mdc2 11162.69k 8729.17k 8831.14k 8834.48k 11446.88k
md4 67800.77k 206300.20k 470452.99k 704249.86k 823265.96k
md5 40618.65k 124262.12k 282748.25k 432961.54k
#!/bin/bash
set -e
verlte() {
[[ "$1" == "$(echo -e "$1\n$2" | sort -V | head -n1)" ]]
}
verlt() {
[[ "$1" == "$2" ]] && return 1 || verlte $1 $2
#!/usr/bin/env python2
import fileinput
values = []
for line in fileinput.input():
values.append(float(line.rstrip()))
values.sort()