Skip to content

Instantly share code, notes, and snippets.

@cryptorick
cryptorick / extract-file-from-sbcl-msi.sh
Last active December 12, 2015 06:59
extract-file-from-sbcl-msi -- If you don't have admin privs on your Windoze machine but would like to install the SBCL msi (which contains pre-built Windoze binaries), you can use this script to extract the files and (original) directory structure. The true pathnames of the files are encoded by the msi by replacing the path separator '/' with '_…
#!/bin/bash
#
# extract-file-from-sbcl-msi -- If you don't have admin privs on your
# Windoze machine but would like to install the SBCL msi (which contains
# pre-built Windoze binaries), you can use this script to extract the
# files and (original) directory structure. The true pathnames of the
# files are encoded by the msi by replacing the path separator '/' with
# '_'; hyphens, '-', in filenames are replaced with '.'; and every file
# that has a pathname (lives in the subdirectory) has its pathname
# additionally encoded by prepending the pathname with 'File_'. The
@cryptorick
cryptorick / activate-newlisp-mode.el
Created June 1, 2013 23:46
Activate newlisp-mode for Emacs.
;;; Two steps to activate newlisp-mode in Emacs (24).
;;;
;;; 1. First, you should have already obtained and placed newlisp.el
;;; (and other files (aka newlisp-mode files)) into a proper
;;; directory. I'm going to recommend they get placed in the directory
;;; ~/.emacs.d/newlisp-mode. Here's one way to do it.
;;;
;;; $ cd ~/.emacs.d
;;; $ git clone git://github.com/kosh04/newlisp-files.git newlisp-mode
;;;
@cryptorick
cryptorick / mysql.lsp
Last active August 29, 2015 13:59
The source at https://github.com/kanendosei/artful-newlisp/blob/e2bb587d0672564d169d160f1aa11bdda12ab6f0/mysql.lsp needs changes to comport with the new (current) way of handling the method call interface in FOOP. This code fixes that. CAVEAT: it is UNTESTED. I need a fool^h^h^h^h^h brave soul to test it. ;) BTW, note the comment below about a p…
;; @module Mysql
;; @author Jeff Ober <jeffober@gmail.com>, Kanen Flowers <kanendosei@gmail.com>
;; @version 1.05 beta
;; @location http://static.artfulcode.net/newlisp/mysql.lsp
;; @package http://static.artfulcode.net/newlisp/mysql.qwerty
;; @description A new MySQL module to replace the distribution standard module (requires newlisp 10).
;; The Mysql module has been written from scratch utilizing some of the more
;; recent features of newLisp, such as FOOP and reference returns. One of its
;; major design goals was to simplify use as well as broaden the features of
;; the standard MySQL module, while at the same time allowing the creation of
@cryptorick
cryptorick / obsd56-gcc421-pil32-3.1.9.12-build-output.log
Created March 20, 2015 21:23
picoLisp 3.1.9.12 not linking on OpenBSD 5.6 with base gcc (4.2.1). Looks like no multilib support. :(
rick@dunsel:~/builds/picoLisp-3.1.9.12/src $ uname -a
OpenBSD dunsel.my.domain 5.6 GENERIC#367 amd64
rick@dunsel:~/builds/picoLisp-3.1.9.12/src $ type -a gcc
gcc is /usr/bin/gcc
rick@dunsel:~/builds/picoLisp-3.1.9.12/src $ gcc --version
gcc (GCC) 4.2.1 20070719
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@cryptorick
cryptorick / obsd32-pil32-unit-test-fails.log
Created March 21, 2015 02:06
On OpenBSD 5.6 (i386), two unit tests fail after building 32-bit picolisp with base system gcc (4.2.1)
#
# FYI, platform and gcc version.
#
$ uname -a
OpenBSD obsd32.my.domain 5.6 GENERIC#274 i386
$ gcc --version
gcc (GCC) 4.2.1 20070719
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
@cryptorick
cryptorick / ersatz-pil-cygwin.sh
Created March 26, 2015 20:16
Changes to `ersatz/pil` for Cygwin/WIndows.
#!/bin/sh
# 29nov10abu
# Values for the civilized world.
_here="${0%/*}"
_cpsep=":"
# Values for the barbarian world.
#
# If on Windows (Cygwin, really), you're probably using a Windows
@cryptorick
cryptorick / cygwin64-pil64-build.log
Created March 26, 2015 20:34
Cygwin64 pil64 build log -- it's failing at building `ext` (i.e. at `cc -o ../lib/ext emu.ext.o`)
picoLisp-3.1.9.12 $ echo "$(uname -o) $(uname -r) $(uname -m)"
Cygwin 1.7.35(0.287/5/3) x86_64
picoLisp-3.1.9.12 $ (cd src64; make)
emu.ext.o:emu.ext.c:(.rdata$.refptr.FirstLib[.refptr.FirstLib]+0x0): undefined reference to `FirstLib'
emu.ext.o:emu.ext.c:(.rdata$.refptr.Z[.refptr.Z]+0x0): undefined reference to `Z'
emu.ext.o:emu.ext.c:(.rdata$.refptr.X[.refptr.X]+0x0): undefined reference to `X'
emu.ext.o:emu.ext.c:(.rdata$.refptr.C[.refptr.C]+0x0): undefined reference to `C'
emu.ext.o:emu.ext.c:(.rdata$.refptr.Carry[.refptr.Carry]+0x0): undefined reference to `Carry'
emu.ext.o:emu.ext.c:(.rdata$.refptr.A[.refptr.A]+0x0): undefined reference to `A'
emu.ext.o:emu.ext.c:(.rdata$.refptr.L[.refptr.L]+0x0): undefined reference to `L'
@cryptorick
cryptorick / XS-OpenBSD-notes.md
Last active February 26, 2017 19:06
Building XS on OpenBSD 6.0

Building XS on OpenBSD

These are some notes on building XS on OpenBSD 6.0. YMMV with other versions (maybe). They follow the build routine outlined in the INSTALL document.

NOTE: Prefixes for install target directories (established by the --prefix option in configure) are not discussed -- this seems to be more of a personal preference for people, even though I must mention that the OpenBSD package manager installs its bits into /usr/local/bin; so, you may not want to use that for your prefix. However, I gather, from reading the openbsd-misc mailing list, that some experienced users still install non-package-manager software there also. Your choice.

Prerequisite

As a prerequisite, you might have to pkg_add the following (I'm not sure, because I didn't start from a clean OpenBSD install; so this is a "best guess"): autoconf, automake, boehm-gc, boost, gmake.

@cryptorick
cryptorick / .sexy-sh-prompt.sh
Last active February 25, 2023 00:37
Sexy sh prompt ("Oh, behave!" :)
# "Sexy sh prompt" (modeled after "Sexy bash prompt")
#
# Tries to work on as many Bourne-style and Korn-style shells as
# possible and tries to be simple and not litter your environment.
#
# When you source this script in your (interactive) shell startup
# script (or on the command line), you can set some (transient)
# environment variables to configure a few extra options; see the
# examples below to get the full idea.
#
@cryptorick
cryptorick / Makefile-for-mg-nonGNU
Last active December 29, 2017 00:17
This makefile was designed as a "drop in" replacement for the file GNUmakefile in repo https://github.com/ibara/mg. The idea is to have a common makefile that can be used by both gmake and BSD make. Two problems I ran into: one, versions of gmake before Apr 2011 do NOT support `!=`; two, NetBSD system make's implicit rule for `.c.o` puts all `.o…
# Mg portable GNUmakefile
# This file written by Brian Callahan <bcallah@openbsd.org>
# and released into the Public Domain.
PROG = mg
PREFIX ?= /usr/local
MANDIR ?= ${PREFIX}/man
DOCDIR ?= ${PREFIX}/share/doc/mg
INSTALL = /usr/bin/install