From d3aff7d14e66f19a8e4e9a3315494ad612ccc1f5 Mon Sep 17 00:00:00 2001
From: Sadeep Madurange
Date: Sat, 3 Jan 2026 16:07:15 +0800
Subject: Remove 'log' from navlink, update cu response, change to lup.
---
_includes/nav.html | 5 +-
_log/site-search.md | 2 +-
_site/404.html | 5 +-
_site/about/index.html | 8 +-
_site/cgi-bin/find.cgi | 3 +-
_site/feed.xml | 2 +-
_site/index.html | 20 ++-
_site/log/arduino-due/index.html | 5 +-
_site/log/arduino-uno/index.html | 5 +-
_site/log/bumblebee/index.html | 5 +-
_site/log/e-reader/index.html | 5 +-
_site/log/etlas/index.html | 5 +-
_site/log/fpm-door-lock-lp/index.html | 5 +-
_site/log/fpm-door-lock-rf/index.html | 5 +-
_site/log/index.html | 212 --------------------------
_site/log/matrix-digital-rain/index.html | 5 +-
_site/log/mosfet-switches/index.html | 5 +-
_site/log/neo4j-a-star-search/index.html | 5 +-
_site/log/site-search/index.html | 7 +-
_site/posts.xml | 3 +-
_site/projects/index.html | 5 +-
_site/sitemap.xml | 3 -
about.html | 3 +-
cgi-bin/_site/feed.xml | 1 +
cgi-bin/_site/find.cgi | 247 +++++++++++++++++++++++++++++++
cgi-bin/_site/indexer.pl | 116 +++++++++++++++
cgi-bin/_site/robots.txt | 1 +
cgi-bin/_site/sitemap.xml | 3 +
cgi-bin/find.cgi | 3 +-
index.html | 4 +-
log.html | 13 --
31 files changed, 408 insertions(+), 308 deletions(-)
delete mode 100644 _site/log/index.html
create mode 100644 cgi-bin/_site/feed.xml
create mode 100644 cgi-bin/_site/find.cgi
create mode 100644 cgi-bin/_site/indexer.pl
create mode 100644 cgi-bin/_site/robots.txt
create mode 100644 cgi-bin/_site/sitemap.xml
delete mode 100644 log.html
diff --git a/_includes/nav.html b/_includes/nav.html
index 0b7b631..9ab3434 100644
--- a/_includes/nav.html
+++ b/_includes/nav.html
@@ -4,9 +4,6 @@
hme
-
- log
-
poc
@@ -14,7 +11,7 @@
abt
- sws
+ lup
rss
diff --git a/_log/site-search.md b/_log/site-search.md
index 61e4bba..2a552f6 100644
--- a/_log/site-search.md
+++ b/_log/site-search.md
@@ -282,6 +282,6 @@ Verdict: Fast SA index lookup. Mitigated primary attack vectors. No
dependencies. Works on every conceivable device.
Commit:
-[9889aca](https://git.asciimx.com/www/commit/?h=term&id=9889acaac984817731ad9f9355f067f9acd02efd)
+[6da102d](https://git.asciimx.com/www/commit/?h=term&id=6da102d6e0494a3eac3f05fa3b2cdcc25ba2754e)
| Benchmarks:
[8a4da68](https://git.asciimx.com/site-search-bm/commit/?id=8a4da6809cf9368cd6a5dd7351181ea4256453f9)
diff --git a/_site/404.html b/_site/404.html
index 89257c3..b210b74 100644
--- a/_site/404.html
+++ b/_site/404.html
@@ -19,9 +19,6 @@
hme
-
- log
-
poc
@@ -29,7 +26,7 @@
abt
- sws
+ lup
rss
diff --git a/_site/about/index.html b/_site/about/index.html
index 35bd281..6b4d19b 100644
--- a/_site/about/index.html
+++ b/_site/about/index.html
@@ -19,9 +19,6 @@
hme
-
- log
-
poc
@@ -29,7 +26,7 @@
abt
- sws
+ lup
rss
@@ -55,10 +52,9 @@
hme: Latest articles.
- log: Technical log.
poc: Projects.
abt: Site information.
- sws: Search within site.
+ lup: Look up articles.
rss: RSS (Atom) feed.
diff --git a/_site/cgi-bin/find.cgi b/_site/cgi-bin/find.cgi
index ab066dd..d3c6cc4 100644
--- a/_site/cgi-bin/find.cgi
+++ b/_site/cgi-bin/find.cgi
@@ -216,10 +216,9 @@ sub render_html {
diff --git a/_site/feed.xml b/_site/feed.xml
index 9ccb174..5026409 100644
--- a/_site/feed.xml
+++ b/_site/feed.xml
@@ -1 +1 @@
-Jekyll 2026-01-02T19:06:26+08:00 /feed.xml ASCIIMX | Log W. D. Sadeep Madurange Matrix Rain: 2025 refactor 2025-12-21T00:00:00+08:00 2025-12-21T00:00:00+08:00 /log/matrix-digital-rain W. D. Sadeep Madurange Fingerprint door lock (LP) 2025-08-18T00:00:00+08:00 2025-08-18T00:00:00+08:00 /log/fpm-door-lock-lp W. D. Sadeep Madurange High-side MOSFET switching 2025-06-22T00:00:00+08:00 2025-06-22T00:00:00+08:00 /log/mosfet-switches W. D. Sadeep Madurange ATmega328P at 3.3V and 5V 2025-06-10T00:00:00+08:00 2025-06-10T00:00:00+08:00 /log/arduino-uno W. D. Sadeep Madurange Fingerprint door lock (RF) 2025-06-05T00:00:00+08:00 2025-06-05T00:00:00+08:00 /log/fpm-door-lock-rf W. D. Sadeep Madurange Bumblebee: browser automation 2025-04-02T00:00:00+08:00 2025-04-02T00:00:00+08:00 /log/bumblebee W. D. Sadeep Madurange Bare-metal ATSAM3X8E 2024-09-16T00:00:00+08:00 2024-09-16T00:00:00+08:00 /log/arduino-due W. D. Sadeep Madurange Etlas: e-paper dashboard 2024-09-05T00:00:00+08:00 2024-09-05T00:00:00+08:00 /log/etlas W. D. Sadeep Madurange ESP32 e-reader prototype 2023-10-24T00:00:00+08:00 2023-10-24T00:00:00+08:00 /log/e-reader W. D. Sadeep Madurange Neo4j shortest path optimization 2018-03-06T00:00:00+08:00 2018-03-06T00:00:00+08:00 /log/neo4j-a-star-search W. D. Sadeep Madurange
+Jekyll 2026-01-03T16:04:13+08:00 /feed.xml ASCIIMX | Log W. D. Sadeep Madurange Site search with Perl + CGI + SA 2026-01-02T00:00:00+08:00 2026-01-02T00:00:00+08:00 /log/site-search W. D. Sadeep Madurange Matrix Rain: 2025 refactor 2025-12-21T00:00:00+08:00 2025-12-21T00:00:00+08:00 /log/matrix-digital-rain W. D. Sadeep Madurange Fingerprint door lock (LP) 2025-08-18T00:00:00+08:00 2025-08-18T00:00:00+08:00 /log/fpm-door-lock-lp W. D. Sadeep Madurange High-side MOSFET switching 2025-06-22T00:00:00+08:00 2025-06-22T00:00:00+08:00 /log/mosfet-switches W. D. Sadeep Madurange ATmega328P at 3.3V and 5V 2025-06-10T00:00:00+08:00 2025-06-10T00:00:00+08:00 /log/arduino-uno W. D. Sadeep Madurange Fingerprint door lock (RF) 2025-06-05T00:00:00+08:00 2025-06-05T00:00:00+08:00 /log/fpm-door-lock-rf W. D. Sadeep Madurange Bumblebee: browser automation 2025-04-02T00:00:00+08:00 2025-04-02T00:00:00+08:00 /log/bumblebee W. D. Sadeep Madurange Bare-metal ATSAM3X8E 2024-09-16T00:00:00+08:00 2024-09-16T00:00:00+08:00 /log/arduino-due W. D. Sadeep Madurange Etlas: e-paper dashboard 2024-09-05T00:00:00+08:00 2024-09-05T00:00:00+08:00 /log/etlas W. D. Sadeep Madurange ESP32 e-reader prototype 2023-10-24T00:00:00+08:00 2023-10-24T00:00:00+08:00 /log/e-reader W. D. Sadeep Madurange
\ No newline at end of file
diff --git a/_site/index.html b/_site/index.html
index 57ba207..9a10f2d 100644
--- a/_site/index.html
+++ b/_site/index.html
@@ -19,9 +19,6 @@
hme
-
- log
-
poc
@@ -29,7 +26,7 @@
abt
- sws
+ lup
rss
@@ -46,7 +43,7 @@
$ cu -l /dev/asciimx
- NMI_LNK: SIG_ASSERT [0x53]
+ UNIX / EMBED / -O3
@@ -189,6 +186,19 @@
+
+
+ Neo4j shortest path optimization
+
+
+
+ 2018-03-06
+
+
+
+
+
+
diff --git a/_site/log/arduino-due/index.html b/_site/log/arduino-due/index.html
index 7bc8a0b..d9cc946 100644
--- a/_site/log/arduino-due/index.html
+++ b/_site/log/arduino-due/index.html
@@ -17,9 +17,6 @@
hme
-
- log
-
poc
@@ -27,7 +24,7 @@
abt
- sws
+ lup
rss
diff --git a/_site/log/arduino-uno/index.html b/_site/log/arduino-uno/index.html
index 0fa997e..3eee3a3 100644
--- a/_site/log/arduino-uno/index.html
+++ b/_site/log/arduino-uno/index.html
@@ -17,9 +17,6 @@
hme
-
- log
-
poc
@@ -27,7 +24,7 @@
abt
- sws
+ lup
rss
diff --git a/_site/log/bumblebee/index.html b/_site/log/bumblebee/index.html
index 4c45649..f1881aa 100644
--- a/_site/log/bumblebee/index.html
+++ b/_site/log/bumblebee/index.html
@@ -17,9 +17,6 @@
hme
-
- log
-
poc
@@ -27,7 +24,7 @@
abt
- sws
+ lup
rss
diff --git a/_site/log/e-reader/index.html b/_site/log/e-reader/index.html
index a4d740d..23d409b 100644
--- a/_site/log/e-reader/index.html
+++ b/_site/log/e-reader/index.html
@@ -17,9 +17,6 @@
hme
-
- log
-
poc
@@ -27,7 +24,7 @@
abt
- sws
+ lup
rss
diff --git a/_site/log/etlas/index.html b/_site/log/etlas/index.html
index 86c9627..9362917 100644
--- a/_site/log/etlas/index.html
+++ b/_site/log/etlas/index.html
@@ -17,9 +17,6 @@
hme
-
- log
-
poc
@@ -27,7 +24,7 @@
abt
- sws
+ lup
rss
diff --git a/_site/log/fpm-door-lock-lp/index.html b/_site/log/fpm-door-lock-lp/index.html
index e110158..54c471c 100644
--- a/_site/log/fpm-door-lock-lp/index.html
+++ b/_site/log/fpm-door-lock-lp/index.html
@@ -17,9 +17,6 @@
hme
-
- log
-
poc
@@ -27,7 +24,7 @@
abt
- sws
+ lup
rss
diff --git a/_site/log/fpm-door-lock-rf/index.html b/_site/log/fpm-door-lock-rf/index.html
index 138d4ea..d6c6b66 100644
--- a/_site/log/fpm-door-lock-rf/index.html
+++ b/_site/log/fpm-door-lock-rf/index.html
@@ -17,9 +17,6 @@
hme
-
- log
-
poc
@@ -27,7 +24,7 @@
abt
- sws
+ lup
rss
diff --git a/_site/log/index.html b/_site/log/index.html
deleted file mode 100644
index 813832d..0000000
--- a/_site/log/index.html
+++ /dev/null
@@ -1,212 +0,0 @@
-
-
-
-
-
-
- Log
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/_site/log/matrix-digital-rain/index.html b/_site/log/matrix-digital-rain/index.html
index e17e16e..72dfd15 100644
--- a/_site/log/matrix-digital-rain/index.html
+++ b/_site/log/matrix-digital-rain/index.html
@@ -17,9 +17,6 @@
hme
-
- log
-
poc
@@ -27,7 +24,7 @@
abt
- sws
+ lup
rss
diff --git a/_site/log/mosfet-switches/index.html b/_site/log/mosfet-switches/index.html
index 032df22..a91f205 100644
--- a/_site/log/mosfet-switches/index.html
+++ b/_site/log/mosfet-switches/index.html
@@ -17,9 +17,6 @@
hme
-
- log
-
poc
@@ -27,7 +24,7 @@
abt
- sws
+ lup
rss
diff --git a/_site/log/neo4j-a-star-search/index.html b/_site/log/neo4j-a-star-search/index.html
index feec42b..00f7886 100644
--- a/_site/log/neo4j-a-star-search/index.html
+++ b/_site/log/neo4j-a-star-search/index.html
@@ -17,9 +17,6 @@
hme
-
- log
-
poc
@@ -27,7 +24,7 @@
abt
- sws
+ lup
rss
diff --git a/_site/log/site-search/index.html b/_site/log/site-search/index.html
index 3c32ba3..65e69e0 100644
--- a/_site/log/site-search/index.html
+++ b/_site/log/site-search/index.html
@@ -17,9 +17,6 @@
hme
-
- log
-
poc
@@ -27,7 +24,7 @@
abt
- sws
+ lup
rss
@@ -316,7 +313,7 @@ Read-only directory.
dependencies. Works on every conceivable device.
Commit:
-9889aca
+6da102d
| Benchmarks:
8a4da68
diff --git a/_site/posts.xml b/_site/posts.xml
index 0136478..64fd4e6 100644
--- a/_site/posts.xml
+++ b/_site/posts.xml
@@ -1,2 +1 @@
-Jekyll 2026-01-02T19:06:26+08:00 /posts.xml ASCIIMX W. D. Sadeep Madurange
-Jekyll 2026-01-03T12:59:44+08:00 /posts.xml ASCIIMX W. D. Sadeep Madurange
+Jekyll 2026-01-03T16:04:13+08:00 /posts.xml ASCIIMX W. D. Sadeep Madurange
\ No newline at end of file
diff --git a/_site/projects/index.html b/_site/projects/index.html
index 090c5dc..6bffe61 100644
--- a/_site/projects/index.html
+++ b/_site/projects/index.html
@@ -19,9 +19,6 @@
hme
-
- log
-
poc
@@ -29,7 +26,7 @@
abt
- sws
+ lup
rss
diff --git a/_site/sitemap.xml b/_site/sitemap.xml
index c5fe837..3a7874c 100644
--- a/_site/sitemap.xml
+++ b/_site/sitemap.xml
@@ -51,9 +51,6 @@
/
-/log/
-
-
/projects/
diff --git a/about.html b/about.html
index 1608bf7..ce515a1 100644
--- a/about.html
+++ b/about.html
@@ -19,10 +19,9 @@ title: About
hme: Latest articles.
- log: Technical log.
poc: Projects.
abt: Site information.
- sws: Search within site.
+ lup: Look up articles.
rss: RSS (Atom) feed.
diff --git a/cgi-bin/_site/feed.xml b/cgi-bin/_site/feed.xml
new file mode 100644
index 0000000..66f8d32
--- /dev/null
+++ b/cgi-bin/_site/feed.xml
@@ -0,0 +1 @@
+Jekyll 2026-01-03T14:43:24+08:00 http://localhost:4000/feed.xml
\ No newline at end of file
diff --git a/cgi-bin/_site/find.cgi b/cgi-bin/_site/find.cgi
new file mode 100644
index 0000000..ab066dd
--- /dev/null
+++ b/cgi-bin/_site/find.cgi
@@ -0,0 +1,247 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Storable qw(retrieve);
+use Encode qw(decode_utf8 encode_utf8);
+use URI::Escape qw(uri_unescape);
+use HTML::Escape qw(escape_html);
+
+# Configuration
+my $max_parallel = 50; # Max parallel search requests
+my $lock_timeout = 30; # Seconds before dropping stale locks
+my $max_results = 20; # Max search results to display
+my $sa_file = 'sa.bin'; # Suffix Array index
+my $cp_file = 'corpus.bin'; # Raw text corpus
+my $map_file = 'file_map.dat'; # File metadata
+my $lock_dir = '/tmp/search_locks'; # Semaphore directory
+
+# Concurrency control
+mkdir $lock_dir, 0777 unless -d $lock_dir;
+my $active_count = 0;
+my $now = time();
+
+opendir(my $dh, $lock_dir);
+while (my $file = readdir($dh)) {
+ next unless $file =~ /\.lock$/;
+ my $path = "$lock_dir/$file";
+ my $mtime = (stat($path))[9] || 0;
+ ($now - $mtime > $lock_timeout) ? unlink($path) : $active_count++;
+}
+closedir($dh);
+
+# Template variables
+my $year = (localtime)[5] + 1900;
+my $search_text = '';
+
+# Busy check
+if ($active_count >= $max_parallel) {
+ print "Content-Type: text/html\n\n";
+ render_html("Server busy. Please try again in a few seconds.
", "", $year);
+ exit;
+}
+
+# Create semaphore lock
+my $lock_file = "$lock_dir/$$.lock";
+open(my $fh_lock, '>', $lock_file);
+
+# Query decoding
+if (($ENV{QUERY_STRING} || '') =~ /^q=([^&]*)/) {
+ my $raw_q = $1;
+ $raw_q =~ tr/+/ /;
+ $search_text = uri_unescape($raw_q);
+ $search_text = decode_utf8($search_text // "");
+ $search_text =~ s/\P{Print}//g;
+ $search_text = substr($search_text, 0, 64);
+ $search_text =~ s/^\s+|\s+$//g;
+}
+
+my $safe_search_text = escape_html($search_text);
+
+print "Content-Type: text/html\n\n";
+
+if ($search_text eq '') {
+ final_output("Please enter a search term above.
");
+}
+
+# Binary search
+my @results;
+my $query = encode_utf8(lc($search_text));
+my $query_len = length($query);
+
+if (-f $sa_file && -f $cp_file) {
+ open(my $fh_sa, '<', $sa_file) or die $!;
+ open(my $fh_cp, '<', $cp_file) or die $!;
+ binmode($fh_sa);
+ binmode($fh_cp);
+
+ my $file_map = retrieve($map_file);
+ my $total_suffixes = (-s $sa_file) / 4;
+
+ # Find left boundary
+ my ($low, $high) = (0, $total_suffixes - 1);
+ my $first_hit = -1;
+
+ while ($low <= $high) {
+ my $mid = int(($low + $high) / 2);
+ seek($fh_sa, $mid * 4, 0);
+ read($fh_sa, my $bin_off, 4);
+ my $off = unpack("L", $bin_off);
+ seek($fh_cp, $off, 0);
+ read($fh_cp, my $text, $query_len);
+
+ my $cmp = $text cmp $query;
+ if ($cmp >= 0) {
+ $first_hit = $mid if $cmp == 0;
+ $high = $mid - 1;
+ } else {
+ $low = $mid + 1;
+ }
+ }
+
+ # Collect results if found
+ if ($first_hit != -1) {
+ my $last_hit = $first_hit;
+ ($low, $high) = ($first_hit, $total_suffixes - 1);
+
+ # Find right boundary
+ while ($low <= $high) {
+ my $mid = int(($low + $high) / 2);
+ seek($fh_sa, $mid * 4, 0);
+ read($fh_sa, my $bin_off, 4);
+ my $off = unpack("L", $bin_off);
+ seek($fh_cp, $off, 0);
+ read($fh_cp, my $text, $query_len);
+
+ if (($text cmp $query) <= 0) {
+ $last_hit = $mid if $text eq $query;
+ $low = $mid + 1;
+ } else {
+ $high = $mid - 1;
+ }
+ }
+
+ my %seen;
+ for my $i ($first_hit .. $last_hit) {
+ seek($fh_sa, $i * 4, 0);
+ read($fh_sa, my $bin_off, 4);
+ my $offset = unpack("L", $bin_off);
+
+ foreach my $m (@$file_map) {
+ if ($offset >= $m->{start} && $offset < $m->{end}) {
+ if (!$seen{$m->{path}}++) {
+ # Capture more than 50 chars for trimming
+ my $snip_start = ($offset - 30 < $m->{start}) ? $m->{start} : $offset - 30;
+ my $max_len = $m->{end} - $snip_start;
+ my $read_len = ($max_len > 120) ? 120 : $max_len;
+ seek($fh_cp, $snip_start, 0);
+ read($fh_cp, my $raw_snip, $read_len);
+
+ my $snippet = decode_utf8($raw_snip, Encode::FB_QUIET) // $raw_snip;
+ $snippet =~ s/\s+/ /g; # Normalize whitespace
+
+ # Trim start: Partial word removal
+ if ($snip_start > $m->{start}) {
+ $snippet =~ s/^[^\s]*\s//;
+ }
+
+ # Trim end: Length limit and partial word removal
+ my $has_more = 0;
+ if (length($snippet) > 50) {
+ $snippet = substr($snippet, 0, 50);
+ $has_more = 1 if $snippet =~ s/\s+[^\s]*$//;
+ }
+ elsif ($snip_start + $read_len < $m->{end}) {
+ # This check handles snippets that are naturally short but
+ # there's still more text in the article we didn't read
+ $has_more = 1;
+ }
+
+ # Cleanup & capitalize
+ $snippet = ucfirst($snippet);
+ $snippet = escape_html($snippet) . ($has_more ? "..." : "");
+
+ my $clean_path = $m->{path};
+ $clean_path =~ s|^\.\./_site/||;
+
+ push @results, {
+ path => $clean_path,
+ title => $m->{title},,
+ snippet => $snippet
+ };
+ }
+ last;
+ }
+ }
+ last if scalar @results >= $max_results;
+ }
+ }
+ close($fh_sa);
+ close($fh_cp);
+}
+
+# --- Formatting & Output ---
+my $list_html = "";
+if (@results == 0) {
+ $list_html = "No results found for \"$safe_search_text \".
";
+} else {
+ $list_html = "";
+}
+
+final_output($list_html);
+
+# --- Helpers ---
+sub final_output {
+ my ($content) = @_;
+ render_html($content, $safe_search_text, $year);
+ if ($fh_lock) { close($fh_lock); unlink($lock_file); }
+ exit;
+}
+
+sub render_html {
+ my ($content, $q_val, $yr) = @_;
+ print <<"HTML";
+
+
+
+
+
+ Search
+
+
+
+
+
+
+
+
Search
+
+ $content
+
+
+
+
+
+HTML
+}
+
diff --git a/cgi-bin/_site/indexer.pl b/cgi-bin/_site/indexer.pl
new file mode 100644
index 0000000..69f6838
--- /dev/null
+++ b/cgi-bin/_site/indexer.pl
@@ -0,0 +1,116 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use File::Find;
+use Storable qw(store);
+use Encode qw(encode_utf8);
+use HTML::Entities qw(decode_entities);
+use Time::HiRes qw(gettimeofday tv_interval);
+
+my $dir = '../_site/log';
+my $cgi_dir = '../_site/cgi-bin/';
+my $corpus_file = "${cgi_dir}corpus.bin";
+my $sa_file = "${cgi_dir}sa.bin";
+my $map_file = "${cgi_dir}file_map.dat";
+
+my %excluded_files = (
+ 'index.html' => 1, # /log/index.html
+);
+
+# Start timing
+my $t0 = [gettimeofday];
+
+my $corpus = "";
+my @file_map;
+
+print "Building corpus...\n";
+
+find({
+ wanted => sub {
+ # Only index index.html files
+ return unless -f $_ && $_ eq 'index.html';
+
+ my $rel_path = $File::Find::name;
+ $rel_path =~ s|^\Q$dir\E/?||;
+ return if $excluded_files{$rel_path};
+
+ if (open my $fh, '<:encoding(UTF-8)', $_) {
+ my $content = do { local $/; <$fh> };
+ close $fh;
+
+ my ($title) = $content =~ m|(.*?) |is;
+ $title //= (split('/', $File::Find::name))[-2]; # Fallback to folder name
+ $title =~ s/^\s+|\s+$//g;
+
+ # Extract content from or use whole file
+ my ($text) = $content =~ m|(.*?) |is;
+ $text //= $content;
+
+ # Strip tags and normalize whitespace
+ $text =~ s|]*>.*? | |gs;
+ $text =~ s|]*>.*?| |gs;
+ $text =~ s|<[^>]+>| |g;
+ $text = decode_entities($text);
+ $text =~ s|\s+| |g;
+ $text =~ s/^\s+|\s+$//g;
+
+ # CRITICAL: Convert to lowercase and then to raw bytes
+ # This ensures length() and substr() work on byte offsets for seek()
+ my $raw_entry = encode_utf8(lc($text) . "\0");
+
+ my $start = length($corpus);
+ $corpus .= $raw_entry;
+
+ push @file_map, {
+ start => $start,
+ end => length($corpus),
+ title => $title,
+ path => $File::Find::name
+ };
+ }
+ },
+ no_chdir => 0,
+}, $dir);
+
+print "Sorting suffixes...\n";
+
+# Initialize the array of indices
+my @sa = 0 .. (length($corpus) - 1);
+
+# Use a block that forces byte-level comparison
+{
+ use bytes;
+ @sa = sort {
+ # First 64 bytes check (fast path)
+ (substr($corpus, $a, 64) cmp substr($corpus, $b, 64)) ||
+ # Full string fallback (required for correctness)
+ (substr($corpus, $a) cmp substr($corpus, $b))
+ } @sa;
+}
+
+print "Writing index files to disk...\n";
+
+open my $cfh, '>', $corpus_file or die "Cannot write $corpus_file: $!";
+binmode($cfh); # Raw byte mode
+print $cfh $corpus;
+close $cfh;
+
+open my $sfh, '>', $sa_file or die "Cannot write $sa_file: $!";
+binmode($sfh);
+# Pack as 32-bit unsigned integers (standard 'L')
+print $sfh pack("L*", @sa);
+close $sfh;
+
+store \@file_map, $map_file;
+
+my $elapsed = tv_interval($t0);
+my $c_size = -s $corpus_file;
+my $s_size = -s $sa_file;
+
+printf "\nIndexing Complete!\n";
+printf "Total Time: %.4f seconds\n", $elapsed;
+printf "Corpus Size: %.2f KB\n", $c_size / 1024;
+printf "Suffix Array: %.2f KB\n", $s_size / 1024;
+printf "Files Processed: %d\n", scalar(@file_map);
+
diff --git a/cgi-bin/_site/robots.txt b/cgi-bin/_site/robots.txt
new file mode 100644
index 0000000..d297064
--- /dev/null
+++ b/cgi-bin/_site/robots.txt
@@ -0,0 +1 @@
+Sitemap: http://localhost:4000/sitemap.xml
diff --git a/cgi-bin/_site/sitemap.xml b/cgi-bin/_site/sitemap.xml
new file mode 100644
index 0000000..9bf9de2
--- /dev/null
+++ b/cgi-bin/_site/sitemap.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/cgi-bin/find.cgi b/cgi-bin/find.cgi
index ab066dd..d3c6cc4 100644
--- a/cgi-bin/find.cgi
+++ b/cgi-bin/find.cgi
@@ -216,10 +216,9 @@ sub render_html {
diff --git a/index.html b/index.html
index 26da2fd..7d871bc 100644
--- a/index.html
+++ b/index.html
@@ -10,13 +10,13 @@ title: ASCIIMX
$ cu -l /dev/asciimx
- NMI_LNK: SIG_ASSERT [0x53]
+ UNIX / EMBED / -O3
- {% include latest.html limit="10" %}
+ {% include latest.html limit="50" %}
diff --git a/log.html b/log.html
deleted file mode 100644
index 084173a..0000000
--- a/log.html
+++ /dev/null
@@ -1,13 +0,0 @@
----
-title: Log
-layout: default
----
-
-
-
-
-
Log
-
- {% include latest.html limit="50" %}
-
-
--
cgit v1.2.3