Skip to content

Instantly share code, notes, and snippets.

@hannesm
hannesm / gist:1045c4aa2d76df6314e1
Created May 24, 2014 10:28
http-client backtrace
(gdb) bt
#0 0x00000008011673c0 in freeaddrinfo () from /lib/libc.so.7
#1 0x000000000053faf3 in result_getaddrinfo ()
#2 0x0000000000541d70 in lwt_unix_self_result ()
#3 0x00000000004ac0c4 in camlLwt_unix__self_result_1168 () at src/unix/lwt_unix.ml:240
#4 0x00000000004aa212 in camlLwt_unix__fun_2363 () at src/unix/lwt_unix.ml:206
#5 0x00000000004f52dc in camlArray__iter_1054 () at array.ml:72
#6 0x00000000004bbead in camlLwt_sequence__loop_1066 () at src/core/lwt_sequence.ml:149
#7 0x00000000004f74f1 in camlList__iter_1061 () at list.ml:73
#8 0x00000000004a7642 in camlLwt_engine__fun_2089 () at src/unix/lwt_engine.ml:342
@hannesm
hannesm / gist:1454578
Created December 10, 2011 04:26
OD packaging
OD_VERSION=2011.1
OD_ARCH=<your-cpu-architecture>
OD_SYSTEM=<your-operating-system>
OD_SOURCES=<where-your-checkout-is>
OD_PLATFORM=$OD_ARCH-$OD_SYSTEM
cd $OD_SOURCES
./configure --prefix=/opt/opendylan-$OD_VERSION
make 3-stage-bootstrap
--- a/admin/builds/fdmake.pl
+++ b/admin/builds/fdmake.pl
@@ -145,16 +145,16 @@ sub build_library {
print "Building $library... ";
my $command = $compiler;
- if ($debugger) {
- $command .= " -debugger";
- }
+# if ($debugger) {
@hannesm
hannesm / treemap.ml
Last active June 11, 2016 17:04
Trremap visualisation (and parse linker flags)
#!/usr/bin/env ocaml
#use "topfind"
#require "cmdliner"
#require "astring"
#require "unix"
(* based on "Squarified Treemaps" by Mark Bruls, Kees Huizing and Jarke J. van Wijk http://www.win.tue.nl/~vanwijk/stm.pdf *)
let width (w, h) =
@hannesm
hannesm / package.ml
Last active November 15, 2016 13:21
Find recursive dependencies, output into a dot file
#!/usr/bin/env ocaml
#use "topfind"
#require "findlib"
#require "astring"
let requires name =
try
let reqs = Findlib.package_property ["native"] name "requires" in
Astring.String.cuts ~empty:false ~sep:" " reqs
with Not_found -> []
@hannesm
hannesm / keybase.md
Last active February 13, 2018 14:55

Keybase proof

I hereby claim:

  • I am hannesm on github.
  • I am hannes (https://keybase.io/hannes) on keybase.
  • I have a public key whose fingerprint is 11B5 4642 49B5 BD85 8FFF 6328 BC89 6588 DF7C 28EE

To claim this, I am signing this object:

@hannesm
hannesm / config.ml
Created June 1, 2018 10:33
bigstringaf test
open Mirage
let main =
foreign
~packages:[package "bigstringaf"]
"Unikernel.Hello" (time @-> job)
let () =
register "hello" [main $ default_time]
@hannesm
hannesm / gist:1452220
Created December 9, 2011 16:24
OD packaging
..finish build...
here $od-sources point to where the git clone is
and $platform is the platform you're on
cd /opt/
tar cjf opendylan-2011.1-$platform-debug-info.tar.bz2 opendylan-2011.1/build
cd opendylan-2011.1
rm -rf build profiles
cp $od-sources/packages/unix/make-dylan-app bin