Skip to content

Instantly share code, notes, and snippets.

@ober
ober / gist:69f258935010f961fbb3a98fe273fa05
Created July 2, 2022 11:36
OpenBSD gerbil/gambit builder
#!/bin/sh
set -eu
# OpenBSD builder
# pkg_add automake autoconf gcc-11 gmake
GERBIL_VERSION=v0.17
GAMBIT_VERSION=v4.9.4
-*- mode: compilation; default-directory: "~/gambit/" -*-
Compilation started at Mon Aug 6 20:11:42
cd ~/gambit/ && make -f ~/kunabi/Makefile gambit
system is Darwin
git checkout master && git clean -f && git fetch -a && git reset --hard origin/master
Already on 'master'
Your branch is up-to-date with 'origin/master'.
Warning: Permanently added 'github.com,192.30.255.113' (RSA) to the list of known hosts.
HEAD is now at 91a4ad2 Update tests/test5.ok test
@ober
ober / gist:b943723f97002ee8e88e92c7ec3b6fe8
Created July 20, 2018 02:51
Gerbil master failure on windows 10.
[*] Building Gerbil
[*] Building gerbil stage0
>>> preparing /cygdrive/c/Users/merc/gerbil/bootstrap
>>> compiling runtime
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../lib/libcygwin.a(libcmain.o): In function `main':
/usr/src/debug/cygwin-2.10.0-1/winsup/cygwin/lib/libcmain.c:37: undefined reference to `WinMain'
/usr/src/debug/cygwin-2.10.0-1/winsup/cygwin/lib/libcmain.c:37:(.text.startup+0x94): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `WinMain'
collect2: error: ld returned 1 exit status
building gerbil/runtime in /cygdrive/c/Users/merc/gerbil/bootstrap/lib
... compile gx-gambc
@ober
ober / gist:9387a64ccffe063376efb7b6c585aa24
Created June 28, 2018 17:06
Docker file for gerbil dev
from gerbil/base:ubuntu
ENV PATH='/root/gerbil/bin:/usr/local/gambit/current/bin:/bin:/usr/bin:/sbin:/usr/sbin'
ENV GERBIL_HOME=/root/gerbil
RUN apt update -y
RUN apt install -y emacs-nox tmux
CMD bash
### Keybase proof
I hereby claim:
* I am ober on github.
* I am lisp (https://keybase.io/lisp) on keybase.
* I have a public key whose fingerprint is CBD7 8720 569B BE32 F060 E3E8 9C95 3681 7159 B703
To claim this, I am signing this object:
@ober
ober / ip
Created July 12, 2016 22:20
netstat in awk
awk -Wposix 'BEGIN{ printf("{ \"tcp_connections\": [") }; {split($2,src,":");split(src[1],sip,"");split($3,dst,":");split(dst[1],dip,"");if ( NR > 1) printf(",");printf("{");printf("\"srcip\":\"%d.%d.%d.%d\",\"sport\": \"%d\",\"dstip\":\"%d.%d.%d.%d\",\"dport\":\"%d\"}","0x" sip[7] sip[8], "0x" sip[5] sip[6],"0x" sip[3] sip[4],"0x" sip[1] sip[2],"0x" src[2],"0x" dip[7] dip[8], "0x" dip[5] dip[6],"0x" dip[3] dip[4], "0x" dip[1] dip[2],"0x" dst[2]);}END{ print "]}"}' < /proc/net/tcp
@ober
ober / anonymous-gist.lisp
Created May 4, 2016 07:22
better format for this?
(defun parse-ct-contents (x)
(let* ((records (cdr (elt (read-json-gzip-file x) 0)))
(record-size (length records)))
(dolist (x records)
(let* ((event-time (cdr-assoc :EVENT-TIME x))
(user-identity (cdr-assoc :USER-IDENTITY x))
(user-name (cdr-assoc :USER-NAME user-identity))
(user-key (cdr-assoc :ACCESS-KEY-ID user-identity))
;;(user-identity (cdr-assoc :ACCESS-KEY-ID (cdr-assoc :USER-IDENTITY x)))
@ober
ober / anonymous-gist.lisp
Created May 4, 2016 07:21
cleaner way to do this?
(defun parse-ct-contents (x)
(let* ((records (cdr (elt (read-json-gzip-file x) 0)))
(record-size (length records)))
(dolist (x records)
(let* ((event-time (cdr-assoc :EVENT-TIME x))
(user-identity (cdr-assoc :USER-IDENTITY x))
(user-name (cdr-assoc :USER-NAME user-identity))
(user-key (cdr-assoc :ACCESS-KEY-ID user-identity))
;;(user-identity (cdr-assoc :ACCESS-KEY-ID (cdr-assoc :USER-IDENTITY x)))
(event-name (cdr-assoc :EVENT-NAME x))
#+sbcl
(progn
(eval-when (:compile-toplevel)
(require :sb-sprof))
(sb-sprof:with-profiling (:report :flat) (do-bench)))
@ober
ober / ql-tools.lisp
Created April 26, 2016 15:08 — forked from bhyde/ql-tools.lisp
A few things for playing with quicklisp metadata. Note that this reveals assorted things that make life interesting; so use 'em in a clean discardable session. Probably ccl only.
(in-package #:cl-user)
(eval-when (:compile-toplevel :load-toplevel :execute)
(ql:quickload "cl-ppcre")
(ql:quickload "optima")
(ql:quickload "optima.ppcre")
(use-package '#:optima)
(use-package '#:optima.ppcre))
(defun ensure-all-system-are-downloaded ()