<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="saramic.github.io/learning/feed.xml" rel="self" type="application/atom+xml" /><link href="saramic.github.io/learning/" rel="alternate" type="text/html" /><updated>2026-11-12T08:08:38+11:00</updated><id>saramic.github.io/learning/feed.xml</id><title type="html">Saramic Learning</title><subtitle>Always learning, some notes to keep me honest and a bunch of TIL (Today I Learnt) hints as well as handy hacks.</subtitle><entry><title type="html">element13 Foil Headwave Aluminium aTtenuator DevKit</title><link href="saramic.github.io/learning/element14,/road-test/2026/06/23/e14-Al-att-devKit.html" rel="alternate" type="text/html" title="element13 Foil Headwave Aluminium aTtenuator DevKit" /><published>2026-06-23T16:00:00+10:00</published><updated>2026-06-23T16:00:00+10:00</updated><id>saramic.github.io/learning/element14,/road-test/2026/06/23/e14-Al-att-devKit</id><content type="html" xml:base="saramic.github.io/learning/element14,/road-test/2026/06/23/e14-Al-att-devKit.html"><![CDATA[<h2 id="the-package-arrives">The Package Arrives</h2>

<p>There are road tests, and then there are <em>road tests</em>. When element14’s April
1st offering landed in my inbox — the <strong>element13 Foil Headwave Aluminium
aTtenuator DevKit</strong> — I was, naturally, all in. Element 13 on the periodic table
is aluminium. I should have known.</p>

<video width="740" controls="">
  <source src="/learning/assets/2026-06-23/al_foil_unboxing.mp4" type="video/mp4" />
  Your browser does not support the video tag.
</video>

<p>The kids’ faces said it all. There is a special kind of disappointment when you
have built up “electronics delivery” energy and the box contains thirty pre-cut
sheets of kitchen foil. Was the foil <em>packaging</em> something? No. The foil <em>was</em>
the thing.</p>

<p>Still — a devkit is a devkit. I decided to take the brief seriously, pulled out
some lab equipment and a Jupyter notebook, and went to work.</p>

<h2 id="what-did-we-actually-receive">What Did We Actually Receive?</h2>

<p>Thirty sheets of aluminium foil, pre-cut to a consistent size. First
observation: the cutting is genuinely precise. All five sheets I measured came
in at <strong>299×273 mm ±0.25 mm</strong> — better tolerance than most craft cutters manage.
Whatever tooling produced these, it is not scissors. I think this had a level
of novelty for me, as I am used to rolls of aluminium foil and having to cut
them myself.</p>

<p><img src="/learning/assets/2026-06-23/al_foil_attenuator_foil.jpg" alt="" /></p>

<p>Oh and there were stickers - I was so excited about the foil, I forgot to put
the stickers in the shot</p>

<p><img src="/learning/assets/2026-06-23/al_foil_lenght.jpg" alt="" /></p>

<h2 id="material-characterisation">Material Characterisation</h2>

<h3 id="thickness-a-tale-of-three-methods">Thickness: A Tale of Three Methods</h3>

<p>The nominal spec for Aluminium foil is a thickness of 16 µm. I tried three
approaches to verify this.</p>

<p><strong>Released caliper jaw (20-layer stack, 6 sections):</strong> 15.0–19.5 µm per sheet,
mean 17.6 µm. Too high — air gaps between the stacked layers inflate the
reading.</p>

<p><strong>Firm caliper press (same stack):</strong> 10.5–13.5 µm per sheet, mean 12.1 µm. Too
low — cheap digital calipers might flex under some jaw force, pulling the
reading down.</p>

<p><img src="/learning/assets/2026-06-23/al_foil_thickness.jpg" alt="" /></p>

<p>The two failure modes bracket the truth from opposite sides, which is itself a
useful result.</p>

<p><strong>Mass method — five sheets, two weighings each, three bundle weighings:</strong></p>

<table>
  <thead>
    <tr>
      <th>method</th>
      <th style="text-align: right">mass/sheet</th>
      <th style="text-align: right">thickness</th>
      <th style="text-align: right">Δ from nominal</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>individual mean</td>
      <td style="text-align: right">3.160 g</td>
      <td style="text-align: right">14.34 µm</td>
      <td style="text-align: right">−1.66 µm</td>
    </tr>
    <tr>
      <td>bundle mean</td>
      <td style="text-align: right">3.157 g</td>
      <td style="text-align: right"><strong>14.32 µm</strong></td>
      <td style="text-align: right"><strong>−1.68 µm (−10.5%)</strong></td>
    </tr>
  </tbody>
</table>

<p><strong>The foil is 14.32 µm — 10.5% thinner than the 16 µm nominal predicted.</strong></p>

<p>The mass method has no air-gap or frame-flex problem. Uncertainty is dominated
by the ruler measurement of sheet area (<code class="language-plaintext highlighter-rouge">±0.25 mm</code> on <code class="language-plaintext highlighter-rouge">299 mm ≈ 0.17%</code>), giving
thickness uncertainty of <code class="language-plaintext highlighter-rouge">±0.02 µm</code>. The caliper method, by contrast, had <code class="language-plaintext highlighter-rouge">±4.5
µm</code> spread from air gaps alone.</p>

<p><img src="/learning/assets/2026-06-23/al_foil_weight.jpg" alt="" /></p>

<p><em>Lesson: for thin compressible stacks, weigh them — don’t measure them.</em></p>

<h3 id="tensile-strength">Tensile Strength</h3>

<p>A <code class="language-plaintext highlighter-rouge">10 mm</code> wide strip, tape-reinforced at each end, hung from a fixed point with
a cup of water added incrementally until failure. Three trials:</p>

<table>
  <thead>
    <tr>
      <th style="text-align: right">trial</th>
      <th style="text-align: right">failure load</th>
      <th style="text-align: right">UTS</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: right">1</td>
      <td style="text-align: right">997 g</td>
      <td style="text-align: right">68.3 MPa</td>
    </tr>
    <tr>
      <td style="text-align: right">2</td>
      <td style="text-align: right">1,004 g</td>
      <td style="text-align: right">68.7 MPa</td>
    </tr>
    <tr>
      <td style="text-align: right">3</td>
      <td style="text-align: right">1,010 g</td>
      <td style="text-align: right">69.1 MPa</td>
    </tr>
    <tr>
      <td style="text-align: right"><strong>mean</strong></td>
      <td style="text-align: right"><strong>1,004 g ± 6 g</strong></td>
      <td style="text-align: right"><strong>68.8 ± 0.4 MPa</strong></td>
    </tr>
  </tbody>
</table>

<p>Only <code class="language-plaintext highlighter-rouge">12.6 g</code> spread across three trials — <code class="language-plaintext highlighter-rouge">1.3%</code> variation. The mean UTS
(Ultimate Tensile Strenght) of <strong>68.8 MPa</strong> is below the <code class="language-plaintext highlighter-rouge">~80 MPa</code> often quoted
for aluminium foil; that figure assumes work-hardened material. This product is
clearly <strong>O-temper</strong> (fully annealed), standard for kitchen foil: softer, more
foldable, 65–75 MPa typical. The ±0.4 MPa standard deviation confirms very
uniform material throughout the roll.</p>

<h2 id="hcl-dissolution">HCl Dissolution</h2>

<video width="740" controls="">
  <source src="/learning/assets/2026-06-23/al_foil_acid_runaway_reaction.mp4" type="video/mp4" />
  Your browser does not support the video tag.
</video>

<p>Hardware-store muriatic acid, diluted <code class="language-plaintext highlighter-rouge">1:3</code> in water. A half-sheet piece (<code class="language-plaintext highlighter-rouge">1.58
g</code>) dropped into a tared beaker. Mass tracked every <code class="language-plaintext highlighter-rouge">30 seconds</code> as <code class="language-plaintext highlighter-rouge">H₂</code>
escapes.</p>

<p>Reaction: <code class="language-plaintext highlighter-rouge">2Al + 6HCl → 2AlCl₃ + 3H₂↑</code>
Stoichiometry shortcut: Al dissolved (g) = H₂ lost (g) × 9</p>

<p><strong>Phase 1 — cold outdoor conditions, undisturbed:</strong></p>

<ul>
  <li>74% of the foil dissolved in <strong>9.4 minutes</strong></li>
  <li>Rate slowed because part of the foil was sitting above the liquid line</li>
</ul>

<p>The interesting result came when I added more acid, impatient with the
remaining 26%. The exothermic reaction had already warmed the solution
slightly; fresh acid tipped it into <strong>thermal runaway</strong>. Rate jumped from
<code class="language-plaintext highlighter-rouge">~0.01 g/min</code> to <code class="language-plaintext highlighter-rouge">&gt;0.5 g/min</code> over two minutes; the solution heated visibly and
fumed. Of the <code class="language-plaintext highlighter-rouge">5.5 g</code> total mass lost in Phase 3, only <code class="language-plaintext highlighter-rouge">~0.046 g</code> was <code class="language-plaintext highlighter-rouge">H₂</code> from
the remaining aluminium — the other <code class="language-plaintext highlighter-rouge">5.5 g</code> was <strong>HCl vapour and water
evaporating from the hot solution</strong>.</p>

<p>This autocatalytic loop</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cold start → slow reaction → exothermic heat → faster reaction → more heat
</code></pre></div></div>

<p>is a neat demonstration of why temperature control matters in wet chemistry, and
why you do this outdoors with safety glasses. It also explains why two of my
three attempts were too vigorous to measure cleanly.</p>

<p>TIP: <em>For a clean kinetics curve: smaller piece (~0.4 g), larger volume (~150
mL), room temperature. Should complete in 3–5 minutes with no runaway.</em></p>

<h2 id="rf-attenuation--433-mhz">RF Attenuation — 433 MHz</h2>

<p>A continuous-carrier 433 MHz transmitter (FS1000A module, DATA pin held HIGH —
a two-line Arduino sketch), the TinySA Ultra as receiver, fixed 30 cm apart
with foil layers added one at a time.</p>

<p><img src="/learning/assets/2026-06-23/rf_radio_side.jpg" alt="" />
<img src="/learning/assets/2026-06-23/rf_setup_overview.jpg" alt="" />
<img src="/learning/assets/2026-06-23/rf_tiny_sa_side.jpg" alt="" /></p>

<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">void</span> <span class="nf">setup</span><span class="p">()</span> <span class="p">{</span>
    <span class="n">Serial</span><span class="p">.</span><span class="n">begin</span><span class="p">(</span><span class="mi">115200</span><span class="p">);</span>
    <span class="n">pinMode</span><span class="p">(</span><span class="n">TX_PIN</span><span class="p">,</span> <span class="n">OUTPUT</span><span class="p">);</span>
    <span class="n">digitalWrite</span><span class="p">(</span><span class="n">TX_PIN</span><span class="p">,</span> <span class="n">HIGH</span><span class="p">);</span>
    <span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="n">F</span><span class="p">(</span><span class="s">"433 MHz TX | continuous carrier ON"</span><span class="p">));</span>
    <span class="n">Serial</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">F</span><span class="p">(</span><span class="s">"DATA pin "</span><span class="p">));</span> <span class="n">Serial</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">TX_PIN</span><span class="p">);</span> <span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="n">F</span><span class="p">(</span><span class="s">" HIGH"</span><span class="p">));</span>
<span class="p">}</span>
</code></pre></div></div>

<p>The theoretical basis: skin depth of aluminium at <code class="language-plaintext highlighter-rouge">433 MHz</code> is <strong>3.94 µm</strong>. The
foil is <code class="language-plaintext highlighter-rouge">14.32 µm</code> thick — <strong>3.6 skin depths</strong> — which the plane-wave
skin-depth model predicts gives <strong>31.6 dB attenuation per layer</strong>. A single
sheet should be close to opaque.</p>

<p><strong>Measured results — 24 layers, 30 cm indoor, TinySA Ultra:</strong></p>

<table>
  <thead>
    <tr>
      <th style="text-align: right">layers</th>
      <th style="text-align: right">dBm</th>
      <th style="text-align: right">attenuation</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: right">0</td>
      <td style="text-align: right">−33.9</td>
      <td style="text-align: right">0 dB</td>
    </tr>
    <tr>
      <td style="text-align: right">1</td>
      <td style="text-align: right">−38.9</td>
      <td style="text-align: right">−5.0 dB</td>
    </tr>
    <tr>
      <td style="text-align: right">5</td>
      <td style="text-align: right">−40.4</td>
      <td style="text-align: right">−6.5 dB</td>
    </tr>
    <tr>
      <td style="text-align: right">10</td>
      <td style="text-align: right">−44.4</td>
      <td style="text-align: right">−10.5 dB</td>
    </tr>
    <tr>
      <td style="text-align: right">15</td>
      <td style="text-align: right">−52.4</td>
      <td style="text-align: right">−18.5 dB</td>
    </tr>
    <tr>
      <td style="text-align: right">20</td>
      <td style="text-align: right">−58.9</td>
      <td style="text-align: right">−25.0 dB</td>
    </tr>
    <tr>
      <td style="text-align: right">24</td>
      <td style="text-align: right">−63.9</td>
      <td style="text-align: right"><strong>−30.0 dB</strong></td>
    </tr>
  </tbody>
</table>

<p>The measured slope is approximately <strong>−1.25 dB/layer</strong> — about <strong>25× less</strong>
than the theoretical 31.6 dB/layer. The result is real and reproducible, but
the discrepancy needs explaining.</p>

<p><img src="/learning/assets/2026-06-23/rf_top_down.jpg" alt="" /></p>

<p><strong>Why so much less than theory?</strong> Three effects combine:</p>

<ol>
  <li>
    <p><strong>Fresnel diffraction</strong> — at 433 MHz (λ = 69 cm), the first Fresnel zone at
the midpoint of a 30 cm path has radius ~23 cm. The foil is 27 cm wide, so
it covers only ~36% of that zone; signal diffracts around the exposed outer
ring.</p>
  </li>
  <li>
    <p><strong>Room multipath</strong> — signal reflects off walls, ceiling, floor, and nearby
objects. These indirect paths arrive at the TinySA from angles the foil does
not block. Only the direct path is attenuated.</p>
  </li>
  <li>
    <p><strong>Near-field geometry</strong> — at 30 cm = λ/2 the coupling is partly near-field
rather than a clean plane wave, making the simple skin-depth model a poor
approximation.</p>
  </li>
</ol>

<p>Despite the reduced per-layer efficiency, the experiment still shows a clear
and measurable 30 dB total attenuation over 24 layers. The foil works; the
indoor setup just can’t isolate the direct path cleanly. Outdoors at 3–5 m with
the Fresnel zone properly covered, each layer would approach the theoretical
value.</p>

<h2 id="summary">Summary</h2>

<p>What element14 sent me was, let’s be honest, a pack of kitchen foil. But not
<em>just</em> kitchen foil:</p>

<ul>
  <li><strong>Precisely cut</strong> to 299×273 mm, consistent to ±0.25 mm across 30 sheets</li>
  <li><strong>14.32 µm actual thickness</strong> — 10.5% thinner than the 16 µm nominal, but
remarkably uniform</li>
  <li><strong>O-temper aluminium</strong> — UTS 68.8 MPa, soft, annealed, consistent to 1.3%
across trials</li>
  <li><strong>Dissolves in dilute HCl</strong> with an entertaining exothermic finale if you are
not careful</li>
  <li><strong>30 dB total attenuation at 433 MHz</strong> — measured over 24 layers indoors;
theory predicts 31.6 dB for a single layer, but multipath and Fresnel
diffraction reduce the effective per-layer result to ~1.25 dB in a real room</li>
</ul>

<p>The tongue-in-cheek devkit framing holds up better than expected. The material
is genuinely well-characterised, the cutting is precise, and the
electromagnetic properties are real.</p>

<p>I note that you cannot seem to be able to get the same DevKit on the element14
website anymore, but the same dimentions and texture can be bought from:</p>
<ul>
  <li>
    <p><a href="https://www.elpack.co.uk/shop/aluminium-foil-sheets-pack-of-500/">https://www.elpack.co.uk/shop/aluminium-foil-sheets-pack-of-500/</a></p>

    <p><img src="/learning/assets/2026-06-23/al_foil_online_store.png" alt="" /></p>
  </li>
</ul>

<h2 id="future-work">Future Work</h2>

<ul>
  <li><strong>2.4 GHz</strong> (nRF24L01, Zigbee) — shorter wavelength, even thinner skin depth;
expect attenuation in fewer layers</li>
  <li><strong>mmWave radar</strong> — at <code class="language-plaintext highlighter-rouge">24/60/77 GHz</code> the skin depth drops to <code class="language-plaintext highlighter-rouge">~0.3–0.5 µm</code>;
the <code class="language-plaintext highlighter-rouge">14.32 µm</code> foil is 28–48 skin depths thick and acts as a near-perfect
reflector rather than an absorber; interesting to verify with the mmWave
sensor whether a single sheet registers as a hard target, and whether
crumpling the foil changes the radar cross-section — a flat sheet is a
specular reflector (strong return only at normal incidence) while a crumpled
sheet scatters in all directions.</li>
  <li><strong>DIY parallel-plate capacitor</strong> — two full sheets + baking paper dielectric →
measure capacitance → compute <code class="language-plaintext highlighter-rouge">ε₀</code> → derive the speed of light from
    <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>c = 1/√(ε₀μ₀)
</code></pre></div>    </div>
    <p>The April Fools devkit that became a Maxwell electromagnetism experiment.</p>
  </li>
</ul>

<hr />

