Skip to content

Instantly share code, notes, and snippets.

@matthiasr
matthiasr / gist:5805902
Created June 18, 2013 14:38
Translate from ss(8) to netstat(8) TCP state names (AWK dictionary)
translate["ESTAB"] = "ESTABLISHED";
translate["SYN-SENT"] = "SYN_SENT";
translate["SYN-RECV"] = "SYN_RECV";
translate["FIN-WAIT-1"] = "FIN_WAIT1";
translate["FIN-WAIT-2"] = "FIN_WAIT2";
translate["TIME-WAIT"] = "TIME_WAIT";
translate["UNCONN"] = "CLOSE";
translate["CLOSE-WAIT"] = "CLOSE_WAIT";
translate["LAST-ACK"] = "LAST_ACK";
translate["LISTEN"] = "LISTEN";
@matthiasr
matthiasr / bisect.sh
Created June 28, 2012 21:00
bisecting curl keepalive problem on DragonFly
#!/bin/sh
echo buildconf
./buildconf 2> /dev/null > /dev/null || exit 125
echo configure
./configure 2> /dev/null > /dev/null || exit 125
echo make
make 2> /dev/null > /dev/null || exit 125
echo Attempting to use the curl we just built ...
@matthiasr
matthiasr / bitrig_dmesg.txt
Created June 14, 2012 17:41
Bitrig bitrig.mr.local 0.1 GENERIC#1 i386
Bitrig 0.1-current (GENERIC) #1: Thu Jun 14 04:53:47 CDT 2012
[email protected]:/usr/src/sys/arch/i386/compile/GENERIC
master:483814b64bc90c4c8e64665bb1675467f74b6ec3
cpu0: Intel(R) Core(TM)2 Duo CPU L9400 @ 1.86GHz ("GenuineIntel" 686-class) 1.87 GHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,NXE,LONG,SSE3,MWAIT,SSSE3,LAHF
real mem = 267907072 (255MB)
avail mem = 252002304 (240MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 06/23/99, BIOS32 rev. 0 @ 0xfc000, SMBIOS rev. 2.5 @ 0xe1000 (5 entries)
bios0: vendor innotek GmbH version "VirtualBox" date 12/01/2006
@matthiasr
matthiasr / zombifier.c
Created April 17, 2012 17:45
shouldn't create zombies
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
int main(int argc, char **argv) {
int pid = 0;
int i;
for( i = 300; i>0; i-- ) {
signal(SIGCHLD, SIG_IGN);
pid = fork();
@matthiasr
matthiasr / offlineimap-manpage.patch
Created February 21, 2012 21:19
patch for bringing back the manpage in the updated pkgsrc/mail/offlineimap
diff --git a/mail/offlineimap/Makefile b/mail/offlineimap/Makefile
index a114d5b..b6d2517 100644
--- a/mail/offlineimap/Makefile
+++ b/mail/offlineimap/Makefile
@@ -18,7 +18,10 @@ PKG_DESTDIR_SUPPORT= user-destdir
WRKSRC= ${WRKDIR}/offlineimap
-INSTALLATION_DIRS= share/examples/offlineimap
+INSTALLATION_DIRS= ${PKGMANDIR}/man1 share/examples/offlineimap
commit f946ce7994cee3918255b4e6c5650ae2e9a71f3b
Author: Matthias Rampke <[email protected]>
Date: Sat Jan 28 21:56:24 2012 +0100
misc/tmux: update to 1.6
diff --git a/misc/tmux/Makefile b/misc/tmux/Makefile
index 5db23ec..2c13c70 100644
--- a/misc/tmux/Makefile
+++ b/misc/tmux/Makefile
@matthiasr
matthiasr / www_py-uwsgi.dfly.patch
Created January 15, 2012 21:05
pkgsrc www/py-uwsgi: DragonFly port
commit 5a9a0563f219cf8bdac041601ba93a8d9d705c9d
Author: Matthias Rampke <[email protected]>
Date: Wed Dec 21 12:30:19 2011 +0100
www/py-uwsgi: DragonFly port
diff --git a/www/py-uwsgi/distinfo b/www/py-uwsgi/distinfo
index fb8f4aa..2ac23c4 100644
--- a/www/py-uwsgi/distinfo
+++ b/www/py-uwsgi/distinfo
section .rodata
num_fmt: db "%u ",0
section .text
; _main for linking with cc (i.e. with crt*)
; start or _start for linking with ld (raw)
global _main
extern _printf, _exit, _putchar
@matthiasr
matthiasr / esound.patch
Created December 29, 2011 23:47
pkgsrc patch for esound not checking for libm
commit 65636f7504715a3ca832cbb72a73180fa0ac74e8
Author: Matthias Rampke <[email protected]>
Date: Thu Dec 29 17:06:19 2011 +0100
audio/esound: add configure check for libm
couldn't manage to patch configure directly, so had to take an
autoreconf detour.
diff --git a/audio/esound/Makefile b/audio/esound/Makefile
@matthiasr
matthiasr / pkgsrc-libaudiofile.patch
Created December 29, 2011 14:34
pkgsrc patch for libaudiofile not checking for libm
commit 4ed7ddf1e3a30f65f8b5d4a63bcffe8317c42b10
Author: Matthias Rampke <[email protected]>
Date: Thu Dec 29 14:41:31 2011 +0100
audio/libaudiofile: add configure check for libm
diff --git a/audio/libaudiofile/distinfo b/audio/libaudiofile/distinfo
index e19de6b..86c54e0 100644
--- a/audio/libaudiofile/distinfo
+++ b/audio/libaudiofile/distinfo