Lisplog

Blogging in Lisp

Search

Lisplog is a templating system that blends Apache and Hunchentoot to aid in the maintenance of a blog-like web site.

It is open source, written in Common Lisp, and the code is at github.com/billstclair/Lisplog

I'm looking for work. My resumé is at lisplog.org/resume.html

Mirroring a Blogspot Site

Submitted by Bill St. Clair on Thu, 13 Apr 2017 10:58:31 GMT

William Norman Grigg died yesterday. RIP.

When an important blogger passes, I often mirror their web site(s). I've been doing that with Mr. Grigg's Pro Libertate. site. It's on Blogspot, so doing a simple "wget -mk" pulls a separate file for each comment to each post, even though all those copies are identical. I finally figured out how to tell wget to NOT keep those files. It still downloads them all, scans for links that it already knows about, and then deletes them, but at least they don't stay to waste disk space. I have found no way to tell it to completely ignore those files. Mirroring would be much faster if that were possible. It took a few minutes to pull the 1,030 html files, and then a long time to pull and discard all the "?showComment" files.

I named the script that does this mirror-blogspot. The important line is:

wget -mk -R "*?showComment*" -pH
 -D "$DOMAIN,1.bp.blogspot.com,2.bp.blogspot.com,3.bp.blogspot.com,4.bp.blogspot.com" $1

-m is the standard wget mirror command. It enables recursive download, disables limits on that, and ensures that no links outside of the initial argument will be followed.

-k is --convert-links. It causes internal links to be changed from absolute to relative, so <a href='$1/foo'> becomes <a href='foo'>, with all the right stuff done to make that work correctly. Unfortunately, there's no way to tell wget to do that process on an existing mirror, so if your mirror quits before it's done, you're SOL.

-R is --reject. It's the important thing I learned yesterday. It tells wget to reject files whose names match the argument, which is either a list of file types or a pattern (not a regular expression).

-p is --page-requisites. It tells wget to download inline images, but will NOT by itself make it download from another domain.

-H is --span-hosts.

-D is --domains. If not specified with -r, then only files from the domain mentioned as the final argument will be downloaded. It allows you to add other domains, but also requires that you include the domain on the command line; hence $DOMAIN in that list. The *.bp.blogspot.com domains are where Blogspot stores images.

1 comment   Edit post   Add post

Xossbow Progress Report

Submitted by Bill St. Clair on Mon, 10 Apr 2017 10:26:54 GMT

I've made significant progress with Xossbow, my Elm-based blogging package. billstclair/elm-html-template now supports a nearly complete version of Markdown, and the Xossbow website uses that for most of its content.

I'm working on adding navigation, so that pages have URLs, hence you won't always have to first visit the home page any time you go to the site. Then I'll learn how to make "PUT" work in Apache, so that I can create editing forms for settings and pages.

Below is an example of the "Tag Classes" extension I made to Markup. You can specify, with a JavaScript-style object (key/value pairs), the CSS class for HTML elements generated by the Markdown. Click on the image for full resolution display (730x999).

Xossbow table example

Add comment   Edit post   Add post

Diceware Passphrase Generator Updated

Submitted by Bill St. Clair on Mon, 10 Apr 2017 03:22:51 GMT

I updated my Diceware Passphrase Generator, adding the EFF's two new (as of last July) wordlists for random passphrases.

The default is now six words from their short (4-die) table, instead of five words from the original (5-die) Diceware table.

I also improved the user interface for rolling your own physical dice. Instead of separate boxes for the dice rolls, there is now just one input box, it limits input to the number of dice necessary (4 or 5), and pressing the Enter/Return key will look up a word.

Add comment   Edit post   Add post

Xossbow Baby Steps

Submitted by Bill St. Clair on Mon, 27 Mar 2017 13:14:28 GMT

I renamed XosBow to Xossbow and modified the HtmlTemplate example code to suit. It's now serving its own web site (eating my own dog food). Lots of work still to do, as evidenced by my growing list of GitHub issues. And, the new name evinced a new logo. There are a couple of other ideas at the site, but I think this one will stick. "Elm Inside!"

Xossbow Logo