<p><em>All data, calculations and plots in the accompanying
<a href="https://github.com/saramic/learning/tree/master/competitions/20260401_e14_road-test_al_foil">Jupyter notebook</a>.</em></p>]]></content><author><name></name></author><category term="element14," /><category term="road-test" /><summary type="html"><![CDATA[The Package Arrives]]></summary></entry><entry><title type="html">Local AI agent rig</title><link href="saramic.github.io/learning/ai/hardware/2026/04/08/local-ai-agent-rig.html" rel="alternate" type="text/html" title="Local AI agent rig" /><published>2026-04-08T21:00:00+10:00</published><updated>2026-04-08T21:00:00+10:00</updated><id>saramic.github.io/learning/ai/hardware/2026/04/08/local-ai-agent-rig</id><content type="html" xml:base="saramic.github.io/learning/ai/hardware/2026/04/08/local-ai-agent-rig.html"><![CDATA[<p>Something intrigued me about running an Eleven labs clone via
<a href="https://github.com/QwenLM/Qwen3-TTS">Quen3-TTS</a> on a local raspberry pi 5 and
an GTX card as mentioned by Adam Curry on <a href="https://noagenda.clipgenie.com/episode/0951c853933eaa74cccbe40087a8290a?q=nvidia&amp;t=1%3A19%3A01">No Agenda Episode 1856
1:19:00</a>.
Most recently watching Silicon Valley and building an Alexa skill, I thought it
would be cool to add a Jin Yang voice to say desparaging morning inspiration to
my 15 year old son.</p>

<p>Having a Manning subscription, I though I would look for books about the topic
but didn’t find much. There is some books aobut <a href="https://www.manning.com/books/domain-specific-small-language-models">Domain Specific small language
models</a>
and <a href="https://www.manning.com/books/cuda-for-deep-learning">CUDA for Deep
learning</a>, but not really
much about building a rig.</p>

<p>After being completely confused on Reddit and EBay of what is what, I turned to
YouTube. The most informative was this video with a metaphor for a chef (the
GPU) and counter top (the VRAM) and how it is actually really all about the
VRAM. He did also mention a Ras Pi but recommended it for small AI on the edge.</p>

<p><strong>Want to Run AI Agents Locally? Here is The Bare Minimum Setup/Build - Daniel
Jindoo</strong></p>

<p><a href="https://youtu.be/P-Fmo_CCIbY"><img src="http://img.youtube.com/vi/P-Fmo_CCIbY/0.jpg" alt="
  Want to Run AI Agents Locally? Here is The Bare Minimum Setup/Build - Daniel
  Jindoo
" /></a></p>

<p>The final recommendation here was probably to go with a <strong>RTX 4060 Ti with 16GB
of VRAM</strong> but once you add the ram, CPU and 2TB of disk it all starts adding
up. And a Mac M4 can do a little bit of it, so maybe I at least start there.</p>

<p>Next up was</p>

<p><strong>DONT Buy these GPU’s for Local AI! (learn from my mistake) - Ai Flux</strong></p>

<p><a href="https://youtu.be/ozqorev2_34"><img src="http://img.youtube.com/vi/ozqorev2_34/0.jpg" alt="
  DONT Buy these GPU's for Local AI! (learn from my mistake) - Ai Flux
" /></a></p>

<p>This was again informative as it overviewed a lot of the rubbish out there but also pointed me to a few resources:</p>

<ul>
  <li>See what people are building at
<a href="https://www.llamabuilds.ai/browse">LlamaBuilds</a></li>
  <li>
    <p>for my conference talk idea <a href="https://wisprflow.ai/">wisperflow</a></p>

    <blockquote>
      <p><strong>Don’t type, just speak</strong></p>

      <p>The voice-to-text AI that turns speech into clear, polished writing in
every app.</p>
    </blockquote>
  </li>
  <li><strong>DO THIS</strong> and at ~ &lt; $2/hour probably the most logical place to start, rent in the
cloud with <a href="https://cloud.vast.ai/">https://cloud.vast.ai/</a></li>
  <li>there was also mention of a build on reddit of a multi card setup
<a href="https://www.reddit.com/r/LocalLLaMA/comments/1eqklu0/update_overclocked_3060_12gb_x_4_running/">Reddit/LocalLLaMA</a></li>
</ul>

<p>I do still have a dream of building a Ras Pi 5 powered AI even if it’s not the right thing</p>

<p><strong>GPU-Powered Private AI on Raspberry Pi 5 – Vulkan Acceleration with RX
6700XT! - Jeffs Pi in the Sky</strong></p>

<p><a href="https://youtu.be/A6T8650QT8A"><img src="http://img.youtube.com/vi/A6T8650QT8A/0.jpg" alt="
  GPU-Powered Private AI on Raspberry Pi 5 – Vulkan Acceleration with RX
  6700XT! - Jeffs Pi in the Sky
" /></a></p>

<ul>
  <li><a href="https://www.reddit.com/r/LocalLLaMA/comments/1jr0oy2/howto_building_a_gpu_server_with_8xrtx_4090s_for/">https://www.reddit.com/r/LocalLLaMA/comments/1jr0oy2/howto_building_a_gpu_server_with_8xrtx_4090s_for/</a></li>
  <li><a href="https://a16z.com/building-an-efficient-gpu-server-with-nvidia-geforce-rtx-4090s-5090s/">https://a16z.com/building-an-efficient-gpu-server-with-nvidia-geforce-rtx-4090s-5090s/</a></li>
</ul>

<p>There are more Qwen3 articles and videos to review</p>
<ul>
  <li>
    <p>https://medium.com/data-science-collective/high-quality-long-form-tts-with-qwen3-open-weight-models-cdd6e3d00df0</p>
  </li>
  <li>
    <p><strong>How to Clone Voice LOCALLY with Qwen3-TTS with ONE-CLICK Install - AsapGuide</strong></p>

    <p><a href="https://youtu.be/HvjKkFjDR9c"><img src="http://img.youtube.com/vi/HvjKkFjDR9c/0.jpg" alt="
  How to Clone Voice LOCALLY with Qwen3-TTS with ONE-CLICK Install - AsapGuide
" /></a></p>
  </li>
  <li>
    <p><strong>Qwen3-TTS Tutorial: Open-Source Voice Design &amp; Cloning - Thorsten-Voice</strong></p>

    <p><a href="https://youtu.be/MOIyC9w1Wi0"><img src="http://img.youtube.com/vi/MOIyC9w1Wi0/0.jpg" alt="
  Qwen3-TTS Tutorial: Open-Source Voice Design &amp; Cloning - Thorsten-Voice
" /></a></p>
  </li>
  <li>
    <p><strong>Qwen 3 TTS - How to Finetune and Install Locally - Jarods Journey</strong></p>

    <p><a href="https://youtu.be/PMzO7N8sIHY"><img src="http://img.youtube.com/vi/PMzO7N8sIHY/0.jpg" alt="
  Qwen 3 TTS - How to Finetune and Install Locally - Jarods Journey
" /></a></p>
  </li>
  <li>
    <p>https://tinycomputers.io/posts/the-real-cost-of-running-qwen-tts-locally-three-machines-compared.html</p>
  </li>
  <li>
    <p><strong>Running Deepseek-R1 671B without a GPU - ServeTheHome</strong></p>

    <p><a href="https://youtu.be/av1eTzsu0wA"><img src="http://img.youtube.com/vi/av1eTzsu0wA/0.jpg" alt="
  Running Deepseek-R1 671B without a GPU - ServeTheHome
" /></a></p>
  </li>
  <li>amazon instances
    <ul>
      <li><a href="https://aws.amazon.com/ec2/instance-types/g4/">https://aws.amazon.com/ec2/instance-types/g4/</a></li>
    </ul>
  </li>
  <li><a href="https://io.net/blog/gpu-cluster">https://io.net/blog/gpu-cluster</a></li>
  <li><a href="https://greennode.ai/blog/what-is-a-gpu-cluster">https://greennode.ai/blog/what-is-a-gpu-cluster</a></li>
</ul>

<p>and in the end I need a no <strong>beeps</strong> 🔊 version of some training data</p>

<p><strong>Jian-Yang’s Best Moments Silicon Valley Max - HBO Max</strong></p>

<p><a href="https://youtu.be/IvJhA8jjcSM"><img src="http://img.youtube.com/vi/IvJhA8jjcSM/0.jpg" alt="
  Jian-Yang's Best Moments | Silicon Valley | Max - HBO Max
" /></a></p>]]></content><author><name></name></author><category term="ai" /><category term="hardware" /><summary type="html"><![CDATA[Something intrigued me about running an Eleven labs clone via Quen3-TTS on a local raspberry pi 5 and an GTX card as mentioned by Adam Curry on No Agenda Episode 1856 1:19:00. Most recently watching Silicon Valley and building an Alexa skill, I thought it would be cool to add a Jin Yang voice to say desparaging morning inspiration to my 15 year old son.]]></summary></entry><entry><title type="html">Merlin C2</title><link href="saramic.github.io/learning/merlin,/hacking,/black/hat,/c2/2026/03/10/merlin-c2.html" rel="alternate" type="text/html" title="Merlin C2" /><published>2026-03-10T00:00:00+11:00</published><updated>2026-03-10T00:00:00+11:00</updated><id>saramic.github.io/learning/merlin,/hacking,/black/hat,/c2/2026/03/10/merlin-c2</id><content type="html" xml:base="saramic.github.io/learning/merlin,/hacking,/black/hat,/c2/2026/03/10/merlin-c2.html"><![CDATA[<h2 id="merlink-c2">Merlink C2</h2>

<p>Reading the book <a href="https://nostarch.com/how-hack-ghost">How to Hack like a Ghost, by Sparc Flow - No Starch
Press</a></p>

<p>I came across some Go based C2 (Command &amp; Control) frameworks. Not knowing
what to realy expect I tried to give it a go. Quickly I worked out that the
book is a little out of date in how this framework now runs and the docs
online are much to be desired. I am sure for those who know how to use C2
frameworks it makes sense. In the end it was a bit of <code class="language-plaintext highlighter-rouge">-v</code> (verbose) flag and
some trial and error before I worked it out.</p>

<p>First problem was the book suggested the repo</p>

<ul>
  <li><a href="https://github.com/ne0nd0g/merlin">https://github.com/ne0nd0g/merlin</a></li>
</ul>

<p>which is the server. Even with the docs</p>

<ul>
  <li><a href="https://merlin-c2.readthedocs.io/en/latest/">https://merlin-c2.readthedocs.io/</a></li>
</ul>

<p>it was not obvious, till I came across this article</p>

<ul>
  <li><a href="https://malware.news/t/merlin-s-evolution-multi-operator-cli-and-peer-to-peer-magic/75702">malware.news merlin’s
evolution</a></li>
</ul>

<p>that I actually needed the:</p>

<ul>
  <li>server <a href="https://github.com/ne0nd0g/merlin">https://github.com/ne0nd0g/merlin
</a></li>
  <li>CLI to control <a href="https://github.com/ne0nd0g/merlin-cli">https://github.com/ne0nd0g/merlin-cli
</a></li>
  <li>agent <a href="https://github.com/ne0nd0g/merlin-agent">https://github.com/ne0nd0g/merlin-agent
</a></li>
</ul>

<p>Once that was established the steps are</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/Ne0nd0g/merlin
<span class="nb">cd </span>merlin
go run main.go
<span class="c"># there are ways to make this and a distro</span>
<span class="c"># make distro</span>
<span class="c"># data/temp/v2.1.4/38...88/merlinServer-Darwin-x64</span>

<span class="c"># this runs just fine with defaults</span>
<span class="o">{</span><span class="s2">"time"</span>:<span class="s2">"2026-03-09T23:09:27.653538+11:00"</span>,<span class="s2">"level"</span>:<span class="s2">"INFO"</span>,
  <span class="s2">"msg"</span>:<span class="s2">"Created new TLS certificate"</span>,
  <span class="s2">"Serial"</span>:25418984412059526003737019249885179218,
  <span class="s2">"Subject"</span>:[<span class="s2">"Merlin"</span><span class="o">]</span>,<span class="s2">"NotBefore"</span>:<span class="s2">"2026-03-09T23:09:27.645966+11:00"</span>,
  <span class="s2">"NotAfter"</span>:<span class="s2">"2027-03-15T23:09:27.645966+11:00"</span><span class="o">}</span>
<span class="o">{</span><span class="s2">"time"</span>:<span class="s2">"2026-03-09T23:09:27.65474+11:00"</span>,<span class="s2">"level"</span>:<span class="s2">"INFO"</span>,
  <span class="s2">"msg"</span>:<span class="s2">"Starting gRPC server on 127.0.0.1:50051"</span><span class="o">}</span>
</code></pre></div></div>

<p>this will show agents and controllers register etc</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/Ne0nd0g/merlin-cli
<span class="nb">cd </span>merlin-cli
go run main.go
</code></pre></div></div>

<p>this was a little harder to run as there seems to be a bunch of text commands
but no readline so VIM keybindings don’t work</p>

<p>I needed to</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">listeners</code> to go into the menu</li>
  <li><code class="language-plaintext highlighter-rouge">use HTTP</code> to use the HTTP protocol</li>
  <li><code class="language-plaintext highlighter-rouge">set Port 8080</code> as the default port 80 would not be allowed? maybe I need to
run the server in <code class="language-plaintext highlighter-rouge">sudo</code> to make this happen?</li>
  <li><code class="language-plaintext highlighter-rouge">start</code> to start it</li>
  <li><code class="language-plaintext highlighter-rouge">back</code> to go out of the listener</li>
  <li><code class="language-plaintext highlighter-rouge">list</code> to list out the listeners</li>
</ul>

<p>finally I could start an agent</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/Ne0nd0g/merlin-agent
<span class="nb">cd </span>merlin-agent
go run main.go
</code></pre></div></div>

<p>this was the hard part till I run it with <code class="language-plaintext highlighter-rouge">-v</code> which showed me some defaults
that were not obvious like it ran in HTTP2 protocol by default. Also the sleep
by default is 30 seconds which means to execute a command takes a minute by
the time it gets it and executes it.</p>

<p>the final command that worked well was</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>go run main.go <span class="se">\</span>
  <span class="nt">-v</span> <span class="se">\</span>
  <span class="nt">-url</span> http://127.0.0.1:8080 <span class="se">\</span>
  <span class="nt">-proto</span> http 
  <span class="nt">-sleep</span> 0s
</code></pre></div></div>

<p>Then I could finally <code class="language-plaintext highlighter-rouge">queue</code> a command</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># from the merlin-cli</span>
queue &lt;AGENT_UUID&gt; <span class="nb">pwd</span>
</code></pre></div></div>

<p>or interact with an agent</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>interact &lt;AGENT_UUID&gt;
<span class="nb">pwd</span>
</code></pre></div></div>

<p>even <code class="language-plaintext highlighter-rouge">ssh</code> a command like <code class="language-plaintext highlighter-rouge">ls</code></p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>interact &lt;AGENT_UUID&gt;
ssh &lt;ssh-username&gt; &lt;ssh-hostname&gt;:&lt;port&gt; &lt;<span class="nb">command</span><span class="o">&gt;</span>
</code></pre></div></div>

<p>it is an intruiging process and would be interesting how people wrap this up
in a process to run on boot, from cron, or as a service? Also there are some
specific Windows commands in the list of agent interact commands.</p>]]></content><author><name></name></author><category term="merlin," /><category term="hacking," /><category term="black" /><category term="hat," /><category term="c2" /><summary type="html"><![CDATA[Merlink C2]]></summary></entry><entry><title type="html">Radio Signal Inteligence</title><link href="saramic.github.io/learning/radio,/war,/sig/int/2026/03/09/radio-sig-int.html" rel="alternate" type="text/html" title="Radio Signal Inteligence" /><published>2026-03-09T21:00:00+11:00</published><updated>2026-03-09T21:00:00+11:00</updated><id>saramic.github.io/learning/radio,/war,/sig/int/2026/03/09/radio-sig-int</id><content type="html" xml:base="saramic.github.io/learning/radio,/war,/sig/int/2026/03/09/radio-sig-int.html"><![CDATA[<p>Telegram @sigintreports, has this pinned at the top</p>

<blockquote>
  <p>📡 What you see posted here is the final result of work that happens behind
the scenes. Every signal gets monitored, analyzed, and cross-referenced
against other data points. Patterns get verified multiple times before I
share anything. I go through each piece carefully to make sure the
information actually holds up and isn’t just noise or coincidence. This
process takes time, but it’s what keeps the analysis reliable and worth your
attention.</p>

  <p>This channel runs independently. There’s no institutional backing, no
sponsors, and no outside funding. I do this on my own because signal
monitoring and analysis is something I’m deeply invested in, and I want to
share it with people who find it useful. If the content here has been
valuable to you, Telegram Stars help sustain the time, equipment, and
resources that go into maintaining this level of coverage. It’s completely
voluntary. Either way, I’m grateful for everyone who follows along and
engages with the work 📡</p>
</blockquote>

<blockquote>
  <p>It is important to note that some posts are intentionally high-level and
minimal. Specific frequencies, bands, and other technical SIGINT details are
omitted to protect collection methodologies, maintain legal compliance, and
avoid disclosing sensitive monitoring capabilities.</p>

  <p>All content posted here is derived from open-source radio monitoring. No
classified information is shared. No individuals are targeted or identified.
Any attempt to misuse, misrepresent, or contact me regarding sensitive topics
will be ignored and logged.</p>

  <p>Signal Reports is an open-source SIGINT aggregation channel focused
exclusively on publicly receivable radio transmissions. All posts are
high-level, non-attributable, and contain no classified or personally
identifiable information. This channel does not engage with, respond to, or
facilitate requests related to operational intelligence. Persistent or
suspicious contact will be documented and reported as appropriate.</p>

  <p><strong>ATTRIBUTION &amp; USAGE:</strong>
If you utilize any information, reports, or media from this channel or
website for your own research, social media channels, or publications, I
kindly request that you provide proper credit for my work. Monitoring and
analyzing these signals involves significant time, technical resources, and
dedicated collection efforts. Attributing your sources to “Signal Reports”
ensures that the effort behind this work is recognized and supports the
continued sharing of this data.</p>
</blockquote>

<p>but what exactly are the “open-source radio monitoring” data sources and
techniques.</p>

<p>Asking AI gives me the following</p>

<p>Short answer: yes, partly like <code class="language-plaintext highlighter-rouge">ADS-B</code> ship/plane tracking with crowdsourced
receivers—but a lot of what those channels post is a mix of public sensors,
hobbyists with <code class="language-plaintext highlighter-rouge">SDRs</code>, and interpretation of other clues. It’s rarely a single
source.</p>

<p>Here’s how Telegram channels like SIGINT Reports usually get those updates.</p>

<ol>
  <li><strong>Crowdsourced radio monitoring</strong> (very similar to ADS-B networks)</li>
</ol>

<p>Many hobbyists run software-defined radios (<code class="language-plaintext highlighter-rouge">SDR</code>) that can monitor wide ranges
of radio frequencies. These are cheap USB receivers like <code class="language-plaintext highlighter-rouge">RTL-SDR</code>, <code class="language-plaintext highlighter-rouge">HackRF</code>,
<code class="language-plaintext highlighter-rouge">BladeRF</code>, etc.</p>

<p>People use them to listen to:</p>

<ul>
  <li>VHF/UHF military radio</li>
  <li>aviation comms</li>
  <li>drone telemetry</li>
  <li>radar emissions</li>
  <li>satellite downlinks</li>
</ul>

<p>Some enthusiasts run automated monitoring stations and feed data to communities
(Discords, Telegram groups, forums).</p>

<p>Typical setup:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Antenna
   ↓
RTL-SDR / HackRF
   ↓
Computer decoding software
   ↓
Shared data or alerts
</code></pre></div></div>

<p>Examples of crowdsourced RF monitoring ecosystems:</p>
<ul>
  <li>SatNOGS (satellite downlinks)</li>
  <li>ADS-B / Mode-S networks</li>
  <li>AIS ship tracking</li>
  <li>ACARS aircraft messages</li>
  <li>hobby SIGINT communities</li>
</ul>

<ol>
  <li><strong>Unencrypted military radio traffic</strong></li>
</ol>

<p>A surprising amount of battlefield communication is still analog voice radio.</p>

<p>Especially:</p>
<ul>
  <li>VHF tactical radios</li>
  <li>field units using older systems</li>
  <li>emergency comms</li>
  <li>logistics channels</li>
</ul>

<p>If the encryption is weak/legacy, this is COMINT (communications intelligence)
— intercepting voice communications not intended for you.</p>

<p>Example posts you see:</p>

<blockquote>
  <p>“intercepted Russian voice comms”</p>

  <p>“unit requesting artillery”</p>

  <p>“radio chatter about drone”</p>
</blockquote>

<p>Often these are simply radio hobbyists near the war zone.</p>

<ol>
  <li><strong>Electronic emissions monitoring</strong> (radars, jammers, etc.)</li>
</ol>

<p>Radars, jammers, and many military systems emit very distinctive radio
signatures.</p>

<p>That’s ELINT (electronic intelligence) — analyzing non-communication signals
like radar emissions.</p>

<p>Each system has a unique:</p>
<ul>
  <li>frequency</li>
  <li>pulse repetition rate</li>
  <li>modulation pattern</li>
  <li>scan timing</li>
</ul>

<p>For example:</p>

<blockquote>
  <p>System	        Signature
S-300 radar	    specific pulse pattern
Patriot radar	    different frequency + sweep
jammer	        broadband noise burst</p>
</blockquote>

<p>SIGINT watchers can detect:</p>

<ul>
  <li>radar turning on/off</li>
  <li>jamming activity</li>
  <li>air defense activation</li>
  <li>Even without decoding anything.</li>
</ul>

<ol>
  <li><strong>Satellite and space-based intercepts</strong></li>
</ol>

<p>Some signals are picked up by:</p>
<ul>
  <li>satellite downlinks</li>
  <li>satellite ground stations</li>
  <li>commercial RF monitoring networks</li>
</ul>

<p>Professional intelligence agencies obviously do this too, but OSINT analysts
sometimes see indirect evidence like:</p>
<ul>
  <li>satellite telemetry leaks</li>
  <li>satellite imagery of jamming activity</li>
  <li>unusual radio bursts.</li>
</ul>

<ol>
  <li><strong>Direction finding networks</strong></li>
</ol>

<p>With multiple receivers you can triangulate the source of a transmitter.</p>

<p>Technique:</p>
<ul>
  <li>several SDR stations detect same signal</li>
  <li>measure direction/arrival time</li>
  <li>compute location.</li>
</ul>

<p>This is called radio direction finding (RDF).</p>

<p>Some amateur networks already do this.</p>

<ol>
  <li><strong>Other OSINT signals combined with RF</strong></li>
</ol>

<p>Channels like SIGINT Reports don’t rely on RF alone. They combine:</p>
<ul>
  <li>satellite imagery</li>
  <li>ADS-B aircraft</li>
  <li>AIS ships</li>
  <li>social media videos</li>
  <li>NOTAM alerts</li>
  <li>acoustic sensors</li>
  <li>battlefield reports</li>
</ul>

<p>Example:</p>

<blockquote>
  <p>radar disappears</p>
  <ul>
    <li>drone video appears</li>
    <li>pilots report no radar lock
→ likely radar destroyed</li>
  </ul>
</blockquote>

<ol>
  <li><strong>Jamming detection</strong></li>
</ol>

<p>Even if a jammer is active, you can still detect:</p>
<ul>
  <li>sudden broadband RF noise</li>
  <li>loss of radar emissions</li>
  <li>GPS disruption</li>
  <li>spike in interference levels.</li>
</ul>

<p>Jamming works by transmitting powerful signals to overwhelm receivers, but the
jamming signal itself is visible to spectrum monitors.</p>

<p>So observers may say:</p>
<blockquote>
  <p>“heavy GPS jamming detected in region”</p>
</blockquote>

<p>because their receivers suddenly see the noise.</p>

<ol>
  <li>Important: many Telegram posts are inference</li>
</ol>

<p>Some reports come from real RF monitoring.</p>

<p>Others are analysis or speculation based on partial clues.</p>

<p>So when a channel says:</p>

<blockquote>
  <p>“radar offline”</p>

  <p>“jammer activated”</p>

  <p>“comms intercepted”</p>
</blockquote>

<p>it may be:</p>
<ul>
  <li>SDR intercept</li>
  <li>military leak</li>
  <li>drone observation</li>
  <li>analyst inference.</li>
</ul>

<p>✅ Bottom line</p>

<p>Yes — your intuition is correct.</p>

<p>Many of these updates come from crowdsourced SDR monitoring networks, similar
in concept to ADS-B flight tracking, but for radio spectrum signals.</p>

<p>But the channels usually combine RF intercepts + OSINT + analysis, not just one
SDR receiver.</p>

<p>If you’re interested, I can also show you something fascinating:</p>

<p>How hobbyists can identify specific military radars (S-300, Patriot, A-50) just
from RF fingerprints. It’s a really cool part of SIGINT.</p>

<h2 id="identifying-military-radars-from-rf-fingerprints">Identifying military radars from RF fingerprints</h2>

<p>Military radars basically have RF “fingerprints”, and analysts can often
identify the exact radar type just from the signal.</p>

<p>I’ll walk through how this works.</p>

<ol>
  <li>Every radar emits a unique signal pattern</li>
</ol>

<p>A radar is not just “a radio wave.” It transmits very specific pulses of energy
with consistent parameters:</p>

<p>Key parameters analysts measure:</p>

<ul>
  <li>Parameter                             What it means</li>
  <li>Frequency band                        e.g., L-band, S-band, X-band</li>
  <li>Pulse repetition frequency (PRF)      pulses per second</li>
  <li>Pulse width                           duration of each pulse</li>
  <li>Scan rate                             antenna rotation speed</li>
  <li>modulation pattern            	    how the pulses change</li>
</ul>

<p>For example:</p>

<p>PRF = how many pulses per second the radar sends.</p>

<p>Radars transmit short bursts then listen for echoes before the next pulse.</p>

<p>Those numbers create a distinctive signature.</p>

<ol>
  <li>Example of radar “fingerprints”</li>
</ol>

<p>A simplified example (illustrative):</p>

<ul>
  <li>Radar type                    Frequency	    PRF     	Scan</li>
  <li>Long-range early warning	    L-band	        ~400 Hz 	slow sweep</li>
  <li>Fire control radar            X-band	        high PRF	narrow beam</li>
  <li>Air defense radar             S-band      	medium PRF	rotating dish</li>
</ul>

<p>For instance:</p>

<p>AN/FPS-20 early warning radar</p>
<ul>
  <li>~1300 MHz</li>
  <li>~400 pulses/sec PRF</li>
</ul>

<p>Even if you never see the radar, intercepting that signal lets analysts
recognize it.</p>

<ol>
  <li>Electronic intelligence receivers measure dozens of properties</li>
</ol>

<p>Modern ELINT systems measure many characteristics of the signal:</p>
<ul>
  <li>frequency</li>
  <li>pulse repetition pattern</li>
  <li>pulse width</li>
  <li>power</li>
  <li>modulation</li>
  <li>timing jitter</li>
  <li>angle of arrival</li>
</ul>

<p>Then compare them to a database of known radar signatures.</p>

<p>This process is called Specific Emitter Identification (SEI).
Advanced systems can even identify the exact individual radar unit based on
tiny imperfections in the electronics.</p>

<p>It’s similar to:</p>
<ul>
  <li>voice recognition</li>
  <li>device fingerprinting</li>
  <li>Wi-Fi RF fingerprints.</li>
</ul>

<ol>
  <li>Why radars are easy to detect</li>
</ol>

<p>Radar transmitters are extremely powerful.</p>

<p>Typical radar transmit powers:</p>
<ul>
  <li>hundreds of kilowatts</li>
  <li>sometimes megawatts.</li>
</ul>

<p>Even if you are hundreds of kilometers away, a receiver can detect the emissions.</p>

<p>That’s why ELINT aircraft exist (like RC-135 Rivet Joint).</p>

<p>But hobbyists with SDRs can sometimes detect nearby systems too.</p>

<ol>
  <li>How analysts know when a radar goes offline</li>
</ol>

<p>If a radar normally emits:</p>

<p>frequency: 3.1 GHz
PRF: 850 Hz
scan: every 6 seconds</p>

<p>and suddenly the signal disappears:</p>

<p>→ radar turned off
→ radar destroyed
→ radar moved
→ radar switched modes.</p>

<p>SIGINT channels often track these changes.</p>

<ol>
  <li>Radar mode changes also reveal intent</li>
</ol>

<p>Radars change modes depending on what they’re doing.</p>

<p>Example:</p>

<p>Mode                	Signature
Search              	slow scan, low PRF
Track               	narrow beam, higher PRF
Missile guidance    	very high PRF</p>

<p>So if a radar suddenly changes parameters, analysts might infer:</p>

<p>air defense active</p>

<p>missile launch preparation</p>

<p>target tracking</p>

<ol>
  <li>What hobbyists can actually detect</li>
</ol>

<p>With decent SDR equipment you can sometimes detect:</p>
<ul>
  <li>weather radars</li>
  <li>airport radars</li>
  <li>maritime radars</li>
  <li>some military radars</li>
  <li>drone control links</li>
  <li>GPS jamming.</li>
</ul>

<p>People run automated software that logs signals and flags new emitters.</p>

<ol>
  <li>Real military ELINT is far more advanced</li>
</ol>

<p>Professional SIGINT platforms measure:</p>

<ul>
  <li>nanosecond timing</li>
  <li>angle of arrival</li>
  <li>multi-station triangulation</li>
  <li>wideband spectrum</li>
</ul>

<p>They build huge emitter databases.</p>

<p>Example platforms:</p>

<ul>
  <li>RC-135 Rivet Joint</li>
  <li>EP-3 Aries</li>
  <li>EA-18G Growler</li>
  <li>satellite SIGINT systems</li>
</ul>

<ol>
  <li>A simple visualization</li>
</ol>

<p>Think of radar signals like musical rhythms.</p>

<p>Radar A:</p>

<p>beep…beep…beep…beep</p>

<p>Radar B:</p>

<p>beep-beep-beep……beep-beep-beep</p>

<p>Radar C:</p>

<p>beeeeeep……beeeeeep</p>

<p>Even if you can’t see the radar, the pattern tells you what it is.</p>

<p>✅ Bottom line</p>

<p>Radar identification works because:</p>

<p>every radar has a distinct RF signature</p>

<p>analysts record frequency, pulse timing, and modulation</p>

<p>those parameters act like a fingerprint.</p>

<p>Even hobbyists with SDRs can sometimes recognize certain systems.</p>

<p>If you’re interested, I can also show you something fascinating:</p>

<p>How OSINT analysts tracked Russian air defense radars and jammers in Ukraine
using open-source RF monitoring and satellites. It’s a really interesting case
study.</p>

<p>So what hardware is required to detect local airport or weather radar? And what
software to make available in the web to my friends?</p>

<p>Yes — you can absolutely build a small home RF monitoring station that detects
things like:</p>
<ul>
  <li>airport radar</li>
  <li>weather radar</li>
  <li>aircraft transponders</li>
  <li>satellite signals</li>
  <li>other radio emissions</li>
</ul>

<p>…and then share the spectrum or decoded data online with friends. Many
hobbyists do exactly this. 📡</p>

<p>I’ll break it into hardware, software for detection/decoding, and ways to
publish it online.</p>

<h3 id="1️⃣--hardware-you-need">1️⃣  Hardware you need</h3>

<p>You don’t need expensive gear to start. A good beginner setup costs $80–$300.</p>

<p>Basic setup (works for many signals)</p>

<p>Receiver</p>
<ul>
  <li>RTL-SDR Blog V3 USB SDR</li>
  <li>about $40–$60</li>
  <li>covers 500 kHz – 1.7 GHz</li>
  <li>perfect for beginners</li>
</ul>

<p>Computer</p>
<ul>
  <li>Raspberry Pi 4 or mini PC</li>
  <li>Linux machine works best</li>
</ul>

<p>Antenna
Depends on what you want to monitor:</p>

<p>Target      	Frequency   	Antenna
aircraft ADS-B 	1090 MHz    	1090 MHz antenna
airport radar	1–3 GHz     	wideband discone
weather radar	2.7–3.0 GHz 	directional antenna
satellite   	1–2 GHz     	patch or LNA antenna</p>

<p>A very common starter antenna:
discone antenna (covers a huge range).</p>

<p>Slightly more advanced SDRs</p>

<p>If you want better performance:</p>

<p>HackRF One SDR</p>

<p>1 MHz–6 GHz coverage</p>

<p>transmit + receive</p>

<p>Airspy R2 Software Defined Radio</p>

<p>much cleaner signals</p>

<p>These are used by many RF hobbyists.</p>

<h3 id="2️⃣--signals-you-can-easily-detect">2️⃣  Signals you can easily detect</h3>

<p>From Melbourne you could detect things like:</p>

<p>Aircraft transponders</p>

<p>ADS-B aircraft location.</p>

<p>Example network:</p>

<p>FlightRadar24</p>

<p>ADSBExchange</p>

<p>Aircraft broadcast location at 1090 MHz.</p>

<p>Airport radar</p>

<p>Air traffic control radars usually operate in:</p>

<p>L-band (~1.2 GHz)</p>

<p>S-band (~2.7–2.9 GHz)</p>

<p>You can detect the pulse patterns easily with SDR.</p>

<p>Weather radar</p>

<p>Australia’s Bureau of Meteorology radars typically operate around 2.7–3 GHz.</p>

<p>Your SDR will show repeating pulses when the radar rotates.</p>

<p>Satellite transmissions</p>

<p>With SDR you can receive:</p>

<p>NOAA satellites</p>

<p>Meteor weather satellites</p>

<p>Iridium satellites</p>

<p>GPS interference</p>

<h3 id="3️⃣--software-to-monitor-radar-or-rf-signals">3️⃣  Software to monitor radar or RF signals</h3>

<p>These tools display spectrum and signals.</p>

<p>SDR visualization</p>

<p>Most common software:</p>

<p>SDR++</p>

<p>modern spectrum viewer</p>

<p>works on Windows/Linux/Mac</p>

<p>GQRX</p>

<p>popular Linux SDR receiver</p>

<p>CubicSDR</p>

<p>beginner friendly</p>

<p>They show a live spectrum waterfall like this:</p>

<p>Frequency →
████████████
█████ radar pulses
██ aircraft signals</p>

<h3 id="4️⃣--radar-detection-software">4️⃣  Radar detection software</h3>

<p>Some specialized tools exist.</p>

<p>Examples:</p>

<p>rtl_power</p>

<p>scans spectrum automatically</p>

<p>krakenSDR software</p>

<p>direction finding</p>

<p>inspectrum</p>

<p>analyze pulse timing</p>

<p>These let you measure:</p>

<p>pulse repetition frequency</p>

<p>radar scan timing</p>

<p>signal strength.</p>

<h3 id="5️⃣--software-to-share-your-receiver-online">5️⃣  Software to share your receiver online</h3>

<p>If you want your friends to see the spectrum live:</p>

<p>OpenWebRX (best option)</p>

<p>OpenWebRX turns your SDR into a web receiver.</p>

<p>Features:</p>

<p>anyone can listen in browser</p>

<p>waterfall spectrum</p>

<p>decoding modes</p>

<p>ADS-B display</p>

<p>Friends just visit:</p>

<p>http://your-ip-address:8073</p>

<p>OpenWebRX project:
https://github.com/jketterl/openwebrx</p>

<p>SpyServer (Airspy)</p>

<p>Another option.</p>

<p>You run a server and people connect using SDR software.</p>

<p>ADS-B maps</p>

<p>If you decode aircraft signals you can host your own map using:</p>

<p>tar1090</p>

<p>dump1090</p>

<p>This produces a live aircraft map in browser.</p>

<h3 id="6️⃣--example-simple-home-setup">6️⃣  Example simple home setup</h3>

<p>Many hobbyists run something like this:</p>

<p>Discone antenna on roof
        ↓
RTL-SDR
        ↓
Raspberry Pi
        ↓
OpenWebRX
        ↓
Friends view spectrum online</p>

<p>Cost roughly:</p>

<p>Item	Price
RTL-SDR	$50
antenna	$60
coax cable	$30
Raspberry Pi	$80</p>

<p>Total ≈ $200–250</p>

<h3 id="7️⃣--legal-considerations-important">7️⃣  Legal considerations (important)</h3>

<p>In most countries (including Australia):</p>

<p>Allowed:</p>

<p>receiving radio signals</p>

<p>SDR listening</p>

<p>But not allowed:</p>

<p>decoding encrypted communications</p>

<p>rebroadcasting private communications</p>

<p>interfering with signals.</p>

<p>Airport radar monitoring is generally fine as passive listening.</p>

<p>✅ If you want, I can also show you:</p>

<ul>
  <li>1️⃣  A $150 SDR station that can detect Melbourne airport radar specifically</li>
  <li>2️⃣  How people build global RF monitoring networks like ADS-B but for military
signals</li>
  <li>3️⃣  How to detect GPS jammers and radar activity automatically with scripts
(very cool hobby project).</li>
</ul>

<p>How would I find openwebrx websites on the web</p>

<p>There are a few good ways hobbyists find public OpenWebRX receivers online.
Most of them are listed in directories or maps.</p>

<h3 id="1️⃣--receiverbook-best-directory">1️⃣  ReceiverBook (best directory)</h3>

<p>The most popular place to find them is ReceiverBook.</p>

<p>It’s basically a global directory of online SDR receivers.</p>

<p>Examples include:</p>
<ul>
  <li>OpenWebRX</li>
  <li>KiwiSDR</li>
  <li>WebSDR</li>
</ul>

<p>You can browse by:</p>

<p>frequency band</p>

<p>country</p>

<p>receiver type</p>

<p>location</p>

<p>👉 https://www.receiverbook.de</p>

<p>The site lists hundreds of publicly accessible receivers and links directly to
their web interfaces.</p>

<h3 id="2️⃣--global-sdr-maps">2️⃣  Global SDR maps</h3>

<p>Another site shows a world map of SDR receivers where you can click and open
them.</p>

<p>Example map:</p>

<p>https://rx-tx.info/map-sdr-points</p>

<p>It lists thousands of receivers worldwide with their frequencies and URLs.</p>

<p>You can explore signals from different continents.</p>

<h3 id="3️⃣--google-search-trick">3️⃣  Google search trick</h3>

<p>Many OpenWebRX servers use the default port 8073, so you can sometimes find
them with search queries like:</p>

<p>“OpenWebRX” 8073</p>

<p>or</p>

<p>inurl:8073 “OpenWebRX”</p>

<p>or</p>

<p>“OpenWebRX+” receiver</p>

<p>Because the interface usually runs at:</p>

<p>http://IP-address:8073</p>
<h3 id="4️⃣--sdr-community-lists">4️⃣  SDR community lists</h3>

<p>Some ham-radio communities maintain lists of receivers.</p>

<p>Examples:</p>

<p>KiwiSDR public list</p>

<p>WebSDR list</p>

<p>OpenWebRX forums</p>

<p>These lists are often updated by people hosting receivers.</p>

<h3 id="5️⃣--examples-of-real-openwebrx-receivers">5️⃣  Examples of real OpenWebRX receivers</h3>

<p>A typical receiver URL looks like:</p>

<p>http://109.164.114.15:8073/</p>

<p>or</p>

<p>http://204.235.44.74:8073/</p>

<p>Opening it shows:</p>

<p>waterfall spectrum</p>

<p>tuning controls</p>

<p>decoding modes</p>

<p>sometimes maps or satellite data.</p>

<h3 id="6️⃣---what-you-can-listen-to-on-them">6️⃣   What you can listen to on them</h3>

<p>Depending on the antenna and SDR hardware, you might see:</p>

<p>shortwave radio</p>

<p>ham radio</p>

<p>aircraft communications</p>

<p>weather satellites</p>

<p>digital modes (FT8, WSPR)</p>

<p>sometimes ADS-B aircraft tracking</p>

<p>OpenWebRX supports many demodulation modes and SDR hardware devices.</p>

<p>✅ Tip:
If you want to explore radar or unusual RF signals, look for receivers that cover:</p>

<p>VHF / UHF / SHF</p>

<p>because most radar systems operate above 1 GHz.</p>

<p>👍 If you want, I can also show you something fun:</p>

<p>How people accidentally discover secret military signals or GPS jammers using
public SDR receivers.
There are some wild examples.</p>]]></content><author><name></name></author><category term="Radio," /><category term="war," /><category term="sig" /><category term="int" /><summary type="html"><![CDATA[Telegram @sigintreports, has this pinned at the top]]></summary></entry><entry><title type="html">SNMP and sending localhost mails</title><link href="saramic.github.io/learning/snmp,/hakcing,/mail/2026/03/01/snmp-and-local-mail.html" rel="alternate" type="text/html" title="SNMP and sending localhost mails" /><published>2026-03-01T19:00:00+11:00</published><updated>2026-03-01T19:00:00+11:00</updated><id>saramic.github.io/learning/snmp,/hakcing,/mail/2026/03/01/snmp-and-local-mail</id><content type="html" xml:base="saramic.github.io/learning/snmp,/hakcing,/mail/2026/03/01/snmp-and-local-mail.html"><![CDATA[<h1 id="snmp-and-sending-localhost-mails">SNMP and sending localhost mails</h1>

<p>To just run a local catch all server:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker run <span class="nt">--rm</span> <span class="nt">-p</span> 1025:1025 <span class="nt">-p</span> 8025:8025 mailhog/mailhog
</code></pre></div></div>

<p>to send an email</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>brew <span class="nb">install </span>swaks

<span class="c"># with default test subject and body</span>
swaks <span class="nt">--server</span> localhost <span class="nt">--port</span> 1025 <span class="se">\</span>
  <span class="nt">--to</span> saramic@gmail.com
</code></pre></div></div>

<p>these can be viewd in the mailhog browser view</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>open http://0.0.0.0:8025
</code></pre></div></div>

<p>To send real email, you would need something like a postfix relay? in the
example below you could optionally limit to a set of sender domains with</p>

<p>`  -e ALLOWED_SENDER_DOMAINS=”<YOUR_DOMAIN.COM>" \`</YOUR_DOMAIN.COM></p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker run <span class="nt">-d</span> <span class="se">\</span>
  <span class="nt">--name</span> postfix-relay <span class="se">\</span>
  <span class="nt">-p</span> 2525:25 <span class="se">\</span>
  <span class="nt">-e</span> <span class="nv">POSTFIX_myhostname</span><span class="o">=</span><span class="s2">"mail.milander.net"</span> <span class="se">\</span>
  <span class="nt">-e</span> <span class="nv">POSTFIX_smtp_helo_name</span><span class="o">=</span><span class="s2">"mail.milander.net"</span> <span class="se">\</span>
  <span class="nt">-e</span> <span class="nv">POSTFIX_mynetworks</span><span class="o">=</span><span class="s2">"127.0.0.0/8,172.16.0.0/12,192.168.0.0/16,10.0.0.0/8"</span> <span class="se">\</span>
  <span class="nt">-e</span> <span class="nv">POSTFIX_smtpd_relay_restrictions</span><span class="o">=</span><span class="s2">"permit_mynetworks,reject_unauth_destination"</span> <span class="se">\</span>
  <span class="nt">-e</span> <span class="nv">ALLOW_EMPTY_SENDER_DOMAINS</span><span class="o">=</span>1 <span class="se">\</span>
  boky/postfix

<span class="c"># at the end to remove the docker container</span>
docker <span class="nb">rm</span> <span class="nt">-f</span> postfix-relay
</code></pre></div></div>

<p>now to send an email you can use the same <code class="language-plaintext highlighter-rouge">swaks</code> command or add a custom
<code class="language-plaintext highlighter-rouge">header</code> and <code class="language-plaintext highlighter-rouge">body</code> as below and even add some <code class="language-plaintext highlighter-rouge">From: </code> headers to change who
the email looks like it is coming from.</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>swaks <span class="se">\</span>
  <span class="nt">--to</span> &lt;SOME_REAL@EMAIL.COM&gt; <span class="se">\</span>
  <span class="nt">--from</span> &lt;THE_REAL@FROM_EMAIL&gt; <span class="se">\</span>
  <span class="nt">--header</span> <span class="s1">'From: "YOUR FAKE NAME" &lt; &lt;YOUR_FAKE@EMAIL.COM&gt; &gt;'</span> <span class="se">\</span>
  <span class="nt">--header</span> <span class="s1">'Subject: THE SUBJCET'</span> <span class="se">\</span>
  <span class="nt">--body</span> <span class="s1">'THE BODY'</span> <span class="se">\</span>
  <span class="nt">--server</span> localhost <span class="nt">--port</span> 2525
</code></pre></div></div>

<p>looking at the server you can look at the logs</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker logs <span class="nt">-f</span> postfix-relay
</code></pre></div></div>

<p>where a successfull send would look like this, in this case using a fake
<code class="language-plaintext highlighter-rouge">FROM_FAKE_EMAIL@ADDRESS.COM</code> and sending it to a <code class="language-plaintext highlighter-rouge">REAL_EMAIL@ADDRESS.COM</code> on
<code class="language-plaintext highlighter-rouge">mx1.dreamhost.com</code></p>

<pre><code class="language-log">2026-03-01T08:24:13.814711+00:00 INFO
    postfix/qmgr[994]: C61FB452021: from=&lt; &lt;FROM_FAKE_EMAIL@ADDRESS.COM&gt; &gt;,
    size=544, nrcpt=1 (queue active)
2026-03-01T08:24:13.815065+00:00 INFO
    postfix/smtpd[1398]: disconnect from unknown[172.17.0.1] ehlo=1 mail=1
    rcpt=1 data=1 quit=1 commands=5
2026-03-01T08:24:18.279605+00:00 INFO
    postfix/smtp[1402]: C61FB452021: to=&lt; &lt;REAL_EMAIL@ADDRESS.COM&gt; &gt;,
    relay=mx1.dreamhost.com[64.90.62.163]:25, delay=4.5,
    delays=0.03/0/3.8/0.65, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as
    4fNw8K693Wz7PJ9)
2026-03-01T08:24:18.280615+00:00 INFO
    postfix/qmgr[994]: C61FB452021: removed
</code></pre>

<p>and if the upstream mail server rejcets you, in this case as your residentiall
IP address is on the <code class="language-plaintext highlighter-rouge">spamhaus.org</code> list of blocked IP addresses, it may look
like this</p>

<pre><code class="language-log">2026-03-01T08:23:45.993782+00:00 INFO
    postfix/qmgr[994]: F0DAD452021: from=&lt; &lt;FROM_EMAIL@ADDRESS.COM&gt; &gt;, size=586,
    nrcpt=1 (queue active)
2026-03-01T08:23:46.797353+00:00
    INFO postfix/smtp[1402]: F0DAD452021: to=&lt; &lt;TO_EMAIL@ADDRESS.COM&gt; &gt;, relay=
    &lt;UPSTREAM_RELAY AND IP &gt;, delay=0.91, delays=0.11/0.02/0.73/0.06,
    dsn=5.7.1, status=bounced (host &lt;UPSTREAM_RELAY AND IP &gt; said: 550 5.7.1
    Service unavailable, Client host [ &lt;SENDING_IP_ADDRESS&gt; ] blocked using
    Spamhaus. To request removal from this list see
    https://www.spamhaus.org/query/ip/&lt;SENDING_IP_ADDRESS&gt; AS(1450)
    [ML1PEPF0001130A.ausprd01.prod.outlook.com 2026-03-01T08:23:46.760Z
    08DE7566F2DB722E] (in reply to RCPT TO command))
2026-03-01T08:23:46.823713+00:00 INFO
    postfix/bounce[1403]: F0DAD452021: sender non-delivery notification:
    C8D02452025
2026-03-01T08:23:46.823900+00:00 INFO
    postfix/qmgr[994]: F0DAD452021: removed
</code></pre>

<p>To manually connect and send an email you can</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>telnet localhost 2525
</code></pre></div></div>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>EHLO <span class="nb">test
</span>MAIL FROM:&lt;VALID_FROM@ADDRESS.COM&gt;
RCPT TO:&lt;VALID_TO@ADDRESS.COM&gt;
DATA
Subject: <span class="nb">test

</span>Hello world
<span class="nb">.</span>
QUIT
</code></pre></div></div>

<p>Other protection mechanisms include</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">IP</code> reputation (historical behavior)</li>
  <li>Domain reputation</li>
  <li><code class="language-plaintext highlighter-rouge">SPF</code> alignment</li>
  <li><code class="language-plaintext highlighter-rouge">DKIM</code> signature validity</li>
  <li><code class="language-plaintext highlighter-rouge">DMARC</code> alignment</li>
  <li>Reverse <code class="language-plaintext highlighter-rouge">DNS</code></li>
  <li><code class="language-plaintext highlighter-rouge">HELO</code> consistency</li>
  <li><code class="language-plaintext highlighter-rouge">TLS</code> usage</li>
  <li>Sending volume patterns</li>
  <li>User engagement (opens, deletes, spam clicks)</li>
  <li>Content signals</li>
  <li><code class="language-plaintext highlighter-rouge">URL</code> reputation</li>
  <li>Behavioral patterns</li>
</ul>]]></content><author><name></name></author><category term="SNMP," /><category term="hakcing," /><category term="mail" /><summary type="html"><![CDATA[SNMP and sending localhost mails]]></summary></entry><entry><title type="html">MAX32630FTHR hackaton</title><link href="saramic.github.io/learning/electronics,/hackaton/2026/02/28/MAX32630FTHR-hackathon.html" rel="alternate" type="text/html" title="MAX32630FTHR hackaton" /><published>2026-02-28T18:00:00+11:00</published><updated>2026-02-28T18:00:00+11:00</updated><id>saramic.github.io/learning/electronics,/hackaton/2026/02/28/MAX32630FTHR-hackathon</id><content type="html" xml:base="saramic.github.io/learning/electronics,/hackaton/2026/02/28/MAX32630FTHR-hackathon.html"><![CDATA[<h1 id="element14-design-challeng">Element14 Design challeng</h1>

<p><a href="https://community.element14.com/challenges-projects/design-challenges/smart-security-and-surveillance/dc/dc/81/smart_security_and_s">https://community.element14.com/challenges-projects/design-challenges/smart-security-and-surveillance/dc/dc/81/smart_security_and_s</a></p>

<p>using the device <a href="https://os.mbed.com/platforms/MAX32630FTHR/">https://os.mbed.com/platforms/MAX32630FTHR/</a></p>

<p>after a bunch of prompting, this was AI suggested as a winning entry</p>

<blockquote>
  <p><strong>VolkWatch</strong> — AI-Powered Wildlife vs Human Intruder Perimeter Sentry</p>

  <p>Project Description</p>

  <p><strong>VolkWatch</strong> is an AI-enabled smart perimeter sentinel designed for remote
outdoor environments such as campsites, scout jamborees, conservation zones,
and rural properties. Its purpose is to distinguish between natural wildlife
activity and genuine human intrusions using on-device machine learning models
running at the edge on the Analog Devices MAX32630FTHR platform. Traditional
motion sensors often generate nuisance alarms from animals or environmental
noise, reducing trust in security alerts; VolkWatch solves this by combining
multi-sensor data (acoustic signatures, motion patterns, vibration features,
and radio spectrum analysis) to make real-time, confidence-based
classifications without relying on cloud connectivity.</p>

  <p>Leveraging TinyML techniques and TensorFlow Lite Micro, VolkWatch extracts
spectral and temporal features from ambient sound and motion in real time,
feeding them into a compact neural network that classifies events as Human,
Animal, or Noise/Environment. The system wakes from low-power sleep only when
significant events are detected, maximizing battery life for extended remote
deployment. Upon classification of a human intrusion, the node triggers local
alerts (LED, buzzer) and can optionally transmit secure notifications via
low-power wireless (e.g., LoRa or BLE), making it suitable even in
low-connectivity environments.</p>

  <p>This project will fully utilize features of the MAX32630FTHR kit — including
its low-power Cortex-M4F MCU, audio sampling, sensor inputs, and display
modules — to demonstrate an effective AI-at-the-edge security prototype. The
build log will cover requirements analysis, sensor integration, embedded
TinyML model training and optimization, hardware prototyping, firmware
design, and real-world testing under outdoor conditions.</p>
</blockquote>

<h2 id="getting-the-max32630fthr">Getting the MAX32630FTHR</h2>

<ul>
  <li><a href="https://octopart.com/part/analog-devices/MAX32630FTHR%23">https://octopart.com/part/analog-devices/MAX32630FTHR%23</a>
    <ul>
      <li><a href="https://www.digikey.com.au/en/products/detail/analog-devices-inc-maxim-integrated/MAX32630FTHR/6575544">Digikey</a>
        <ul>
          <li>$60.92</li>
        </ul>
      </li>
      <li><a href="https://au.element14.com/analog-devices/max32630fthr/pegasus-dev-brd-batt-optimized/dp/2723406">Element14</a>
        <ul>
          <li>$70.884 (inc GST)</li>
        </ul>
      </li>
      <li><a href="https://www.flywing-tech.com/product-detail/evaluation-boards-embedded-mcu-dsp-maxim-integrated-max32630fthr-8d216212">https://www.flywing-tech.com/product-detail/evaluation-boards-embedded-mcu-dsp-maxim-integrated-max32630fthr-8d216212</a>
        <ul>
          <li>USD $28.82</li>
        </ul>
      </li>
      <li><a href="https://www.bettlink.com/product/analogdevicesincmaximintegrated-max32630fthr-8834365">https://www.bettlink.com/product/analogdevicesincmaximintegrated-max32630fthr-8834365</a>
        <ul>
          <li>USD $31.16</li>
        </ul>
      </li>
      <li><a href="https://uk.farnell.com/analog-devices/max32630fthr/pegasus-dev-brd-batt-optimized/dp/2723406">https://uk.farnell.com/analog-devices/max32630fthr/pegasus-dev-brd-batt-optimized/dp/2723406</a>
        <ul>
          <li>£28.540 (ex VAT)</li>
        </ul>
      </li>
    </ul>
  </li>
  <li><a href="https://au.mouser.com/new/analog-devices/maxim-max32630fthr-pegasus-platform">AnalogDevices</a>
    <ul>
      <li>???</li>
    </ul>
  </li>
  <li><a href="https://www.ebay.com/itm/276807336322">EBay</a>
    <ul>
      <li>USD $29.99</li>
    </ul>
  </li>
</ul>

<h2 id="sensors">Sensors</h2>

<ul>
  <li>AMG8833 IR Infrared Sensor
    <ul>
      <li><a href="https://www.aliexpress.com/item/1005004932931593.html">https://www.aliexpress.com/item/1005004932931593.html</a></li>
      <li>$26</li>
    </ul>
  </li>
  <li>Adaruit AMG8833 IR <a href="https://core-electronics.com.au/adafruit-amg8833-ir-thermal-camera-breakout.html">core-electronics</a>
    <ul>
      <li>$84.10</li>
      <li><a href="https://core-electronics.com.au/sparkfun-grid-eye-infrared-array-breakout-amg8833-qwiic.html">https://core-electronics.com.au/sparkfun-grid-eye-infrared-array-breakout-amg8833-qwiic.html</a></li>
    </ul>
  </li>
</ul>]]></content><author><name></name></author><category term="electronics," /><category term="hackaton" /><summary type="html"><![CDATA[Element14 Design challeng]]></summary></entry><entry><title type="html">Combining Semantic and Full Text Search</title><link href="saramic.github.io/learning/ai,/search,/sematic/2026/02/28/combining-semantic-and-full-text-search.html" rel="alternate" type="text/html" title="Combining Semantic and Full Text Search" /><published>2026-02-28T18:00:00+11:00</published><updated>2026-02-28T18:00:00+11:00</updated><id>saramic.github.io/learning/ai,/search,/sematic/2026/02/28/combining-semantic-and-full-text-search</id><content type="html" xml:base="saramic.github.io/learning/ai,/search,/sematic/2026/02/28/combining-semantic-and-full-text-search.html"><![CDATA[<h1 id="combining-semantic-and-full-text-search">Combining Semantic and Full Text Search</h1>

<p>“how to merge text search with vector search results”</p>

<blockquote>
  <p>✨ AI Overview</p>

  <p>Merging text (keyword) and vector (semantic) search, known as hybrid search,
combines precise term matching with conceptual understanding for better
accuracy. This is achieved by executing both searches in parallel,
normalizing their results, and merging them using techniques like Reciprocal
Rank Fusion (RRF) weighted scoring, or reranking models to produce a
unified, ranked list.</p>

  <h3 id="key-methods-for-merging-results">Key Methods for Merging Results</h3>

  <ul>
    <li><strong>Reciprocal Rank Fusion (RRF)</strong>: This is a popular, effective method that
combines results based on their rankings in both lists without requiring
normalized scores. It calculates a score for each document based on
      <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>       1
 Σ  --------
    k + rank
</code></pre></div>      </div>

      <p><img src="https://latex.codecogs.com/svg.image?\text{RRF}(d)=\sum\frac{1}{k+\text{rank}(d)}" alt="RRF formula" /></p>

      <p>, where <code class="language-plaintext highlighter-rouge">k</code> is a constant (often 60).</p>
    </li>
    <li>
      <p><strong>Weighted Fusion (Alpha Parameter)</strong>: You can assign weights to each
method, such as assigning 70% weight to keyword search and 30% to vector
search (or vice versa), using an alpha parameter <code class="language-plaintext highlighter-rouge">(0 &lt;= ⍺ &lt;= 1)</code>.</p>
    </li>
    <li>
      <p><strong>Re-ranking (Two-Stage Search)</strong>: A faster approach is to use keyword
search to identify a large set of candidate documents, then use a reranker
model (e.g., Cohere) to rank them based on semantic relevance to the query.</p>
    </li>
    <li><strong>Normalized Score Combination</strong>: Normalize the scores from both systems
(e.g., scaling them to a 0-1 range) and then combine them, allowing for a
balanced, combined score.</li>
  </ul>

  <h3 id="steps-to-implement-hybrid-search">Steps to Implement Hybrid Search</h3>

  <ul>
    <li>
      <p><strong>Generate Embeddings</strong>: Use an AI model to create vector representations
of your data for the vector search.</p>
    </li>
    <li>
      <p><strong>Set Up Indexes</strong>: Create a search index that supports both full-text
(BM25) and vector (ANN) search, such as Elasticsearch, Pinecone, or Azure
AI Search.</p>
    </li>
    <li>
      <p><strong>Execute Parallel Queries</strong>: Send the same search query to both the text
search and vector search engines simultaneously.</p>
    </li>
    <li>
      <p><strong>Combine and Rerank</strong>: Use RRF or weighted scoring to combine the top
results from both methods into one list, sorted by the final score.</p>
    </li>
  </ul>
</blockquote>

<ul class="task-list">
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" /><a href="https://www.tigerdata.com/blog/combining-semantic-search-and-full-text-search-in-postgresql-with-cohere-pgvector-and-pgai">https://www.tigerdata.com/blog/combining-semantic-search-and-full-text-search-in-postgresql-with-cohere-pgvector-and-pgai</a></li>
</ul>

<blockquote>
  <p><strong>Implementing Hybrid Search</strong></p>

  <p>We’ll combine the results of both search functions to implement hybrid
search. To sort the results by relevance, we’ll use a Cohere reranker model,
rerank-english-v3.0.</p>
</blockquote>

<div class="language-sql highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">-- SQL query for reranking using pgai</span>
<span class="k">SELECT</span>
  <span class="n">x</span><span class="p">.</span><span class="nv">"index"</span><span class="p">,</span>
  <span class="n">x</span><span class="p">.</span><span class="n">document</span><span class="o">-&gt;&gt;</span><span class="s1">'text'</span> <span class="k">as</span> <span class="nv">"text"</span><span class="p">,</span>
  <span class="n">x</span><span class="p">.</span><span class="n">relevance_score</span>
<span class="k">FROM</span> <span class="n">jsonb_to_recordset</span><span class="p">(</span>
  <span class="n">ai</span><span class="p">.</span><span class="n">cohere_rerank</span><span class="p">(</span>
    <span class="s1">'rerank-english-v3.0'</span><span class="p">,</span>
    <span class="o">%</span><span class="n">s</span><span class="p">,</span>
    <span class="o">%</span><span class="n">s</span><span class="p">::</span><span class="n">jsonb</span><span class="p">,</span>
    <span class="n">return_documents</span> <span class="o">=&gt;</span> <span class="k">true</span><span class="p">,</span>
    <span class="n">api_key</span><span class="o">=&gt;%</span><span class="n">s</span>
  <span class="p">)</span><span class="o">-&gt;</span><span class="s1">'results'</span>
<span class="p">)</span> <span class="k">AS</span> <span class="n">x</span><span class="p">(</span><span class="nv">"index"</span> <span class="nb">int</span><span class="p">,</span> <span class="nv">"document"</span> <span class="n">jsonb</span><span class="p">,</span> <span class="n">relevance_score</span> <span class="n">float8</span><span class="p">)</span>
<span class="k">ORDER</span> <span class="k">BY</span> <span class="n">relevance_score</span> <span class="k">DESC</span>
<span class="k">LIMIT</span> <span class="mi">5</span><span class="p">;</span>
</code></pre></div></div>

<p>The function cohere_rerank uses a language model to assess the relevance of
each document to the query and then reorders the documents based on their
relevance.</p>

<ul class="task-list">
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" /><a href="https://cloud.google.com/blog/topics/developers-practitioners/hybrid-search-in-spanner-combine-full-text-and-vector-search">https://cloud.google.com/blog/topics/developers-practitioners/hybrid-search-in-spanner-combine-full-text-and-vector-search</a></li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" /><a href="https://milvus.io/ai-quick-reference/how-do-hybrid-approaches-combine-fulltext-and-vector-search">https://milvus.io/ai-quick-reference/how-do-hybrid-approaches-combine-fulltext-and-vector-search</a></li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" /><a href="https://medium.com/codex/96-hybrid-search-combining-bm25-and-vector-search-7a93adfd3f4e">https://medium.com/codex/96-hybrid-search-combining-bm25-and-vector-search-7a93adfd3f4e</a></li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" /><a href="https://thenewstack.io/combining-the-power-of-text-based-keyword-and-vector-search/">https://thenewstack.io/combining-the-power-of-text-based-keyword-and-vector-search/</a>
    <ul class="task-list">
      <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" /><strong>Vector Search: The Future of Data Querying Explained | Semantic
Searching - MongoDB</strong></li>
    </ul>

    <p><a href="https://youtu.be/1ZIYVNvRVsY"><img src="http://img.youtube.com/vi/1ZIYVNvRVsY/0.jpg" alt="
  Vector Search: The Future of Data Querying Explained | Semantic Searching -
  MongoDB
" /></a></p>
  </li>
  <li class="task-list-item">
    <p><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" /><strong>20. Hybrid Search Explained: Combining Keyword and Vector Search for
Maximum Accuracy - AI Academy</strong></p>

    <p><a href="https://youtu.be/obr2XV2vI3Q"><img src="http://img.youtube.com/vi/obr2XV2vI3Q/0.jpg" alt="
  Hybrid Search Explained: Combining Keyword and Vector Search for
  Maximum Accuracy - AI Academy
" /></a></p>
  </li>
</ul>]]></content><author><name></name></author><category term="AI," /><category term="search," /><category term="sematic" /><summary type="html"><![CDATA[Combining Semantic and Full Text Search]]></summary></entry><entry><title type="html">Fediverse Explained</title><link href="saramic.github.io/learning/fediverse,/ruby,/talk/idea/2026/02/28/fediverse-explained.html" rel="alternate" type="text/html" title="Fediverse Explained" /><published>2026-02-28T18:00:00+11:00</published><updated>2026-02-28T18:00:00+11:00</updated><id>saramic.github.io/learning/fediverse,/ruby,/talk/idea/2026/02/28/fediverse-explained</id><content type="html" xml:base="saramic.github.io/learning/fediverse,/ruby,/talk/idea/2026/02/28/fediverse-explained.html"><![CDATA[<h1 id="fediverse-talk-idea">Fediverse Talk Idea</h1>

<p><em>TODO WIP …</em></p>

<h2 id="fediverse-as-a-transport-pseudonymous-activitypub--github-key-encryption-in-ruby">“Fediverse as a Transport: Pseudonymous ActivityPub + GitHub-Key Encryption in Ruby”</h2>

<h3 id="core-concepts">core concepts</h3>

<ul>
  <li>Fediverse = message routing + discovery + delivery (ActivityPub)</li>
  <li>Privacy = end-to-end encryption (you add it at the app layer)</li>
  <li>“Anonymous” = realistically “pseudonymous/throwaway identity” (because
federation typically requires signed HTTP requests)</li>
</ul>

<ol>
  <li>
    <p>Hook (2 min):</p>

    <p><strong>“What if Twitter DMs were federated… and you brought your own
crypto?”</strong></p>

    <p>Show the final outcome first: you post a weird ciphertext note; your friend
runs one command and decrypts it.</p>
  </li>
  <li>
    <p>Reality check: Mastodon vs Bluesky (2 min)</p>

    <ul>
      <li>Mastodon: ActivityPub (fediverse).</li>
      <li>Bluesky: AT Protocol (different ecosystem).</li>
    </ul>

    <p>Your talk is ActivityPub-focused.</p>
  </li>
  <li>
    <p>Fediverse mental model (5 min)</p>

    <p>Draw 4 boxes:</p>

    <p>Actor (identity + public key)</p>

    <p>Inbox (where others POST Activities)</p>

    <p>Outbox (where you publish)</p>

    <p>Object (Note, Document, etc.)</p>

    <p>Key idea: federation moves JSON activities, not “files”; files are usually URLs + metadata.</p>
  </li>
  <li>
    <p>“Anonymous” posting, honestly (3 min)</p>

    <p>Explain:</p>

    <p>Server-to-server delivery usually uses signatures → not truly anonymous.</p>

    <p>But you can do throwaway pseudonyms:</p>

    <p>generate a new actor + keypair per message or per session</p>

    <p>host it briefly (even on a laptop with a tunnel)</p>

    <p>Threat model disclaimer: pseudonymity ≠ anonymity.</p>
  </li>
  <li>
    <p>Encryption plan (5 min)</p>

    <p>Use your friend’s GitHub SSH public key as the recipient key and encrypt:</p>

    <p>the message text</p>

    <p>optionally a small key file (or any file)</p>

    <p>Best practical tool for this: age (supports SSH recipient keys and is perfect for demos).</p>

    <p>You’ll shell out to age from Ruby.</p>
  </li>
  <li>
    <p>Code walkthrough (8–10 min)</p>

    <p>Three tiny Ruby scripts + one Sinatra receiver:</p>

    <p><code class="language-plaintext highlighter-rouge">inbox_server.rb</code> – prints received Activities (your “friend’s server” stand-in)</p>

    <p><code class="language-plaintext highlighter-rouge">fetch_github_keys.rb</code> – fetches public SSH keys for a GitHub user</p>

    <p><code class="language-plaintext highlighter-rouge">encrypt_for_github_key.rb</code> – encrypts message/file using age + SSH public key</p>

    <p><code class="language-plaintext highlighter-rouge">send_activitypub_note.rb</code> – posts Create{Note} to an inbox (local demo first)</p>
  </li>
  <li>
    <p>Final demo (5–10 min)</p>

    <p>You run the sender; friend receives ciphertext in inbox.</p>

    <p>Friend runs decrypt command using their private SSH key.</p>

    <p>Optional: show “attachment” encryption too.</p>

    <p>Repo layout (what you put on screen)</p>
    <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> fediverse-transport-demo/
   Gemfile
   inbox_server.rb
   scripts/
     fetch_github_keys.rb
     encrypt_for_github_key.rb
     send_activitypub_note.rb
   demo_payloads/
     secret.txt
</code></pre></div>    </div>

    <p>Dependencies</p>
    <ul>
      <li>Ruby stdlib + sinatra + json</li>
      <li>External tool: age (one-liner install)</li>
      <li>macOS: brew install age</li>
      <li>linux: package manager or releases</li>
    </ul>
  </li>
</ol>

<p>Code examples (meetup-friendly)</p>

<ol>
  <li>
    <p>Gemfile</p>

    <div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># Gemfile</span>
<span class="n">source</span> <span class="s2">"https://rubygems.org"</span>
<span class="n">gem</span> <span class="s2">"sinatra"</span>
</code></pre></div>    </div>
  </li>
  <li>
    <p>“Friend’s inbox” server (Sinatra)</p>

    <p>This simulates a fediverse server inbox so you can demo locally without
signatures.</p>

    <div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># inbox_server.rb</span>
<span class="nb">require</span> <span class="s2">"sinatra"</span>
<span class="nb">require</span> <span class="s2">"json"</span>

<span class="n">set</span> <span class="ss">:bind</span><span class="p">,</span> <span class="s2">"0.0.0.0"</span>
<span class="n">set</span> <span class="ss">:port</span><span class="p">,</span> <span class="mi">4567</span>

<span class="n">post</span> <span class="s2">"/inbox"</span> <span class="k">do</span>
  <span class="n">payload</span> <span class="o">=</span> <span class="n">request</span><span class="p">.</span><span class="nf">body</span><span class="p">.</span><span class="nf">read</span>
  <span class="nb">puts</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">=== INBOX RECEIVED ==="</span>
  <span class="nb">puts</span> <span class="n">payload</span>
  <span class="nb">puts</span> <span class="s2">"======================</span><span class="se">\n</span><span class="s2">"</span>
  <span class="n">status</span> <span class="mi">202</span>
<span class="k">end</span>

<span class="n">get</span> <span class="s2">"/"</span> <span class="k">do</span>
  <span class="s2">"Inbox running. POST ActivityPub to /inbox"</span>
<span class="k">end</span>
</code></pre></div>    </div>

    <p>Run:</p>

    <div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bundle <span class="nb">install
</span>bundle <span class="nb">exec </span>ruby inbox_server.rb
</code></pre></div>    </div>
  </li>
  <li>
    <p>Fetch recipient GitHub SSH keys</p>

    <p>GitHub exposes public keys at https://github.com/<user>.keys.</user></p>

    <div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># scripts/fetch_github_keys.rb</span>
<span class="nb">require</span> <span class="s2">"net/http"</span>
<span class="nb">require</span> <span class="s2">"uri"</span>

<span class="n">user</span> <span class="o">=</span> <span class="no">ARGV</span><span class="p">.</span><span class="nf">fetch</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="p">{</span> <span class="nb">abort</span> <span class="s2">"Usage: ruby fetch_github_keys.rb &lt;github_user&gt;"</span> <span class="p">}</span>
<span class="n">uri</span> <span class="o">=</span> <span class="no">URI</span><span class="p">(</span><span class="s2">"https://github.com/</span><span class="si">#{</span><span class="n">user</span><span class="si">}</span><span class="s2">.keys"</span><span class="p">)</span>

<span class="n">keys</span> <span class="o">=</span> <span class="no">Net</span><span class="o">::</span><span class="no">HTTP</span><span class="p">.</span><span class="nf">get</span><span class="p">(</span><span class="n">uri</span><span class="p">).</span><span class="nf">lines</span><span class="p">.</span><span class="nf">map</span><span class="p">(</span><span class="o">&amp;</span><span class="ss">:strip</span><span class="p">).</span><span class="nf">reject</span><span class="p">(</span><span class="o">&amp;</span><span class="ss">:empty?</span><span class="p">)</span>
<span class="nb">abort</span> <span class="s2">"No keys found for </span><span class="si">#{</span><span class="n">user</span><span class="si">}</span><span class="s2">"</span> <span class="k">if</span> <span class="n">keys</span><span class="p">.</span><span class="nf">empty?</span>

<span class="nb">puts</span> <span class="n">keys</span>
</code></pre></div>    </div>

    <p>Usage:</p>

    <div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ruby scripts/fetch_github_keys.rb &lt;github_user&gt;
</code></pre></div>    </div>
  </li>
  <li>
    <p>Encrypt a message (or file) for the first GitHub key using age</p>

    <p>This uses the SSH public key line directly as an age recipient (-R).</p>

    <div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># scripts/encrypt_for_github_key.rb</span>
<span class="nb">require</span> <span class="s2">"open3"</span>
<span class="nb">require</span> <span class="s2">"tempfile"</span>

<span class="n">recipient_key</span> <span class="o">=</span> <span class="no">ARGV</span><span class="p">.</span><span class="nf">fetch</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
  <span class="nb">abort</span> <span class="s2">"Usage: ruby encrypt_for_github_key.rb '&lt;ssh-public-key&gt;' &lt;infile&gt; &lt;outfile&gt;"</span>
<span class="p">}</span>
<span class="n">infile</span> <span class="o">=</span> <span class="no">ARGV</span><span class="p">.</span><span class="nf">fetch</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="n">outfile</span> <span class="o">=</span> <span class="no">ARGV</span><span class="p">.</span><span class="nf">fetch</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>

<span class="no">Tempfile</span><span class="p">.</span><span class="nf">create</span><span class="p">(</span><span class="s2">"recipient"</span><span class="p">)</span> <span class="k">do</span> <span class="o">|</span><span class="n">f</span><span class="o">|</span>
  <span class="n">f</span><span class="p">.</span><span class="nf">write</span><span class="p">(</span><span class="n">recipient_key</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span>
  <span class="n">f</span><span class="p">.</span><span class="nf">flush</span>

  <span class="n">cmd</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"age"</span><span class="p">,</span> <span class="s2">"-R"</span><span class="p">,</span> <span class="n">f</span><span class="p">.</span><span class="nf">path</span><span class="p">,</span> <span class="s2">"-o"</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">infile</span><span class="p">]</span>
  <span class="n">stdout</span><span class="p">,</span> <span class="n">stderr</span><span class="p">,</span> <span class="n">status</span> <span class="o">=</span> <span class="no">Open3</span><span class="p">.</span><span class="nf">capture3</span><span class="p">(</span><span class="o">*</span><span class="n">cmd</span><span class="p">)</span>
  <span class="nb">abort</span> <span class="s2">"age failed: </span><span class="si">#{</span><span class="n">stderr</span><span class="si">}</span><span class="s2">"</span> <span class="k">unless</span> <span class="n">status</span><span class="p">.</span><span class="nf">success?</span>
<span class="k">end</span>

<span class="nb">puts</span> <span class="s2">"Encrypted </span><span class="si">#{</span><span class="n">infile</span><span class="si">}</span><span class="s2"> -&gt; </span><span class="si">#{</span><span class="n">outfile</span><span class="si">}</span><span class="s2">"</span>
</code></pre></div>    </div>

    <p>Create a demo secret:</p>

    <p>``sh
echo “meet me at 7 behind the bikeshed” &gt; demo_payloads/secret.txt</p>
    <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
Encrypt it:

```sh
KEY="$(ruby scripts/fetch_github_keys.rb &lt;github_user&gt; | head -n 1)"
ruby scripts/encrypt_for_github_key.rb "$KEY" demo_payloads/secret.txt demo_payloads/secret.txt.age
</code></pre></div>    </div>
  </li>
</ol>

<p>4) Send an ActivityPub Create Note with ciphertext embedded</p>

<p>For the demo, we’ll embed the ciphertext (armored) in the Note content. age
   output is already safe text.</p>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code>   <span class="c1"># scripts/send_activitypub_note.rb</span>
   <span class="nb">require</span> <span class="s2">"json"</span>
   <span class="nb">require</span> <span class="s2">"net/http"</span>
   <span class="nb">require</span> <span class="s2">"uri"</span>
   <span class="nb">require</span> <span class="s2">"securerandom"</span>
   <span class="nb">require</span> <span class="s2">"time"</span>

   <span class="n">inbox_url</span> <span class="o">=</span> <span class="no">ARGV</span><span class="p">.</span><span class="nf">fetch</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="p">{</span> <span class="nb">abort</span> <span class="s2">"Usage: ruby send_activitypub_note.rb &lt;inbox_url&gt; &lt;ciphertext_file&gt;"</span> <span class="p">}</span>
   <span class="n">ciphertext_file</span> <span class="o">=</span> <span class="no">ARGV</span><span class="p">.</span><span class="nf">fetch</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>

   <span class="n">ciphertext</span> <span class="o">=</span> <span class="no">File</span><span class="p">.</span><span class="nf">read</span><span class="p">(</span><span class="n">ciphertext_file</span><span class="p">)</span>

   <span class="n">activity</span> <span class="o">=</span> <span class="p">{</span>
     <span class="s2">"@context"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"https://www.w3.org/ns/activitystreams"</span><span class="p">],</span>
     <span class="ss">id: </span><span class="s2">"urn:uuid:</span><span class="si">#{</span><span class="no">SecureRandom</span><span class="p">.</span><span class="nf">uuid</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span>
     <span class="ss">type: </span><span class="s2">"Create"</span><span class="p">,</span>
     <span class="ss">actor: </span><span class="s2">"https://example.invalid/actors/throwaway"</span><span class="p">,</span> <span class="c1"># pseudonymous placeholder for local demo</span>
     <span class="ss">published: </span><span class="no">Time</span><span class="p">.</span><span class="nf">now</span><span class="p">.</span><span class="nf">utc</span><span class="p">.</span><span class="nf">iso8601</span><span class="p">,</span>
     <span class="ss">object: </span><span class="p">{</span>
       <span class="ss">id: </span><span class="s2">"urn:uuid:</span><span class="si">#{</span><span class="no">SecureRandom</span><span class="p">.</span><span class="nf">uuid</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span>
       <span class="ss">type: </span><span class="s2">"Note"</span><span class="p">,</span>
       <span class="ss">attributedTo: </span><span class="s2">"https://example.invalid/actors/throwaway"</span><span class="p">,</span>
       <span class="ss">content: </span><span class="s2">"&lt;p&gt;Encrypted message (age):&lt;/p&gt;&lt;pre&gt;</span><span class="si">#{</span><span class="n">ciphertext</span><span class="si">}</span><span class="s2">&lt;/pre&gt;"</span><span class="p">,</span>
       <span class="ss">to: </span><span class="p">[</span><span class="s2">"https://www.w3.org/ns/activitystreams#Public"</span><span class="p">]</span>
     <span class="p">}</span>
   <span class="p">}</span>

   <span class="n">uri</span> <span class="o">=</span> <span class="no">URI</span><span class="p">(</span><span class="n">inbox_url</span><span class="p">)</span>
   <span class="n">req</span> <span class="o">=</span> <span class="no">Net</span><span class="o">::</span><span class="no">HTTP</span><span class="o">::</span><span class="no">Post</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="n">uri</span><span class="p">)</span>
   <span class="n">req</span><span class="p">[</span><span class="s2">"Content-Type"</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"application/activity+json"</span>
   <span class="n">req</span><span class="p">.</span><span class="nf">body</span> <span class="o">=</span> <span class="n">activity</span><span class="p">.</span><span class="nf">to_json</span>

   <span class="no">Net</span><span class="o">::</span><span class="no">HTTP</span><span class="p">.</span><span class="nf">start</span><span class="p">(</span><span class="n">uri</span><span class="p">.</span><span class="nf">host</span><span class="p">,</span> <span class="n">uri</span><span class="p">.</span><span class="nf">port</span><span class="p">,</span> <span class="ss">use_ssl: </span><span class="n">uri</span><span class="p">.</span><span class="nf">scheme</span> <span class="o">==</span> <span class="s2">"https"</span><span class="p">)</span> <span class="k">do</span> <span class="o">|</span><span class="n">http</span><span class="o">|</span>
     <span class="n">res</span> <span class="o">=</span> <span class="n">http</span><span class="p">.</span><span class="nf">request</span><span class="p">(</span><span class="n">req</span><span class="p">)</span>
     <span class="nb">puts</span> <span class="s2">"POST </span><span class="si">#{</span><span class="n">inbox_url</span><span class="si">}</span><span class="s2"> -&gt; </span><span class="si">#{</span><span class="n">res</span><span class="p">.</span><span class="nf">code</span><span class="si">}</span><span class="s2">"</span>
   <span class="k">end</span>
</code></pre></div></div>

<p>Send to your local friend inbox:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>   ruby scripts/send_activitypub_note.rb http://localhost:4567/inbox demo_payloads/secret.txt.age
</code></pre></div></div>

<p>You’ll see the Activity JSON printed on the “friend” terminal.</p>

<p>Decryption step (friend side)</p>

<p>If the friend has the corresponding private SSH key loaded (e.g., their GitHub key), they can decrypt with:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>   age <span class="nt">-d</span> <span class="nt">-i</span> ~/.ssh/id_ed25519 demo_payloads/secret.txt.age
</code></pre></div></div>

<p>That’s your “mic drop”: federated transport + BYO E2E crypto.</p>

<p>Optional upgrade for the finale (attachment + URL)</p>

<p>Instead of embedding ciphertext in the post, you can:</p>

<p>upload secret.txt.age somewhere (even a tiny local HTTP server),</p>

<p>include an ActivityPub attachment:</p>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="w">   </span><span class="nl">"attachment"</span><span class="p">:</span><span class="w"> </span><span class="p">[{</span><span class="w">
     </span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Document"</span><span class="p">,</span><span class="w">
     </span><span class="nl">"mediaType"</span><span class="p">:</span><span class="w"> </span><span class="s2">"application/octet-stream"</span><span class="p">,</span><span class="w">
     </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"secret.txt.age"</span><span class="p">,</span><span class="w">
     </span><span class="nl">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:8000/secret.txt.age"</span><span class="w">
   </span><span class="p">}]</span><span class="w">
</span></code></pre></div></div>

<p>Then your friend clicks/downloads and decrypts locally.</p>

<p>“How to make it real fediverse” (one slide, not live)</p>

<p>Explain: to deliver to actual Mastodon inboxes you’ll need:</p>

<p>a real Actor URL with public key</p>

<p>signed HTTP requests (HTTP Signatures / message signatures)</p>

<p>inbox discovery via WebFinger / actor document</p>

<p>You can mention there are Ruby libs/gems that help, but keep the live demo tight.</p>

<p>Suggested demo script (what you literally say/do)</p>

<p>Start inbox_server.rb (friend).</p>

<p>Fetch GitHub key: fetch_github_keys.rb.</p>

<p>Encrypt secret with age.</p>

<p>Send ActivityPub Create(Note) to /inbox.</p>

<p>Friend decrypts with age -d.</p>

<h2 id="expand-to-tor">Expand to TOR</h2>

<p>The simplest model is:</p>

<p>Ruby app stays normal → bind it to 127.0.0.1 → Tor exposes it as an onion
service.
You usually do not need a special Ruby onion library for that. Tor can publish
any local TCP service by mapping an onion port to a localhost port with
HiddenServiceDir and HiddenServicePort.</p>

<p>For file exchange, the easiest off-the-shelf option is OnionShare: it can
anonymously share files, host websites, and chat by starting local web servers
and making them available as Tor onion services.</p>

<h3 id="best-recommendation-for-your-meetup">Best recommendation for your meetup</h3>

<p>Use a two-level story:</p>

<p><strong>Level 1: “Pure concept”</strong></p>

<ul>
  <li>Tiny Sinatra site on a Raspberry Pi or laptop</li>
  <li>Tor exposes it as a .onion</li>
  <li>Your friend opens it in Tor Browser</li>
  <li>You post an encrypted message / download an encrypted file</li>
</ul>

<p><strong>Level 2: “No-code convenience option”</strong></p>

<ul>
  <li>Mention OnionShare as the production-ready shortcut for anonymous file
sharing and temporary websites</li>
  <li>Then say your Ruby version shows the same idea with less magic</li>
</ul>

<p>That gives you both:</p>
<ul>
  <li>a clean protocol explanation</li>
  <li>a memorable live demo</li>
</ul>

<h3 id="what-anonymous-means-here">What “anonymous” means here</h3>

<p>Running an onion service hides the server’s network location from visitors, and
onion services are only reachable over Tor. The Tor Project describes onion
services as services accessible only over Tor, with privacy benefits beyond
ordinary HTTPS.</p>

<p>That said, your app can still deanonymize you if it leaks identifying info in
headers, logs, page content, filenames, or timestamps. Tor’s docs explicitly
warn about web servers revealing identifying information about you, your
computer, or your location.</p>

<p>So for the talk, say “pseudonymous/private hosting” rather than promising
perfect anonymity.</p>

<p>Simplest architecture</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Friend with Tor Browser
        |
     .onion
        |
      Tor daemon
        |
127.0.0.1:4567
        |
   Sinatra app
</code></pre></div></div>

<p>This is much simpler than “building onion routing into Ruby.”</p>

<h3 id="minimal-live-demo-plan">Minimal live demo plan</h3>

<p><strong>Demo A: Host a secret page on onion</strong></p>

<ol>
  <li>Start a tiny Sinatra app on 127.0.0.1:4567</li>
  <li>Configure Tor:
    <ul>
      <li>HiddenServiceDir</li>
      <li>HiddenServicePort 80 127.0.0.1:4567</li>
    </ul>
  </li>
  <li>Tor generates a .onion hostname in the hidden service directory</li>
  <li>Open that URL in Tor Browser</li>
</ol>

<p><strong>Demo B: Exchange an encrypted file</strong></p>

<p>On the page, offer:</p>
<ul>
  <li>a text message encrypted with age</li>
  <li>an encrypted file download</li>
  <li>optional upload form for your friend to send a file back</li>
</ul>

<p>That ties perfectly into your earlier GitHub-public-key idea.</p>

<p><strong>Minimal Tor config</strong></p>

<p>In torrc, you can configure an onion service like this:</p>

<div class="language-conf highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">HiddenServiceDir</span> /<span class="n">var</span>/<span class="n">lib</span>/<span class="n">tor</span>/<span class="n">my_demo_service</span>/
<span class="n">HiddenServicePort</span> <span class="m">80</span> <span class="m">127</span>.<span class="m">0</span>.<span class="m">0</span>.<span class="m">1</span>:<span class="m">4567</span>
</code></pre></div></div>

<p>That is the standard Tor model for exposing a local service as an onion
service. Tor’s setup docs show this exact pattern.</p>

<p><strong>Minimal Ruby app</strong></p>
<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># app.rb</span>
<span class="nb">require</span> <span class="s2">"sinatra"</span>
<span class="nb">require</span> <span class="s2">"fileutils"</span>

<span class="n">set</span> <span class="ss">:bind</span><span class="p">,</span> <span class="s2">"127.0.0.1"</span>
<span class="n">set</span> <span class="ss">:port</span><span class="p">,</span> <span class="mi">4567</span>

<span class="n">get</span> <span class="s2">"/"</span> <span class="k">do</span>
  <span class="o">&lt;&lt;~</span><span class="no">HTML</span><span class="sh">
    &lt;h1&gt;Secret Onion Drop&lt;/h1&gt;
    &lt;p&gt;This page is reachable only through Tor.&lt;/p&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href="/message.txt.age"&gt;Encrypted message&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="/secret.zip.age"&gt;Encrypted file&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
</span><span class="no">  HTML</span>
<span class="k">end</span>

<span class="n">get</span> <span class="s2">"/upload"</span> <span class="k">do</span>
  <span class="o">&lt;&lt;~</span><span class="no">HTML</span><span class="sh">
    &lt;form action="/upload" method="post" enctype="multipart/form-data"&gt;
      &lt;input type="file" name="file" /&gt;
      &lt;button type="submit"&gt;Upload&lt;/button&gt;
    &lt;/form&gt;
</span><span class="no">  HTML</span>
<span class="k">end</span>

<span class="n">post</span> <span class="s2">"/upload"</span> <span class="k">do</span>
  <span class="n">tempfile</span> <span class="o">=</span> <span class="n">params</span><span class="p">.</span><span class="nf">dig</span><span class="p">(</span><span class="s2">"file"</span><span class="p">,</span> <span class="ss">:tempfile</span><span class="p">)</span>
  <span class="n">filename</span> <span class="o">=</span> <span class="n">params</span><span class="p">.</span><span class="nf">dig</span><span class="p">(</span><span class="s2">"file"</span><span class="p">,</span> <span class="ss">:filename</span><span class="p">)</span>

  <span class="n">halt</span> <span class="mi">400</span><span class="p">,</span> <span class="s2">"No file uploaded"</span> <span class="k">unless</span> <span class="n">tempfile</span> <span class="o">&amp;&amp;</span> <span class="n">filename</span>

  <span class="no">FileUtils</span><span class="p">.</span><span class="nf">mkdir_p</span><span class="p">(</span><span class="s2">"uploads"</span><span class="p">)</span>
  <span class="n">path</span> <span class="o">=</span> <span class="no">File</span><span class="p">.</span><span class="nf">join</span><span class="p">(</span><span class="s2">"uploads"</span><span class="p">,</span> <span class="no">File</span><span class="p">.</span><span class="nf">basename</span><span class="p">(</span><span class="n">filename</span><span class="p">))</span>
  <span class="no">File</span><span class="p">.</span><span class="nf">binwrite</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">tempfile</span><span class="p">.</span><span class="nf">read</span><span class="p">)</span>

  <span class="s2">"Uploaded </span><span class="si">#{</span><span class="no">File</span><span class="p">.</span><span class="nf">basename</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span>
<span class="k">end</span>
</code></pre></div></div>

<p>Then place encrypted files in the same directory:</p>
<ul>
  <li><code class="language-plaintext highlighter-rouge">message.txt.age</code></li>
  <li><code class="language-plaintext highlighter-rouge">secret.zip.age</code></li>
</ul>

<p>That alone is a very strong demo.</p>

<p>If you want “library” simplicity</p>

<p>There are two practical answers:</p>

<p><strong>1) Simplest overall: no Ruby library</strong></p>

