btcinfo  

Hic inserere motto

Botworks - ircbot and logbot genesis

June 21, 2020 — shinohai

Alf has reminded me several times that it might be helpful to publish the sauce for my ircbot setup so this post is an attempt to do just that, and generally make it easier to install the bot components using V. My botworks tree uses trinque's lisp ircbot and logbot combo as the starting point.

A lot of good patches are scattered about on former republican blogs, though it seems I could get none of them to play nice with esthlos-v so a regrind was in order. For ircbot these are:

trinque's ircbot-genesis-kv.vpatch.

ben_vulpes' ircbot-multiple-channels-kv.vpatch.

whaack's ircbot-no-suicide-on-reconnect-kv.vpatch.

Assuming you already have SBCL and quicklisp, you can then use `V` to press ircbot and move the output to your local-projects directory:

v press ircbot-no-suicide-on-reconnect-kv out

mv out/ircbot ~/quicklisp/local-projects

The process is repeated to add the logbot system. While testing the regrinds I came upon a curious problem where adding ben_vulpes "logbot-multiple-channels" patch caused an error when trying to start logbot. Simply pressing the logbot genesis and running the bot is working, so I will continue to debug the issue and post results in a future botworks piece. The logbot requires that postgres be installed on your system, whaack has a good piece on how to do this on his blog, if you aren't familiar with setting that part up.

v press logbot-genesis-kv.vpatch

mv out/logbot ~/quicklisp/local-projects

With both of these components installed where ASDF can find them running the bot is as simple as firing up a REPL, adding your parameters and connecting to it according to the instructions in the "logbot/USAGE" file.

TODO:

Put together a better prefixed command system, the system I am currently using works but needs quite a bit of polish before being worthy of turning into a vpatch.

Cobble together a www log reader for use with the logbot system.

Links to useful lisp botworks resources:

trinque's sources: http://trinque.org/src/

ben_vulpes' post on multiple channels: http://cascadianhacker.com/correction-multiple-channel-patches-for-irclogbot

spyked's botworks vpatches: http://lucian.mogosanu.ro/src/botworks/v/patches/

whaack's post on setting up trinque's logbot: http://ztkfg.com/2019/12/setting-up-trinques-logbot-on-centos-6-with-sbcl-quicklisp-swank-and-postgres/

Tags: News, Lisp, UNIX

Notes on esthlos-v and some restructuring thereof

January 30, 2020 — shinohai

This particular post will serve as a place to put my notes on esthlos-v, which I have been reading over in an attempt to polish it up for personal use. Now there are many fine implementations of "V" out there already, and I admit mod6's "v.pl" has served me well over time, but this particular "V" is delightfully readable and the code is well commented.

Way back in ancient Greece, the word "esthlos" meant that "something exists" or at least is true. Even though the author of esthlos-v vanished into internet space some time ago, and apparently abandoned work on the project, we'll retain the original name since it seems rather fitting for a tool used to magic software into existence.

I will expound upon the contents of esthlos-v in a later piece, though for now I am adding a single new vpatch: "esthlos-v_makefile-and-vdiff.vpatch" - this patch contains simple modifications to the original Makefile so it will build both "v.lisp" and "cl-keccak" as standalone binaries at the same time, and install them if the operator so desires. A modified version of phf's original vdiff.sh that uses cl-keccak instead of sha512sum is included. This vpatch and it's corresponding seal can be found in the esthlos-v mirror here.

Tags: News, Lisp, UNIX

Essential kit items: Building SBCL on Gentoo with musl

November 08, 2019 — shinohai

Steel Bank Common Lisp is another must-have tool in my kit, since I use it to run my hybrid irc/Telegram bot and many other daily use items. In my previous post I documented how I managed to get gcc-4.9.4 massaged into shape, so this post will serve as a reference on how to do the same for SBCL so in the future I don't have to spend the day researching fixes and locating obscure patchsets.

When building many things using musl, one will often run into "undefined reference to `memcpy@GLIBC_*'" type errors, since glibc uses versioned symbols and musl does not. SBCL is no different, but fortunately a little digging turned up a working patchset on the SBCL mailing list which works beautifully, so I didn't have to spend the better part of a day cobbling one together as I did for gcc. I have preserved a copy of the patchset here and will definitely do my best to maintain these into the future should any major changes occur.

Much like Ada, SBCL requires itself or another ANSI common lisp to build. I decided to use CLISP (version 2.49.92) to perform this task, as it can be quickly built from sources using gcc only (and I didn't want to use a pre-built sbcl binary of unknown provenance). After getting clisp in place, building SBCL is mostly painless using the following steps:

I downloaded the 1.5.7 sources from my site and verified the checksums:

curl -O http://btc.info.gf/devel/gentoo/distfiles/dev-lisp/sbcl/1.5.7/sbcl-1.5.7-source.tar.bz2
curl -O http://btc.info.gf/devel/gentoo/distfiles/dev-lisp/sbcl/1.5.7/Manifest.sha512

Unpack the sources and enter the directory:

tar xjf sbcl-1.5.7-source.tar.bz2 && cd sbcl-1.5.7

Get the musl patchset and apply them:

wget -q -r -nd -N --no-parent -R "index.html*" http://btc.info.gf/devel/gentoo/distfiles/dev-lisp/sbcl/patches/
for i in *.patch; do patch -p1 < $i; done

Build using CLISP and install:

./make.sh "clisp" --fancy
./install.sh

The above recipe has so far worked quite nicely, having been tested by running the above mentioned irc bot and a few other essential lisp programs. I will update this post if/when any bugs are found or if any changes are made.

Tags: News, Linux, Lisp