Add comment   Edit post   Add post

Web Pages from JSON Templates in Elm

Submitted by Bill St. Clair on Fri, 24 Mar 2017 16:30:26 GMT

One of the problems I find with Elm is that the HTML is compiled into the JavaScript code for a web site. I wrote a template package to enable more data-driven HTML generation.

It's in the Elm repository at package.elm-lang.org/packages/billstclair/elm-html-template.

There's a live example website at lisplog.org/elm-html-template.

I'm switching now to a WordPress-like blogging package built on top of it. It will be similar to Lisplog (this web site), but will do all the rendering in the client browser, just as is done by the example, but with forms to create and edit content.

It's called XosBow, pronounced "Crossbow". That web site is a one-page place-holder for now, but once enough works, it will itself be done in XosBow.

Add comment   Edit post   Add post

Cryptographically-Secure Random Numbers in Elm

Submitted by Bill St. Clair on Fri, 24 Mar 2017 16:24:28 GMT

Elm contains a random number generator, and if you seed it well, it's not too bad, but JavaScript has a real cryptographically-secure random number generator, window.crypto.getRandomValue(). I built an interface to that.

It's in the Elm package repository at package.elm-lang.org/packages/elm-dev-random. There's a live example, which generates Diceware passphrases, at lisplog.org/diceware.

Add comment   Edit post   Add post

Elm Digital Ocean Interface

Submitted by Bill St. Clair on Sat, 11 Feb 2017 01:01:19 GMT

I have built an Elm interface to a subset of the Digital Ocean HTTP API.

http://package.elm-lang.org/packages/billstclair/elm-digital-ocean/latest
https://www.digitalocean.com
https://lisplog.org/elm-do

Add comment   Edit post   Add post

Fixed: Slow Macintosh File Dialogs

Submitted by Bill St. Clair on Tue, 07 Feb 2017 11:05:34 GMT

I have been plagued for quite a while now with a two or three second wait every time I invoke the open or save file dialog on my Macintosh (running El Sierra). I finally did a Google search and found a solution. Less than a second now! Yay!

http://osxdaily.com/2015/04/17/fix-slow-folder-populating-cloudkit-macosx/

In a shell:

cd ~/Library/Caches/CloudKit
rm CloudKitMetadata
rm CloudKitMetadata-shm
rm CloudKitMetadata-wal
killall cloudd

Add comment   Edit post   Add post

Kokuro Dojo for Android

Submitted by Bill St. Clair on Tue, 17 Jan 2017 16:49:29 GMT

My Kakuro puzzle game, Kakuro Dojo, is now available from the Google Play Store. You may now play on iPhone, iPad, iPad Touch, Android phones and tablets, and a web browser on any device.

Download on the App Store  Get it on Google Play

Add comment   Edit post   Add post

Android Version Hell

Submitted by Bill St. Clair on Mon, 16 Jan 2017 16:05:48 GMT

I spent a number of hours over the weekend determining which version of Android was required for my Kakuro Dojo app. It appears that I need at least KitKat, version 4.4, API 19. It puts up a page with a couple of notches out of it in Jelly Bean, version 4.1, API 16, which is the default oldest version for Cordova, but none of the links work.

KitKat, version 4.4 is the shipping version for the Samsung Galaxy 5 phone and the Galaxy Tab E, the under-$100 tablet that I considered yesterday at WalMart before buying a Galaxy Tab A for $139.

I have it working now, modulo the in-app purchase of the additional puzzles. If you'd like to give it a try, head over to GibGoyGames.com/beta, and click on the "android-debug.apk" link. My Galaxy Tab A (Android Lollipop, version 5.1.1, API 22) offered to override the security setting disallowing installation of random apps. You may need to enable "Unknown sources" explicitly in "Settings / Lock screen and security" before attempting the install.

The image below is from the "Android Virtual Device Manager" in Android Studio. It's compressed to fit. Click on it for full-sized image.

I tested in each of the downloaded versions. The Google Play Store requires phone screen shots and both seven-inch and ten-inch tablet screen shots.

Android Virtual Device Manager

Add comment   Edit post   Add post