<p>Use:</p>
<ul>
  <li>sinatra for the site</li>
  <li>Tor daemon for onion hosting</li>
  <li>age for encryption</li>
</ul>

<p>This is the easiest to explain and the least fragile.</p>

<p><strong>2) Simplest ready-made app: OnionShare</strong></p>

<p>OnionShare already does:</p>
<ul>
  <li>anonymous file sharing
web hosting</li>
  <li>chat
by launching local web servers exposed as onion services. By default it can
also protect services with a private key / client authentication.</li>
</ul>

<p>So if your question is “is there a simple library?”, the honest answer is:</p>

<ul>
  <li>for Ruby: simplest is usually not a library, but Tor as a sidecar</li>
  <li>for a polished tool: OnionShare is the easiest complete solution</li>
</ul>

<h3 id="raspberry-pi-angle">Raspberry Pi angle</h3>

<p>A Raspberry Pi is a very natural fit here because the onion service only needs:</p>

<ul>
  <li>Tor</li>
  <li>a tiny local web app</li>
  <li>a stable machine left running on the network</li>
</ul>

<p>Tor’s onion service setup is generic and works by forwarding an onion port to a
local port, so a Pi works fine as long as it can run Tor and your web app.</p>

<h3 id="best-meetup-finale">Best meetup finale</h3>

