Skip to content

Instantly share code, notes, and snippets.

@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 / out.b
Created November 3, 2010 16:13
convert text to brainfuck
>++++++++[<++++++++>-]<-->
>++++++[<+++++++>-]<+>
,[[-<.>]<+++.---<.>>,]
@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;
@gebi
gebi / csv-test.go
Last active December 19, 2015 16:38
csv test progs in various languages
package main
import (
"encoding/csv"
"flag"
"fmt"
"io"
"os"
)
@gebi
gebi / json_utils.go
Created July 30, 2013 19:52
http utils for protobuf/json
package main
import (
"encoding/json"
"io/ioutil"
"log"
"net/http"
"strconv"
)