Skip to content

Instantly share code, notes, and snippets.

@shakna-israel
shakna-israel / TALE.md
Created July 31, 2024 07:20
Balad of the Tuskless

Balad of the Tuskless

When the stranger walked into the pub, almost no one paid any mind. The heaving bulk walking over and collapsing at the bar, hooded head falling down with a heavy thunk.

The wings of the bartender flared for a moment, before she smiled, "Here for water or wine, stranger?"

"A rest between the wars." He mumbled with a growl that made her heart flutter in a familiar fear.

All the same, it wasn't in the pixie to show any sort of stranger anything less than the best hospitality. This was her inn, the only place of comfort between Camein and Goruut. Here, she would always maintain a place to fall, if not a thing of paradise.

..--- ..-. / ...-- ----. / -.... .- / ..--- ..-. / ...-- ....- / ....- .---- / ....- .---- / ..... .---- / ..... ...-- / -.... -... / ..... .- / ....- .- / ..... ..--- / -.... --... / ....- .---- / ....- ..--- / ....- .---- / ..... .---- / ....- ..... / ....- .---- / ..... ...-- / ....- .---- / ....- ..--- / ....- ----. / ....- .---- / ....- .---- / ....- ....- / ..--- ..-. / ...-- ..--- / --... --... / ....- ..--- / ....- ....- / ....- .---- / ....- .---- / ....- -.. / ....- ...-- / ....- .---- / -.... --... / ....- -.. / ....- ...-- / ....- .---- / -.... --... / ....- -.. / ....- ....- / ....- .---- / --... --... / ....- -.. / ....- ..... / ....- .---- / --... --... / ....- -.. / ....- ..... / ....- ..--- / ..... .---- / -.... --... / ....- -.... / ....- ..--- / ..... .---- / ..... .---- / ....- ..... / ....- ..--- / ..... .---- / -.... ..-. / ....- ---.. / ....- ..--- / --... --... / ..... ----. / ....- ----. / ....- ....- / ....- .---- / -.... ..-. / ....- -.. / ....- ....- / ....- .---- / --... ...-- / .
# https://www.reddit.com/r/thethirdcave/
import secrets
import hashlib
quotes = []
init_salt = "?".encode()
salt = init_salt
@shakna-israel
shakna-israel / test.sh
Created June 28, 2020 18:14
Predictable Limits on Python's JSON Parser
#!/bin/sh
# Python will hit it's recursion limit
# If you supply just 4 less than the recursion limit
# I assume this means there's a few objects on the call stack first
# Probably: __main__, print, json.loads, and input.
n="$(python3 -c 'import math; import sys; sys.stdout.write(str(math.floor(sys.getrecursionlimit() - 4)))')"
echo "N: $n"
@shakna-israel
shakna-israel / Prose.md
Last active March 28, 2020 03:42
SegFault

Expectation

We're basically just calling an infinite loop here, passing an int, that we never change, forward.

There shouldn't be any memory being allocated, and so this should just continue on forever.

Reality

Segmentation Fault.

@shakna-israel
shakna-israel / LetsDestroyC.md
Created January 30, 2020 03:50
Let's Destroy C

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?


@shakna-israel
shakna-israel / hello.js
Created October 29, 2019 08:54
hello.js
console.log([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+
@shakna-israel
shakna-israel / fib.js
Created October 24, 2019 14:38
fib.js
var fib = eval(([][[]]+[])[+!+[]]+(+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+!+[]]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+[]+[+!+[]]]+([]+[])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]
@shakna-israel
shakna-israel / Prose.md
Created October 23, 2019 23:32
Obfuscating Lua

Obfuscating Lua

I've had some fun ruining Python recently, but Python is what I use at work. I prefer to use other languages when I'm doing stuff for fun.

And obfuscation only really makes sense in fun and competition - given a suffeciently determined actor, your code will be reverse engineered. Unless you write it in Malboge.

For this particular experiment, I'll be using Lua 5.3. As I'll probably need to dive into some of the less portable functions to commit our atrocities, I can't guarantee it will run on other popular versions like Luajit or 5.1.


@shakna-israel
shakna-israel / Prose.md
Last active November 15, 2023 22:06
Obfuscating Python

Obfuscating Python

Obfuscation isn't difficult in most programming languages. It's why we have "good practices" because it is so easy to hide what you mean in badly written code.

Obfuscation tends to be even easier in dynamic languages because of how forgiving they tend to be - and because they tend to give you direct access to the environment so that you can manipulate it.

Today, for fun, I'm going to obfuscate this code:

def _(n):

if n <= 0: