Skip to content

Instantly share code, notes, and snippets.

%(:html
(#headerbox
(ul#header-ul
(li.lnk#smallhdr (a.undec href: 'http://apkx44pmf7fyd63e.onion/' 'apkx44pmf7fyd63e.onion'))
(li.lnk#bighdr (a.undec href: 'http://apk.li/' 'apk.li'))
(li 'Andreas Krey')
(li.lnk (a.undec href: 'https://www.google.de/maps/@48.425,10,17z'
'10E48.4¼N')))))
@apk
apk / tcpdump.txt
Created October 2, 2013 06:11
Zwangsproxy im ICE antwortet...217.140.74.15 ist nicht mal aktiv.
08:07:10.711532 IP (tos 0x0, ttl 64, id 46155, offset 0, flags [DF], proto TCP (6), length 64) 10.56.150.122.51293 > 217.140.74.15.http: S, cksum 0x077a (correct), 50911869:50911869(0) win 65535 <mss 1460,nop,wscale 3,nop,nop,timestamp 793744820 0,sackOK,eol>
0x0000: 4500 0040 b44b 4000 4006 c21e 0a38 967a E..@.K@.@....8.z
0x0010: d98c 4a0f c85d 0050 0308 da7d 0000 0000 ..J..].P...}....
0x0020: b002 ffff 077a 0000 0204 05b4 0103 0303 .....z..........
0x0030: 0101 080a 2f4f 95b4 0000 0000 0402 0000 ..../O..........
08:07:10.729128 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52) 217.140.74.15.http > 10.56.150.122.51293: S, cksum 0xbf12 (correct), 3845998943:3845998943(0) ack 50911870 win 5840 <mss 1460,nop,nop,sackOK,nop,wscale 6>
0x0000: 4500 0034 0000 4000 4006 7676 d98c 4a0f E..4..@.@.vv..J.
0x0010: 0a38 967a 0050 c85d e53d 495f 0308 da7e .8.z.P.].=I_...~
0x0020: 8012 16d0 bf12 0000 0204 05b4 0101 0402 ................
0x0030: 0103 0306
@apk
apk / README.md
Last active December 20, 2015 00:49
Transfer commits from git into cvs, for use in what is a CVS checkout and a git repo at the same time.

git-to-cvs.sh is part of the workflow for syncing a CVS branch with a git branch (and it's the only part of this that is actually tested, the rest has just been written down quickly). You do check out your CVS tree (with -kk), go into its root directory, and run git-init.sh (untested as of yet). The local git repo has the branch cvs checked out, and that is the one we keep in sync with CVS (and the branch we checked out there).

Update from cvs is

cvs -q update -dP
git add --all .
git commit -m 'update from cvs'

(It does not try to recreate the individual commits of the CVS side into git; we're just interested in bringing over the current tree state in this direction.)

@apk
apk / about.md
Created May 7, 2012 05:32
A compiler for an algol-style syntax, C-style semantic language in QBasic (written in 1992)

This is a compiler I wrote back in the days. It is actually in QBasic because I did not have anything else available (I only got hold of Linux 0.99 a while later.) The output were DOS .com files which have the most simple memory model available on DOS/Windows.

The most remarkable thing I remember is that I used a lisp s-expr style representation for the parse tree; since basic data structures were lacking (and because I wanted the short syntax of car(a) and cdr(a)) I used two arrays car and cdr where the same place in both formed one cons cell; positive numbers in the array referred to other cons cells, negative one

@apk
apk / websock.sh
Created April 18, 2012 15:51
A web socket server as a bash script.
#!/bin/bash
# WebSocket shell, start & browse to http://<Host>:6655/
# Requires bash 4.x, openssl.
# Author: rootshell@corelogics.de (which isn't me, apk)
coproc d { nc -l -p 6656 -q 0; }
nc -l -p 6655 -q 1 > /dev/null <<-ENDOFPAGE
HTTP/1.1 200 OK
<html><head><script language="javascript">
var url = location.hostname + ':' + (parseInt(location.port) + 1);
@apk
apk / Plain.java
Created April 11, 2012 13:08
A (very) simple pub/sub server for node.js
// -*- mode: Java; c-basic-offset: 3; tab-width: 8; indent-tabs-mode: nil -*-
import java.io.*;
import java.net.*;
public class Plain {
public static class Client {
protected Socket s;
@apk
apk / fonig.png
Created November 17, 2011 09:46
gunplotify a ping log
fonig.png
@apk
apk / gist:1313587
Created October 25, 2011 17:32
time trace wrapper
def took(msg: String)(expr: => Unit) = {
val s = System.currentTimeMillis();
expr
val d = System.currentTimeMillis() - s;
val m = msg + " took " + d + "ms";
println m;
tooks += m; // Collect traces, too
}
@apk
apk / slocat.c
Created October 20, 2011 05:23
Pipe slowed down to 200 cps
main () {
int f = 0;
int w;
char buf [1024];
while (1) {
int r = read (0, buf, sizeof (buf));
if (r <= 0) break;
if (r < sizeof (buf)) {
f = 1;
}
@apk
apk / collect_wav_file.c
Created September 22, 2011 18:33
Program that scrapes the big wav file from the damaged filesystem (FAT borked); throwaway code
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
int iszero (char *buf, int size) {
int i;
int z = 0;
for (i = 0; i < size; i ++) {
if (buf [i] == 0) z ++;
}