<p>I’d structure the final demo like this:</p>

<p>Finale script</p>
<ul>
  <li>“Here’s a normal Sinatra app on localhost.”</li>
  <li>“Now I add three Tor config lines.”</li>
  <li>“Tor gives me a .onion address.”</li>
  <li>“My friend opens it in Tor Browser.”</li>
  <li>“They download secret.txt.age.”</li>
  <li>“They decrypt it with their SSH private key.”</li>
  <li>“Optional: they upload a reply file back through the same onion service.”</li>
</ul>

<p>That lands really well because it shows:</p>
<ul>
  <li>federation/decentralization adjacent ideas</li>
  <li>privacy-preserving hosting</li>
  <li>real file exchange</li>
  <li>very little code</li>
</ul>

<p><strong>My recommendation</strong>
For your talk, I would not try to combine:</p>
<ul>
  <li>ActivityPub federation
Tor onion hosting</li>
  <li>file exchange</li>
  <li>end-to-end encryption
all equally.</li>
</ul>

<p>That’s too much for one meetup.</p>

<p>Instead, make the main story:</p>

<p><strong>“A tiny Ruby app served as an onion site, exchanging an encrypted
message/file.”</strong></p>

<p>Then mention:</p>

<ul>
  <li>ActivityPub could carry the message metadata/discovery layer</li>
  <li>onion service could host the payload privately</li>
  <li>encryption protects the content end-to-end</li>
