ksh software

2024-04-24

imgram poster

imgram

imgram is a static html gallery generator with tagging, paging and an rss feed written in ksh.

dependencies:

By default, imgram is written to work on base OpenBSD system with no extra software. it has been tested on debian, where the only missing dependency was ksh.

download:

Pick one. The .tgz version has a separate file for configuring imgram. the .ksh version is a single file that you configure by editing the script itself:

usage:

$ img FILENAME [tag1] [tag2] [tag3] [...]
- posts a new image FILENAME with tags: tag1, tag2, tag3
- tags are optional; if none are provided, defaults to 'no_context'

$ img rebuild
- rebuilds the entire gallery
- manipulation with the gallery is done through editing the database file in $db/db.

$ img rss
- rebuilds rss feed

config

imgram looks for configuration in ~/.config/img.conf of the user running it. Place it there and edit it before running imgram. Alternative use the all-in-one version and edit img.ksh directly. In both cases, the important variables are at the very top of either file.

user running imgram needs rw access to two directories. One where it stores its image database, the other where it builds the gallery. These are the $db and $wroot variables that must be set. Everything else is cosmetic.

examples:

post an image with tags 'computer' 'bsod' 'funny':

img 039503264.jpg computer bsod funny

change tags for a post:

find the line in $db/db, edit tags, run img rebuild

remove image:

find the line in $db/db, delete it, find filename in $wroot, delete it, run img rebuild

html

The defaul html configuration can be edited in the html function block in the configuration file. With some examples. imgram's basic look is intended to be readable and enjoyable without css, but you can use this stylesheet to get started: img.css

db

to manipulate the gallery, edit the $db/db file. each line represents a single image, from top to bottom, oldest to newest. Change order, edit tags, remove, etc. DO NOT place anything else in the $db directory. It will be wiped during rebuild.

performance:

Posting a new image with already existing tags takes ~2 seconds, with repaging.

Posting an image with a new tag(s) depends on the amount of tags already present, aprox 10 seconds with 30 tags.

notes:

running it for the first time will produce several 'missing' messages.

grep: /home/user/imgram/alltags: No such file or directory

cat: /home/user/imgram/rss: No such file or directory

This is okay.

notable imgrammers: