Skip to content

Instantly share code, notes, and snippets.

@csabahenk
csabahenk / strafi.rb
Created January 8, 2011 04:53
ruby script to inspect / filter processes in a strace log on Linux
#!/usr/bin/env ruby
if RUBY_VERSION < "1.9"
class Symbol
def to_proc
proc { |obj, *args| obj.send self, *args }
end
end
end
@csabahenk
csabahenk / Makefile
Created January 17, 2011 02:04
the buggy example of http://golang.org/pkg/rpc/ with two fixes
include $(GOROOT)/src/Make.inc
TARG=aserver\
aclient
SHARED=arith
all: $(SHARED:%=%.$O) $(TARG)
$(TARG): %: %.$O
@csabahenk
csabahenk / README.md
Created July 21, 2011 00:44
Rsync rolling sum calculation in various languages

Rsync rolling sum calculation in various languages

The programs below calculate the rsync weak sum (of block size 4096) of the last block of the data available on stdin.

The data is assumed to be at least block size big; the weak sum is calculated in a direct manner for the first block, and from that on, the sum is adjusted on each incoming byte using the "rollability" of this kind of checksum.

The primary goal was to see the performance of naive implementations; so my metrics was both performance and "how close is the code to

@csabahenk
csabahenk / quine.sh
Created July 31, 2011 17:45
gist quine
curl -Ls http://gist.github.com/raw/1117010/quine.sh
@csabahenk
csabahenk / Readme.md
Created December 9, 2011 02:26
Gist ripoff markdown server

This script spawns you a file server which serves markdown files (of .md extension) by rendering them to html. Might come handy if you are writing up something in markdown and want to check the work you've done.

It needs the github-markdown gem (gem install github-markdown).

@csabahenk
csabahenk / quickparsefuse.go
Created September 15, 2012 08:39
Quick printer (for glusterfs and github.com/csabahenk/strace-fusedump produced) FUSE dumps
package main
import (
"fmt"
"io"
"log"
"os"
"unsafe"
)
@csabahenk
csabahenk / necrowitch.md
Last active December 15, 2015 08:59
A Buddha és a nekrofil boszorkány
@csabahenk
csabahenk / 00-Readme.md
Last active December 13, 2016 12:02
RFC: Filetree Schema Language

Filetree Schema Language is a format that's intended to make it easy to specify certain file tree layouts.

The idea is that the performance dataset tool (yet to be written) will be capable of producing actual file trees upon feeding it with a file tree schema.

I tried to addressed a good trade-off between versatility and simplicity.

Syntactically, this manifests in being based on JSON -- that's easy to write by humans while providing the processing utility with properly typed structural data. A lot of abbreviations are added to make writing easy and expressive (eg. you can specify the empty directory as "DIR" or {}, while the full form would be [ "DIR", {"entries": {} } ]).

@csabahenk
csabahenk / py-jsonfun.md
Last active December 22, 2015 20:39
Some fun with Python and JSON

Some fun with Python and JSON

This document will help you to introspect complex Python data.

Requirements

We need some JSON goodness to start with.

Required