Jon Jensen: software

This is an archive of various mostly old and trivial programs, gathered here in case they prove useful to someone.

extract-har-hostnames.bash extracts hostnames from URLs in HAR files exported by e.g. Firefox & Chrome.

binary-to-text.py and binary-to-text.pl convert textual binary to ASCII/Unicode equivalents.

inventory-json-objects-walktree.py and inventory-json-objects-filenames.py inventory datatypes of JSON files in a directory tree. They do the same thing; the first is object-oriented and walks directory trees itself, and the second is functional and relies on xargs to supply names (and exclude circular symlinks).

check_sitemap.py is a Nagios plugin for fetching an Google XML sitemap and checking it is recent enough and has a configurable number and content of links.

check_postfix_blocked.py is a Nagios plugin that scans Postfix logs (in syslog format) to count outbound messages blocked or greylisted as spam and alert based on supplied thresholds.

fix_latin_jon.pl converts a text format PostgreSQL pg_dump file from “byte soup” (mixed character set encodings) to UTF-8, leaving UTF-8 as is, converting other lines from Windows-1252 where possible. See also Postgres migrating SQL_ASCII to UTF-8 with fix_latin by Greg Sabino Mullane.

collect-server-stats is a simple shell script for collecting server statistics for diagnostics.

imagemunge and timestamp-rename are scripts to do lossless rotation of JPEG (with jpegtran) and rename JPEG, HEIC, and PNG files (using jpegtran or exiftool) to match either their last-modified, JFIF, or EXIF timestamps.

kill-large-processes: kills large processes (1 GiB by default).

idlekill: selectively kills processes of idle login sessions, simplifying unattended calls to skill.

pgindexsize: rebuild PostgreSQL indexes and report on disk space saved (or rarely, gained).

odbc_dump_dbi.pl and odbc_dump_win32.pl: dump ODBC-accessible database tables to tab-delimited text files using Perl on Windows. Microsoft's Access table exporter (and by hearsay, SQL Server's too) don't filter tabs from the data, thus corrupting any row with a tab in one of its text fields. This program lets you dump everything cleanly. It converts tabs to spaces and makes sure no Unix line endings are in the data.

te: table editor, a front-end for editing tab-delimited text files with your favorite text editor. Now included as part of Interchange.

qx2html.pl converts QuarkXPress Tags text exports to HTML. Written for MacPerl, but easy to adapt.

Local mirror of Restoration, a no-cost but no-source file undelete and shredding program for Windows. Also available from SnapFiles.