Skip to content

Instantly share code, notes, and snippets.

View Dav1dde's full-sized avatar

David Herberth Dav1dde

View GitHub Profile

Minecraft Encryption with OpenSSL

Definitions

pk = Public Key, sent with the EncryptionKeyRequest

vt = Verify Token, sent unecrypted with the EncryptionKeyRequest

ss = Shared Secret, generated by the client, 16 random bytes

@Dav1dde
Dav1dde / bridge.lua
Created December 15, 2012 20:07
This is a program for ComputerCraft, it tells the turtle to build a one wide bridge
function refuel()
local fueled = false
for i=12,16 do
turtle.select(i)
fueled = turtle.refuel()
end
return fueled
end
from ijson import common
from ijson.backends import YAJLImportError
from cffi import FFI
ffi = FFI()
ffi.cdef("""
typedef void * (*yajl_malloc_func)(void *ctx, size_t sz);
typedef void (*yajl_free_func)(void *ctx, void * ptr);
typedef void * (*yajl_realloc_func)(void *ctx, void * ptr, size_t sz);
@Dav1dde
Dav1dde / config.h
Created April 20, 2013 18:48
My dwm setup
/* See LICENSE file for copyright and license details. */
/* appearance */
static const char font[] = "fixed medium roman semicondensed normal normal 13px";
//static const char font[] = "Sans 8";
/*static const char selbordercolor[] = "#ffffff";
static const char selbgcolor[] = "#5c5c5c";
static const char selfgcolor[] = "#ffffff";
static const char normbordercolor[] = "#000000";
static const char normbgcolor[] = "#ffffff";
@Dav1dde
Dav1dde / build.rf
Last active June 24, 2017 06:50
Example application for gl3n/glamour
-version=Derelict3
-version=SDLImage # needed for glamour (otherwise DevIL would be used for texture loading, but SDL is more common)
-version=gl3n # enable gl3n support in glamour
-debug
-L-lDerelictSDL2
-L-lDerelictUtil
-L-lDerelictGLFW3
-L-lDerelictGL3
@Dav1dde
Dav1dde / gist:5831219
Last active December 18, 2015 19:09 — forked from anonymous/gist:5831109
upstream dtutorapp {
server 127.0.0.0:9001;
}
server {
listen 80 default_server;
server_name _;
root /home/dtutor/dtutor/app/static/;
keepalive_timeout 5;
struct Node {
Rectangle area;
string name;
Image image;
Node* left;
Node* right;
Node* insert(Image image, string name) {
auto newTypeArray = cast(ArrayType)newType;
auto oldTypeArray = cast(ArrayType)oldType;
if (result.isPointer && (newTypeArray !is null && oldTypeArray !is null)) {
auto llvmPrim = cast(PrimitiveType)newTypeArray.base;
if (llvmPrim !is null && llvmPrim.bits <= 8)
return handleCastArray(state, loc, newType, result);
}
#!/bin/sh
echo "[Compile]"
OUT=$(dub build --rdmd 2>&1)
bin/rcd 1>/dev/null 2>&1 &
PID=$!
echo " [Ready]"
inotifywait -m ./rcd -r 2>/dev/null | while read -r dir event name; do
if [ "$event" == "MODIFY" -o "$event" == "MOVED_TO" ]; then
#!/usr/bin/python
# -*- coding: utf-8 -*-
from string import ascii_lowercase
char_order_de = ['e', 'n', 'i', 'r', 's', 'a', 't', 'd', 'h', 'u', 'l', 'g',
'o', 'c', 'm', 'b', 'f', 'w', 'k', 'z', 'p', 'v', 'j', 'y', 'x', 'q']
char_order_en = ['e', 't', 'a', 'o', 'i', 'n', 's', 'r', 'h', 'l', 'd', 'c',