</ul>

<p>That’s a clean narrative.</p>

<p>I can turn this into a complete meetup pack with:</p>

<ul>
  <li>a 20-minute talk outline,</li>
  <li>exact torrc setup steps,</li>
  <li>a polished Sinatra demo,</li>
</ul>

<p>and a final live-demo script you can rehearse.</p>

<h3 id="on-macos">On MacOS</h3>

<p>Ruby + Sinatra for the local web app</p>

<p>Tor daemon to expose that app as an onion service</p>

<p>age for encrypting files/messages before download or after upload</p>

<p>You do not need a special “onion Ruby library” just to host the site. Tor can
publish any local TCP service by mapping an onion port to a localhost port with
HiddenServiceDir and HiddenServicePort. Sinatra is a lightweight Ruby web DSL,
and age is a simple file encryption tool with a Homebrew package on macOS.</p>

<p><strong>What to install on your Mac</strong></p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>brew <span class="nb">install </span>tor age
brew <span class="nb">install</span> <span class="nt">--cask</span> tor-browser
gem <span class="nb">install </span>sinatra
</code></pre></div></div>

<p>Homebrew currently provides tor and age for macOS, and Tor Browser is available
as a cask for testing the .onion site locally.</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Project layout
onion-drop/
  app.rb
  files/
  uploads/
  tor-data/
  tor-hidden-service/
</code></pre></div></div>
<p>The Ruby app</p>

<p>This gives you:</p>
<ul>
  <li>a home page</li>
  <li>a file upload form</li>
  <li>a file list</li>
  <li>a download endpoint</li>
  <li>optional encryption endpoint using age</li>
</ul>

<p>Save this as app.rb:</p>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">require</span> <span class="s2">"sinatra"</span>
<span class="nb">require</span> <span class="s2">"fileutils"</span>
<span class="nb">require</span> <span class="s2">"open3"</span>
<span class="nb">require</span> <span class="s2">"shellwords"</span>

<span class="n">set</span> <span class="ss">:bind</span><span class="p">,</span> <span class="s2">"127.0.0.1"</span>
<span class="n">set</span> <span class="ss">:port</span><span class="p">,</span> <span class="mi">4567</span>

<span class="no">FILES_DIR</span> <span class="o">=</span> <span class="no">File</span><span class="p">.</span><span class="nf">expand_path</span><span class="p">(</span><span class="s2">"files"</span><span class="p">,</span> <span class="n">__dir__</span><span class="p">)</span>
<span class="no">UPLOADS_DIR</span> <span class="o">=</span> <span class="no">File</span><span class="p">.</span><span class="nf">expand_path</span><span class="p">(</span><span class="s2">"uploads"</span><span class="p">,</span> <span class="n">__dir__</span><span class="p">)</span>

<span class="no">FileUtils</span><span class="p">.</span><span class="nf">mkdir_p</span><span class="p">(</span><span class="no">FILES_DIR</span><span class="p">)</span>
<span class="no">FileUtils</span><span class="p">.</span><span class="nf">mkdir_p</span><span class="p">(</span><span class="no">UPLOADS_DIR</span><span class="p">)</span>

<span class="n">helpers</span> <span class="k">do</span>
  <span class="k">def</span> <span class="nf">safe_name</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
    <span class="no">File</span><span class="p">.</span><span class="nf">basename</span><span class="p">(</span><span class="nb">name</span><span class="p">.</span><span class="nf">to_s</span><span class="p">).</span><span class="nf">gsub</span><span class="p">(</span><span class="sr">/[^\w.\-]/</span><span class="p">,</span> <span class="s2">"_"</span><span class="p">)</span>
  <span class="k">end</span>

  <span class="k">def</span> <span class="nf">all_files</span>
    <span class="no">Dir</span><span class="p">.</span><span class="nf">children</span><span class="p">(</span><span class="no">FILES_DIR</span><span class="p">).</span><span class="nf">sort</span>
  <span class="k">end</span>

  <span class="k">def</span> <span class="nf">uploaded_files</span>
    <span class="no">Dir</span><span class="p">.</span><span class="nf">children</span><span class="p">(</span><span class="no">UPLOADS_DIR</span><span class="p">).</span><span class="nf">sort</span>
  <span class="k">end</span>
