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 | |
| parent | 94a42f4e48e5371462fccf92a6e94155951d97d4 (diff) | |
| download | www-99a21a1bf35c5af6188abdcb87e894b371bbffa5.tar.gz | |
Fix date tag h5 and broken html.
| -rw-r--r-- | _layouts/post.html | 8 | ||||
| -rw-r--r-- | _log/arduino-due.md | 26 | ||||
| -rw-r--r-- | _log/fpm-door-lock-rf.md | 2 | ||||
| -rw-r--r-- | _log/neo4j-a-star-search.md | 2 | ||||
| -rw-r--r-- | _log/search-with-cgi.md | 73 | ||||
| -rw-r--r-- | _site/feed.xml | 2 | ||||
| -rw-r--r-- | _site/index.html | 26 | ||||
| -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 | ||||
| -rw-r--r-- | _site/posts.xml | 2 | ||||
| -rw-r--r-- | _site/projects/index.html | 20 | ||||
| -rw-r--r-- | _site/sitemap.xml | 4 |
22 files changed, 58 insertions, 360 deletions
diff --git a/_layouts/post.html b/_layouts/post.html index 8fb1702..322e242 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -1,12 +1,6 @@ <!DOCTYPE html> <html> - <head> - <meta charset="utf-8"> - <title>{{ page.title }}</title> - {% include header.html %} - - </head> <body> {% include nav.html %} @@ -15,7 +9,7 @@ <div class="container"> <div class="container-2"> <h2 class="center" id="title">{{ page.title | upcase }}</h2> - <h6 class="center">{{ page.date | date_to_long_string | upcase }}</h5> + <h5 class="center">{{ page.date | date_to_long_string | upcase }}</h5> <br> <div class="twocol justify">{{ content }}</div> <p class="post-author right">by {{ site.author }}</p> diff --git a/_log/arduino-due.md b/_log/arduino-due.md index 0d4f495..f604e89 100644 --- a/_log/arduino-due.md +++ b/_log/arduino-due.md @@ -4,25 +4,15 @@ date: 2024-09-16 layout: post --- -Notes on programming ATSAM3X8E chips (Arduino Due) without bootloader. Tested -on OpenBSD. +Notes on programming bare-metal ATSAM3X8E chips (Arduino Due) using Serial Wire +Debug (SwD) protocol. ## Toolchain -Need to bypass embedded bootloader—requires hardware programmer that speaks -Serial Wire Debug (SWD). ST-LINK/V2 works as SWD-USB adapter. - -OpenOCD translates commands to binary sequences the chip understands. Runs -telnet server on startup for issuing commands. - -ARM GNU Compiler Toolchain for compiling C programs. Both OpenOCD and ARM -toolchain available on OpenBSD. +ST-LINK/V2 programmer, OpenOCD, ARM GNU Compiler Toolchain. ## Electrical connections -Arduino Due exposes ATSAM3X8E's SWD interface via DEBUG port. ST-LINK/V2 -connects there. - <table style="border: none; width: 100%;"> <tr style="border: none;"> <td style="border: none; width: 50%; vertical-align: top; background-color: transparent;"> @@ -41,8 +31,7 @@ ST-LINK/v2 programmer connects to that to communicate with the chip. ## Upload procedure -Sample LED blink program with OpenOCD config and linker scripts in tarball -below. +Build. Magic is in the script.ld linker script. ``` $ arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -T script.ld \ @@ -51,7 +40,8 @@ $ arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -T script.ld \ -o a.elf main.c ``` -Upload: + +Upload using OpenOCD: ``` $ openocd -f openocd-due.cfg @@ -81,8 +71,8 @@ Program goes in flash0, so set GPNVM1=1 to boot our code instead of bootloader. ## Linker script notes -Vector table must be at first flash address--mandatory for ARM chips unless -using VTOR register for relocation. +Vector table must be at first flash address--required for ARM chips unless +relocated using VTOR register. First vector table entry: stack pointer. Initialize to highest memory location (ATSAM3X8E has descending stack). diff --git a/_log/fpm-door-lock-rf.md b/_log/fpm-door-lock-rf.md index 46f4dbe..76f64d7 100644 --- a/_log/fpm-door-lock-rf.md +++ b/_log/fpm-door-lock-rf.md @@ -2,6 +2,8 @@ title: Fingerprint door lock (RF) date: 2025-06-05 layout: post +project: true +thumbnail: thumb_sm.jpeg --- Wanted to unlock door with fingerprint, wirelessly to avoid drilling. diff --git a/_log/neo4j-a-star-search.md b/_log/neo4j-a-star-search.md index a8882d1..3233428 100644 --- a/_log/neo4j-a-star-search.md +++ b/_log/neo4j-a-star-search.md @@ -4,7 +4,7 @@ date: 2018-03-06 layout: post --- -Replaced Dijkstra's for vessel route tracking in Neo4J. +Replaced Dijkstra's search for vessel route tracking in Neo4J. 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/_log/search-with-cgi.md b/_log/search-with-cgi.md deleted file mode 100644 index 0109294..0000000 --- a/_log/search-with-cgi.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: Site search using Perl + CGI -date: 2025-12-29 -layout: post ---- - -Number of articles on the site are growing. Need a way to search site. - -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. - -Not gonna use an inverted index--More than an evening's effort, especially if I -want partial matching. I want partial matching. - -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. - -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. - -``` -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); -``` - -httpd sets the search text in QUERY_STRING env. Don't need Perl's CGI module. - -``` -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; - } -} -``` - -Security. - -ReDOS, XSS, command injection, symlink attacks. Did I miss anything? Probably. - -ReDOS: sanitized user input, length-limit search text, quote metacharacters -with `\Q$search_text\E`. - -XSS: sanitized user input. Escaped HTML. - -Command injection: no exec()/system() calls. Non-privileged user (www). - -Symlink attacks: File::Find don't follow symlinks (follow => 0). chroot. - -Access controls: files (444), directories and CGI script: 554. - -Verdict: O(n) speed. Works on every conceivable browser. Good enough. - -Commit: [9fec793](https://git.asciimx.com/www/commit/?h=term&id=9fec793abe0a73e5cd502a1d1e935e2413b85079) diff --git a/_site/feed.xml b/_site/feed.xml index 6b0e884..427a075 100644 --- a/_site/feed.xml +++ b/_site/feed.xml @@ -1 +1 @@ -<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2025-12-30T22:31:10+08:00</updated><id>/feed.xml</id><title type="html">ASCIIMX | Log</title><author><name>W. D. Sadeep Madurange</name></author><entry><title type="html">Site search using Perl + CGI</title><link href="/log/search-with-cgi/" rel="alternate" type="text/html" title="Site search using Perl + CGI" /><published>2025-12-29T00:00:00+08:00</published><updated>2025-12-29T00:00:00+08:00</updated><id>/log/search-with-cgi</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Number of articles on the site are growing. Need a way to search site.]]></summary></entry><entry><title type="html">Matrix Rain: 2025 refactor</title><link href="/log/matrix-digital-rain/" rel="alternate" type="text/html" title="Matrix Rain: 2025 refactor" /><published>2025-12-21T00:00:00+08:00</published><updated>2025-12-21T00:00:00+08:00</updated><id>/log/matrix-digital-rain</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[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 separate array when it should’ve been packed with RGB; Code was harder to read than it needed to be.]]></summary></entry><entry><title type="html">Fingerprint door lock (LP)</title><link href="/log/fpm-door-lock-lp/" rel="alternate" type="text/html" title="Fingerprint door lock (LP)" /><published>2025-08-18T00:00:00+08:00</published><updated>2025-08-18T00:00:00+08:00</updated><id>/log/fpm-door-lock-lp</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Second iteration of the RF door lock. Old version worked but drew too much quiescent current. Sensor and servo pulled 13.8mA and 4.6mA idle. Linear regulators were a disaster. Battery didn’t last 24 hours.]]></summary></entry><entry><title type="html">High-side MOSFET switching</title><link href="/log/mosfet-switches/" rel="alternate" type="text/html" title="High-side MOSFET switching" /><published>2025-06-22T00:00:00+08:00</published><updated>2025-06-22T00:00:00+08:00</updated><id>/log/mosfet-switches</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Needed low-power switching for the fingerprint door lock. Servo and FPM draw high quiescent current–had to cut power electronically during sleep. MOSFETs can do this.]]></summary></entry><entry><title type="html">ATmega328P at 3.3V and 5V</title><link href="/log/arduino-uno/" rel="alternate" type="text/html" title="ATmega328P at 3.3V and 5V" /><published>2025-06-10T00:00:00+08:00</published><updated>2025-06-10T00:00:00+08:00</updated><id>/log/arduino-uno</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Quick reference for wiring ATmega328P ICs at 5V and 3.3V. 5V uses 16MHz crystal, 3.3V uses 8MHz.]]></summary></entry><entry><title type="html">Fingerprint door lock (RF)</title><link href="/log/fpm-door-lock-rf/" rel="alternate" type="text/html" title="Fingerprint door lock (RF)" /><published>2025-06-05T00:00:00+08:00</published><updated>2025-06-05T00:00:00+08:00</updated><id>/log/fpm-door-lock-rf</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Wanted to unlock door with fingerprint, wirelessly to avoid drilling.]]></summary></entry><entry><title type="html">Bumblebee: browser automation</title><link href="/log/bumblebee/" rel="alternate" type="text/html" title="Bumblebee: browser automation" /><published>2025-04-02T00:00:00+08:00</published><updated>2025-04-02T00:00:00+08:00</updated><id>/log/bumblebee</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Built with Andy Zhang for an employer. Tool to automate web scraping script generation.]]></summary></entry><entry><title type="html">ATSAM3X8E bare-metal programming</title><link href="/log/arduino-due/" rel="alternate" type="text/html" title="ATSAM3X8E bare-metal programming" /><published>2024-09-16T00:00:00+08:00</published><updated>2024-09-16T00:00:00+08:00</updated><id>/log/arduino-due</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Notes on programming ATSAM3X8E chips (Arduino Due) without bootloader. Tested on OpenBSD.]]></summary></entry><entry><title type="html">Etlas: e-paper dashboard</title><link href="/log/etlas/" rel="alternate" type="text/html" title="Etlas: e-paper dashboard" /><published>2024-09-05T00:00:00+08:00</published><updated>2024-09-05T00:00:00+08:00</updated><id>/log/etlas</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Repurposed e-reader prototype into something for regular use. News, stocks, weather dashboard. ESP32 NodeMCU D1 + 7.5” Waveshare e-paper + DHT22 sensor.]]></summary></entry><entry><title type="html">ESP32 e-reader prototype</title><link href="/log/e-reader/" rel="alternate" type="text/html" title="ESP32 e-reader prototype" /><published>2023-10-24T00:00:00+08:00</published><updated>2023-10-24T00:00:00+08:00</updated><id>/log/e-reader</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[First project with e-paper displays and ESP32.]]></summary></entry></feed>
\ No newline at end of file +<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2025-12-31T21:45:45+08:00</updated><id>/feed.xml</id><title type="html">ASCIIMX | Log</title><author><name>W. D. Sadeep Madurange</name></author><entry><title type="html">Matrix Rain: 2025 refactor</title><link href="/log/matrix-digital-rain/" rel="alternate" type="text/html" title="Matrix Rain: 2025 refactor" /><published>2025-12-21T00:00:00+08:00</published><updated>2025-12-21T00:00:00+08:00</updated><id>/log/matrix-digital-rain</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[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 separate array when it should’ve been packed with RGB; Code was harder to read than it needed to be.]]></summary></entry><entry><title type="html">Fingerprint door lock (LP)</title><link href="/log/fpm-door-lock-lp/" rel="alternate" type="text/html" title="Fingerprint door lock (LP)" /><published>2025-08-18T00:00:00+08:00</published><updated>2025-08-18T00:00:00+08:00</updated><id>/log/fpm-door-lock-lp</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Second iteration of the RF door lock. Old version worked but drew too much quiescent current. Sensor and servo pulled 13.8mA and 4.6mA idle. Linear regulators were a disaster. Battery didn’t last 24 hours.]]></summary></entry><entry><title type="html">High-side MOSFET switching</title><link href="/log/mosfet-switches/" rel="alternate" type="text/html" title="High-side MOSFET switching" /><published>2025-06-22T00:00:00+08:00</published><updated>2025-06-22T00:00:00+08:00</updated><id>/log/mosfet-switches</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Needed low-power switching for the fingerprint door lock. Servo and FPM draw high quiescent current–had to cut power electronically during sleep. MOSFETs can do this.]]></summary></entry><entry><title type="html">ATmega328P at 3.3V and 5V</title><link href="/log/arduino-uno/" rel="alternate" type="text/html" title="ATmega328P at 3.3V and 5V" /><published>2025-06-10T00:00:00+08:00</published><updated>2025-06-10T00:00:00+08:00</updated><id>/log/arduino-uno</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Quick reference for wiring ATmega328P ICs at 5V and 3.3V. 5V uses 16MHz crystal, 3.3V uses 8MHz.]]></summary></entry><entry><title type="html">Fingerprint door lock (RF)</title><link href="/log/fpm-door-lock-rf/" rel="alternate" type="text/html" title="Fingerprint door lock (RF)" /><published>2025-06-05T00:00:00+08:00</published><updated>2025-06-05T00:00:00+08:00</updated><id>/log/fpm-door-lock-rf</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Wanted to unlock door with fingerprint, wirelessly to avoid drilling.]]></summary></entry><entry><title type="html">Bumblebee: browser automation</title><link href="/log/bumblebee/" rel="alternate" type="text/html" title="Bumblebee: browser automation" /><published>2025-04-02T00:00:00+08:00</published><updated>2025-04-02T00:00:00+08:00</updated><id>/log/bumblebee</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Built with Andy Zhang for an employer. Tool to automate web scraping script generation.]]></summary></entry><entry><title type="html">ATSAM3X8E bare-metal programming</title><link href="/log/arduino-due/" rel="alternate" type="text/html" title="ATSAM3X8E bare-metal programming" /><published>2024-09-16T00:00:00+08:00</published><updated>2024-09-16T00:00:00+08:00</updated><id>/log/arduino-due</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Notes on programming bare-metal ATSAM3X8E chips (Arduino Due) using Serial Wire Debug (SwD) protocol.]]></summary></entry><entry><title type="html">Etlas: e-paper dashboard</title><link href="/log/etlas/" rel="alternate" type="text/html" title="Etlas: e-paper dashboard" /><published>2024-09-05T00:00:00+08:00</published><updated>2024-09-05T00:00:00+08:00</updated><id>/log/etlas</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Repurposed e-reader prototype into something for regular use. News, stocks, weather dashboard. ESP32 NodeMCU D1 + 7.5” Waveshare e-paper + DHT22 sensor.]]></summary></entry><entry><title type="html">ESP32 e-reader prototype</title><link href="/log/e-reader/" rel="alternate" type="text/html" title="ESP32 e-reader prototype" /><published>2023-10-24T00:00:00+08:00</published><updated>2023-10-24T00:00:00+08:00</updated><id>/log/e-reader</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[First project with e-paper displays and ESP32.]]></summary></entry><entry><title type="html">Neo4j shortest path optimization</title><link href="/log/neo4j-a-star-search/" rel="alternate" type="text/html" title="Neo4j shortest path optimization" /><published>2018-03-06T00:00:00+08:00</published><updated>2018-03-06T00:00:00+08:00</updated><id>/log/neo4j-a-star-search</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Replaced Dijkstra’s search for vessel route tracking in Neo4J.]]></summary></entry></feed>
\ No newline at end of file diff --git a/_site/index.html b/_site/index.html index 79b0549..b985dfc 100644 --- a/_site/index.html +++ b/_site/index.html @@ -61,19 +61,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"> @@ -189,6 +176,19 @@ + <tr> + <td class="posts-td posts-td-link"> + <a href="/log/neo4j-a-star-search/" class="link-decor-none">Neo4j shortest path optimization</a> + </td> + <td class="posts-td posts-td-time"> + <span class="post-meta"> + <time datetime="2018-03-06 00:00:00 +0800">2018-03-06</time> + </span> + </td> + </tr> + + + </table> </div> 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> diff --git a/_site/posts.xml b/_site/posts.xml index 6f08cc2..88f6d2f 100644 --- a/_site/posts.xml +++ b/_site/posts.xml @@ -1 +1 @@ -<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="/posts.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2025-12-30T22:31:10+08:00</updated><id>/posts.xml</id><title type="html">ASCIIMX</title><author><name>W. D. Sadeep Madurange</name></author></feed>
\ No newline at end of file +<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="/posts.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2025-12-31T21:45:45+08:00</updated><id>/posts.xml</id><title type="html">ASCIIMX</title><author><name>W. D. Sadeep Madurange</name></author></feed>
\ No newline at end of file diff --git a/_site/projects/index.html b/_site/projects/index.html index 2357793..6a2f996 100644 --- a/_site/projects/index.html +++ b/_site/projects/index.html @@ -76,12 +76,25 @@ <td class="project-item"> + <a href="../log/fpm-door-lock-rf" class="link-decor-none"> + <img src="../log/fpm-door-lock-rf/thumb_sm.jpeg" alt="Fingerprint door lock (RF)"> + <h5>Fingerprint door lock (RF)</h5> + </a> + </td> + + <td class="project-item"> + <a href="../log/bumblebee" class="link-decor-none"> <img src="../log/bumblebee/thumb_sm.png" alt="Bumblebee: browser automation"> <h5>Bumblebee: browser automation</h5> </a> </td> + </tr> + + <tr> + + <td class="project-item"> <a href="../log/etlas" class="link-decor-none"> @@ -90,11 +103,6 @@ </a> </td> - </tr> - - <tr> - - <td class="project-item"> <a href="../log/e-reader" class="link-decor-none"> @@ -106,8 +114,6 @@ - <td class="project-item"></td> - </tr> diff --git a/_site/sitemap.xml b/_site/sitemap.xml index 93b39c0..b799547 100644 --- a/_site/sitemap.xml +++ b/_site/sitemap.xml @@ -41,10 +41,6 @@ <lastmod>2025-12-21T00:00:00+08:00</lastmod> </url> <url> -<loc>/log/search-with-cgi/</loc> -<lastmod>2025-12-29T00:00:00+08:00</lastmod> -</url> -<url> <loc>/about/</loc> </url> <url> |
