diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2025-12-31 21:51:40 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2025-12-31 21:51:40 +0800 |
| commit | 99a21a1bf35c5af6188abdcb87e894b371bbffa5 (patch) | |
| tree | 294f4e6a90150fb3b478c06576e147c9f24540b4 /_site/log | |
| parent | 94a42f4e48e5371462fccf92a6e94155951d97d4 (diff) | |
| download | www-99a21a1bf35c5af6188abdcb87e894b371bbffa5.tar.gz | |
Fix date tag h5 and broken html.
Diffstat (limited to '_site/log')
| -rw-r--r-- | _site/log/arduino-due/index.html | 33 | ||||
| -rw-r--r-- | _site/log/arduino-uno/index.html | 8 | ||||
| -rw-r--r-- | _site/log/bumblebee/index.html | 8 | ||||
| -rw-r--r-- | _site/log/e-reader/index.html | 8 | ||||
| -rw-r--r-- | _site/log/etlas/index.html | 8 | ||||
| -rw-r--r-- | _site/log/fpm-door-lock-lp/index.html | 8 | ||||
| -rw-r--r-- | _site/log/fpm-door-lock-rf/index.html | 8 | ||||
| -rw-r--r-- | _site/log/index.html | 13 | ||||
| -rw-r--r-- | _site/log/matrix-digital-rain/index.html | 8 | ||||
| -rw-r--r-- | _site/log/mosfet-switches/index.html | 8 | ||||
| -rw-r--r-- | _site/log/neo4j-a-star-search/index.html | 10 | ||||
| -rw-r--r-- | _site/log/search-with-cgi/index.html | 133 |
12 files changed, 18 insertions, 235 deletions
diff --git a/_site/log/arduino-due/index.html b/_site/log/arduino-due/index.html index a2135cb..970136d 100644 --- a/_site/log/arduino-due/index.html +++ b/_site/log/arduino-due/index.html @@ -1,9 +1,5 @@ <!DOCTYPE html> <html> - <head> - <meta charset="utf-8"> - <title>ATSAM3X8E bare-metal programming</title> - <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> @@ -13,8 +9,6 @@ </head> - - </head> <body> <div id="nav-container" class="container"> @@ -47,27 +41,17 @@ <div class="container"> <div class="container-2"> <h2 class="center" id="title">ATSAM3X8E BARE-METAL PROGRAMMING</h2> - <h6 class="center">16 SEPTEMBER 2024</h5> + <h5 class="center">16 SEPTEMBER 2024</h5> <br> - <div class="twocol justify"><p>Notes on programming ATSAM3X8E chips (Arduino Due) without bootloader. Tested -on OpenBSD.</p> + <div class="twocol justify"><p>Notes on programming bare-metal ATSAM3X8E chips (Arduino Due) using Serial Wire +Debug (SwD) protocol.</p> <h2 id="toolchain">Toolchain</h2> -<p>Need to bypass embedded bootloader—requires hardware programmer that speaks -Serial Wire Debug (SWD). ST-LINK/V2 works as SWD-USB adapter.</p> - -<p>OpenOCD translates commands to binary sequences the chip understands. Runs -telnet server on startup for issuing commands.</p> - -<p>ARM GNU Compiler Toolchain for compiling C programs. Both OpenOCD and ARM -toolchain available on OpenBSD.</p> +<p>ST-LINK/V2 programmer, OpenOCD, ARM GNU Compiler Toolchain.</p> <h2 id="electrical-connections">Electrical connections</h2> -<p>Arduino Due exposes ATSAM3X8E’s SWD interface via DEBUG port. ST-LINK/V2 -connects there.</p> - <table style="border: none; width: 100%;"> <tr style="border: none;"> <td style="border: none; width: 50%; vertical-align: top; background-color: transparent;"> @@ -86,8 +70,7 @@ ST-LINK/v2 programmer connects to that to communicate with the chip.</p> <h2 id="upload-procedure">Upload procedure</h2> -<p>Sample LED blink program with OpenOCD config and linker scripts in tarball -below.</p> +<p>Build. Magic is in the script.ld linker script.</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -T script.ld \ -nostartfiles \ @@ -95,7 +78,7 @@ below.</p> -o a.elf main.c </code></pre></div></div> -<p>Upload:</p> +<p>Upload using OpenOCD:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ openocd -f openocd-due.cfg $ telnet localhost 4444 @@ -124,8 +107,8 @@ GPNVM2=0: flash0 (0x80000) maps to 0x00000. Both cleared: flash1 maps to <h2 id="linker-script-notes">Linker script notes</h2> -<p>Vector table must be at first flash address–mandatory for ARM chips unless -using VTOR register for relocation.</p> +<p>Vector table must be at first flash address–required for ARM chips unless +relocated using VTOR register.</p> <p>First vector table entry: stack pointer. Initialize to highest memory location (ATSAM3X8E has descending stack).</p> diff --git a/_site/log/arduino-uno/index.html b/_site/log/arduino-uno/index.html index 66fff37..33ca118 100644 --- a/_site/log/arduino-uno/index.html +++ b/_site/log/arduino-uno/index.html @@ -1,9 +1,5 @@ <!DOCTYPE html> <html> - <head> - <meta charset="utf-8"> - <title>ATmega328P at 3.3V and 5V</title> - <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> @@ -13,8 +9,6 @@ </head> - - </head> <body> <div id="nav-container" class="container"> @@ -47,7 +41,7 @@ <div class="container"> <div class="container-2"> <h2 class="center" id="title">ATMEGA328P AT 3.3V AND 5V</h2> - <h6 class="center">10 JUNE 2025</h5> + <h5 class="center">10 JUNE 2025</h5> <br> <div class="twocol justify"><p>Quick reference for wiring ATmega328P ICs at 5V and 3.3V. 5V uses 16MHz crystal, 3.3V uses 8MHz.</p> diff --git a/_site/log/bumblebee/index.html b/_site/log/bumblebee/index.html index b4c9c25..9d12851 100644 --- a/_site/log/bumblebee/index.html +++ b/_site/log/bumblebee/index.html @@ -1,9 +1,5 @@ <!DOCTYPE html> <html> - <head> - <meta charset="utf-8"> - <title>Bumblebee: browser automation</title> - <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> @@ -13,8 +9,6 @@ </head> - - </head> <body> <div id="nav-container" class="container"> @@ -47,7 +41,7 @@ <div class="container"> <div class="container-2"> <h2 class="center" id="title">BUMBLEBEE: BROWSER AUTOMATION</h2> - <h6 class="center">02 APRIL 2025</h5> + <h5 class="center">02 APRIL 2025</h5> <br> <div class="twocol justify"><p>Built with Andy Zhang for an employer. Tool to automate web scraping script generation.</p> diff --git a/_site/log/e-reader/index.html b/_site/log/e-reader/index.html index 44ae1e6..2d76f26 100644 --- a/_site/log/e-reader/index.html +++ b/_site/log/e-reader/index.html @@ -1,9 +1,5 @@ <!DOCTYPE html> <html> - <head> - <meta charset="utf-8"> - <title>ESP32 e-reader prototype</title> - <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> @@ -13,8 +9,6 @@ </head> - - </head> <body> <div id="nav-container" class="container"> @@ -47,7 +41,7 @@ <div class="container"> <div class="container-2"> <h2 class="center" id="title">ESP32 E-READER PROTOTYPE</h2> - <h6 class="center">24 OCTOBER 2023</h5> + <h5 class="center">24 OCTOBER 2023</h5> <br> <div class="twocol justify"><p>First project with e-paper displays and ESP32.</p> diff --git a/_site/log/etlas/index.html b/_site/log/etlas/index.html index 8149618..97f0ff8 100644 --- a/_site/log/etlas/index.html +++ b/_site/log/etlas/index.html @@ -1,9 +1,5 @@ <!DOCTYPE html> <html> - <head> - <meta charset="utf-8"> - <title>Etlas: e-paper dashboard</title> - <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> @@ -13,8 +9,6 @@ </head> - - </head> <body> <div id="nav-container" class="container"> @@ -47,7 +41,7 @@ <div class="container"> <div class="container-2"> <h2 class="center" id="title">ETLAS: E-PAPER DASHBOARD</h2> - <h6 class="center">05 SEPTEMBER 2024</h5> + <h5 class="center">05 SEPTEMBER 2024</h5> <br> <div class="twocol justify"><p>Repurposed <a href="../e-reader/">e-reader prototype</a> into something for regular use. News, stocks, weather dashboard. ESP32 NodeMCU D1 + 7.5” Waveshare e-paper + diff --git a/_site/log/fpm-door-lock-lp/index.html b/_site/log/fpm-door-lock-lp/index.html index a5d237c..8d1c721 100644 --- a/_site/log/fpm-door-lock-lp/index.html +++ b/_site/log/fpm-door-lock-lp/index.html @@ -1,9 +1,5 @@ <!DOCTYPE html> <html> - <head> - <meta charset="utf-8"> - <title>Fingerprint door lock (LP)</title> - <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> @@ -13,8 +9,6 @@ </head> - - </head> <body> <div id="nav-container" class="container"> @@ -47,7 +41,7 @@ <div class="container"> <div class="container-2"> <h2 class="center" id="title">FINGERPRINT DOOR LOCK (LP)</h2> - <h6 class="center">18 AUGUST 2025</h5> + <h5 class="center">18 AUGUST 2025</h5> <br> <div class="twocol justify"><p>Second iteration of the <a href="../fpm-door-lock-rf">RF door lock</a>. Old version worked but drew too much quiescent current. Sensor and servo pulled 13.8mA and 4.6mA diff --git a/_site/log/fpm-door-lock-rf/index.html b/_site/log/fpm-door-lock-rf/index.html index 04c84de..342fa44 100644 --- a/_site/log/fpm-door-lock-rf/index.html +++ b/_site/log/fpm-door-lock-rf/index.html @@ -1,9 +1,5 @@ <!DOCTYPE html> <html> - <head> - <meta charset="utf-8"> - <title>Fingerprint door lock (RF)</title> - <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> @@ -13,8 +9,6 @@ </head> - - </head> <body> <div id="nav-container" class="container"> @@ -47,7 +41,7 @@ <div class="container"> <div class="container-2"> <h2 class="center" id="title">FINGERPRINT DOOR LOCK (RF)</h2> - <h6 class="center">05 JUNE 2025</h5> + <h5 class="center">05 JUNE 2025</h5> <br> <div class="twocol justify"><p>Wanted to unlock door with fingerprint, wirelessly to avoid drilling.</p> diff --git a/_site/log/index.html b/_site/log/index.html index defcfed..955f645 100644 --- a/_site/log/index.html +++ b/_site/log/index.html @@ -51,19 +51,6 @@ <tr> <td class="posts-td posts-td-link"> - <a href="/log/search-with-cgi/" class="link-decor-none">Site search using Perl + CGI</a> - </td> - <td class="posts-td posts-td-time"> - <span class="post-meta"> - <time datetime="2025-12-29 00:00:00 +0800">2025-12-29</time> - </span> - </td> - </tr> - - - - <tr> - <td class="posts-td posts-td-link"> <a href="/log/matrix-digital-rain/" class="link-decor-none">Matrix Rain: 2025 refactor</a> </td> <td class="posts-td posts-td-time"> diff --git a/_site/log/matrix-digital-rain/index.html b/_site/log/matrix-digital-rain/index.html index a570230..86d918d 100644 --- a/_site/log/matrix-digital-rain/index.html +++ b/_site/log/matrix-digital-rain/index.html @@ -1,9 +1,5 @@ <!DOCTYPE html> <html> - <head> - <meta charset="utf-8"> - <title>Matrix Rain: 2025 refactor</title> - <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> @@ -13,8 +9,6 @@ </head> - - </head> <body> <div id="nav-container" class="container"> @@ -47,7 +41,7 @@ <div class="container"> <div class="container-2"> <h2 class="center" id="title">MATRIX RAIN: 2025 REFACTOR</h2> - <h6 class="center">21 DECEMBER 2025</h5> + <h5 class="center">21 DECEMBER 2025</h5> <br> <div class="twocol justify"><p>The 2022 version worked but had some loose ends. Unicode support was inflexible–couldn’t mix ASCII with Katakana; Phosphor decay was stored in a diff --git a/_site/log/mosfet-switches/index.html b/_site/log/mosfet-switches/index.html index 37d6707..e3a6868 100644 --- a/_site/log/mosfet-switches/index.html +++ b/_site/log/mosfet-switches/index.html @@ -1,9 +1,5 @@ <!DOCTYPE html> <html> - <head> - <meta charset="utf-8"> - <title>High-side MOSFET switching</title> - <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> @@ -13,8 +9,6 @@ </head> - - </head> <body> <div id="nav-container" class="container"> @@ -47,7 +41,7 @@ <div class="container"> <div class="container-2"> <h2 class="center" id="title">HIGH-SIDE MOSFET SWITCHING</h2> - <h6 class="center">22 JUNE 2025</h5> + <h5 class="center">22 JUNE 2025</h5> <br> <div class="twocol justify"><p>Needed low-power switching for the <a href="../fpm-door-lock-lp/">fingerprint door lock</a>. Servo and FPM draw high quiescent current–had to diff --git a/_site/log/neo4j-a-star-search/index.html b/_site/log/neo4j-a-star-search/index.html index 013cd95..4154255 100644 --- a/_site/log/neo4j-a-star-search/index.html +++ b/_site/log/neo4j-a-star-search/index.html @@ -1,9 +1,5 @@ <!DOCTYPE html> <html> - <head> - <meta charset="utf-8"> - <title>Neo4j shortest path optimization</title> - <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> @@ -13,8 +9,6 @@ </head> - - </head> <body> <div id="nav-container" class="container"> @@ -47,9 +41,9 @@ <div class="container"> <div class="container-2"> <h2 class="center" id="title">NEO4J SHORTEST PATH OPTIMIZATION</h2> - <h6 class="center">06 MARCH 2018</h5> + <h5 class="center">06 MARCH 2018</h5> <br> - <div class="twocol justify"><p>Replaced Dijkstra’s for vessel route tracking in Neo4J.</p> + <div class="twocol justify"><p>Replaced Dijkstra’s search for vessel route tracking in Neo4J.</p> <p>Tracking 13,000 marine vessel route points. Needed shortest paths between ports for arrival prediction. Neo4j’s Dijkstra’s algorithm slows after 4,000 route diff --git a/_site/log/search-with-cgi/index.html b/_site/log/search-with-cgi/index.html deleted file mode 100644 index 71b9f23..0000000 --- a/_site/log/search-with-cgi/index.html +++ /dev/null @@ -1,133 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> - <title>Site search using Perl + CGI</title> - - <head> - <meta charset="utf-8"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Site search using Perl + CGI</title> - <link rel="stylesheet" href="/assets/css/main.css"> - <link rel="stylesheet" href="/assets/css/skeleton.css"> -</head> - - - - </head> - <body> - - <div id="nav-container" class="container"> - <ul id="navlist" class="left"> - - <li > - <a href="/" class="link-decor-none">hme</a> - </li> - <li class="active"> - <a href="/log/" class="link-decor-none">log</a> - </li> - <li > - <a href="/projects/" class="link-decor-none">poc</a> - </li> - <li > - <a href="/about/" class="link-decor-none">abt</a> - </li> - <li> - <a href="/cgi-bin/find.cgi" class="link-decor-none">sws</a> - </li> - <li> - <a href="/feed.xml" class="link-decor-none">rss</a> - </li> - </ul> -</div> - - - - <main> - <div class="container"> - <div class="container-2"> - <h2 class="center" id="title">SITE SEARCH USING PERL + CGI</h2> - <h6 class="center">29 DECEMBER 2025</h5> - <br> - <div class="twocol justify"><p>Number of articles on the site are growing. Need a way to search site.</p> - -<p>Searching the RSS feed client-side using JavaScript is not an option. That -would make the feed much heavier and break the site for text-based web browsers -like Lynx.</p> - -<p>Not gonna use an inverted index–More than an evening’s effort, especially if I -want partial matching. I want partial matching.</p> - -<p>Few lines of Perl could do a regex search and send the result back via CGI. -OpenBSD httpd speaks CGI. Perl and slowcgi are in the base system. No -dependencies.</p> - -<p>Perl: traverse directory with File::Find. If search text is found grab the file -name, title and up to 50 chars from the first paragraph to include in the -search result.</p> - -<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>find({ - wanted => sub { - return unless -f $_ && $_ eq 'index.html'; - # ... file reading ... - if ($content =~ /\Q$search_text\E/i) { - # Extract title, snippet - push @results, { - path => $File::Find::name, - title => $title, - snippet => $snippet - }; - } - }, - follow => 0, -}, $dir); -</code></pre></div></div> - -<p>httpd sets the search text in QUERY_STRING env. Don’t need Perl’s CGI module.</p> - -<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>my %params; -if ($ENV{QUERY_STRING}) { - foreach my $pair (split /&/, $ENV{QUERY_STRING}) { - my ($key, $value) = split /=/, $pair; - $value =~ tr/+/ /; - $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; - $params{$key} = $value; - } -} -</code></pre></div></div> - -<p>Security.</p> - -<p>ReDOS, XSS, command injection, symlink attacks. Did I miss anything? Probably.</p> - -<p>ReDOS: sanitized user input, length-limit search text, quote metacharacters -with <code class="language-plaintext highlighter-rouge">\Q$search_text\E</code>.</p> - -<p>XSS: sanitized user input. Escaped HTML.</p> - -<p>Command injection: no exec()/system() calls. Non-privileged user (www).</p> - -<p>Symlink attacks: File::Find don’t follow symlinks (follow => 0). chroot.</p> - -<p>Access controls: files (444), directories and CGI script: 554.</p> - -<p>Verdict: O(n) speed. Works on every conceivable browser. Good enough.</p> - -<p>Commit: <a href="https://git.asciimx.com/www/commit/?h=term&id=9fec793abe0a73e5cd502a1d1e935e2413b85079">9fec793</a></p> -</div> - <p class="post-author right">by W. D. Sadeep Madurange</p> - </div> - </div> - </main> - - <div class="footer"> - <div class="container"> - <div class="twelve columns right container-2"> - <p id="footer-text">© ASCIIMX - 2025</p> - </div> - </div> -</div> - - - </body> -</html> |