<span class="k">end</span>

<span class="n">get</span> <span class="s2">"/"</span> <span class="k">do</span>
  <span class="n">files_html</span> <span class="o">=</span> <span class="n">all_files</span><span class="p">.</span><span class="nf">map</span> <span class="p">{</span> <span class="o">|</span><span class="n">f</span><span class="o">|</span> <span class="sx">%(&lt;li&gt;&lt;a href="/files/#{f}"&gt;#{f}&lt;/a&gt;&lt;/li&gt;)</span> <span class="p">}.</span><span class="nf">join</span>
  <span class="n">uploads_html</span> <span class="o">=</span> <span class="n">uploaded_files</span><span class="p">.</span><span class="nf">map</span> <span class="p">{</span> <span class="o">|</span><span class="n">f</span><span class="o">|</span> <span class="sx">%(&lt;li&gt;#{f}&lt;/li&gt;)</span> <span class="p">}.</span><span class="nf">join</span>

  <span class="o">&lt;&lt;~</span><span class="no">HTML</span><span class="sh">
    &lt;h1&gt;Onion Drop&lt;/h1&gt;
    &lt;p&gt;This site is intended to be reached over Tor as a .onion service.&lt;/p&gt;

    &lt;h2&gt;Available files&lt;/h2&gt;
    &lt;ul&gt;
      </span><span class="si">#{</span><span class="n">files_html</span><span class="p">.</span><span class="nf">empty?</span> <span class="p">?</span> <span class="s2">"&lt;li&gt;No files yet&lt;/li&gt;"</span> <span class="p">:</span> <span class="n">files_html</span><span class="si">}</span><span class="sh">
    &lt;/ul&gt;

    &lt;h2&gt;Upload a file&lt;/h2&gt;
    &lt;form action="/upload" method="post" enctype="multipart/form-data"&gt;
      &lt;input type="file" name="file" /&gt;
      &lt;button type="submit"&gt;Upload&lt;/button&gt;
    &lt;/form&gt;

    &lt;h2&gt;Encrypt a local file for a recipient&lt;/h2&gt;
    &lt;form action="/encrypt" method="post"&gt;
      &lt;label&gt;Existing file name:&lt;/label&gt;&lt;br&gt;
      &lt;input type="text" name="filename" placeholder="secret.txt" /&gt;&lt;br&gt;&lt;br&gt;

      &lt;label&gt;Recipient public key (age public key or SSH public key):&lt;/label&gt;&lt;br&gt;
      &lt;textarea name="recipient" rows="4" cols="80"&gt;&lt;/textarea&gt;&lt;br&gt;&lt;br&gt;

      &lt;button type="submit"&gt;Encrypt&lt;/button&gt;
    &lt;/form&gt;

    &lt;h2&gt;Uploaded files&lt;/h2&gt;
    &lt;ul&gt;
      </span><span class="si">#{</span><span class="n">uploads_html</span><span class="p">.</span><span class="nf">empty?</span> <span class="p">?</span> <span class="s2">"&lt;li&gt;No uploads yet&lt;/li&gt;"</span> <span class="p">:</span> <span class="n">uploads_html</span><span class="si">}</span><span class="sh">
    &lt;/ul&gt;
</span><span class="no">  HTML</span>
<span class="k">end</span>

<span class="n">get</span> <span class="s2">"/files/:name"</span> <span class="k">do</span>
  <span class="nb">name</span> <span class="o">=</span> <span class="n">safe_name</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="ss">:name</span><span class="p">])</span>
  <span class="n">path</span> <span class="o">=</span> <span class="no">File</span><span class="p">.</span><span class="nf">join</span><span class="p">(</span><span class="no">FILES_DIR</span><span class="p">,</span> <span class="nb">name</span><span class="p">)</span>
  <span class="n">halt</span> <span class="mi">404</span><span class="p">,</span> <span class="s2">"Not found"</span> <span class="k">unless</span> <span class="no">File</span><span class="p">.</span><span class="nf">file?</span><span class="p">(</span><span class="n">path</span><span class="p">)</span>
  <span class="n">send_file</span> <span class="n">path</span>
<span class="k">end</span>

<span class="n">post</span> <span class="s2">"/upload"</span> <span class="k">do</span>
  <span class="n">file</span> <span class="o">=</span> <span class="n">params</span><span class="p">[</span><span class="ss">:file</span><span class="p">]</span>
  <span class="n">halt</span> <span class="mi">400</span><span class="p">,</span> <span class="s2">"No file uploaded"</span> <span class="k">unless</span> <span class="n">file</span> <span class="o">&amp;&amp;</span> <span class="n">file</span><span class="p">[</span><span class="ss">:tempfile</span><span class="p">]</span> <span class="o">&amp;&amp;</span> <span class="n">file</span><span class="p">[</span><span class="ss">:filename</span><span class="p">]</span>

  <span class="n">filename</span> <span class="o">=</span> <span class="n">safe_name</span><span class="p">(</span><span class="n">file</span><span class="p">[</span><span class="ss">:filename</span><span class="p">])</span>
  <span class="n">dest</span> <span class="o">=</span> <span class="no">File</span><span class="p">.</span><span class="nf">join</span><span class="p">(</span><span class="no">UPLOADS_DIR</span><span class="p">,</span> <span class="n">filename</span><span class="p">)</span>
  <span class="no">File</span><span class="p">.</span><span class="nf">binwrite</span><span class="p">(</span><span class="n">dest</span><span class="p">,</span> <span class="n">file</span><span class="p">[</span><span class="ss">:tempfile</span><span class="p">].</span><span class="nf">read</span><span class="p">)</span>

  <span class="s2">"Uploaded </span><span class="si">#{</span><span class="n">filename</span><span class="si">}</span><span class="s2">"</span>
<span class="k">end</span>

<span class="n">post</span> <span class="s2">"/encrypt"</span> <span class="k">do</span>
  <span class="n">filename</span> <span class="o">=</span> <span class="n">safe_name</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="ss">:filename</span><span class="p">])</span>
  <span class="n">recipient</span> <span class="o">=</span> <span class="n">params</span><span class="p">[</span><span class="ss">:recipient</span><span class="p">].</span><span class="nf">to_s</span><span class="p">.</span><span class="nf">strip</span>

  <span class="n">halt</span> <span class="mi">400</span><span class="p">,</span> <span class="s2">"Missing file name"</span> <span class="k">if</span> <span class="n">filename</span><span class="p">.</span><span class="nf">empty?</span>
  <span class="n">halt</span> <span class="mi">400</span><span class="p">,</span> <span class="s2">"Missing recipient key"</span> <span class="k">if</span> <span class="n">recipient</span><span class="p">.</span><span class="nf">empty?</span>

  <span class="n">input_path</span> <span class="o">=</span> <span class="no">File</span><span class="p">.</span><span class="nf">join</span><span class="p">(</span><span class="no">FILES_DIR</span><span class="p">,</span> <span class="n">filename</span><span class="p">)</span>
  <span class="n">halt</span> <span class="mi">404</span><span class="p">,</span> <span class="s2">"Source file not found"</span> <span class="k">unless</span> <span class="no">File</span><span class="p">.</span><span class="nf">file?</span><span class="p">(</span><span class="n">input_path</span><span class="p">)</span>

  <span class="n">recipient_file</span> <span class="o">=</span> <span class="no">File</span><span class="p">.</span><span class="nf">join</span><span class="p">(</span><span class="no">Dir</span><span class="p">.</span><span class="nf">tmpdir</span><span class="p">,</span> <span class="s2">"recipient_</span><span class="si">#{</span><span class="no">Process</span><span class="p">.</span><span class="nf">pid</span><span class="si">}</span><span class="s2">.txt"</span><span class="p">)</span>
  <span class="n">output_path</span> <span class="o">=</span> <span class="no">File</span><span class="p">.</span><span class="nf">join</span><span class="p">(</span><span class="no">FILES_DIR</span><span class="p">,</span> <span class="s2">"</span><span class="si">#{</span><span class="n">filename</span><span class="si">}</span><span class="s2">.age"</span><span class="p">)</span>

  <span class="k">begin</span>
    <span class="no">File</span><span class="p">.</span><span class="nf">write</span><span class="p">(</span><span class="n">recipient_file</span><span class="p">,</span> <span class="n">recipient</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span>

    <span class="n">cmd</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"age"</span><span class="p">,</span> <span class="s2">"-R"</span><span class="p">,</span> <span class="n">recipient_file</span><span class="p">,</span> <span class="s2">"-o"</span><span class="p">,</span> <span class="n">output_path</span><span class="p">,</span> <span class="n">input_path</span><span class="p">]</span>
    <span class="n">_stdout</span><span class="p">,</span> <span class="n">stderr</span><span class="p">,</span> <span class="n">status</span> <span class="o">=</span> <span class="no">Open3</span><span class="p">.</span><span class="nf">capture3</span><span class="p">(</span><span class="o">*</span><span class="n">cmd</span><span class="p">)</span>

    <span class="n">halt</span> <span class="mi">500</span><span class="p">,</span> <span class="s2">"age failed: </span><span class="si">#{</span><span class="n">stderr</span><span class="si">}</span><span class="s2">"</span> <span class="k">unless</span> <span class="n">status</span><span class="p">.</span><span class="nf">success?</span>
  <span class="k">ensure</span>
    <span class="no">File</span><span class="p">.</span><span class="nf">delete</span><span class="p">(</span><span class="n">recipient_file</span><span class="p">)</span> <span class="k">if</span> <span class="no">File</span><span class="p">.</span><span class="nf">exist?</span><span class="p">(</span><span class="n">recipient_file</span><span class="p">)</span>
  <span class="k">end</span>

  <span class="s2">"Encrypted </span><span class="si">#{</span><span class="n">filename</span><span class="si">}</span><span class="s2"> -&gt; </span><span class="si">#{</span><span class="n">filename</span><span class="si">}</span><span class="s2">.age"</span>
<span class="k">end</span>
</code></pre></div></div>

<p>This uses Sinatra for the site and shells out to age, which is usually much
simpler than embedding crypto logic in Ruby for a demo like this. Sinatra
serves routes and static file downloads cleanly, and age is designed as a
composable command-line encryption tool.</p>

<p>Start the Ruby app</p>

<p>From that folder:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkdir</span> <span class="nt">-p</span> files uploads tor-data tor-hidden-service
<span class="nb">echo</span> <span class="s1">'hello from onion land'</span> <span class="o">&gt;</span> files/message.txt
ruby app.rb
</code></pre></div></div>

<p>Then check locally in a normal browser:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>open http://127.0.0.1:4567
</code></pre></div></div>

<p>Tor’s onion-service setup expects your local service to already be listening on
localhost before you map it into the onion service.</p>

<p>Tor config for macOS</p>

<p>Instead of editing a system-wide torrc, use a small project-local config file.
Create torrc-demo:</p>

<div class="language-conf highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">DataDirectory</span> ./<span class="n">tor</span>-<span class="n">data</span>
<span class="n">HiddenServiceDir</span> ./<span class="n">tor</span>-<span class="n">hidden</span>-<span class="n">service</span>
<span class="n">HiddenServicePort</span> <span class="m">80</span> <span class="m">127</span>.<span class="m">0</span>.<span class="m">0</span>.<span class="m">1</span>:<span class="m">4567</span>
<span class="n">Log</span> <span class="n">notice</span> <span class="n">stdout</span>
</code></pre></div></div>

<p>Those are the key Tor settings: HiddenServiceDir stores the onion hostname and
keys, and HiddenServicePort 80 127.0.0.1:4567 maps the onion site’s port 80 to
your Sinatra app on localhost port 4567. Tor creates the hostname file
automatically inside the hidden-service directory when it starts.</p>

<p>Start Tor</p>

<p>Run this from the same project directory:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>tor <span class="nt">-f</span> torrc-demo
</code></pre></div></div>

<p>After Tor starts, print your onion hostname:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cat </span>tor-hidden-service/hostname
</code></pre></div></div>

<p>The Tor Project’s setup docs say the onion hostname appears in a file named
hostname inside the hidden service directory, and the private keys in that same
directory must be kept secret.</p>

<p>Open it in Tor Browser</p>

<p>Launch Tor Browser and visit the .onion address from:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cat </span>tor-hidden-service/hostname
</code></pre></div></div>

<p>That is the simplest end-to-end local-macOS setup: your Mac hosts Sinatra on
localhost, Tor publishes it as a .onion, and Tor Browser accesses it.</p>

<p>Encrypt a file for someone</p>

<p>If you already have a recipient public key, paste it into the web form and
click Encrypt.</p>

<p>For example, with a plain age public key, the value looks like:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p
</code></pre></div></div>

<p>The age project documents that style of public key and the normal
encrypt/decrypt workflow.</p>

<p>Decrypt on the recipient side</p>

<p>If the recipient has the matching private key, they can decrypt:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>age --decrypt -i key.txt files/message.txt.age &gt; message.txt
</code></pre></div></div>

<p>That is the standard age CLI pattern documented by the project.</p>

<p>If you want to use a GitHub SSH public key</p>

<p>For a quick demo, you can fetch a user’s public SSH keys from GitHub’s public
.keys endpoint and use one of them as the recipient text in the form. GitHub
documents SSH keys as the mechanism for connecting/authenticating with GitHub,
and users can add public SSH keys to their accounts.</p>

<p>A tiny helper script:</p>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># fetch_github_keys.rb</span>
<span class="nb">require</span> <span class="s2">"net/http"</span>
<span class="nb">require</span> <span class="s2">"uri"</span>

<span class="n">user</span> <span class="o">=</span> <span class="no">ARGV</span><span class="p">.</span><span class="nf">fetch</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="nb">puts</span> <span class="no">Net</span><span class="o">::</span><span class="no">HTTP</span><span class="p">.</span><span class="nf">get</span><span class="p">(</span><span class="no">URI</span><span class="p">(</span><span class="s2">"https://github.com/</span><span class="si">#{</span><span class="n">user</span><span class="si">}</span><span class="s2">.keys"</span><span class="p">))</span>
</code></pre></div></div>

<p>Run:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ruby fetch_github_keys.rb SOME_GITHUB_USERNAME
</code></pre></div></div>

<p>Then paste one returned SSH public key into the encrypt form.</p>

<p>The exact “simple meetup demo” flow</p>

<p>Run these in separate terminals:</p>

<p>Terminal 1 — web app</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ruby app.rb
</code></pre></div></div>

<p>Terminal 2 — tor</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>tor <span class="nt">-f</span> torrc-demo
</code></pre></div></div>

<p>Terminal 3 — inspect onion address</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cat </span>tor-hidden-service/hostname
</code></pre></div></div>

<p>Then:</p>

<ol>
  <li>Open the onion URL in Tor Browser.</li>
  <li>Show message.txt.</li>
  <li>Paste a recipient key and encrypt it into message.txt.age.</li>
  <li>Download message.txt.age.</li>
  <li>Decrypt it on another machine or terminal.</li>
</ol>

<p>That is probably the cleanest “cool factor vs setup time” version.</p>

<p>What libraries I’d actually use</p>

<p>For your macOS demo, I’d keep it to this:</p>

<ul>
  <li>Ruby gem: sinatra</li>
  <li>CLI tools: tor, age</li>
  <li>Optional: tor-browser for local testing</li>
</ul>

<p>I would not add a Tor-specific Ruby library unless you want advanced control of
Tor itself. For simple hosting, Tor already does the onion-service part
directly through config. The Tor docs describe onion services as a Tor-level
service configuration, not something that requires an app framework
integration.</p>

<p>Two practical cautions</p>

<p>First, keep tor-hidden-service/ private. The Tor docs warn that the files in
the hidden-service directory include the onion service keys; if those leak,
someone else can impersonate the service.</p>

<p>Second, don’t over-claim anonymity. Tor hides the network location of the
service, but your app can still leak identifying information through file
names, content, logs, timestamps, or anything you put on the page. Tor’s
support/docs emphasize privacy benefits for onion services, but operational
details still matter.</p>

