Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am gebi on github.
* I am gebi (https://keybase.io/gebi) on keybase.
* I have a public key whose fingerprint is 2779 5CE5 412C 409A B140 5897 6E30 2CF4 D98B 9702
To claim this, I am signing this object:
@gebi
gebi / avcodec.c
Last active August 29, 2015 14:17 — forked from maxlapshin/avcodec.c
#define __USE_GNU
#define _GNU_SOURCE
#include <pthread.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include "erl_nif.h"
#include "frog_draw.h"
#!/usr/bin/env node
// Configuration
var argv = require('optimist')
.usage('Usage: $0 --prefix index_prefix [options]')
.demand(['prefix'])
.describe({
host: 'Elastic Search host',
port: 'Elastic Search port',
secure: 'Use secure Elastic Search connection',
@gebi
gebi / gist:142042
Created July 7, 2009 11:56
grml ini fileformat
# main stuff for identification
[general]
flavours=[grml,grml-medium,grml-small]
[buildsystem]
generator=[grml-live|...]
version=[0.9.7]
date=2009-07-07_12:24:08 # date -u +'%F_%T'
# provide information about kernel files for each defined value in kernel-versions
@gebi
gebi / Readme.md
Created September 9, 2012 21:29
NNP - No New Privileges
@gebi
gebi / myssl.erl
Created September 25, 2012 13:19
ssl setopt hang fix
ssl_setopts(SslSocket, Options) ->
Ref = erlang:now(),
PPid = self(),
Pid = spawn_link(fun() ->
ssl:setopts(SslSocket, Options),
PPid ! {self(), Ref, ssl_setopts_successful} end),
receive
{Pid, Ref, ssl_setopts_successful} -> ok
after ?SSL_SETOPTS_TIMEOUT ->
erlang:exit({error, timeout, {ssl_setopts, Options}})
@gebi
gebi / sva
Created September 27, 2012 15:46
runit service overview script
#!/bin/sh
sv s /etc/service/* |grep -Ev "(: file does not exist)|(: not a directory)"
@gebi
gebi / update_go.sh
Last active December 12, 2015 02:58
go cross compile/update helper script
#!/bin/bash
set -e
cd /opt/go/src/
echo "### UPDATING SOURCE"
hg pull
hg update -C release
echo "### BUILDING NATIVE TOOLCHAIN"
package main
import (
"os"
"fmt"
"log"
"strconv"
"github.com/cznic/mathutil"
)
@gebi
gebi / static_mem_test.c
Last active December 16, 2015 18:59
Short example program to show linux memory allocation behaviour (memory is only allocated on first access, in this example program after you press enter) Test with: gcc -O0 -Wall static_mem_test.c -o static_mem_test && /usr/bin/time --verbose ./static_mem_test
#include <unistd.h>
static char staticfoo[80*1024*1024]; // = {"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"};
#define WRITE(Str) write(1, Str, sizeof(Str))
int main()
{
char in;
int i;