Skip to content

Instantly share code, notes, and snippets.

View lava's full-sized avatar

Benno Evers lava

  • Hamburg, Germany
View GitHub Profile
@lava
lava / minbashmaxfun.md
Last active January 11, 2018 20:56
34c3 writeup: minbashmaxfun

Writeup: minbashmaxfun

by lava & ntq

+=============================================================+
|                MINIMAL BASH - MAXIMAL FUN                   | 
|                                                             | 
|            Who needs regular characters anyway?             |
|                                                             | 
|         Supported characters: $ ( ) # ! { } < \ ' ,         |
| |
Relaxed Agent state recovery
# Problem
Most experienced mesos users will have encountered the following error message:
E1103 18:30:03.451825 12204 slave.cpp:6302] EXIT with status 1: Failed to perform recovery: Incompatible agent info detected.
------------------------------------------------------------
[...]
------------------------------------------------------------
@lava
lava / nethack_armor.md
Last active June 10, 2018 04:58
Nethack armor comparison

Nethack armor comparison

Imagine this totally hypothetical situation: You're in a boring meeting without internet, play a round of nethack as a rogue, and come across a dwarvish mithril-coat. Should you replace your current leather armor? On the one hand, mithril sounds pretty nifty. On the other hand, it seems a bit out-of-character for a rogue to wear full plate armor, so surely there are some good reasons to keep the leather?

Luckily, you are a professional developer, so you have a local copy of the games' source code.

@lava
lava / hello_world.md
Last active March 2, 2024 17:22
Hello, world: Deep analysis of a shallow program.

Hello, world!

Please explain in detail what will happen if the following program is executed:

#include <iostream>

int main() {
    std::cout << "Hello, world!" << std::endl;
}
@lava
lava / gist:4706289
Created February 4, 2013 11:44
Python and CPP kalman filter update
def kalman_update(state_mean, state_cov, measurement, measurement_matrix, meas_cov):
# meas_cov should be a matrix with the right dimensions
statedim = state_mean.size
x = reshape( atleast_2d(state_mean), (statedim,1) )
C = atleast_2d( state_cov )
H = atleast_2d(measurement_matrix)
y = atleast_2d(np.array(measurement))
innovation = y - dot(H,x)
@lava
lava / gist:4179092
Created November 30, 2012 22:15
circle input file
100
200
0 1 1 1
1 0 1 1
1 2 1 1
2 1 1 1
2 3 1 1
3 2 1 1
3 4 1 1
4 3 1 1
@lava
lava / combined_grabber.rb
Created October 3, 2011 22:29
Naive ACM Metadata Grabber
require 'nokogiri'
require 'open-uri'
require 'watir-webdriver'
require './acm_issue_downloader.rb'
require './acm_base.rb'
#base class for all acm-specific html extraction functions
class ACMBase
def extract_id(url)
@lava
lava / exercise.tex
Created March 8, 2011 11:57
CG Test Exercises
\documentclass{exam}
\begin{document}
\begin{questions}
\section{Koordinatensysteme und Geometrie}
\titledquestion{Kameramodell}
Gegeben sei eine Kamera $C$ mit Projektionszentrum ${\mathbf{e}}$, Ziel-Vektor $\mathbf{z}$ und normalisiertem Up-Vektor $\mathbf{up}$.
@lava
lava / gist:849292
Created March 1, 2011 15:27
GLSL Shader Test
#include <string>
#include <vector>
#include <iterator>
#include <fstream>
#include <iostream>
#include <GL/gl.h>
#include <GL/glext.h>
#include <SDL/SDL.h>