<p>If you want, I can turn this into a single copy-paste project with a Gemfile,
torrc-demo, and a polished app.rb ready to run on macOS.</p>]]></content><author><name></name></author><category term="Fediverse," /><category term="ruby," /><category term="talk" /><category term="idea" /><summary type="html"><![CDATA[Fediverse Talk Idea]]></summary></entry><entry><title type="html">Learning radio and electronics</title><link href="saramic.github.io/learning/radio,/electronics/2026/02/28/learning-radio-and-electronics.html" rel="alternate" type="text/html" title="Learning radio and electronics" /><published>2026-02-28T18:00:00+11:00</published><updated>2026-02-28T18:00:00+11:00</updated><id>saramic.github.io/learning/radio,/electronics/2026/02/28/learning-radio-and-electronics</id><content type="html" xml:base="saramic.github.io/learning/radio,/electronics/2026/02/28/learning-radio-and-electronics.html"><![CDATA[<h1 id="plan-for-learning-radio-and-electronics">Plan for learning radio and electronics</h1>

<p>_TODO WIP … _</p>

<p>internal notes https://chatgpt.com/c/69755ac5-efc8-8322-87a2-9059b38c0d55</p>

<p>Ground rules (do these first)</p>

<ul>
  <li>Know what you’re allowed to transmit on. If you don’t have a ham license,
keep TX experiments to legal services (CB, LPD/FRS/UHF CB where applicable)
and follow power/antenna rules.</li>
  <li>Start with receive-only. You can learn tons without transmitting.</li>
  <li>Keep distances small at first (near-field), low power, and avoid long “random
wires” near power lines.</li>
  <li>Build a “test transmitter” plan: either
    <ul>
      <li>an existing legal handheld/CB, or</li>
      <li>a low-power signal source (later: NanoVNA output, tiny oscillator, or a
licensed low-power transmitter).</li>
    </ul>
  </li>
</ul>

<h2 id="phase-1--i-can-detect-rf-no-fancy-tools">Phase 1 — “I can detect RF” (no fancy tools)</h2>

<h3 id="experiment-1-simple-pickup-loop--detector-the-article-idea">Experiment 1: Simple pickup loop + detector (the article idea)</h3>

<p><strong>Goal:</strong> See a measurable voltage when a nearby radio transmits.</p>

<p><strong>Build:</strong></p>

<p>Loop: 5–20 turns of wire on a cardboard form (5–15 cm diameter).</p>

<p>Detector: Schottky diode (e.g., 1N5711 or BAT43) + RC (say 10 nF + 100 kΩ) to
make a simple envelope detector.</p>

<p>Load: measure DC across the capacitor with a multimeter.</p>

<p><strong>What you learn:</strong></p>

<p>Strong near-field coupling</p>

<p>Orientation matters (rotate loop, voltage peaks/nulls)</p>

<p>Distance falloff (roughly fast in near-field)</p>

<p>Safety/notes:</p>

<p>A “nearby transmitting radio” can produce surprisingly high RF near the
antenna—don’t touch the transmitting antenna.</p>

<h3 id="experiment-2-resonant-loop-tunes-louder">Experiment 2: Resonant loop “tunes louder”</h3>

<p><strong>Goal:</strong> Add a capacitor to resonate the loop at a frequency and watch the
detected voltage peak.</p>

<p><strong>Build:</strong></p>

<p>Same loop, add a variable capacitor (or fixed caps you can swap).</p>

<p>Keep the same diode detector.</p>

<p><strong>What you learn:</strong></p>

<p>Resonance is real and sharp-ish</p>

<p>Q factor, bandwidth, detuning by your hand nearby</p>

<h3 id="experiment-3-human-body-detunes-antennas">Experiment 3: “Human body detunes antennas”</h3>

<p><strong>Goal:</strong> Quantify hand proximity effects.</p>

<p>Measure detected output while moving your hand near the loop.</p>

<p>Try different loop sizes, turns, and capacitor values.</p>

<p>Phase 2 — Add NanoVNA early (it’s the best teacher)</p>

<p>Once you can “see” RF with the detector, add measurement.</p>

<h3 id="experiment-4-measure-resonance-and-impedance-with-nanovna">Experiment 4: Measure resonance and impedance with NanoVNA</h3>

<p><strong>Goal:</strong> See your loop’s resonance on a plot.</p>

<p>Do:</p>

<p>Connect loop (with tuning cap) to NanoVNA.</p>

<p>Sweep around target frequency.</p>

<p>Look at S11 return loss, Smith chart, and resonant dip.</p>

<p><strong>What you learn:</strong></p>

<p>Resonance frequency shifts with geometry and environment</p>

<p>Matching and impedance are not abstract concepts anymore</p>

<p>Tip: build a couple of simple calibration standards habits (do the NanoVNA SOL
calibration at the end of your test cable).</p>

<h3 id="experiment-5-build-a-basic-rf-field-probe">Experiment 5: Build a basic RF “field probe”</h3>

<p><strong>Goal:</strong> Turn your pickup loop into a repeatable “RF strength” sensor.</p>

<p>Small loop + diode detector + resistor load</p>

<p>Use the NanoVNA or a known TX as the source</p>

<p>Mark distances and compare relative readings</p>

<h2 id="phase-3--wire-antennas-you-can-build-in-20-minutes">Phase 3 — Wire antennas you can build in 20 minutes</h2>

<h3 id="experiment-6-random-wire--counterpoise-receive-only-first">Experiment 6: Random wire + counterpoise (receive-only first)</h3>

<p><strong>Goal:</strong> Compare “just wire” vs “wire + counterpoise”.</p>

<p><strong>Build:</strong></p>

<p>3–10 m wire as antenna</p>

<p>3–10 m wire as counterpoise (or a few radials on the ground)</p>

<p>Simple LC tuner (optional) or directly into a receiver / NanoVNA</p>

<p><strong>Learn:</strong></p>

<p>The “other half” of the antenna matters</p>

<p>Noise pickup changes dramatically with counterpoise/grounding</p>

<h3 id="experiment-7-half-wave-dipole-the-baseline">Experiment 7: Half-wave dipole (the baseline)</h3>

<p><strong>Goal:</strong> Build a reference antenna you can compare everything against.</p>

<p><strong>Build:</strong></p>

<p>Cut for a band you can legally test on (or receive-only).</p>

<p>Make a 1:1 choke balun (simple: several turns of coax on a form).</p>

<p>Measure with NanoVNA: resonance, SWR, bandwidth.</p>

<p><strong>Learn:</strong></p>

<p>How height and surroundings shift resonance</p>

<p>Why choke/balun reduces common-mode mess</p>

<h2 id="phase-4--matching-networks--feedlines-where-rf-starts-feeling-real">Phase 4 — Matching networks &amp; feedlines (where “RF” starts feeling real)</h2>

<h3 id="experiment-8-build-a-simple-l-match--tuner">Experiment 8: Build a simple L-match / tuner</h3>

<p><strong>Goal:</strong> Match a non-50 Ω antenna to 50 Ω.</p>

<p><strong>Build:</strong></p>

<p>One inductor + one capacitor (var cap helps)</p>

<p>Use NanoVNA to watch match improve in real time</p>

<p><strong>Learn:</strong></p>

<p>What “matching” actually does (and does not do)</p>

<p>Loss, Q, and how narrowband matching can be</p>

<h3 id="experiment-9-transmission-line-experiments">Experiment 9: Transmission line experiments</h3>

<p><strong>Goal:</strong> Understand coax length, velocity factor, and impedance transforms.</p>

<p><strong>Do:</strong></p>

<p>Use NanoVNA to measure a coax stub and see phase delay</p>

<p>Try open/short stubs and observe impedance swings on Smith chart</p>

<h2 id="phase-5--directionality-multi-element--arrays">Phase 5 — Directionality: multi-element &amp; arrays</h2>

<h3 id="experiment-10-two-element-array-receive-is-easiest">Experiment 10: Two-element array (receive is easiest)</h3>

<p><strong>Goal:</strong> Make directionality with two simple elements.</p>

<p>Options:</p>

<p>Two small loops separated by 0.1–0.3 wavelength (or smaller, even)</p>

<p>Or two short verticals with a simple combiner</p>

<p>Try:</p>

<p>Combine in-phase vs out-of-phase (even manually swapping leads)</p>

<p>Observe nulls and peaks by rotating the setup or moving the source</p>

<p><strong>Learn:</strong></p>

<p>Phase creates steering/nulls</p>

<p>The environment matters a lot</p>

<h3 id="experiment-11-yagi-basics-vhf-is-much-easier-than-hf">Experiment 11: Yagi basics (VHF is much easier than HF)</h3>

<p><strong>Goal:</strong> Build a small Yagi you can actually manage on a bench.</p>

<p>Pick an easy band:</p>

<p>Something like 2 m (144 MHz) if you’re licensed, or receive-only</p>

<p>Build a 3-element Yagi from tape measure steel or aluminum rod</p>

<p>Use NanoVNA for feedpoint match</p>

<p><strong>Learn:</strong></p>

<p>Director/reflector tuning and spacing effects</p>

<p>Front-to-back ratio, pattern shaping</p>

<h2 id="phase-6--nanosa--whats-in-the-air">Phase 6 — NanoSA &amp; “what’s in the air?”</h2>

<h3 id="experiment-12-spectrum-surveying-nanosa">Experiment 12: Spectrum surveying (NanoSA)</h3>

<p><strong>Goal:</strong> Observe real signals and your own sources.</p>

<p><strong>Do:</strong></p>

<p>Use a tiny pickup antenna on NanoSA</p>

<p>Compare noise floor with different antennas, indoors/outdoors</p>

<p>Observe how switching antennas changes signal strength and noise</p>

<p><strong>Learn:</strong></p>

<p>Your antenna is also a noise sensor</p>

<p>Receive performance is often limited by local noise, not antenna gain</p>

<h2 id="phase-7--esp32-controlled-antenna-switching--combining">Phase 7 — ESP32-controlled antenna switching &amp; combining</h2>

<h3 id="experiment-13-simple-antenna-switch-box">Experiment 13: Simple antenna switch box</h3>

<p><strong>Goal:</strong> Select among antennas cleanly and repeatably.</p>

<p>Build:</p>

<p>ESP32 + I²C GPIO expander (or direct pins)</p>

<p>RF relays (or relay modules for HF receive-only; better: RF relays)</p>

<p>Control multiple antennas into one receiver</p>

<p>Learn:</p>

<p>Repeatable A/B comparisons</p>

<p>How to avoid coupling and leakage</p>

<h3 id="experiment-14-two-channel-coherent-sdr--dsp-advanced-but-awesome">Experiment 14: Two-channel coherent SDR + DSP (advanced but awesome)</h3>

<p>Goal: Actually combine antennas (beamforming / noise cancel / diversity).</p>

<p>For true combining, you need two simultaneous, phase-coherent receive channels
(many cheap SDRs aren’t coherent unless designed for it).</p>

<p>Do:</p>

<p>Two antennas into coherent SDR channels</p>

<p>Implement:</p>

<p>Equal-gain combining (phase align + sum)</p>

<p>Maximal ratio combining (weight by SNR)</p>

<p>Adaptive noise cancellation (LMS filter using a “noise antenna”)</p>

<p>Learn:</p>

<p>Why phase coherence matters</p>

<p>Practical beam steering and nulling</p>

<p>(ESP32 can do switching and control, but the math usually runs on a PC/SBC.)</p>

<p>A good “starter kit” list (minimal but powerful)</p>

<p>Wire, ferrite cores, coax + connectors</p>

<p>Schottky diode + caps/resistors for detector probes</p>

<p>NanoVNA (for S11/impedance)</p>

<p>NanoSA (for spectrum “what changed?” checks)</p>

<p>A known signal source (legal TX, or later a small oscillator / VNA output)</p>

<p>Notebook + repeatable test setup (same location/height each time)</p>

<p>If you want a super practical 1-week plan</p>

<ul>
  <li>Day 1: pickup loop + diode detector; measure vs distance/orientation</li>
  <li>Day 2: resonant loop with capacitor; find peak; observe hand detune</li>
  <li>Day 3: NanoVNA: measure loop resonance and dipole resonance</li>
  <li>Day 4: build dipole + choke; measure height/environment changes</li>
  <li>Day 5: build L-match; match something “bad” to 50 Ω</li>
  <li>Day 6: two-antenna A/B switch; measure noise + signal differences</li>
  <li>Day 7: build directional (small loop nulling or simple 2-element)</li>
</ul>

<p>If you tell me roughly what bands you’re aiming for (e.g., 27 MHz CB, HF ham,
VHF/UHF), I’ll tailor the exact dimensions (loop size/turns, dipole lengths,
spacing) and a simple measurement worksheet so each experiment produces clear
“before/after” results.</p>

<hr />

<h2 id="option-a-pivot-toward-a-metal-detector">Option A: Pivot toward a metal detector</h2>

<p>A metal detector is basically near-field electromagnetics + sensing + DSP, not
far-field radio. That’s great because it’s easier to do controlled experiments.</p>

<p>Two good project “tracks”
1) VLF induction-balance (classic hobby detector)</p>

<p>Idea: Transmit a steady sinusoid (often ~5–20 kHz) into a TX coil. A nearby RX
coil is arranged so the direct coupling cancels (“balanced”). Metal nearby
changes the field → imbalance → measurable signal.</p>

<p>What you build</p>

<p>Coils: TX + RX (often overlapping “DD” coils or concentric coils), plus a rigid mount.</p>

<p>Analog front-end: low-noise amplifier for RX, notch/balance trim, bandpass filter.</p>

<p>DSP (ESP32 is enough here):</p>

<p>Generate a clean sine (DAC or PWM + filter)</p>

<p>Synchronous detection (lock-in / I/Q demod): multiply RX by sin/cos reference,
low-pass → you get I and Q</p>

<p>Use phase (Q vs I) to distinguish ferrous/non-ferrous tendencies and amplitude
for strength/depth-ish</p>

<p>Auto ground-balance (slowly adapt the DC offsets of I/Q)</p>

<p>Why it’s a great final</p>

<p>It’s very “signal processing”: lock-in detection, adaptive filtering, classification.</p>

<p>Clear demo: find coins, distinguish materials, show depth curves.</p>

<p>2) Pulse Induction (PI) detector (excellent “DSP &amp; timing” project)</p>

<p>Idea: Blast a coil with current pulses, then listen to the decay. Metal changes
the decay curve.</p>

<p>What you build</p>

<p>Power stage: MOSFET switch, current pulse into coil</p>

<p>RX window: after the pulse, measure coil ring-down / decay at precise times</p>

<p>DSP:</p>

<p>Sample at fixed delays (“time gates”)</p>

<p>Average many pulses (coherent averaging) to boost SNR</p>

<p>Fit decay constants or compare gate ratios for target ID</p>

<p>Why it’s compelling</p>

<p>Looks “serious engineering”: power electronics + precise sampling + averaging.</p>

<p>Very visible improvements from DSP (stacking/averaging).</p>

<p>Which is easier?
VLF induction-balance is generally simpler and quieter electrically. PI is
awesome but more “power switching noise / layout discipline.”</p>

<h2 id="option-b-antennas-separated-by-km-and-combine-data-over-the-internet-faint-cosmic-signals">Option B: Antennas separated by km and combine data over the internet (faint cosmic signals)</h2>

<p>What you’re describing is basically radio interferometry, and in the extreme
case VLBI (Very Long Baseline Interferometry): multiple receivers far apart,
each timestamping samples using precise clocks, then later correlating the
recordings to extract faint sky signals.</p>

<p>A realistic “student final” version (doable without a radio observatory budget)
Step 1: Choose an easy signal target</p>

<p>Cosmic signals are real but hard. Pick one of these levels:</p>

<p>Level 1 (easiest demo): correlate a known transmitter (a beacon you can legally
use, or a satellite) across two sites. Proves the method.</p>

<p>Level 2: correlate strong natural sources:</p>

<p>The Sun (radio noise bursts / broadband emission) is the most approachable
natural source.</p>

<p>The Milky Way background is possible at some frequencies but needs good
receivers/antennas and low noise.</p>

<p>Level 3 (hard): hydrogen line (1420 MHz) or pulsars—possible, but it’s a bigger
telescope/receiver problem.</p>

<p>Step 2: Hardware per site</p>

<p>Antenna (directional helps), LNA if needed, bandpass filter</p>

<p>SDR that can stream raw I/Q (lots of options)</p>

<p>A GPS-disciplined oscillator (GPSDO) or at least a stable reference clock input</p>

<p>A way to timestamp samples:</p>

<p>Ideally: sample clock locked to GPSDO and timestamps derived from 1PPS</p>

<p>Or: record I/Q continuously and align later using cross-correlation (works if
drift isn’t too wild)</p>

<p>Step 3: Data pipeline</p>

<p>Raw I/Q data rates get big quickly:</p>

<p>Example: 2 Msps complex, 8-bit I+Q → ~4 MB/s → ~14 GB/hour per site.
So you usually:</p>

<p>Record locally (fast SSD)</p>

<p>Upload subsets or ship drives</p>

<p>Or reduce bandwidth (narrowband channelize first)</p>

<p>Step 4: The core DSP: correlation</p>

<p>You’ll build an “FX correlator” style pipeline:</p>

<p>F stage: FFT channelization into frequency bins</p>

<p>X stage: cross-multiply spectra between sites and integrate</p>

<p>Peak appears when you apply the correct time delay and fringe rate corrections
(Earth rotation causes phase to wind)</p>

<p>Even a simpler time-domain cross-correlation works for narrowband demo signals.</p>

<p>Step 5: Why atomic clocks / GPS matter</p>

<p>For km baselines, the killer is time and phase coherence:</p>

<p>To correlate faint signals, you need to know the relative timing to within a
small fraction of the sample period and keep clocks from drifting.</p>

<p>GPS gives you:</p>

<p>1PPS timing</p>

<p>A disciplined frequency reference (GPSDO)</p>

<p>True “atomic clock” quality isn’t required at km scale for a demo, but
stability helps a lot.</p>

<p>What’s the “benefit” of the km separation?</p>

<p>With multiple antennas separated by baseline B, you effectively get angular
resolution like a telescope of diameter ~B.</p>

<p>You trade “one big dish” for “many smaller dishes + math.”</p>

<p>The honest difficulty</p>

<p>Building a proof of concept interferometer is very doable. Detecting really
faint cosmic sources is where receiver noise, RFI, calibration, and antenna
design become the main battle.</p>

<p>How to scope a final project so it actually finishes
If you want something you can demo reliably:</p>

<p>Metal detector (VLF or PI) is the best “guaranteed win”:</p>

<p>Controlled environment</p>

<p>Strong signals</p>

<p>Clear performance metrics</p>

<p>If you want something that screams “radio astronomy / advanced DSP”:</p>

<p>Do a two-site correlator with a known signal, and optionally show a natural
target (Sun) as a stretch goal.</p>

<p>A very clean project statement could be:</p>

<p>“Build a two-node, GPS-disciplined SDR system and implement cross-correlation
to estimate time delay / direction-of-arrival, demonstrating interferometry
principles.”</p>

<p>Pick your adventure (no more questions needed—here are two ready-to-run project
outlines)</p>

<h3 id="final-a-metal-detector-dsp-heavy">Final A (Metal detector, DSP-heavy)</h3>

<p>Build TX/RX coils + analog front end</p>

<p>Implement lock-in I/Q demod on ESP32</p>

<p>Add auto ground balance + target classification (phase/amplitude features)</p>

<p>Quantify detection depth vs coil size and frequency</p>

<p>Final B (Distributed antennas, internet correlation)</p>

<p>Two SDR stations km apart</p>

<p>GPSDO + 1PPS disciplined capture</p>

<p>Record I/Q, upload, correlate (FFT → cross-power spectrum)</p>

<p>Demonstrate delay estimation and “beam”/direction inference for a known signal; stretch: Sun</p>

<p>If you tell me which direction you’re leaning (metal detector vs distributed
interferometry), I’ll turn it into a concrete build plan with block diagrams,
parts lists at “hobby budget” level, and a week-by-week test checklist.</p>

<hr />

<p>8 simple transistor circuits (build these first)
Circuit 1 — NPN low-side LED switch (transistor as a switch)</p>

<p>Use: any general NPN (2N2222/2N3904/BC547/etc.)</p>

<p>VCC = 5–12 V</p>

<p>LED + RLED from VCC to collector</p>

<p>Emitter to GND</p>

<p>Base via RB = 4.7k–22k from MCU/switch</p>

<p>Add 100k base-to-GND to keep it off</p>

<p>RLED:</p>

<p>5 V: 330–1k</p>

<p>9–12 V: 1k–3.3k</p>

<p>Circuit 2 — PNP high-side switch (turn loads on from the “top”)</p>

<p>Use: any general PNP (2N3906/A1015/BC557/etc.)</p>

<p>Emitter to VCC</p>

<p>Collector to load → then to GND</p>

<p>Base via RB = 4.7k–22k to a control signal that can pull the base down</p>

<p>Add 100k base-to-VCC to keep it off</p>

<p>Tip: easiest control is an NPN transistor pulling the PNP base down (two-transistor high-side driver).</p>

<p>Circuit 3 — Two-transistor astable LED flasher (classic)</p>

<p>Use: 2× NPN (or 2× PNP, mirrored)</p>

<p>Two NPNs cross-coupled with caps.</p>

<p>For each side:</p>

<p>Collector resistor RC = 1k–4.7k to VCC (LED can be in series here)</p>

<p>Base resistor RB = 47k–220k to VCC</p>

<p>Coupling capacitor C = 1µF–10µF from opposite collector to base</p>

<p>Blink rate scales with RB × C.</p>

<p>Circuit 4 — One-transistor audio preamp (common-emitter)</p>

<p>Use: low-noise-ish small-signal NPN (BC549/BC550/2N3904/C1815/etc.)</p>

<p>VCC: 9 V (works 5–12 V with tweaks)</p>

<p>Bias: R1 = 100k (VCC→base), R2 = 22k (base→GND)</p>

<p>RE = 1k (emitter→GND) + optional bypass CE = 47µF for more gain</p>

<p>RC = 4.7k (collector→VCC)</p>

<p>Input cap Cin = 100nF–1µF into base</p>

<p>Output cap Cout = 1µF–10µF from collector to next stage</p>

<p>This is a great “learn transistor gain/bias” circuit.</p>

<p>Circuit 5 — Emitter follower buffer (voltage follower)</p>

<p>Use: any NPN (or PNP inverted)</p>

<p>Collector to VCC</p>

<p>Base = input via 1k–10k</p>

<p>Emitter = output</p>

<p>Add RE = 1k–10k from emitter to GND (sets bias/load)</p>

<p>Use it to buffer a sensor/pot into something higher load.</p>

<p>Circuit 6 — Constant current sink (simple LED driver / bias source)</p>

<p>Use: any NPN; BC517 makes it easy for tiny base currents</p>

<p>Put a reference on base (e.g., 2× diode drops or a small trimpot divider)</p>

<p>Emitter resistor RE sets current:</p>

<p>Example: set base ≈ 1.3 V with two diodes → with RE=68Ω gives ~9 mA.</p>

<p>Circuit 7 — Simple transistor “logic”: inverter + Schmitt-ish trigger</p>

<p>Use: any NPN</p>

<p>NPN inverter: collector resistor 10k to VCC, emitter to GND, output at collector, input through 10k to base, plus 100k base-to-GND.</p>

<p>Add positive feedback (470k–1M from collector to base) to create hysteresis (Schmitt-ish) for clean switching from slow signals.</p>

<p>Circuit 8 — RF “sniffer” / field-strength probe (receiver-ish, very simple)</p>

<p>Use: fast-ish NPNs like 2N3904 / BC547 / BC337 work fine for a probe</p>

<p>Make a tiny pickup loop (1–3 turns, 1–2 cm diameter) into a diode detector OR transistor detector.</p>

<p>Easiest version:</p>

<p>Loop → 1N4148 (or Schottky if you have) → 10nF to GND → meter input</p>

<p>“Transistorized” boost:</p>

<p>Loop into base via 10pF–100pF, bias base lightly (1M to GND), use Circuit 4-ish but with small caps.
This won’t be calibrated, but it’s great for “is it transmitting?” and comparing antennas.</p>

<p>(If you later transmit, keep it legal for your region/band.)</p>

<p>Which transistors to use for what (a few circuits each)</p>

<p>I’m grouping by what they’re best at, but I’ll still list every part you showed.</p>

<p>General-purpose NPN (great starters)</p>

<p>2N2222, 2N3904, C945, C1815, S9013, S9014, S9015, BC547, BC548, BC337, S8050, BC517</p>

<p>Good circuits: 1 (switch), 3 (flasher), 5 (buffer), 7 (logic)</p>

<p>Also good: 4 (audio preamp) for the “quieter” ones (BC547/548/549/550, 2N3904, C1815)</p>

<p>Notes:</p>

<p>2N2222 / BC337 / S8050: generally happier with a bit more current (switching
small relays, brighter LEDs) → circuits 1, 3, 6, 7</p>

<p>BC517 (Darlington NPN): very high gain → excellent for 6 (constant current) and
driving loads with tiny base current in 1. Not ideal for RF.</p>

<p>“Low-noise / small-signal” NPN (nice for amplifiers)</p>

<p>BC549, BC550</p>

<p>Good circuits: 4 (audio preamp), 5 (buffer), 7 (Schmitt-ish)</p>

<p>Also fine for 1/3, but you’ll mainly enjoy them in amplifier roles.</p>

<p>Higher-voltage NPN</p>

<p>2N5551</p>

<p>Good circuits: 4 (preamp at higher supply), 7 (logic at higher supply), 6 (current sink)</p>

<p>Use it when you want to play with 12–30 V supplies more comfortably than some of the others.</p>

<p>General-purpose PNP (great starters)</p>

<p>2N3906, A1015, S8550, S9012, BC327, BC556, BC557, BC558</p>

<p>Good circuits: 2 (high-side switch), 3 (flasher mirrored as PNP), 5 (PNP follower inverted)</p>

<p>Notes:</p>

<p>S8550 / BC327: often better for higher current PNP switching → circuits 2, 3</p>

<p>BC556/557/558: great for small-signal biasing and amplifier pairs (e.g., complementary stages later).</p>

<p>Higher-voltage PNP</p>

<p>2N5401</p>

<p>Good circuits: 2 (high-side at higher supply), 6 (current source style), and
complementary amplifier experiments with 2N5551.</p>

<p>What I’d build first (fastest learning curve)</p>

<p>Circuit 1 with 2N2222 (LED switch)</p>

<p>Circuit 3 with 2× 2N3904 (blinker)</p>

<p>Circuit 4 with BC549/BC550 (audio preamp)</p>

<p>Circuit 2 with 2N3906 (high-side switch)</p>

<p>Circuit 7 with BC547 (clean digital switching)</p>

