<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>inti-tidball</title>
    <link>https://inti-tidball.writeas.com/</link>
    <description> code &amp; chaos &amp; a bit of everything else</description>
    <pubDate>Fri, 20 Nov 2026 11:22:55 +0000</pubDate>
    <item>
      <title>IoT System for Environmental Monitoring at Nerdearla: architecture, hardware, and lessons learned</title>
      <link>https://inti-tidball.writeas.com/sistema-iot-para-monitoreo-ambiental-en-nerdearla-arquitectura-hardware-y?pk_campaign=rss-feed</link>
      <description>From the home lab to Nerdearla: how I built an IoT air-quality system that worked at an event with thousands of people — and a network of people that held me up (english version)&#xA;&#xA;I&#39;m very happy to finally share part of the work I&#39;ve been doing over the last month for Nerdearla, together with the Nerdearla team — Eduardo Casarero, Emilio Nagy (Nachi), and Lole.</description>
      <content:encoded><![CDATA[<p><em>From the home lab to Nerdearla: how I built an IoT air-quality system that worked at an event with thousands of people — and a network of people that held me up (english version)</em></p>

<p>I&#39;m very happy to finally share part of the work I&#39;ve been doing over the last month for <strong>Nerdearla</strong>, together with the Nerdearla team — Eduardo Casarero, Emilio Nagy (Nachi), and Lole.</p>



<p>My intention in writing this is also to encourage more girls and women to dare to take on technical challenges like this one.</p>

<p>My main profession is DevOps. In my day-to-day work I mostly deal with infrastructure, automation, observability, and distributed systems.</p>

<p>IoT is something different, and I like it because it forces me to cross worlds that usually appear separate: software, infrastructure, electronics, hardware, and — above all — problems from the physical world.</p>

<p>Since I was a kid I&#39;ve been interested in ecology and in the idea of understanding our environment better. Today I&#39;m especially interested in thinking about how we can use technology to build a slightly better world: more accessible, more aware of its environment, and also kinder to people with sensory sensitivities and neurodivergences.</p>

<p>About a month ago I was invited to develop an IoT system to measure different environmental conditions during this year&#39;s Nerdearla, and then to share in a live interview how to build an air-quality measurement station simply and accessibly.</p>

<p>The truth is I was quite surprised when they wrote to me. I had been working with IoT as part of my Bachelor&#39;s thesis, but I didn&#39;t expect an opportunity like this to come up.</p>

<p>So I said yes.</p>

<p>I immediately turned to my colleagues from AWS Women in Cloud Buenos Aires (WiC), with whom I had been studying Infrastructure at the Universidad de la Marina Mercante. They encouraged me a lot and helped me find the courage to dive fully into the project.</p>

<p>As I started telling people what we were doing, I began to hear very personal reasons why this kind of measurement can matter. Someone told me their dad would love to know the humidity because it affects his joints. Another person told me they have asthma and would like to be able to access this information.</p>

<p>That made the project feel much more real.</p>

<h2 id="from-the-home-lab-to-the-event">From the home lab to the event</h2>

<p>My interest in IoT started a long time ago. Last year I was working with a friend who is a primary school teacher to develop robotics ideas for her nieces. This interest sharpened this year with an IoT course with Agustín Candia at UNLP, which I took as an elective. I liked it so much that I started talking with Agustín and Laura Fava about doing my thesis with them at LINTI (Laboratorio de Investigación en Nuevas Tecnologías Informáticas de la UNLP).</p>

<p>Originally I was thinking about working with water flow meters for a municipality — a very concrete and current problem — when the Nerdearla possibility came up.</p>

<p>I asked Agustín and Laura whether the Nerdearla project could work as a pre-thesis. They told me that at LINTI they were also working on air-quality projects, and that opened a conversation about participating in the existing environmental measurement projects, and about how this could serve as previous experience.</p>

<p>What we have in common is an interest in how we can build environmental measurement systems that are accessible, open, and inexpensive for local communities and cooperatives, and that can eventually scale.</p>

<p>Some ideas also stayed outside this project. For example, I&#39;m especially interested in the immutable signature of measurements, something I had explored in the IoT final project and that I&#39;d like to keep researching.</p>

<h2 id="building-for-a-real-environment">Building for a real environment</h2>

<p>Nerdearla presented challenges very different from the experiments I had done at home.</p>

<p>The scale of the place mattered. So did the fact that we had little time, limited hardware, and very little prior information about how the network and the physical environment would behave once tens of thousands of people were moving through the building.</p>

<p>In my experiments I had found that Wi-Fi transmission peaks when sending MQTT messages could occasionally cause <em>brownouts</em> on some ESP32 boards. A brownout is a momentary voltage drop: the radio asks for a current peak that the power supply can&#39;t deliver, and the board reboots.</p>

<p>Given the limited time available, I decided not to spend effort on solving battery operation, since from previous experience that also requires fine-tuning resource usage, for which there was no time. Instead, I focused on having reliable power supplies and on solving connectivity and storage problems with flash memory and other caching strategies.</p>

<p>We also had different ESP32 boards, including some cheaper ones with shorter-range Wi-Fi. All of them had 2.4 GHz Wi-Fi and Bluetooth. Even if we had had newer boards with 5 GHz Wi-Fi, which has other possibilities, that also requires more electricity. I wasn&#39;t convinced that investing in that would solve the connectivity problem at an event with so many people.</p>

<p>Agustín suggested that we first make sure we had robust power supplies and then work on the software solutions.</p>

<p>It was an important decision.</p>

<h2 id="infrastructure">Infrastructure</h2>

<p>The Nerdearla team wanted to have a centralized virtual host, moving away from the LAN setup for more autonomy during the prior tests.</p>

<p>We considered using a VM on their private server with access through a tunnel, but since the MQTT/Mosquitto scheme uses TCP directly and not HTTP, for this architecture a VM accessible from the Internet made more sense.</p>

<p>I proposed a small <strong>AWS (EC2)</strong> instance with a public IP, enough to run the node backend, the observability, and a small static website where attendees could check which rooms were cooler, had better air, or were quieter.</p>

<p>The backend is a simple <strong>Docker Compose</strong>. The data flow is a single line:</p>

<pre><code>ESP32 nodes  --MQTT/TLS:443--&gt;  Mosquitto  --Telegraf--&gt;  InfluxDB  --Grafana--&gt;  dashboards
</code></pre>

<p>A detail that shaped the whole design: on the venue&#39;s network the only reliable outbound port was 443. So I published the MQTT broker <strong>over TLS directly on 443</strong>, not over HTTP. This is raw encrypted MQTT, not WebSockets:</p>

<pre><code class="language-ini"># mosquitto.conf
allow_anonymous false
password_file /mosquitto/config/passwd

# Internal listener (Docker network only, for Telegraf)
listener 1883 0.0.0.0

# Public listener: MQTT over TLS on 443 (the only port the venue lets out)
listener 443 0.0.0.0
certfile /mosquitto/config/certs/fullchain.pem
keyfile  /mosquitto/config/certs/privkey.pem
</code></pre>

<p>The certificate is from Let&#39;s Encrypt. In each node&#39;s firmware I embed the public root (ISRG Root X1) to validate the broker&#39;s chain, so the connection is encrypted end to end without depending on an intermediate proxy.</p>

<p>I chose <strong>Telegraf</strong> instead of Node-RED because the requirements were relatively simple and, for this case, a configuration-file-based approach fit better. Each node publishes a JSON to a topic of the form <code>iot/&lt;type&gt;/&lt;device&gt;/telemetry</code>; Telegraf consumes it, turns <code>type</code> and <code>device</code> into tags, and uses the payload&#39;s <code>ts</code> as the InfluxDB timestamp:</p>

<pre><code class="language-toml"># telegraf.conf
[[inputs.mqtt_consumer]]
  servers   = [&#34;tcp://mosquitto:1883&#34;]
  topics    = [&#34;iot/+/+/telemetry&#34;]
  data_format    = &#34;json&#34;
  tag_keys       = [&#34;type&#34;, &#34;device&#34;]
  json_time_key  = &#34;ts&#34;         
  json_time_format = &#34;unix&#34;
  name_override  = &#34;telemetry&#34;

[[outputs.influxdb]]
  urls     = [&#34;http://influxdb:8086&#34;]
  database = &#34;iot&#34;
</code></pre>

<p>Having the timestamp set by the node (and not the server) is key: a reading delayed by a Wi-Fi drop is inserted into InfluxDB at the moment it actually happened, not when it arrived. Below I explain how the firmware takes advantage of this.</p>

<p>Observability is <strong>Grafana</strong>, exposed only on <code>localhost</code> and published outward through a tunnel, never opening an extra port. The static site is served by <code>nginx:alpine</code>, and a small Python script queries InfluxDB every 10 seconds and writes a <code>latest.json</code> that the page reads <em>same-origin</em>.</p>

<p>I also had a small creative moment: I gave the site a poetic name with Andean influence, and designed a logo inspired by ideas of environmental awareness, and I worked on the page design with a friend who helped me to lighten the workload.</p>

<p>The backend is provisioned with <strong>Ansible</strong>. The playbook also includes basic <em>hardening</em> measures: SSH by key only, no root, and <code>fail2ban</code>.</p>

<pre><code class="language-yaml"># ansible/roles/hardening/tasks/main.yml
- name: Harden sshd_config (key only, no root)
  ansible.builtin.lineinfile:
    path: /etc/ssh/sshd_config
    regexp: &#39;^#?\s*{{ item.key }}\s+&#39;
    line:   &#39;{{ item.key }} {{ item.value }}&#39;
    validate: /usr/sbin/sshd -t -f %s
  loop:
    - { key: PasswordAuthentication, value: &#39;no&#39; }
    - { key: PermitRootLogin,        value: &#39;no&#39; }
  notify: restart sshd

- name: Install fail2ban
  ansible.builtin.apt: { name: fail2ban, state: present, update_cache: true }
</code></pre>

<p>Secrets live encrypted with <strong>SOPS</strong> and are injected into <code>.env</code> at provision time, never in the repo.</p>

<h2 id="firmware-a-single-base-several-boards">Firmware: a single base, several boards</h2>

<p>Then came the physical part.</p>

<p>We had to get enclosures for the nodes. Some we bought from an online store and others were 3D printed by a volunteer.</p>

<p>We coordinated which components to buy based on the measurements the team wanted to obtain. We ended up using <strong>SCD40/SCD41</strong> sensors (CO₂, temperature, and humidity) and <strong>INMP441 MEMS microphones</strong> (noise level via I2S).</p>

<p>Everything was shipped to my home and I started soldering and wiring.</p>

<p>The microphones were particularly hard to solder. I soldered the first one backwards so I could see the labels more easily.</p>

<p>It worked anyway.</p>

<p>After that I got the hang of it and was able to finish all the nodes on time and right side up, already knowing the labels.</p>

<p>I also had some quite frustrating moments with the cheaper boards. I added a board of my own and bought some <strong>ESP32-C3s</strong> to replace others. The problem is that each ESP32 variant (C3, S3, classic NodeMCU) has different pins and even different I2S peripherals. Instead of maintaining three firmwares, I maintain <strong>just one</strong> and select the board with a <code>#define</code> before flashing:</p>

<pre><code class="language-c">#define BOARD_S3       1
#define BOARD_NODEMCU  2
#define BOARD_C3       3

#define BOARD BOARD_C3   // &lt;-- change per board

#if   BOARD == BOARD_S3
  #define SCD_SDA 8
  #define SCD_SCL 9
  #define I2S_BCK 5
  #define I2S_WS  4
  #define I2S_DIN 6
#elif BOARD == BOARD_NODEMCU
  #define SCD_SDA 21
  #define SCD_SCL 22
  #define I2S_BCK 26
  #define I2S_WS  25
  #define I2S_DIN 33
#elif BOARD == BOARD_C3
  #define SCD_SDA 4     // avoids the C3&#39;s strapping / flash / USB pins
  #define SCD_SCL 5
  #define I2S_BCK 6
  #define I2S_WS  7
  #define I2S_DIN 10
#else
  #error &#34;Define BOARD = BOARD_S3 / BOARD_NODEMCU / BOARD_C3&#34;
#endif
</code></pre>

<p>Details I didn&#39;t expect came up. The same INMP441 microphone read by each chip&#39;s I2S peripheral leaves the 24-bit sample in a different position within the 32-bit word, so the same bit shift gives a different level per board. That&#39;s why I added a <code>MIC_DB_OFFSET</code> to each variant, which I calibrated live against a sound-level-meter app on my phone.</p>

<p>In a future iteration I&#39;d like to be able to count on a professional sound level meter at the same installation location.</p>

<h2 id="surviving-brownouts-store-and-forward-on-the-node">Surviving brownouts: store-and-forward on the node</h2>

<p>The real risk at the event was losing data when the Wi-Fi became intermittent or when a radio peak rebooted a board. I solved it on the node itself, with a <strong>store-and-forward</strong> pattern similar to a database snapshot: a queue in RAM that drains to MQTT, and every 5 minutes, if it changed, a dump to flash memory (LittleFS) to survive a reboot.</p>

<p>Two decisions make it work.</p>

<p>First, drain <strong>little by little, never in a burst</strong>. A Wi-Fi burst is exactly what re-triggers the brownout on a marginal power supply, so I send at most 2 messages every 500 ms:</p>

<pre><code class="language-c">// Drain little by little: a WiFi burst can re-trigger the brownout.
// At most 2 messages every 500ms = ~4/s.
void bufDrain() {
  static uint32_t lastDrain = 0;
  if (bufCount == 0 || !mqtt.connected() || millis() - lastDrain &lt; 500) return;
  lastDrain = millis();
  for (int k = 0; k &lt; 2 &amp;&amp; bufCount &gt; 0 &amp;&amp; mqtt.connected(); k++) {
    char payload[320];
    buildPayload(payload, sizeof(payload), ring[bufHead]);
    if (!mqtt.publish(TOPIC, payload)) break;  // no ACK: retry later
    bufHead = (bufHead + 1) % BUF_CAP;
    bufCount--;
  }
}
</code></pre>

<p>Second, each reading travels with <strong>its own timestamp</strong>. A measurement that sat delayed in the queue arrives late, but it enters InfluxDB at the moment it actually happened, so the time series has no gaps or shifts. The queue holds up to ~12 hours of data in RAM; if it fills, it overwrites the oldest; and the monotonic <code>seq</code> makes it possible to detect whether any message was lost.</p>

<p>Meanwhile, the days kept going by. The system still wasn&#39;t finished.</p>

<p>I was able to test the distributed system with the help of some friends, which gave me the confidence I needed to take it to the event.</p>

<h2 id="and-finally-the-moment-arrived">And finally the moment arrived</h2>

<p>Out of responsibility to clients, I couldn&#39;t ask for the day off work to be there during the whole <em>setup</em>, so I was sending some instructions remotely.</p>

<p>At first, the nodes weren&#39;t sending anything.</p>

<p>The problem turned out to be an accented character in the Wi-Fi network name.</p>

<p>They changed it.</p>

<p>And, suddenly, all the nodes came online.</p>

<p>It was incredible.</p>

<p>When people started coming in, the Wi-Fi became intermittent for some nodes. But even so we were able to get enough metrics to compare the different spaces. This is where the buffer on the node did its job: what couldn&#39;t be sent at the moment was stored and came in later, at its correct time.</p>

<p>It was fascinating to watch the measurements change moment by moment as the building filled up. This allowed the Nerdearla staff to take measures to prevent overcrowding and refresh the rooms between sessions.</p>

<p>There were also a couple of anecdotes that stuck with me.</p>

<p>At one point I came into Nerdearla with some extra nodes and ended up talking with an attendee who is very fond of electronics and who works building escape rooms. He looked at the nodes and started identifying the components, even the board models. He even recognized the microphone I had soldered backwards, and we laughed for a while.</p>

<p>We went to install an extra node in the quiet coworking area and one of the event&#39;s main speakers — whom, to my embarrassment, I didn&#39;t recognize at the time — gave up his seat and his power strip so that we could install it.</p>

<p>He told me, “I think it&#39;s important to measure the CO₂, and I really need to get some sunlight.” Only when I went to see his panel did I realize how important he was.</p>

<p>I felt understood, though each of us for different reasons.</p>

<p>I was exhausted — I had been sleeping very little for days — and at first I didn&#39;t even have a clear notion of what was happening. But as feedback started to come in, by noon on Friday I finally felt that everything was working fairly smoothly.</p>

<p>I had also designed a node to measure electrical consumption, with an SCT-013 current clamp and an ADS1115 ADC. We were able to get it running during the second day, once we found a suitable place to install it, and although its placement in the space (with many columns and surrounded by people coming and going) caused several connectivity problems, we managed to get some measurements.</p>

<p>At one point I had to ask for a soldering iron to fix a component, and they guided me to a quiet space where I talked with some of the venue&#39;s workers who were fascinated by the process.</p>

<p>Seeing the whole system working in a place full of people was incredibly exciting.</p>

<p>What had started as small experiments in my home lab ended up becoming a distributed IoT system running in a real environment, with real constraints and people using the results.</p>

<p>And I learned a huge amount in the process.</p>

<h2 id="acknowledgments">Acknowledgments</h2>

<p>And none of this would have been possible without the unconditional support of <strong>Javier Perales</strong>, who helped me with the website design, came to accompany me during the first two days, and afterwards went to my home to take care of my kitty, who had been left alone. <strong>Federico Meza</strong> was also there, an electrician friend who gave us a logistical hand with the electrical measurement and its installation.</p>

<p>Thanks to <strong>Eduardo, Nachi, and Lole</strong> from Nerdearla; to <strong>Agustín and Laura</strong> at LINTI; to the volunteers who helped with the hardware; to my friends who helped me test the system; and to all the people who encouraged me to say yes to this project.</p>

<p>I also want to thank my colleagues from <strong>AWS Women in Cloud</strong>, who were at Nerdearla as <em>community partners</em>. In the middle of the intense pace, having several of them — especially <strong>Silvina Belén Aponte Díaz</strong> — come up to find me to give me support was something that held me up a lot. I want to thank from the heart <strong>Guadalupe Tulín</strong>, who accompanied me on the logistics side, in addition to her judicious design and outreach support; and a special mention to <strong>Dai Rodríguez, Alejandra Leuno, and Laura Bolaños</strong>, who supported and stood by me during and after. <strong>Delia Alomo</strong> shared her experience with me and encouraged me to publish in the community.</p>

<p>And I especially want to thank my work team, who covered for me while I went to do the installation and so that I could be present during the setup.</p>

<p>Having that kind of support made a huge difference: it allowed me to take something I had been experimenting with as part of my studies and bring it into a real environment.</p>

<p>I hope more girls and women dare to take on challenges like these. I started with doubts and fears, but I ended with a system running at a real event. If I could, many more can.</p>

<p>I&#39;m very grateful to all the people who made this possible.</p>

<hr/>

<p><em>This article is also published in Spanish: <a href="https://builder.aws.com/content/3KKH4HCvufqkOIqE5ZICZEzukHP/sistema-iot-para-monitoreo-ambiental-en-un-evento-de-gran-escala-arquitectura-hardware-y-aprendizajes" rel="nofollow ugc">Sistema IoT para monitoreo ambiental en un evento de gran escala</a>.</em></p>

<p><em>Also available on the Sysarmy blog: <a href="https://sysarmy.com/blog/posts/iot-nerdearla-monitoreo-ambiental/" rel="nofollow ugc">IoT, Nerdearla y monitoreo ambiental</a>.</em></p>
]]></content:encoded>
      <guid>https://inti-tidball.writeas.com/sistema-iot-para-monitoreo-ambiental-en-nerdearla-arquitectura-hardware-y</guid>
      <pubDate>Thu, 08 Oct 2026 19:08:55 +0000</pubDate>
    </item>
    <item>
      <title>Why I use (and recommend) numeric .xyz domains for self-hosting</title>
      <link>https://inti-tidball.writeas.com/por-que-uso-y-recomiendo-dominios-xyz-numericos-para-self-hosting?pk_campaign=rss-feed</link>
      <description>The problem&#xA;&#xA;Self-hosting something like Grafana, your app, or an API needs three things: a stable name that resolves to your IP, a valid TLS certificate (Let&#39;s Encrypt doesn&#39;t issue for IPs), and not depending on a free DDNS subdomain that can change or disappear. A domain of your own solves all three. The catch is the cost and the availability of the name.&#xA;&#xA;That&#39;s where the numeric class of .xyz comes in.</description>
      <content:encoded><![CDATA[<p><img src="https://i.postimg.cc/MTpj9Cb9/diagrama.png" alt="Self-hosting from your local network (without a public IP): numeric .xyz + Cloudflare Tunnel"/></p>

<h2 id="the-problem">The problem</h2>

<p>Self-hosting something like Grafana, your app, or an API needs three things: a <strong>stable name</strong> that resolves to your IP, a <strong>valid TLS certificate</strong> (Let&#39;s Encrypt doesn&#39;t issue for IPs), and <strong>not depending on a free DDNS subdomain</strong> that can change or disappear. A domain of your own solves all three. The catch is the <strong>cost</strong> and the <strong>availability</strong> of the name.</p>

<p>That&#39;s where the numeric class of .xyz comes in.</p>



<p>And if you host from home, a fourth thing is added: the ISP normally doesn&#39;t give you a public IP but leaves you behind CGNAT (an IP shared among several clients). With CGNAT, port forwarding doesn&#39;t even work, since there&#39;s nowhere to forward to.</p>

<p>A <strong>domain of your own</strong> + an <strong>outbound tunnel</strong> solve all four.</p>

<h2 id="what-the-1-111b-class-is">What the 1.111B class is</h2>

<p>  In 2017 the .xyz registry opened a block: all domains with 6 to 9 digits ending in .xyz (from 000000.xyz to 999999999.xyz), 1.111 billion combinations, at US$0.99
  per year forever — registration, renewal, and transfer, with ICANN fees included. Renewal costs the same as the initial registration.</p>

<h2 id="why-i-recommend-it">Why I recommend it</h2>
<ol><li><strong>Negligible cost</strong>: ~US$1/year, forever and with no surprises at renewal.</li>
<li><strong>Availability</strong>: with 1.111 billion combinations, you find a free one without fighting for it.</li>
<li><strong>No brand risk</strong>: a number doesn&#39;t collide with any brand, and no one is going to dispute it with you.</li>
<li><strong>Functional, not branding</strong>: for self-hosting you don&#39;t need a pretty or memorable name, you just need it to resolve.</li>
<li><strong>Wildcard + subdomains</strong>: a single domain gives you infinite subdomains with one wildcard record.</li>
<li><strong>Free Let&#39;s Encrypt</strong>: with the DNS-01 challenge you get a wildcard certificate (*.12345678.xyz) and cover all subdomains with just one.</li>
<li><strong>Independence</strong>: it&#39;s your domain. You don&#39;t depend on a third-party DDNS that can shut down.</li></ol>

<h2 id="how-i-use-it">How I use it</h2>

<p>The numeric domain (e.g. 12345678.xyz) as the root, with DNS on Cloudflare (free) and a wildcard *. And the key thing for hosting from home is Cloudflare Tunnel (the <em>cloudflared</em> daemon), which gives me an outbound tunnel to Cloudflare, without a public IP and without opening ports on the router. Each service has its own subdomain (app., api., grafana.).</p>

<h2 id="downsides">Downsides</h2>
<ul><li>It&#39;s <strong>ugly and not memorable</strong>. For self-hosting it doesn&#39;t matter; for a brand, it does.</li>
<li>Cheap TLDs (.xyz included) carry a certain <strong>spam/phishing reputation</strong>; some corporate filters look at them warily. For personal use it&#39;s not a bother, but it can come up.</li>
<li>It&#39;s not for “serious” production facing third parties (a bank won&#39;t trust it), but for your own infrastructure and demos it&#39;s perfect.</li></ul>
]]></content:encoded>
      <guid>https://inti-tidball.writeas.com/por-que-uso-y-recomiendo-dominios-xyz-numericos-para-self-hosting</guid>
      <pubDate>Mon, 05 Oct 2026 20:58:30 +0000</pubDate>
    </item>
    <item>
      <title>Build Your Own AI Bunker: Privacy-First Agents on Outdated Hardware</title>
      <link>https://inti-tidball.writeas.com/build-your-own-ai-bunker-privacy-first-agents-on-outdated-hardware?pk_campaign=rss-feed</link>
      <description>In an era where AI productivity often comes at the cost of data privacy, building a local “Bunker” is the sweet and often sought after solution. I was inspired by Liz Howard and their focus on open-source model accessibility, and Simon Willison’s experiments running Claude Code in “dangerous” containerized environments. So I set out to make my own local stack.</description>
      <content:encoded><![CDATA[<p>In an era where AI productivity often comes at the cost of data privacy, building a local “Bunker” is the sweet and often sought after solution. I was inspired by <a href="https://www.lizthe.dev/" rel="nofollow ugc">Liz Howard</a> and their focus on open-source model accessibility, and <a href="https://simonwillison.net/" rel="nofollow ugc">Simon Willison</a>’s experiments running Claude Code in “dangerous” containerized environments. So I set out to make my own local stack.</p>



<p>While Simon might be running an Nvidia Spark, I am humbly proof-of-concepting this on an old Thinkpad with 16GB of RAM. The goal was to test the limits, see what breaks, and keep my data offline. Hopefully I too will one day be able to do similar experiments!</p>

<h2 id="the-hardware-stack">The Hardware Stack</h2>
<ul><li><strong>Host:</strong> Proxmox VE 9 running on a ThinkPad T420</li>
<li><strong>CPU:</strong> Intel Core i5-2520M (4 Cores, 2 Threads each)</li>
<li><strong>RAM:</strong> 16GB DDR3</li>
<li><strong>Storage:</strong> 480GB SSD</li></ul>

<h2 id="1-the-infrastructure-proxmox-lxc">1. The Infrastructure (Proxmox LXC)</h2>

<p>The stack lives in a Proxmox LXC. If you wanted to allow the container to run its own instances, you must grant the LXC specific permissions on the Proxmox host. My initial idea was to run agents with Podman, so I had to do this:</p>

<pre><code class="language-bash"># Edit /etc/pve/lxc/ID.conf
features: nesting=1,keyctl=1
</code></pre>

<p>Allows nesting and keyctl=1 allows the container to manage its own cryptographic keys and process-specific tokens which is required when running Podman in a nested environment.</p>

<h2 id="2-the-engine-llama-cpp">2. The Engine (llama.cpp)</h2>

<p>To squeeze performance out of an older i5, we compile locally to utilize the AVX (AVX1) instruction set.</p>

<pre><code class="language-bash"># Install dependencies
apt update &amp;&amp; apt install -y   git curl tmux direnv   build-essential cmake ccache   libssl-dev libsqlite3-dev liblzma-dev   zlib1g-dev libbz2-dev libreadline-dev

# Clone repo
git clone https://github.com/ggerganov/llama.cpp

# Compile
cd llama.cpp
cmake -B build -DGGML_AVX=ON -DGGML_NATIVE=ON
cmake --build build --config Release --target llama-server -j 4
</code></pre>

<p>I included ccache in the dependencies. It’s optional, but it will cut recompilation time.</p>

<p>Run a few tests:</p>

<pre><code class="language-bash"># The llama-server binary should exist
ls -lh build/bin/llama-server
</code></pre>

<h2 id="3-orchestration-persistence-tmux">3. Orchestration &amp; Persistence (TMUX)</h2>

<p>On limited hardware, high CPU load can cause SSH lag. Use TMUX inside the LXC to decouple the LLM from your connection.</p>

<p>Step-by-Step Setup:</p>

<pre><code class="language-bash"># Start Session
tmux new -s ai_bunker

# Prepare Models
mkdir -p models
wget -O models/qwen-0.5b.gguf https://huggingface.co/Qwen/Qwen2.5-Coder-0.5B-Instruct-GGUF/resolve/main/qwen2.5-coder-0.5b-instruct-q4_k_m.gguf

# Fire up the Server
mkdir -p bunker_memory
./build/bin/llama-server   \
-m models/qwen-0.5b.gguf  \
--port 8080  \
--ctx-size 2048  \
--threads 4   \
--mlock   \
--no-mmap  \
--host 0.0.0.0   \
--slot-save-path ./bunker_memory
</code></pre>

<h2 id="4-direct-inference-curl">4. Direct Inference (curl)</h2>

<pre><code class="language-bash">curl http://localhost:8080/v1/chat/completions   -H &#34;Content-Type: application/json&#34;   -d &#39;{
    &#34;model&#34;: &#34;local&#34;,
    &#34;max_tokens&#34;: 128,
    &#34;temperature&#34;: 0.2,
    &#34;messages&#34;: [
      {
        &#34;role&#34;: &#34;user&#34;,
        &#34;content&#34;: &#34;Write a simple Python function that reverses a string.&#34;
      }
    ]
  }&#39;
</code></pre>

<h2 id="5-connecting-via-browser">5. Connecting via browser</h2>

<p>Since the llama-server is bound to 0.0.0.0:8080, it’s accessible to any tool on your network. The lightest method is via a browser calling the endpoint directly.</p>

<h2 id="6-connecting-locally-wave-claude-aider">6. Connecting locally (Wave &amp; Claude &amp; Aider)</h2>

<p> Most modern terminals and AI extensions expect an OpenAI-compatible endpoint. However, these tools inject massive system prompts, and will cause context overflow errors and eat up more tokens than you might have.</p>

<p>I got it working, but it was slow. If you have a better machine and want to go ahead, you may want to configure your tools to use your local model. To do so for Wave, you can follow the documentation. Most AI terminals have similar setup. You need to edit the configuration at  ~/.config/waveterm/waveai.json or run a custom command to configure Wave:</p>

<pre><code class="language-bash">wsh editconfig waveai.json
</code></pre>

<p>Inside the JSON file, add a new entry. Based on your existing llama-server setup, use this exact structure:</p>

<pre><code class="language-json">{
  &#34;ia-bunker&#34;: {
    &#34;display:name&#34;: &#34;IA Bunker - Qwen Coder&#34;,
    &#34;display:order&#34;: 1,
    &#34;display:icon&#34;: &#34;shield&#34;,
    &#34;display:description&#34;: &#34;Local Qwen 2.5 Coder on Thinkpad T420&#34;,
    &#34;ai:apitype&#34;: &#34;openai-chat&#34;,
    &#34;ai:model&#34;: &#34;qwen-coder&#34;,
    &#34;ai:endpoint&#34;: &#34;http://192.168.1.XX:8080/v1/chat/completions&#34;,
    &#34;ai:apitoken&#34;: &#34;not-needed&#34;
  }
}
</code></pre>

<p>Replace <code>192.168.1.XX</code> with your local IP.</p>

<pre><code class="language-bash">wsh setconfig waveai:defaultmode=&#34;ia-bunker&#34;
</code></pre>

<p> I also experimented with running higher-level terminal agents (for example, Claude and Aider) inside Podman and pointing them at the bunker via environment variables.</p>

<p>On a 2 k token context, this usually results in exceed<em>context</em>size_error failures or multi-minute stalls before the first token is produced.</p>

<p>These are the commands I tried inside the container that successfully loaded Aider &amp; then Claude, but unfortunately, they just stalled with my setup (you may have more luck):</p>

<pre><code class="language-bash">podman run -it --rm \
  -v $(pwd):/app \
  -e OPENAI_API_BASE=http://172.17.0.1:8080/v1 \
  -e OPENAI_API_KEY=not-needed \
  paulgauthier/aider-full \
  --model openai/gpt-3.5-turbo \ #  used to select prompt profile
  --no-auto-commits

</code></pre>

<pre><code class="language-bash">podman run -it --rm \
  --network host \
  -v $(pwd):/app \
  -e ANTHROPIC_BASE_URL=&#34;http://127.0.0.1:8080&#34; \
  -e ANTHROPIC_AUTH_TOKEN=&#34;local-bunker&#34; \
  -e CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 \
  node:20-alpine \
  sh -c &#34;apk add --no-cache git &amp;&amp; npm install -g @anthropic-ai/claude-code@latest &amp;&amp; claude --model qwen-coder&#34;
</code></pre>

<h2 id="7-the-global-tunnel-tailscale-in-the-bunker">7. The Global Tunnel: Tailscale in the Bunker</h2>

<p> To access your “Bunker” from a coffee shop you could install Tailscale, CloudFlare or Zerotier directly inside the LXC. This turns your old Thinkpad into a secure, private node on your personal VPN. It’s probably worth securing the entry with some auth if you wanted to do that.</p>

<p>But it’s a topic for another post!</p>

<h2 id="ps-tweak-your-engine">PS: Tweak your Engine</h2>

<p> Initially, I was getting a painfully slow 0.25 tokens/s. To make it usable on this vintage i5, I had to aggressively tune the llama-server flags:</p>
<ul><li>—ctx-size 2048: Dropping this down helped because smaller context equals faster “thinking”.</li>
<li>-ctk q8<em>0 -ctv q8</em>0: I tried this KV-cache quantization (-ctk/-ctv), but opted out, as on a small-context (2k) Sandy Bridge CPU, the added CPU overhead often outweighs the memory savings. If I had a newer CPU, this might have helped.</li>
<li>—mlock: Essential to prevent the model from being paged to the Swap partition, which would turn the 20-minute wait into a total system hang.</li></ul>
]]></content:encoded>
      <guid>https://inti-tidball.writeas.com/build-your-own-ai-bunker-privacy-first-agents-on-outdated-hardware</guid>
      <pubDate>Mon, 26 Jan 2026 00:11:23 +0000</pubDate>
    </item>
  </channel>
</rss>