Skip to content

Instantly share code, notes, and snippets.

Avatar

hyperreality

View GitHub Profile
View keybase.md

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:

View Vigenere demo
#!/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 Oct 28, 2018
Automatic Stack Overflow debugging (joke)
View so-debug.js
#!/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 {
View rlwrap substitute
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)]"
View Krypton 6 walkthrough.md

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 Apr 14, 2017
Simple Python reverse shell using the SCTP protocol
View sctp_reverse_shell.py
#!/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 Nov 29, 2016
Programming Problem 5: Sum to 100
View problem5.js
// 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 Sep 24, 2016
And auto-subscribe to favourite subreddits
View Reddit: Auto - unsubscribe from default 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)
}
View Unicode Shift Cipher
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import random
code_points = {
'english': (32, 126),
'burmese': (1024, 1279),
'arabic': (1536, 1791),
'canadian_aboriginal': (5120, 5759),
@hyperreality
hyperreality / SomethingAwfulUnfilter.user.js
Created Jul 16, 2016
Greasemonkey script to uncensor the Something Awful forums
View SomethingAwfulUnfilter.user.js
// ==UserScript==
// @name Something Awful Unfilter
// @namespace http://localhost
// @description Uncensor Something Awful forums for unregistered guests
// @include http://*somethingawful.com/*
// @include https://*somethingawful.com/*
// @version 1
// @grant none
// ==/UserScript==