<p>Circuit 6 with BC517 (constant current)</p>]]></content><author><name></name></author><category term="Radio," /><category term="electronics" /><summary type="html"><![CDATA[Plan for learning radio and electronics]]></summary></entry><entry><title type="html">Ruxmon meetup</title><link href="saramic.github.io/learning/hacking,/security/2026/02/27/ruxmon-meetup.html" rel="alternate" type="text/html" title="Ruxmon meetup" /><published>2026-02-27T18:00:00+11:00</published><updated>2026-02-27T18:00:00+11:00</updated><id>saramic.github.io/learning/hacking,/security/2026/02/27/ruxmon-meetup</id><content type="html" xml:base="saramic.github.io/learning/hacking,/security/2026/02/27/ruxmon-meetup.html"><![CDATA[<h2 id="ruxmon-meetup">Ruxmon Meetup</h2>

<p>Went to the Melbourne Ruxmon meetup <a href="https://www.meetup.com/ruxmon/events/313290893/">1. Glitter nail polish vs the Evil Maid,
the Story 2. I put CVE in your
CVE</a></p>

<p>@hoodiePony gave an intersting talk on cirumventing tamper detection</p>

<p>also has taken part in <a href="https://2025.chcon.nz/">CH Con New Zealand hacker con</a></p>

<ul>
  <li>
    <p>https://www.youtube.com/c/chconnz - looks like a treasure trove of videos</p>
  </li>
  <li>
    <p>https://www.linkedin.com/company/chcon-nz/?originalSubdomain=nz</p>
  </li>
</ul>

<p>On the nail polish presentation</p>

<ul>
  <li>https://www.vice.com/en/article/itll-take-more-than-glitter-nail-polish-to-stop-snooping/</li>
  <li>https://fahrplan.events.ccc.de/congress/2013/Fahrplan/events/5600.html</li>
  <li>https://boingboing.net/2013/12/31/glitter-nail-polish-is-the-bes-2.html</li>
  <li>https://www.wired.com/2013/12/better-data-security-nail-polish/</li>
  <li>https://mullvad.net/en/blog/how-tamper-protect-laptop-nail-polish</li>
  <li>https://www.anarsec.guide/posts/tamper/</li>
  <li><strong>Detect Physical Computer Tampering - 🥷 RTP Tech Tips 📡</strong>
<a href="https://youtu.be/D4xX435nBdg"><img src="http://img.youtube.com/vi/D4xX435nBdg/0.jpg" alt="
  Detect Physical Computer Tampering - 🥷 RTP Tech Tips 📡
" /></a></li>
</ul>

<p>similar style of presentation although virtual:</p>

<p><strong>DEF CON 31 DCGVR Village - hoodiepony - Ghost On The Wire -
DEFCONConference</strong>
<a href="https://youtu.be/6ATtAmOhdE0"><img src="http://img.youtube.com/vi/6ATtAmOhdE0/0.jpg" alt="
  DEF CON 31 DCGVR Village - hoodiepony - Ghost On The Wire - DEFCONConference
" /></a></p>

<h2 id="on-learning-from-cves">On learning from CVE’s</h2>

<p>@Snyff (<a href="https://pentesterlab.com/">Pentesterlab.com</a>) did an interesting talk
on looking at finding new CVE’s inside of existing CVE’s. The general premise
being that people are publishing CVE’s and fixes and often the fixes are not
that good and the code around them is likely to have more security
vulnerabilities. This could lead to having CVE’s that are attributed to you!</p>

<p>The talk covered things like</p>

<h3 id="cve-2023-28109">CVE-2023-28109</h3>

<p><a href="https://github.com/play-with-docker/play-with-docker/security/advisories/GHSA-vq59-5x26-h639">Authorization Bypass Through User-Controlled Key play-with-docker</a></p>

<p><a href="https://github.com/play-with-docker/play-with-docker/commit/ed82247c9ab7990ad76ec2bf1498c2b2830b6f1a">https://github.com/play-with-docker/play-with-docker/commit/ed82247c9ab7990ad76ec2bf1498c2b2830b6f1a</a></p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gh">diff a/handlers/bootstrap.go b/handlers/bootstrap.go
</span><span class="gd">--- a/handlers/bootstrap.go
</span><span class="gi">+++ b/handlers/bootstrap.go
</span><span class="p">@@ -69,10 +70,10 @@</span>
<span class="p">func Register(extend HandlerExtender) {
</span>  corsHandler := gh.CORS(gh.AllowCredentials(), gh.AllowedHeaders([]string{"x-requested-with", "content-type"}), gh.AllowedMethods([]string{"GET", "POST", "HEAD", "DELETE"}), gh.AllowedOriginValidator(func(origin string) bool {
    if strings.Contains(origin, "localhost") ||
<span class="gd">-      strings.HasSuffix(origin, "play-with-docker.com") ||
-      strings.HasSuffix(origin, "play-with-kubernetes.com") ||
-      strings.HasSuffix(origin, "docker.com") ||
-      strings.HasSuffix(origin, "play-with-go.dev") {
</span><span class="gi">+      strings.HasSuffix(origin, ".play-with-docker.com") ||
+      strings.HasSuffix(origin, ".play-with-kubernetes.com") ||
+      strings.HasSuffix(origin, ".docker.com") ||
+      strings.HasSuffix(origin, ".play-with-go.dev") {
</span>      return true
    }
    return false
</code></pre></div></div>

<p>But a better fix would have been to allow the bare/apex domains to match as
well. Better still treat them as a Path/URL and not a string, where you could
do a proper root-domain match.</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gi">+      origin == "play-with-docker.com" ||
+      strings.HasSuffix(origin, ".play-with-docker.com") ||
+      origin == "play-with-kubernetes.com" ||
+      strings.HasSuffix(origin, ".play-with-kubernetes.com") ||
+      origin == "docker.com" ||
+      strings.HasSuffix(origin, ".docker.com") ||
+      origin == "play-with-go.dev" ||
+      strings.HasSuffix(origin, ".play-with-go.dev") {
</span></code></pre></div></div>

<p>Looking around the change, another issue is found, the match on</p>

<p><code class="language-plaintext highlighter-rouge">Contains(origin, "localhost")</code></p>

<p>opens a bunch of issues around <strong>ANY</strong> url with the term <code class="language-plaintext highlighter-rouge">localhost</code></p>

<div class="language-go highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">func</span> <span class="n">Register</span><span class="p">(</span><span class="n">extend</span> <span class="n">HandlerExtender</span><span class="p">)</span> <span class="p">{</span>
  <span class="n">corsHandler</span> <span class="o">:=</span> <span class="n">gh</span><span class="o">.</span><span class="n">CORS</span><span class="p">(</span><span class="n">gh</span><span class="o">.</span><span class="n">AllowCredentials</span><span class="p">(),</span> <span class="n">gh</span><span class="o">.</span><span class="n">AllowedHeaders</span><span class="p">([]</span><span class="kt">string</span><span class="p">{</span><span class="s">"x-requested-with"</span><span class="p">,</span> <span class="s">"content-type"</span><span class="p">}),</span> <span class="n">gh</span><span class="o">.</span><span class="n">AllowedMethods</span><span class="p">([]</span><span class="kt">string</span><span class="p">{</span><span class="s">"GET"</span><span class="p">,</span> <span class="s">"POST"</span><span class="p">,</span> <span class="s">"HEAD"</span><span class="p">,</span> <span class="s">"DELETE"</span><span class="p">}),</span> <span class="n">gh</span><span class="o">.</span><span class="n">AllowedOriginValidator</span><span class="p">(</span><span class="k">func</span><span class="p">(</span><span class="n">origin</span> <span class="kt">string</span><span class="p">)</span> <span class="kt">bool</span> <span class="p">{</span>
    <span class="c">// ⚠️️ ⚠️ ⚠️️️️️ what about http://localhostpentesterlab.com ???</span>
    <span class="k">if</span> <span class="n">strings</span><span class="o">.</span><span class="n">Contains</span><span class="p">(</span><span class="n">origin</span><span class="p">,</span> <span class="s">"localhost"</span><span class="p">)</span> <span class="o">||</span>
      <span class="n">strings</span><span class="o">.</span><span class="n">HasSuffix</span><span class="p">(</span><span class="n">origin</span><span class="p">,</span> <span class="s">".play-with-docker.com"</span><span class="p">)</span> <span class="o">||</span>
      <span class="n">strings</span><span class="o">.</span><span class="n">HasSuffix</span><span class="p">(</span><span class="n">origin</span><span class="p">,</span> <span class="s">".play-with-kubernetes.com"</span><span class="p">)</span> <span class="o">||</span>
      <span class="n">strings</span><span class="o">.</span><span class="n">HasSuffix</span><span class="p">(</span><span class="n">origin</span><span class="p">,</span> <span class="s">".docker.com"</span><span class="p">)</span> <span class="o">||</span>
      <span class="n">strings</span><span class="o">.</span><span class="n">HasSuffix</span><span class="p">(</span><span class="n">origin</span><span class="p">,</span> <span class="s">".play-with-go.dev"</span><span class="p">)</span> <span class="p">{</span>
      <span class="k">return</span> <span class="no">true</span>
    <span class="p">}</span>
    <span class="k">return</span> <span class="no">false</span>
</code></pre></div></div>

<blockquote>
  <p>The learnings:</p>

  <ul>
    <li>Look around the change</li>
    <li>string matching is hard</li>
  </ul>
</blockquote>

<h3 id="cve-2024-31860">CVE-2024-31860</h3>

<p><a href="https://github.com/advisories/GHSA-g64r-xf39-q4p5">Apache Zeppelin Path Traversal vulnerability</a></p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- zeppelin-server/src/main/java/org/apache/zeppelin/service/NotebookService.java
</span><span class="gi">+++ zeppelin-server/src/main/java/org/apache/zeppelin/service/NotebookService.java
</span>  import static org.apache.zeppelin.scheduler.Job.Status.ABORT;

  import java.io.IOException;
<span class="gi">+ import java.net.URLDecoder;
+ import java.nio.charset.StandardCharsets;
</span>  import java.text.ParseException;
  import java.text.SimpleDateFormat;
  import java.time.Instant;
    }

    notePath = notePath.replace("\r", " ").replace("\n", " ");
<span class="gi">+
+   notePath = URLDecoder.decode(notePath, StandardCharsets.UTF_8.toString());
+   if (notePath.endsWith("/")) {
+     throw new IOException("Note name shouldn't end with '/'");
+   }
+
</span>    int pos = notePath.lastIndexOf("/");
    if ((notePath.length() - pos) &gt; 255) {
      throw new IOException("Note name must be less than 255");
</code></pre></div></div>

<p>The problem here being that this will prevent directory traversal using <code class="language-plaintext highlighter-rouge">%2e%2e</code>
by decoding the value. They only decode the value <strong>once</strong> so if we recursively
encode the value with say <code class="language-plaintext highlighter-rouge">%252e%252e</code> we get past the fix.</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># single encoding</span>
<span class="nb">echo</span> <span class="s2">"%2e%2e/%2e%2e/etc/passwd"</span> | <span class="se">\</span>
  ruby <span class="nt">-r</span> cgi <span class="nt">-e</span> <span class="s1">'puts CGI.unescape($stdin.read)'</span>

../../etc/passwd

<span class="c"># double encoding</span>
<span class="nb">echo</span> <span class="s2">"%252e%252e/%252e%252e/etc/passwd"</span> | <span class="se">\</span>
  ruby <span class="nt">-r</span> cgi <span class="nt">-e</span> <span class="s1">'puts CGI.unescape($stdin.read)'</span>

%2e%2e/%2e%2e/etc/passwd

<span class="c"># tripple encoding</span>
<span class="nb">echo</span> <span class="s2">"%25252e%25252e/%25252e%25252e/etc/passwd"</span> | <span class="se">\</span>
  ruby <span class="nt">-r</span> cgi <span class="nt">-e</span> <span class="s1">'puts CGI.unescape($stdin.read)'</span>

%252e%252e/%252e%252e/etc/passwd

<span class="c"># a recurisve solution (applied to tripple encoding)</span>
 <span class="nb">echo</span> <span class="s2">"%25252e%25252e/%25252e%25252e/etc/passwd"</span> | ruby <span class="nt">-r</span> cgi <span class="nt">-e</span> <span class="s1">'
def recursive_decode(input)
  decoded = CGI.unescape(input)
  while decoded != input
    input = decoded
    decoded = CGI.unescape(input)
  end
  decoded
end
puts recursive_decode($stdin.read)'</span>

../../etc/passwd
</code></pre></div></div>

<blockquote>
  <p>The learnings:</p>

  <ul>
    <li>recursive filtering</li>
  </ul>
</blockquote>

<h3 id="ghsa-8g98-m4j9-qww5">GHSA-8g98-m4j9-qww5</h3>

<p><a href="https://github.com/advisories/GHSA-8g98-m4j9-qww5">GHSA-8g98-m4j9-qww5 Taylored webhook validation
vulnerabilities</a></p>

<p>https://github.com/tailot/taylored/commit/57b7634391959dbbdb39b387ac4dc68157cd58a1#diff-67dab5650d08966d480460df1e79b263c9b69a24ebffd30179374a9f6bbc990b</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gi">+ db.get(`SELECT id, patch_id, purchase_token, status, token_used_at
+         FROM purchases WHERE patch_id = ? AND purchase_token = ? AND status = 'COMPLETED'`,
</span>
  # -- SNIP --
<span class="gi">+
+ db.run(`UPDATE purchases SET token_used_at = CURRENT_TIMESTAMP
+         WHERE id = ?`, [row.id], function(updateErr) {
</span></code></pre></div></div>

<p>This reduced the attack but did not get rid of it completely, just reduced the
likely hood as there would still be a chance for an attack if timing could work.
The real solution would be to have this in a transaction or a single query get
AND set. This was fixed in</p>

<ul>
  <li><strong><a href="https://github.com/advisories/GHSA-vh5j-5fhq-9xwg">GHSA-vh5j-5fhq-9xwg</a></strong></li>
</ul>

<p>but NO CVE given - “emotional damage” to the creator</p>

<blockquote>
  <p>Lessons learned:</p>

  <ul>
    <li>Replay to race condition</li>
  </ul>
</blockquote>

<h3 id="cve-2025-12762">CVE-2025-12762</h3>

<p><a href="https://github.com/advisories/GHSA-w2p4-p4rh-qcm3">pgAdmin4 vulnerable to Remote Code Execution (RCE) when running in server
mode</a></p>

<blockquote>
  <p>PosgreSQL allows you to run command when importing data using <code class="language-plaintext highlighter-rouge">"\!"</code> at the
start of the line <code class="language-plaintext highlighter-rouge">\! touch /tmp/HACKED</code></p>
</blockquote>

<p>the fix does not match ALL KINDS OF whitespace in the regex and there is a chance of sneaking the characters between chunks, <code class="language-plaintext highlighter-rouge">\</code> at the end of one chunk and <code class="language-plaintext highlighter-rouge">!</code> at beginning of next chunk</p>

<p><a href="https://github.com/pgadmin-org/pgadmin4/commit/1d397395f75320ca1d4ed5e9ca721c603415e836">https://github.com/pgadmin-org/pgadmin4/commit/1d397395f75320ca1d4ed5e9ca721c603415e836</a></p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gi">+    # Look for start-of-line pattern: beginning or after newline,
+    # optional spaces, then backslash
+    pattern = re.compile(br'(^|\n)[ \t]*\\')
</span>
  # -- SNIP --
<span class="gi">+
+     with open(path, "rb") as f:
+       prev_tail = b""
+       while chunk := f.read(chunk_size):
</span></code></pre></div></div>

<blockquote>
  <p>Lessons Learned:</p>
  <ul>
    <li>Regular expressions are hard</li>
    <li>Be greedy when filtering</li>
    <li>People are watching (other people are watching CVE’s and creating CVE’s)</li>
  </ul>
</blockquote>

<h3 id="cve-2024-21643">CVE-2024-21643</h3>

<h3 id="cve-2025-12203">CVE-2025-12203</h3>

<h3 id="cve-2026-25130">CVE-2026-25130</h3>

<h3 id="cve-2026-">CVE-2026-????</h3>

<p>This one intruigued me due to some funky issues with <code class="language-plaintext highlighter-rouge">toLowerCase</code> but I could not seem to find the exact code here</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone git@github.com:github/advisory-database.git

<span class="nb">cd </span>advisory-database

ag <span class="nt">-l</span> 2026-02-27 advisories/unreviewed/2026/02/ | xargs ag domain

advisories/unreviewed/2026/02/GHSA-hcv4-2wj7-9p5g/GHSA-hcv4-2wj7-9p5g.json
  9:  <span class="s2">"details"</span>: <span class="s2">"Unitree Go2 firmware versions V1.1.7 through V1.1.9 and
  V1.1.11 (EDU) do not implement DDS authentication or authorization for the
  Eclipse CycloneDDS topic rt/api/programming_actuator/request handled by
  actuator_manager.py. A network-adjacent, unauthenticated attacker can join DDS
  domain 0 and publish a crafted message (api_id=1002) containing arbitrary
  Python, which the robot writes to disk under /unitree/etc/programming/ and
  binds to a physical controller keybinding. When the keybinding is pressed, the
  code executes as root and the binding persists across reboots."</span>,

advisories/unreviewed/2026/02/GHSA-j5mf-6rh3-rhgg/GHSA-j5mf-6rh3-rhgg.json
  9:  <span class="s2">"details"</span>: <span class="s2">"CleverTap Web SDK version 1.15.2 and earlier is vulnerable to
  Cross-Site Scripting (XSS) via window.postMessage. The
  handleCustomHtmlPreviewPostMessageEvent function in
  src/util/campaignRender/nativeDisplay.js performs insufficient origin
  validation using the includes() method, which can be bypassed by an attacker
  using a subdomain"</span>,

advisories/unreviewed/2026/02/GHSA-jfrq-hj9f-c8qx/GHSA-jfrq-hj9f-c8qx.json
  9:  <span class="s2">"details"</span>: <span class="s2">"CleverTap Web SDK version 1.15.2 and earlier is vulnerable to
  DOM-based Cross-Site Scripting (XSS) via window.postMessage in the Visual
  Builder module. The origin validation in
  src/modules/visualBuilder/pageBuilder.js (lines 56-60) uses the includes()
  method to verify the originUrl contains </span><span class="se">\"</span><span class="s2">dashboard.clevertap.com</span><span class="se">\"</span><span class="s2">, which can
  be bypassed by an attacker using a crafted subdomain"</span>,
</code></pre></div></div>

<p>And even with some AI help it suggested the <strong>CleverTap Web SDK</strong> but the code
is as below and seems unrelated ¯_(ツ)_/¯</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/lib/controllers/xxxxx.js
</span><span class="gi">+++ b/lib/controllers/xxxxx.js
</span><span class="p">@@ -94,9 +94,9 @@</span> module.exports = function (options) {
     host = host.toLowerCase();
     //check that host is from one of these domains
     for (var i = 0; i &lt; allowedDomains.length; i++) {
<span class="gi">+      const domainLower = allowedDomains[i].toLowerCase();
</span>       if (
<span class="gd">-       host.indexOf(allowedDomains[i], host.length - allowedDomains[i].length)!== -1
</span><span class="gi">+       host === domainLower || host.endsWith("." + domainLower)
</span>       ) {
         return true;
       }
</code></pre></div></div>

<p>The intruigue here is that <code class="language-plaintext highlighter-rouge">toLowerCase</code> in many languages may convert unicode
to ASCII and the same can be true for when using regular expressions</p>

<p><strong>In Ruby</strong></p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ruby <span class="nt">-e</span> <span class="s1">'(0..0x10FFFF).each do |cp|
  next if (0xD800..0xDFFF) === cp         # skip surrogate pairs
  c = [cp].pack("U")                      # convert codepoint to UTF-8 character
  next if c =~ /\A[\x20-\x7e]+\z/         # skip already-ASCII characters
  u = c.upcase; d = c.downcase            # case-fold both directions
                                          # emit if upcase yields ASCII
  puts "U+#{"%04X"%cp} #{c} -&gt; upcase=#{u}" if u != c &amp;&amp; u =~ /\A[\x20-\x7e]+\z/
                                          # emit if downcase yields ASCII
  puts "U+#{"%04X"%cp} #{c} -&gt; downcase=#{d}" if d != c &amp;&amp; d =~ /\A[\x20-\x7e]+\z/
end'</span>

U+00DF ß -&gt; <span class="nv">upcase</span><span class="o">=</span>SS
U+0131 ı -&gt; <span class="nv">upcase</span><span class="o">=</span>I
U+017F ſ -&gt; <span class="nv">upcase</span><span class="o">=</span>S
U+212A K -&gt; <span class="nv">downcase</span><span class="o">=</span>k
U+FB00 ﬀ -&gt; <span class="nv">upcase</span><span class="o">=</span>FF
U+FB01 ﬁ -&gt; <span class="nv">upcase</span><span class="o">=</span>FI
U+FB02 ﬂ -&gt; <span class="nv">upcase</span><span class="o">=</span>FL
U+FB03 ﬃ -&gt; <span class="nv">upcase</span><span class="o">=</span>FFI
U+FB04 ﬄ -&gt; <span class="nv">upcase</span><span class="o">=</span>FFL
U+FB05 ﬅ -&gt; <span class="nv">upcase</span><span class="o">=</span>ST
U+FB06 ﬆ -&gt; <span class="nv">upcase</span><span class="o">=</span>ST
</code></pre></div></div>

<p>and <strong>In JavaScript</strong></p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>node <span class="nt">-e</span> <span class="s1">'for (let cp = 0; cp &lt;= 0x10FFFF; cp++) {
  if (cp &gt;= 0xD800 &amp;&amp; cp &lt;= 0xDFFF) continue;     // skip surrogate pairs
  const c = String.fromCodePoint(cp);             // convert codepoint to UTF-16 character
  if (/^[\x20-\x7e]+$/.test(c)) continue;         // skip already-ASCII characters
  const u = c.toUpperCase(), d = c.toLowerCase(); // case-fold both directions
                                                  // emit if toUpperCase yields ASCII
  if (u !== c &amp;&amp; /^[\x20-\x7e]+$/.test(u))
    console.log(`U+${cp.toString(16).toUpperCase().padStart(4,"0")} ${c} -&gt; toUpperCase=${u}`);
                                                  // emit if toLowerCase yields ASCII
  if (d !== c &amp;&amp; /^[\x20-\x7e]+$/.test(d))
    console.log(`U+${cp.toString(16).toUpperCase().padStart(4,"0")} ${c} -&gt; toLowerCase=${d}`);
}'</span>

U+00DF ß -&gt; <span class="nv">toUpperCase</span><span class="o">=</span>SS
U+0131 ı -&gt; <span class="nv">toUpperCase</span><span class="o">=</span>I
U+017F ſ -&gt; <span class="nv">toUpperCase</span><span class="o">=</span>S
U+212A K -&gt; <span class="nv">toLowerCase</span><span class="o">=</span>k
U+FB00 ﬀ -&gt; <span class="nv">toUpperCase</span><span class="o">=</span>FF
U+FB01 ﬁ -&gt; <span class="nv">toUpperCase</span><span class="o">=</span>FI
U+FB02 ﬂ -&gt; <span class="nv">toUpperCase</span><span class="o">=</span>FL
U+FB03 ﬃ -&gt; <span class="nv">toUpperCase</span><span class="o">=</span>FFI
U+FB04 ﬄ -&gt; <span class="nv">toUpperCase</span><span class="o">=</span>FFL
U+FB05 ﬅ -&gt; <span class="nv">toUpperCase</span><span class="o">=</span>ST
U+FB06 ﬆ -&gt; <span class="nv">toUpperCase</span><span class="o">=</span>ST
</code></pre></div></div>

<p>clearly <code class="language-plaintext highlighter-rouge">facebooK.com</code>, with a Kelvin K is not <code class="language-plaintext highlighter-rouge">facebook.com</code></p>

<blockquote>
  <p>Lessons Learned</p>
  <ul>
    <li>Matching is hard</li>
    <li>Even simple modifications can have security impacts.</li>
    <li>Don’t just look at change, look around it</li>
  </ul>
</blockquote>

<p><strong>Easy Bypasses</strong></p>

<ul>
  <li>Bad String Matching</li>
  <li>Case-Sensitivity and Unicode</li>
  <li>SSRF Fix:
    <ul>
      <li>Check for Redirect Support</li>
      <li>Check for DNS Rebinding (Time of Check/Time of Use - TOCTOU)</li>
    </ul>
  </li>
  <li>Directory Traversal Fix:
    <ul>
      <li>Check for <code class="language-plaintext highlighter-rouge">my/path/roo</code> against <code class="language-plaintext highlighter-rouge">my/path/root</code></li>
    </ul>
  </li>
</ul>

<p>Thanks the presenter 🙏</p>

<ul>
  <li>Louis Nyffenegger</li>
  <li><a href="https://x.com/snyff">𝕏 @snyff</a></li>
  <li>https://www.linkedin.com/in/snyﬀ/@snyﬀ</li>
  <li>louis@pentesterlab.com</li>
  <li><a href="https://pentesterlab.com/">PentesterLab.com</a></li>
  <li><a href="https://x.com/PentesterLab">𝕏 @PentesterLab</a></li>
</ul>

<p>Book -&gt; <a href="https://www.amazon.com/CVE-Archeologists-Field-Guide-vulnerability/dp/B0GMVXM7S1">CVE Archeologist’s Field Guide: Methodology and lessons from 10 vulnerability analyses</a></p>

<p>Find vulnerabilities being reported</p>
<ul>
  <li>https://github.com/github/advisory-database</li>
</ul>

<p>But I found there is also</p>]]></content><author><name></name></author><category term="hacking," /><category term="security" /><summary type="html"><![CDATA[Ruxmon Meetup]]></summary></entry></feed>