<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[The Noel Blog]]></title><description><![CDATA[The Noel Blog]]></description><link>https://www.thenoel.org/</link><image><url>https://www.thenoel.org/favicon.png</url><title>The Noel Blog</title><link>https://www.thenoel.org/</link></image><generator>Ghost 4.48</generator><lastBuildDate>Tue, 05 May 2026 11:38:52 GMT</lastBuildDate><atom:link href="https://www.thenoel.org/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Yeah Yeah Yeahs - Hollywood Bowl]]></title><description><![CDATA[<!--kg-card-begin: html--><blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="https://www.instagram.com/p/CjaGIc5OHNw/?utm_source=ig_embed&amp;utm_campaign=loading" data-instgrm-version="14" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:540px; min-width:326px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:16px;"> <a href="https://www.instagram.com/p/CjaGIc5OHNw/?utm_source=ig_embed&amp;utm_campaign=loading" style=" background:#FFFFFF; line-height:0; padding:0 0; text-align:center; text-decoration:none; width:100%;" target="_blank"> <div style=" display: flex; flex-direction: row; align-items: center;"> <div style="background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 40px; margin-right: 14px; width: 40px;"></div> <div style="display: flex; flex-direction: column; flex-grow: 1; justify-content: center;"> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 100px;"></div> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; width: 60px;"></div></div></div><div style="padding: 19% 0;"></div> <div style="display:block; height:50px; margin:0 auto 12px; width:50px;"><svg width="50px" height="50px" viewbox="0 0 60 60" version="1.1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g transform="translate(-511.000000, -20.000000)" fill="#000000"><g><path d="M556.869,30.41 C554.814,30.41 553.148,32.076 553.148,34.131 C553.148,36.186 554.814,37.852 556.869,37.852 C558.924,37.852 560.59,36.186 560.59,34.131 C560.59,32.076 558.924,30.41 556.869,30.41 M541,60.657 C535.114,60.657 530.342,55.887 530.342,50 C530.342,44.114 535.114,39.342 541,39.342 C546.887,39.342 551.658,44.114 551.658,50 C551.658,55.887 546.887,60.657 541,60.657 M541,33.886 C532.1,33.886 524.886,41.1 524.886,50 C524.886,58.899 532.1,66.113 541,66.113 C549.9,66.113 557.115,58.899 557.115,50 C557.115,41.1 549.9,33.886 541,33.886 M565.378,62.101 C565.244,65.022 564.756,66.606 564.346,67.663 C563.803,69.06 563.154,70.057 562.106,71.106 C561.058,72.155 560.06,72.803 558.662,73.347 C557.607,73.757 556.021,74.244 553.102,74.378 C549.944,74.521 548.997,74.552 541,74.552 C533.003,74.552 532.056,74.521 528.898,74.378 C525.979,74.244 524.393,73.757 523.338,73.347 C521.94,72.803 520.942,72.155 519.894,71.106 C518.846,70.057 518.197,69.06 517.654,67.663 C517.244,66.606 516.755,65.022 516.623,62.101 C516.479,58.943 516.448,57.996 516.448,50 C516.448,42.003 516.479,41.056 516.623,37.899 C516.755,34.978 517.244,33.391 517.654,32.338 C518.197,30.938 518.846,29.942 519.894,28.894 C520.942,27.846 521.94,27.196 523.338,26.654 C524.393,26.244 525.979,25.756 528.898,25.623 C532.057,25.479 533.004,25.448 541,25.448 C548.997,25.448 549.943,25.479 553.102,25.623 C556.021,25.756 557.607,26.244 558.662,26.654 C560.06,27.196 561.058,27.846 562.106,28.894 C563.154,29.942 563.803,30.938 564.346,32.338 C564.756,33.391 565.244,34.978 565.378,37.899 C565.522,41.056 565.552,42.003 565.552,50 C565.552,57.996 565.522,58.943 565.378,62.101 M570.82,37.631 C570.674,34.438 570.167,32.258 569.425,30.349 C568.659,28.377 567.633,26.702 565.965,25.035 C564.297,23.368 562.623,22.342 560.652,21.575 C558.743,20.834 556.562,20.326 553.369,20.18 C550.169,20.033 549.148,20 541,20 C532.853,20 531.831,20.033 528.631,20.18 C525.438,20.326 523.257,20.834 521.349,21.575 C519.376,22.342 517.703,23.368 516.035,25.035 C514.368,26.702 513.342,28.377 512.574,30.349 C511.834,32.258 511.326,34.438 511.181,37.631 C511.035,40.831 511,41.851 511,50 C511,58.147 511.035,59.17 511.181,62.369 C511.326,65.562 511.834,67.743 512.574,69.651 C513.342,71.625 514.368,73.296 516.035,74.965 C517.703,76.634 519.376,77.658 521.349,78.425 C523.257,79.167 525.438,79.673 528.631,79.82 C531.831,79.965 532.853,80.001 541,80.001 C549.148,80.001 550.169,79.965 553.369,79.82 C556.562,79.673 558.743,79.167 560.652,78.425 C562.623,77.658 564.297,76.634 565.965,74.965 C567.633,73.296 568.659,71.625 569.425,69.651 C570.167,67.743 570.674,65.562 570.82,62.369 C570.966,59.17 571,58.147 571,50 C571,41.851 570.966,40.831 570.82,37.631"/></g></g></g></svg></div><div style="padding-top: 8px;"> <div style=" color:#3897f0; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:550; line-height:18px;">View this post on Instagram</div></div><div style="padding: 12.5% 0;"></div> <div style="display: flex; flex-direction: row; margin-bottom: 14px; align-items: center;"><div> <div style="background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(0px) translateY(7px);"></div> <div style="background-color: #F4F4F4; height: 12.5px; transform: rotate(-45deg) translateX(3px) translateY(1px); width: 12.5px; flex-grow: 0; margin-right: 14px; margin-left: 2px;"></div> <div style="background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(9px) translateY(-18px);"></div></div><div style="margin-left: 8px;"> <div style=" background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 20px; width: 20px;"></div> <div style=" width: 0; height: 0; border-top: 2px solid transparent; border-left: 6px solid #f4f4f4; border-bottom: 2px solid transparent; transform: translateX(16px) translateY(-4px) rotate(30deg)"></div></div><div style="margin-left: auto;"> <div style=" width: 0px; border-top: 8px solid #F4F4F4; border-right: 8px solid transparent; transform: translateY(16px);"></div> <div style=" background-color: #F4F4F4; flex-grow: 0; height: 12px; width: 16px; transform: translateY(-4px);"></div> <div style=" width: 0; height: 0; border-top: 8px solid #F4F4F4; border-left: 8px solid transparent; transform: translateY(-4px) translateX(8px);"></div></div></div> <div style="display: flex; flex-direction: column; flex-grow: 1; justify-content: center; margin-bottom: 24px;"> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 224px;"></div> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; width: 144px;"></div></div></a><p style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;"><a href="https://www.instagram.com/p/CjaGIc5OHNw/?utm_source=ig_embed&amp;utm_campaign=loading" style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none;" target="_blank">A post shared by Noel Ferreria (@leonowski)</a></p></div></blockquote> <script async src="//www.instagram.com/embed.js"></script><!--kg-card-end: html-->]]></description><link>https://www.thenoel.org/yeah-yeah-yeahs-hollywood-bowl/</link><guid isPermaLink="false">6369759efe693e0001140f5c</guid><dc:creator><![CDATA[Noel]]></dc:creator><pubDate>Mon, 07 Nov 2022 21:17:15 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: html--><blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="https://www.instagram.com/p/CjaGIc5OHNw/?utm_source=ig_embed&amp;utm_campaign=loading" data-instgrm-version="14" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:540px; min-width:326px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:16px;"> <a href="https://www.instagram.com/p/CjaGIc5OHNw/?utm_source=ig_embed&amp;utm_campaign=loading" style=" background:#FFFFFF; line-height:0; padding:0 0; text-align:center; text-decoration:none; width:100%;" target="_blank"> <div style=" display: flex; flex-direction: row; align-items: center;"> <div style="background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 40px; margin-right: 14px; width: 40px;"></div> <div style="display: flex; flex-direction: column; flex-grow: 1; justify-content: center;"> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 100px;"></div> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; width: 60px;"></div></div></div><div style="padding: 19% 0;"></div> <div style="display:block; height:50px; margin:0 auto 12px; width:50px;"><svg width="50px" height="50px" viewbox="0 0 60 60" version="1.1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g transform="translate(-511.000000, -20.000000)" fill="#000000"><g><path d="M556.869,30.41 C554.814,30.41 553.148,32.076 553.148,34.131 C553.148,36.186 554.814,37.852 556.869,37.852 C558.924,37.852 560.59,36.186 560.59,34.131 C560.59,32.076 558.924,30.41 556.869,30.41 M541,60.657 C535.114,60.657 530.342,55.887 530.342,50 C530.342,44.114 535.114,39.342 541,39.342 C546.887,39.342 551.658,44.114 551.658,50 C551.658,55.887 546.887,60.657 541,60.657 M541,33.886 C532.1,33.886 524.886,41.1 524.886,50 C524.886,58.899 532.1,66.113 541,66.113 C549.9,66.113 557.115,58.899 557.115,50 C557.115,41.1 549.9,33.886 541,33.886 M565.378,62.101 C565.244,65.022 564.756,66.606 564.346,67.663 C563.803,69.06 563.154,70.057 562.106,71.106 C561.058,72.155 560.06,72.803 558.662,73.347 C557.607,73.757 556.021,74.244 553.102,74.378 C549.944,74.521 548.997,74.552 541,74.552 C533.003,74.552 532.056,74.521 528.898,74.378 C525.979,74.244 524.393,73.757 523.338,73.347 C521.94,72.803 520.942,72.155 519.894,71.106 C518.846,70.057 518.197,69.06 517.654,67.663 C517.244,66.606 516.755,65.022 516.623,62.101 C516.479,58.943 516.448,57.996 516.448,50 C516.448,42.003 516.479,41.056 516.623,37.899 C516.755,34.978 517.244,33.391 517.654,32.338 C518.197,30.938 518.846,29.942 519.894,28.894 C520.942,27.846 521.94,27.196 523.338,26.654 C524.393,26.244 525.979,25.756 528.898,25.623 C532.057,25.479 533.004,25.448 541,25.448 C548.997,25.448 549.943,25.479 553.102,25.623 C556.021,25.756 557.607,26.244 558.662,26.654 C560.06,27.196 561.058,27.846 562.106,28.894 C563.154,29.942 563.803,30.938 564.346,32.338 C564.756,33.391 565.244,34.978 565.378,37.899 C565.522,41.056 565.552,42.003 565.552,50 C565.552,57.996 565.522,58.943 565.378,62.101 M570.82,37.631 C570.674,34.438 570.167,32.258 569.425,30.349 C568.659,28.377 567.633,26.702 565.965,25.035 C564.297,23.368 562.623,22.342 560.652,21.575 C558.743,20.834 556.562,20.326 553.369,20.18 C550.169,20.033 549.148,20 541,20 C532.853,20 531.831,20.033 528.631,20.18 C525.438,20.326 523.257,20.834 521.349,21.575 C519.376,22.342 517.703,23.368 516.035,25.035 C514.368,26.702 513.342,28.377 512.574,30.349 C511.834,32.258 511.326,34.438 511.181,37.631 C511.035,40.831 511,41.851 511,50 C511,58.147 511.035,59.17 511.181,62.369 C511.326,65.562 511.834,67.743 512.574,69.651 C513.342,71.625 514.368,73.296 516.035,74.965 C517.703,76.634 519.376,77.658 521.349,78.425 C523.257,79.167 525.438,79.673 528.631,79.82 C531.831,79.965 532.853,80.001 541,80.001 C549.148,80.001 550.169,79.965 553.369,79.82 C556.562,79.673 558.743,79.167 560.652,78.425 C562.623,77.658 564.297,76.634 565.965,74.965 C567.633,73.296 568.659,71.625 569.425,69.651 C570.167,67.743 570.674,65.562 570.82,62.369 C570.966,59.17 571,58.147 571,50 C571,41.851 570.966,40.831 570.82,37.631"/></g></g></g></svg></div><div style="padding-top: 8px;"> <div style=" color:#3897f0; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:550; line-height:18px;">View this post on Instagram</div></div><div style="padding: 12.5% 0;"></div> <div style="display: flex; flex-direction: row; margin-bottom: 14px; align-items: center;"><div> <div style="background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(0px) translateY(7px);"></div> <div style="background-color: #F4F4F4; height: 12.5px; transform: rotate(-45deg) translateX(3px) translateY(1px); width: 12.5px; flex-grow: 0; margin-right: 14px; margin-left: 2px;"></div> <div style="background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(9px) translateY(-18px);"></div></div><div style="margin-left: 8px;"> <div style=" background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 20px; width: 20px;"></div> <div style=" width: 0; height: 0; border-top: 2px solid transparent; border-left: 6px solid #f4f4f4; border-bottom: 2px solid transparent; transform: translateX(16px) translateY(-4px) rotate(30deg)"></div></div><div style="margin-left: auto;"> <div style=" width: 0px; border-top: 8px solid #F4F4F4; border-right: 8px solid transparent; transform: translateY(16px);"></div> <div style=" background-color: #F4F4F4; flex-grow: 0; height: 12px; width: 16px; transform: translateY(-4px);"></div> <div style=" width: 0; height: 0; border-top: 8px solid #F4F4F4; border-left: 8px solid transparent; transform: translateY(-4px) translateX(8px);"></div></div></div> <div style="display: flex; flex-direction: column; flex-grow: 1; justify-content: center; margin-bottom: 24px;"> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 224px;"></div> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; width: 144px;"></div></div></a><p style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;"><a href="https://www.instagram.com/p/CjaGIc5OHNw/?utm_source=ig_embed&amp;utm_campaign=loading" style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none;" target="_blank">A post shared by Noel Ferreria (@leonowski)</a></p></div></blockquote> <script async src="//www.instagram.com/embed.js"></script><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[AI Image Processing at Home (Hot Dog/Not Hot Dog)]]></title><description><![CDATA[<p>Home automation is wonderful. &#xA0;Up until recently, I used things like motion sensors and contact sensors to trigger various things. &#xA0;While these devices still have their place, they are &quot;dumb.&quot; &#xA0;For example, I could have a motion sensor in my backyard that triggers lights, but</p>]]></description><link>https://www.thenoel.org/ai-image-processing-at-home/</link><guid isPermaLink="false">5f4ed82c7d00680001424fd4</guid><dc:creator><![CDATA[Noel]]></dc:creator><pubDate>Wed, 02 Sep 2020 00:47:32 GMT</pubDate><media:content url="https://www.thenoel.org/content/images/2020/09/jian_yang_hbo_silicon_valley.0.jpeg" medium="image"/><content:encoded><![CDATA[<img src="https://www.thenoel.org/content/images/2020/09/jian_yang_hbo_silicon_valley.0.jpeg" alt="AI Image Processing at Home (Hot Dog/Not Hot Dog)"><p>Home automation is wonderful. &#xA0;Up until recently, I used things like motion sensors and contact sensors to trigger various things. &#xA0;While these devices still have their place, they are &quot;dumb.&quot; &#xA0;For example, I could have a motion sensor in my backyard that triggers lights, but any motion from squirrels or my dog unnecessarily triggers.<br><br>Recently, a youtube channel I came across detailed how to easily set something up that can determine objects in your camera and act accordingly.<br></p><figure class="kg-card kg-embed-card"><iframe width="612" height="344" src="https://www.youtube.com/embed/fwoonl5JKgo?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></figure><p><br><br>The meat of this uses 3 pieces of software:<br><br>- Blue Iris <a href="https://blueirissoftware.com/">https://blueirissoftware.com/</a><br><br>This is the only piece of software that requires cash money. &#xA0;Also, it runs in Windows. &#xA0;These might be deal breakers for some (it was almost for me), but after trying it out, I decided to go with it. &#xA0;It turned out to be worth the price (around $60) and it&apos;s much easier to work with than ZoneMinder. &#xA0;There are also efforts to make this work in Docker (more on that later).<br><br>- Deep Stack AI Server <a href="https://deepstack.cc/">https://deepstack.cc/</a><br><br>This software is free and available as a Docker container. &#xA0;<a href="https://hub.docker.com/r/deepquestai/deepstack">https://hub.docker.com/r/deepquestai/deepstack</a><br><br>- AI Tool (Windows - <a href="https://github.com/gentlepumpkin/bi-aidetection">https://github.com/gentlepumpkin/bi-aidetection</a>) or node-deepstackai-trigger (Docker - <a href="https://github.com/danecreekphotography/node-deepstackai-trigger">https://github.com/danecreekphotography/node-deepstackai-trigger</a>)<br><br>The AI Tool runs on windows while node-deepstackai-triggers runs in a Docker container. &#xA0;This is the important piece of the puzzle and sits in-between Deep Stack AI Server and Blue Iris. &#xA0;The basic flow is:<br><br>Blue Iris captures a still image into a folder &#x2013; &gt;AI Tool/node-deepstackai-trigger sees the image &gt; image is sent to Deep Stack AI &gt; results are returned to AI Tool/node-deepstackai-trigger &gt; actions are taken based on results<br><br></p><figure class="kg-card kg-embed-card"><iframe width="612" height="344" src="https://www.youtube.com/embed/ACmydtFDTGs?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></figure><p><br><br>Actions can be any type of home automation you have going on. &#xA0;With node-deepstack-ai, you can send out a web request or a MQTT message. &#xA0;In a particular set up, I set up my front door car to recognize people. &#xA0;After everything happens, my front door records a high resolution video and makes a chime/announcment on select Alexa devices in my home. &#xA0;Previously, I would get false alarms if any motion was detected on the camera. &#xA0;Now, I have a &quot;smarter&quot; camera that gives me finer control on my home automation. &#xA0;This is all very exciting stuff for home automation. &#xA0;You can run all this processing locally and not depend on pay/Internet services.<br><br>Below is an example of another automation I have with a camera pointed at my pool. &#xA0;When it notices a person, I trigger Blue Iris to record a high resolution video. &#xA0;Blue Iris can also trigger other things as well so you can chain these things together (or, just add another trigger Uri to the array).</p><!--kg-card-begin: markdown--><p>Example snippet of configuration for my pool camera:</p>
<pre><code class="language-&quot;triggers&quot;:">    {
      &quot;name&quot;: &quot;poolsd&quot;,
      &quot;watchPattern&quot;: &quot;/aiinput/poolsd*.jpg&quot;,
      &quot;cooldownTime&quot;: 5,
      &quot;enabled&quot;: true,
      &quot;threshold&quot;: {
        &quot;minimum&quot;: 0,
        &quot;maximum&quot;: 100
      },
      &quot;handlers&quot;: {
        &quot;webRequest&quot;: {
          &quot;triggerUris&quot;: [&quot;http://192.168.1.28:81/admin?camera=poolhd&amp;trigger&amp;user=user&amp;pw=pass&quot;]
        }
      },
</code></pre>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.thenoel.org/content/images/2020/09/Screen-Shot-2020-09-01-at-5.32.50-PM.png" class="kg-image" alt="AI Image Processing at Home (Hot Dog/Not Hot Dog)" loading="lazy" width="1546" height="658" srcset="https://www.thenoel.org/content/images/size/w600/2020/09/Screen-Shot-2020-09-01-at-5.32.50-PM.png 600w, https://www.thenoel.org/content/images/size/w1000/2020/09/Screen-Shot-2020-09-01-at-5.32.50-PM.png 1000w, https://www.thenoel.org/content/images/2020/09/Screen-Shot-2020-09-01-at-5.32.50-PM.png 1546w" sizes="(min-width: 720px) 720px"><figcaption>Blue Iris action I can run after it&apos;s triggered by the AI. This one announces someone is at the pool on select Alexa devices and is just a simple powershell script to do an HTTP POST. node-deepstackai-trigger only does GET requests at the moment, so using Blue Iris in this works well.</figcaption></figure><p><br><br>To set this all up, I recommend watching The Hook Up youtube channel video on how to set this all up. &#xA0;The wiki for node-deepstackai-trigger also has good detailed info: &#xA0;<a href="https://github.com/danecreekphotography/node-deepstackai-trigger/wiki">https://github.com/danecreekphotography/node-deepstackai-trigger/wiki</a><br><br>Hopefully, we can have something set up to train the AI with our own personal faces. &#xA0;We can get really creative with home automation then. &#xA0;I would like my doors to open when my camera sees my ugly mug.<br><br># Windows?<br><br>I prefer to use the node-deepstackai-trigger docker container since it is easy to keep running and configure. &#xA0;It also pairs well in a docker-compose set up with Deep Stack AI server. &#xA0;The final piece of the puzzle is getting Blue Iris running in Docker. &#xA0;jshridha has created a container, but ther is a lot of work to be done. &#xA0;It isn&apos;t stable for my tastes, but we are working to fix things. &#xA0;I have already submitted some PRs to update things and I hope we can eventually get this working properly. &#xA0; <a href="https://github.com/jshridha/docker-blueiris">https://github.com/jshridha/docker-blueiris</a><br><br></p><p></p><p></p><p>Funny last note: &#xA0;As I was writing this on my patio, I noticed some log entries from node-deepstackai-trigger:<br></p><!--kg-card-begin: markdown--><pre><code>2020-09-01T15:52:07-07:00 [Trigger patiodoorsd] /aiinput/patiodoorsd.20200901_155151275.jpg: Detected object laptop is not in the watch objects list [person, dog]
2020-09-01T15:52:07-07:00 [Trigger patiodoorsd] /aiinput/patiodoorsd.20200901_155151275.jpg: Not triggered by laptop (95.88411500000001)
</code></pre>
<!--kg-card-end: markdown--><p>lol - that&apos;s pretty cool.</p>]]></content:encoded></item><item><title><![CDATA[A Simple Utility to Expose Shell Commands as an HTTP API]]></title><description><![CDATA[<p>I lost most of this original post due to datacenter outage at my cheap VPS provider (<a href="https://buyvm.net/">https://buyvm.net/</a> - they are pretty good cause they are pretty cheap). &#xA0;Since I don&apos;t want to forget things and it may be useful to some, here is a link</p>]]></description><link>https://www.thenoel.org/a-simple-utilty-to-expose-shell-commands-as/</link><guid isPermaLink="false">5f21ee84d127860001d0c1da</guid><dc:creator><![CDATA[Noel]]></dc:creator><pubDate>Sat, 04 Apr 2020 21:52:00 GMT</pubDate><media:content url="https://www.thenoel.org/content/images/2020/07/3il_ZknLSeabcezT7mDDgmImRmJ2fWhkXZzwzTA1Y-U.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://www.thenoel.org/content/images/2020/07/3il_ZknLSeabcezT7mDDgmImRmJ2fWhkXZzwzTA1Y-U.jpg" alt="A Simple Utility to Expose Shell Commands as an HTTP API"><p>I lost most of this original post due to datacenter outage at my cheap VPS provider (<a href="https://buyvm.net/">https://buyvm.net/</a> - they are pretty good cause they are pretty cheap). &#xA0;Since I don&apos;t want to forget things and it may be useful to some, here is a link to the github project for this:<br><br><a href="https://github.com/leonowski/go-shell-api-docker">https://github.com/leonowski/go-shell-api-docker</a><br><br>Basically: &#xA0;Build this thing, run it in Docker, and copy the binaries out. &#xA0;Great for making small utilities that run in shell but called through HTTP.<br><br>Good usage example: &#xA0;as a WOL interface that lives on your router. &#xA0;Instead of having to remember how to send a WOL packet, just do something like a curl command.</p>]]></content:encoded></item><item><title><![CDATA[Freedom! (From your wireless carrier's hotspot throttling)]]></title><description><![CDATA[<p>So, for Independence Day, my family set out on a road trip to Lake Tahoe. &#xA0;My wife and I take turns driving. &#xA0;During one of my turns riding shotgun, something came up at the office that required my attention. &#xA0;It should have been a quick task, but</p>]]></description><link>https://www.thenoel.org/freedom-from-your-wireless-carriers-hotspot-throttlng/</link><guid isPermaLink="false">5f19608e5d26b30001a91a16</guid><dc:creator><![CDATA[Noel]]></dc:creator><pubDate>Sat, 06 Jul 2019 00:49:33 GMT</pubDate><media:content url="https://www.thenoel.org/content/images/2019/07/freedom.jpeg" medium="image"/><content:encoded><![CDATA[<img src="https://www.thenoel.org/content/images/2019/07/freedom.jpeg" alt="Freedom! (From your wireless carrier&apos;s hotspot throttling)"><p>So, for Independence Day, my family set out on a road trip to Lake Tahoe. &#xA0;My wife and I take turns driving. &#xA0;During one of my turns riding shotgun, something came up at the office that required my attention. &#xA0;It should have been a quick task, but my particular carrier throttles my hotspot connection. &#xA0;It&apos;s very frustrating because the same connections that go through my phone directly work quickly and are not throttled. &#xA0;So, I did a little workaround to get past this restriction.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.thenoel.org/content/images/2019/07/IMG_20190705_125331.jpg" class="kg-image" alt="Freedom! (From your wireless carrier&apos;s hotspot throttling)" loading="lazy"><figcaption>While my wife drives and the windshield collects dead bugs, I&apos;m trying to keep my connection speeds up.</figcaption></figure><p>SSH has the ability to create a SOCKS proxy. &#xA0;This is a general TCP proxy that can be used to forward traffic from your computer through another computer. &#xA0;So, with an android app acting as an SSH server and any SSH client (I&apos;m using MacOS), you can bypass any hotspot throttling using an application that can connect using a SOCKS proxy. &#xA0;Your traffic will basically appear to come from your phone directly instead of a client behind a hotspot NAT connection.<br><br>My preferred SSH server on Android is <a href="https://play.google.com/store/apps/details?id=berserker.android.apps.sshdroid&amp;hl=en_US">SSHDroid</a>. &#xA0;The option to enable an SSH proxy is simply -D followed by the port you want the proxy server to listen on. &#xA0;Here is the basic idea:<br><br>1 - Turn on hotspot tethering and confirm that your client can connect.<br>2 - Launch SSHDroid. &#xA0;Hit the start button. &#xA0;SSHDroid will report the IP and port that the SSH server is running on.</p><figure class="kg-card kg-image-card"><img src="https://www.thenoel.org/content/images/2019/07/Screenshot_20190703-235648.png" class="kg-image" alt="Freedom! (From your wireless carrier&apos;s hotspot throttling)" loading="lazy"></figure><p>3. &#xA0;Connect to the SSH server from your ssh client. &#xA0;For example, I would connect to SSHdroid from my Mac with this command:</p><!--kg-card-begin: markdown--><p><code>ssh admin@192.168.43.66 -D 9999</code></p>
<!--kg-card-end: markdown--><p>This will start the SSH connection to the SSHDroid server on my android phone and create a local SOCKS proxy on port 9999 on my laptop.</p><p>4. &#xA0;Finally, configure your client to connect to the proxy server. &#xA0;For Mac OS, that means configuring the network settings to connect to the proxy server at localhost:9999. &#xA0;For some clients (like Firefox or git), they use their own proxy settings apart from the system wide proxy settings.</p><p>While this is connected, you should now have full speed from your carrier. &#xA0;No more throttling. &#xA0;Just freedom.<br><br>Things to note:<br></p><ul><li>You may want to check the TOS with your provider. &#xA0;This stuff may violate the TOS. &#xA0;But, in a pinch, it works well. &#xA0;You shouldn&apos;t abuse it.</li><li>You don&apos;t need root access to your phone!</li><li>You may get better performance if you add the -C option in your ssh command. &#xA0;This turns on compression.</li><li>This method works well with any SSH client. &#xA0;It should work with putty on Windows. &#xA0;It works well on my Chromebook running in Crostini (<a href="https://chrome.google.com/webstore/detail/connection-forwarder/ahaijnonphgkgnkbklchdhclailflinn">you may need to forward ports</a>) and with the wonderful <a href="https://chrome.google.com/webstore/detail/secure-shell-app/pnhechapfaindjhompbnflcldabbghjo?hl=en">Chromebook SSH app</a>.</li><li>Creating a SOCKS proxy is also a good way to encrypt your traffic without having to use VPN. &#xA0;For example, during this roadtrip, I SSH into my home SSH servers to create the SOCKS proxy tunnel. &#xA0;This protects me from the foreign network that I&apos;m on with encryption and my point of presence for the Internet is my home.</li><li>SSHdroid has a lot of options including the ability to use keys or passwords.</li></ul><p> </p>]]></content:encoded></item><item><title><![CDATA[BlueKeep Scanner Docker Image]]></title><description><![CDATA[<p>&quot;Hey - this isn&apos;t a security blog!&quot;<br><br>IKR? &#xA0;But yeah, this BlueKeep stuff &#xA0;a.k.a CVE-2019-0708 seems scary. &#xA0;So, some nice peeps out there have made scanning utilities for this stuff. &#xA0;<a href="https://github.com/robertdavidgraham/rdpscan">https://github.com/robertdavidgraham/rdpscan</a></p><p>There are pre-build MacOS and</p>]]></description><link>https://www.thenoel.org/bluekeep-scanner-docker-image/</link><guid isPermaLink="false">5f19608e5d26b30001a91a14</guid><dc:creator><![CDATA[Noel]]></dc:creator><pubDate>Tue, 28 May 2019 20:43:12 GMT</pubDate><content:encoded><![CDATA[<p>&quot;Hey - this isn&apos;t a security blog!&quot;<br><br>IKR? &#xA0;But yeah, this BlueKeep stuff &#xA0;a.k.a CVE-2019-0708 seems scary. &#xA0;So, some nice peeps out there have made scanning utilities for this stuff. &#xA0;<a href="https://github.com/robertdavidgraham/rdpscan">https://github.com/robertdavidgraham/rdpscan</a></p><p>There are pre-build MacOS and Windows binaries there. &#xA0;If you love Docker (and I know you do), I also made an image here:<br><br>leonowski/rdpscan:latest<br>To use it, simply invoke it like this:</p><!--kg-card-begin: markdown--><p><code>docker run --rm -i leonowski/rdpscan:latest x.x.x.x</code></p>
<!--kg-card-end: markdown--><p>Where &quot;x.x.x.x&quot; is the IP you want to scan. &#xA0;Full usage and instructions at: &#xA0;<a href="https://github.com/robertdavidgraham/rdpscan">https://github.com/robertdavidgraham/rdpscan</a> . &#xA0;You can also pass in a subnet like x.x.x.x/24 or even a file with a list to scan.<br><br>I used google&apos;s fantastic distroless images as the base to keep things small. &#xA0;Dockerfile available here: &#xA0;<a href="https://hub.docker.com/r/leonowski/rdpscan">https://hub.docker.com/r/leonowski/rdpscan</a><br></p>]]></content:encoded></item><item><title><![CDATA[Docker Container for August Lock Bridge]]></title><description><![CDATA[<p>It turns out that my old blog post about making an August lock bridge device was popular <a href="https://www.thenoel.org/diy-august-l/">https://www.thenoel.org/diy-august-l/</a></p><p>Unfortunately, some folks had problems getting things to run due to a combination of some vague instructions I put up and possibly a lack of experience working with</p>]]></description><link>https://www.thenoel.org/august-bridge-docker/</link><guid isPermaLink="false">5f19608e5d26b30001a91a12</guid><dc:creator><![CDATA[Noel]]></dc:creator><pubDate>Sun, 07 Apr 2019 04:23:23 GMT</pubDate><media:content url="https://www.thenoel.org/content/images/2019/04/1_9hGvYE5jegHm1r_97gH-jQ.png" medium="image"/><content:encoded><![CDATA[<img src="https://www.thenoel.org/content/images/2019/04/1_9hGvYE5jegHm1r_97gH-jQ.png" alt="Docker Container for August Lock Bridge"><p>It turns out that my old blog post about making an August lock bridge device was popular <a href="https://www.thenoel.org/diy-august-l/">https://www.thenoel.org/diy-august-l/</a></p><p>Unfortunately, some folks had problems getting things to run due to a combination of some vague instructions I put up and possibly a lack of experience working with things like nodejs. &#xA0;So, I thought about making a Docker image that could do most of the nodejs stuff automagically. &#xA0;It took some time as I had never worked with Docker on a Raspberry Pi before and I didn&apos;t know how to make bluetooth work in a container.</p><p>Fortunately, <a href="https://www.balena.io/">balena</a> has all of this worked out already! &#xA0;The other part of this is getting Docker to work properly on the Raspberry Pi Zero W. &#xA0;As of this writing, <a href="https://github.com/docker/compose/issues/6335">there is a bug that causes a seg fault when running Docker on Raspbian</a>. &#xA0;There is a workaround if you install a particular version. &#xA0;Instructions will be below. &#xA0;First, a note: &#xA0;You should know how to SSH into your Raspberry Pi Zero and work with Linux. &#xA0;It is expected that you will run this bridge headless and hidden away somewhere (but close enough to connect via bluetooth to your lock). &#xA0;The instructions below start with the assumption that you have installed Raspbian Stretch on your zero.</p><p>1. &#xA0;Run these commands to get some required things and things up to date:</p><p><code>sudo apt-get update &amp;&amp; sudo apt-get upgrade -y &amp;&amp; sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev</code><br></p><p>2. &#xA0;Run these commands to install the particular version of Docker that doesn&apos;t crash:</p><p><code>curl -fsSL https://get.docker.com -o get-docker.sh</code></p><p><code>chmod u+x get-docker.sh</code></p><p><code>VERSION=18.06.3~ce~3-0~raspbian ./get-docker.sh</code><br></p><h2 id="running-the-docker-container">Running the Docker Container</h2><p>To run the Docker container, launch it with environment variables that specify the key, key offset, and port (default is 8080). &#xA0;An example is below:</p><pre><code>sudo docker run --restart always -d \
-e &quot;OFFLINEKEY=ABCD1234&quot; -e &quot;OFFLINEKEYOFFSET=1&quot; -e &quot;PORT=8080&quot; \
-v /run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket \
--privileged --network host leonowski/august-server</code></pre><p>Explanation of options:</p><p><code>--restart always</code> --&gt; &#xA0;tells Docker to always restart this container</p><p><code>-d</code> --&gt; &#xA0;tells Docker to run the container daemonized</p><p><code>-e</code> --&gt; specifies an environment variable pair. &#xA0;3 are specified for the key, key offset, and port (if port is not set, 8080 is default). &#xA0;Obviously, set it these env vars to your particular lock&apos;s keys.</p><p><code>-v /run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket</code> --&gt; maps the dbus path to allow bluetooth to work. &#xA0;:)</p><p><code>--privileged</code> --&gt; &#xA0;the bluetooth stuff requires privileged container mode to be on</p><p><code>--network host</code> --&gt; &#xA0;the bluetooth stuff also requires the container to be in network host mode.<br><br></p><h2 id="one-final-thing">One Final Thing</h2><p>I was building the container on the raspi directly and then I found out you could cross compile on an x86 machine including Docker Hub! &#xA0;That&apos;s why you can pull the image directly from Dockerhub at leonowski/august-server. &#xA0;Check out the Dockerfile to see how the cross compile works. &#xA0;It&apos;s really simple thanks to the folks at balena.</p>]]></content:encoded></item><item><title><![CDATA[Ghost 2.0 and Sausage!]]></title><description><![CDATA[<p>2019 is here. &#xA0;That means it&apos;s time to update Ghost to 2.0. &#xA0;Also, I put a new picture up as the cover for thenoel.org. &#xA0;It&apos;s a picture of some hot sausage cooking up on a grill that I took in Prague.</p>]]></description><link>https://www.thenoel.org/ghost-2-0-and-sausage/</link><guid isPermaLink="false">5f19608e5d26b30001a91a11</guid><dc:creator><![CDATA[Noel]]></dc:creator><pubDate>Sat, 12 Jan 2019 16:26:59 GMT</pubDate><media:content url="https://www.thenoel.org/content/images/2020/08/IMG_20181230_194931.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://www.thenoel.org/content/images/2020/08/IMG_20181230_194931.jpg" alt="Ghost 2.0 and Sausage!"><p>2019 is here. &#xA0;That means it&apos;s time to update Ghost to 2.0. &#xA0;Also, I put a new picture up as the cover for thenoel.org. &#xA0;It&apos;s a picture of some hot sausage cooking up on a grill that I took in Prague. &#xA0;The street food was amazing.</p>]]></content:encoded></item><item><title><![CDATA[Great Utility - ngrok]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p><a href="https://ngrok.com/">https://ngrok.com/</a></p>
<p>It lets you make a public, Internet accesible endpoint.  It&apos;s great for doing quick tests.</p>
<!--kg-card-end: markdown-->]]></description><link>https://www.thenoel.org/greatest-thing-since-sliced-bread-ngrok/</link><guid isPermaLink="false">5f19608e5d26b30001a91a0f</guid><dc:creator><![CDATA[Noel]]></dc:creator><pubDate>Sat, 21 Jul 2018 09:13:22 GMT</pubDate><media:content url="https://www.thenoel.org/content/images/2020/08/ngrok-black.svg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://www.thenoel.org/content/images/2020/08/ngrok-black.svg" alt="Great Utility - ngrok"><p><a href="https://ngrok.com/">https://ngrok.com/</a></p>
<p>It lets you make a public, Internet accesible endpoint.  It&apos;s great for doing quick tests.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[1 Year with the Chevy Bolt]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>It has been about 1 year since I got the Chevy Bolt.  It&apos;s time to reflect on this revolutionary EV.</p>
<p><img src="https://www.thenoel.org/content/images/2018/03/00000IMG_00000_BURST20180309144917915_COVER.jpg" alt="00000IMG_00000_BURST20180309144917915_COVER" loading="lazy"></p>
<p>First, I have to say - this thing is still awesome.  Instant torque, long range battery (60KWh), and the DC fast charger make this an awesome car.  There</p>]]></description><link>https://www.thenoel.org/1-year-with-the-chevy-bolt/</link><guid isPermaLink="false">5f19608e5d26b30001a91a0e</guid><dc:creator><![CDATA[Noel]]></dc:creator><pubDate>Sat, 10 Mar 2018 01:52:58 GMT</pubDate><media:content url="https://www.thenoel.org/content/images/2020/07/00000IMG_00000_BURST20180309144917915_COVER.jpg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://www.thenoel.org/content/images/2020/07/00000IMG_00000_BURST20180309144917915_COVER.jpg" alt="1 Year with the Chevy Bolt"><p>It has been about 1 year since I got the Chevy Bolt.  It&apos;s time to reflect on this revolutionary EV.</p>
<p><img src="https://www.thenoel.org/content/images/2018/03/00000IMG_00000_BURST20180309144917915_COVER.jpg" alt="1 Year with the Chevy Bolt" loading="lazy"></p>
<p>First, I have to say - this thing is still awesome.  Instant torque, long range battery (60KWh), and the DC fast charger make this an awesome car.  There is still no maintenance (other than tire rotations) and the battery hasn&apos;t shown any loss of performance/charge (probably due to the liquid cooling, unlike the air-cooled Leaf which has potential long-term battery issues).  The odometer is at around 20k miles and the car still feels like it&apos;s brand new.  I ride this car hard and run it in sport mode all the time.  It&apos;s a tiny beast.</p>
<p>After driving a Leaf for 3 years, I was hesitant to jump ship - but Nissan didn&apos;t have the larger capacities available yet and I was really itching to get a long range EV.  The Model 3 is still in mass production hell (still is) and I&apos;m just an impatient nerd.  Was it worth it?  After 1 year, I say jumping ship was well worth it.</p>
<p>I do have the same gripes with the vehicle:</p>
<ul>
<li>
<p>It&apos;s tiny.  I&apos;m a small asian guy and it still feels a bit cramped inside.</p>
</li>
<li>
<p>For something that is so technologically advanced, the in car sound system does have some strange problems that require me to reboot it from time to time (I have to stop the car, turn off the entire car, and then turn it back on - ugh!)</p>
</li>
<li>
<p>There is little trunk space.  My wife and I did manage to bring home a large heat lamp from Lowes once using very creative spacing techniques - but man, that trunk is TINY!</p>
</li>
<li>
<p>Chevy&apos;s OnStar cellular system is slooowww.  I don&apos;t subscribe to their major services, but the free basic connection that reports the car&apos;s status, allows door lock/unlock, and other related features is slow.  It also times out a lot when it sits in my garage.  It&apos;s very unreliable (perhaps, an AT&amp;T problem?)</p>
</li>
<li>
<p>This is a common gripe with all EV tires:  No grip.  I realize that EV cars are designed with efficiency in mind and as a result, the tires aren&apos;t the best for performance.  I&apos;m not asking for Z-rated tires here (although, that would be fun in a car like this), but I wish someone made a better tire for EVs.  With all that torque, it&apos;s easy to lose control in sport mode if you&apos;re not careful.  All that torque probably wears out the tires quickly too.</p>
</li>
</ul>
<p>My family is now ready for a 2nd EV.  There are lots of options now with bigger batteries.  Maybe something will change my mind soon about how good the Bolt is - but for now, the Bolt is badass.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Things I Learned While Trying To Solve Euler Project Problem #3]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Euler Project problem 3 took me way longer than I expected.  While I am not a real programmer, I thought I was good enough to script this in bash quickly.  My life as an IT guy requires me to have some knowledge of scripting and I thought I was good</p>]]></description><link>https://www.thenoel.org/things-i-learned-while-trying-to-solve-euler-project-3/</link><guid isPermaLink="false">5f19608e5d26b30001a91a0c</guid><dc:creator><![CDATA[Noel]]></dc:creator><pubDate>Sat, 03 Mar 2018 08:55:48 GMT</pubDate><media:content url="https://www.thenoel.org/content/images/2018/03/euler_portrait.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://www.thenoel.org/content/images/2018/03/euler_portrait.png" alt="Things I Learned While Trying To Solve Euler Project Problem #3"><p>Euler Project problem 3 took me way longer than I expected.  While I am not a real programmer, I thought I was good enough to script this in bash quickly.  My life as an IT guy requires me to have some knowledge of scripting and I thought I was good enough to pound this out quickly.  It took some time.  In the end, I realized that there was a simple and elegant way to get the correct result.  If you want to just skip to it, here it is:  <a href="https://github.com/leonowski/euler-practice/blob/master/euler3.sh">https://github.com/leonowski/euler-practice/blob/master/euler3.sh</a></p>
<p>My first approach was really like a brute force method.  I made a function to check if something was a prime number and made another function to get the square root of a number (I checked if numbers 2 through the square root were evenly divisible).  I then made an array of all numbers evenly divisible into the input number.  It looked like this:</p>
<pre><code>#lets make an array to get divisibles first
array=()
for x in $(eval echo &quot;{1..$1}&quot;)
do
  if [[ $1%$x -eq 0 ]];
    then
    array+=(&quot;$x&quot;)
  fi
done
</code></pre>
<p>After I got that array, I would then pull out only the primes into a new array.  I would use the function I made previously to verify if the number was prime.  It looked like this:</p>
<pre><code>#now lets filter out the divisible array and keep only primes
primearray=()
for z in &quot;${array[@]}&quot;;
  do
    if [[ $(primecheck &quot;$z&quot;) -eq 1 ]];
    then
      primearray+=(&quot;$z&quot;)
    fi
  done
</code></pre>
<p>Finally, I would just print out the last number in the new prime only array like this:</p>
<pre><code>printf &apos;%s\n&apos; &quot;${primearray[-1]}&quot;
</code></pre>
<p>And that did work.  But it was freakin slow.  On top of that, it wouldn&apos;t take the input of the number that the Euler problem wanted me to use:600851475143.</p>
<p>I scratched my head during my free time.  My next idea was to abandon the use of arrays.  Why not just loop backwards from the input to 1 and stop when we find even divisibility AND have a prime number?!  So, I dropped the whole array approach and just made 1 for loop like this:</p>
<pre><code>for x in $(seq &quot;$1&quot; -1 1)
 do
   if [[ $1%$x -eq 0 &amp;&amp; $(primecheck $x) -eq 1 ]];
   then
   printf &apos;%s\n&apos; &quot;$x&quot;
   break 2
  fi
done
</code></pre>
<p>Technically, this was better.  I didn&apos;t have to go through a set of numbers twice.  I was able to calculate prime factors a little faster, but it still wasn&apos;t that fast and I still couldn&apos;t use the actual number the problem wanted me to use.  AARGH!</p>
<p>My next thought was to optimize the loop by immediately skipping the primecheck() function on numbers that were obviously not prime - numbers ending in 0,2,4,6, and 8.  So, I added this check before the mod 0 and primecheck:</p>
<pre><code>for x in $(seq &quot;$1&quot; -1 1)
 do
   lastdigit=&quot;${x: -1}&quot;
   if [[ &quot;$lastdigit&quot; -eq &quot;0&quot; ]] || [[ &quot;$lastdigit&quot; -eq &quot;2&quot; ]] || [[ &quot;$lastdigit&quot; -eq &quot;4&quot; ]] || [[ &quot;$lastdigit&quot; -eq &quot;6&quot; ]] || [[ &quot;$lastdigit&quot; -eq &quot;8&quot; ]]; then
   continue

   elif [[ $1%$x -eq 0 &amp;&amp; $(primecheck $x) -eq 1 ]]; then
   printf &apos;%s\n&apos; &quot;$x&quot;
   break 
  fi
done
</code></pre>
<p>This also gave a speedup again.  But - you guessed it, still no luck with:600851475143.</p>
<p>I battled some flu symptoms while thinking about this in my head.  I then thought about trying to figure out prime factors by hand.  I had actually forgotten how to do this by hand - it&apos;s actually really simple.  Starting at 2, see if you can evenly divide the input number by 2.  If you can, great - write it down.  Try 2 again against the answer of the previous try (the input divided by 2).  If it still works, write it down again.  Try 2 again against the answer of the previous try (the input divided by 2 divided by 2) - if it doesn&apos;t work, try 3 against the answer of the previous try.  If 3 works, write that down.  If it doesn&apos;t, continue to 4.  Continue this until all the numbers you have written down multiplied by each other equal your input number.</p>
<p>Some examples:</p>
<p>Input:  12345<br>
Factors:  3 x 5 x 823</p>
<p>Input:  123456<br>
Factors:  2 x 2 x 2 x 2 x 2 x 2 x 3 x 643</p>
<p>Input:  22<br>
Factors:  2 x 11</p>
<p>Input:  123<br>
Factors:  3 x 41</p>
<p>A pattern began to show.  The last number is always a prime!  While in my medicated/woozy state, I wrote down my thought on a new loop (using arrays again) to get what I needed.  It turns out being away from my computer really helped.  Doing things by hand can really make things simple for the brain.</p>
<p><img src="https://www.thenoel.org/content/images/2018/03/notes.jpg" alt="Things I Learned While Trying To Solve Euler Project Problem #3" loading="lazy"></p>
<p>So, the script simply looked like this (no more prime checks):</p>
<pre><code>factors=()
current=$1
for x in $(seq 2 1 &quot;$1&quot;)
do
  if [[ $current%$x -eq 0 ]]; then
  factors+=(&quot;$x&quot;)
  current=&quot;$current&quot;/&quot;$x&quot;
  x=$x
  fi
done

printf &apos;%s\n&apos; &quot;${factors[-1]}&quot;
</code></pre>
<p>This seemed to work really well!  I was like &quot;holy crap!&quot; - but there was still a problem.  I couldn&apos;t use the input number that the Euler project wanted me to use:600851475143.  I was REALLY starting to hate that number.  In fact large 6+ digit numbers all seemed slow.</p>
<p>After running through this in my head, I realized that the entire loop had to be run from 2 through the input number.  So, the bigger the input number, the longer it would take.  It shouldn&apos;t need to keep going once you have all the factors in place to equal the input number.  So, I added something in the loop to keep track of it:</p>
<pre><code>mul=1
  for i in &quot;${factors[@]}&quot;; do
    mul=$(( mul * i ))
    done
#    echo $mul #uncomment to see progress of check done before break
    if [[ $mul -eq $1 ]]; then
    break
  fi
</code></pre>
<p>What this did was print out the current state of the array if you multiplied all the values.  Once it got to the input number, the loop could stop.  Done - you have your prime at the end of the array.  This improvement also worked well.  I even had something in there to print the progress of the array multiplication.  Things were now SUPER FAST!  But - GUESS WHAT AGAIN!?  I still couldn&apos;t use the 600851475143 number.  I was almost ready to scream.</p>
<p>I tried to run it again with 600851475143 and realized that my &quot;echo $mul&quot; wasn&apos;t even showing any progress.  Surely, it would have hit 1 number at some point that was evenly divisible.  I suspected that the number 600851475143 was just way too big for what I was running this on and the for loop would never run on that big number (I was running this in Cygwin64 on Windows).  Maybe this isn&apos;t a problem in a real linux environment?  I then started experimenting with the main loop.  I realized that if I changed the upper range of the for loop to a hard number (instead of the variable input like 600851475143), I could get my answer for 600851475143!  The answer was 6857, so if I put 7000 as the last number in the loop, things worked!  So, finally, I thought about doing a loop that didn&apos;t depend on a definite number range.  The answer was to simply use a while loop!  I could initialize the counter at 2 and count up indefinitely without specifying the upper number!  So, the final work looked like this:</p>
<pre><code>factors=()
current=$1
x=2
while [[ $x -gt 1 ]]
do
  if [[ $current%$x -eq 0 ]]; then
  factors+=(&quot;$x&quot;)
  current=&quot;$current&quot;/&quot;$x&quot;
  x=$x
  mul=1
  for i in &quot;${factors[@]}&quot;; do
    mul=$(( mul * i ))
    done
#    echo $mul #uncomment to see progress of check done for break
    if [[ $mul -eq $1 ]]; then
    break
    fi
  fi
x=$((x+1))
done


#largest prime factor should be last element in the factors array
printf &apos;%s\n&apos; &quot;${factors[-1]}&quot;
</code></pre>
<p>YES!  That worked!  No more hard coding a for loop range!  I&apos;m sure this problem would be easy for a seasoned programmer, but it was actually fun for me to go through this and struggle.</p>
<p><em><strong>UPDATE</strong></em></p>
<p>OK, while the above did work for the project euler number, the script seemed to be broken for some other numbers.  I took a closer look and I was incrementing the loop at the wrong time.  I also made the break just print it out right there.  Here is the final best version (I promise!):</p>
<pre><code>factors=()
current=$1
x=2
while [[ $x -gt 1 ]]
do
  if [[ $current%$x -eq 0 ]]; then
  factors+=(&quot;$x&quot;)
  current=&quot;$current&quot;/&quot;$x&quot;
  x=$x
  mul=1
  for i in &quot;${factors[@]}&quot;; do
    mul=$(( mul * i ))
  done
#    echo $mul #uncomment to see progress of check done for break
    if [[ $mul -eq $1 ]]; then
    printf &apos;%s\n&apos; &quot;${factors[-1]}&quot;
    exit
    fi
  continue
  fi
x=$((x+1))
done
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Getting Laid Off Sucks - And Then it Doesn't]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Of course getting laid off sucks!  Duh, right?  It bruises the ego and makes you question your own abilities.  I was laid off recently about a month ago.  Ouch.  I went through the usual range of emotions.  I read multiple articles on how to dust yourself off and get back</p>]]></description><link>https://www.thenoel.org/getting-laid/</link><guid isPermaLink="false">5f19608e5d26b30001a91a0b</guid><dc:creator><![CDATA[Noel]]></dc:creator><pubDate>Sun, 25 Feb 2018 06:25:33 GMT</pubDate><media:content url="https://www.thenoel.org/content/images/2018/02/44cidlt.jpg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://www.thenoel.org/content/images/2018/02/44cidlt.jpg" alt="Getting Laid Off Sucks - And Then it Doesn&apos;t"><p>Of course getting laid off sucks!  Duh, right?  It bruises the ego and makes you question your own abilities.  I was laid off recently about a month ago.  Ouch.  I went through the usual range of emotions.  I read multiple articles on how to dust yourself off and get back up on that horse.  I&apos;ve had setbacks before - this is nothing, right?</p>
<p><img src="https://www.thenoel.org/content/images/2018/02/You-Jump-Back-On-The-Horse-Funny-Meme-Picture.jpg" alt="Getting Laid Off Sucks - And Then it Doesn&apos;t" loading="lazy"></p>
<p>Well, this isn&apos;t a post about how things are different.  The cliches and stories out there are true.  Dust yourself off and get going again.  No one is going to feel sorry for you.  This lay off was a kick in the pants that I needed.  At some point, a well-paying job where you aren&apos;t challenged isn&apos;t good.  Things that are worth it are always hard.</p>
<p>So, with that in mind - I thought I would try to run through <a href="https://projecteuler.net/archives">Project Euler problems</a> using only Bash.  Yikes!  The goals being:</p>
<ol>
<li>Refresh my shell scripting skills.</li>
<li>Improve my thinking skills.</li>
<li>Do something hard.</li>
</ol>
<p>I actually skimmed through the problems quickly and thought to myself, &quot;these should be easy!&quot;.  Well, I&apos;m writing this post after doing the first 2.  While the idea of how to run through these things seemed easy in my head (&quot;pseudocode&quot;), getting the syntax right in Bash and remembering what is possible seems to be a challenge.  Fortunately, I found a neat tool called ShellCheck:</p>
<p><a href="https://github.com/koalaman/shellcheck">https://github.com/koalaman/shellcheck</a></p>
<p>They also have a neat web-based version:</p>
<p><a href="https://www.shellcheck.net/">https://www.shellcheck.net/</a></p>
<p>This tool helps you format your shell scripts properly.  It can even tell you if certain things will only work for certain shells (bash, zsh, etc.) and how to make them more generic so they work in all shells.  Very neat stuff.</p>
<p>I&apos;m going to keep a copy of the scripts in this repo:</p>
<p><a href="https://github.com/leonowski/euler-practice">https://github.com/leonowski/euler-practice</a></p>
<p>Feel free to mock my approach/style.  Any criticism will help me in the long run.  This is why getting laid off no longer sucks for me.  Challenges are fun.  Discovering new tools (to me anyway) is fun.  Discussing opportunities with old co-workers, friends, and potential new employers is fun.  It took getting laid off to remind me.</p>
<p><img src="https://www.thenoel.org/content/images/2018/02/f8b73f64f0c18ce756f9c9074cdb8eb8f2a0f52a600609eb0921b74c48893537.jpg" alt="Getting Laid Off Sucks - And Then it Doesn&apos;t" loading="lazy"></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[ESP8266 DeepSleep Mode Button]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>I ran across <a href="https://randomnerdtutorials.com/esp8266-wi-fi-button-diy-amazon-dash-button-clone/">this neat idea on Random Nerd Tutorials</a> that is basically a way to make your own Amazon Dash button with a customizable action.  While you can certainly get your own Amazon Dash button and hack it for your needs, this solution uses a simple ESP8266 module and</p>]]></description><link>https://www.thenoel.org/esp8266-deepsleep-mode-button/</link><guid isPermaLink="false">5f19608e5d26b30001a91a09</guid><dc:creator><![CDATA[Noel]]></dc:creator><pubDate>Tue, 13 Feb 2018 09:25:17 GMT</pubDate><media:content url="https://www.thenoel.org/content/images/2018/02/esp8266.jpg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://www.thenoel.org/content/images/2018/02/esp8266.jpg" alt="ESP8266 DeepSleep Mode Button"><p>I ran across <a href="https://randomnerdtutorials.com/esp8266-wi-fi-button-diy-amazon-dash-button-clone/">this neat idea on Random Nerd Tutorials</a> that is basically a way to make your own Amazon Dash button with a customizable action.  While you can certainly get your own Amazon Dash button and hack it for your needs, this solution uses a simple ESP8266 module and a small Arduino sketch.</p>
<p>The code is available <a href="https://github.com/RuiSantosdotme/Random-Nerd-Tutorials/blob/master/Projects/ESP8266_WiFi_Button.ino">here</a>.</p>
<p>In most of my blog posts, I mention the use of Espurna - but with this, it&apos;s so simple and beautiful.  You only need a small sketch to do this.  The idea is:</p>
<ol>
<li>Place the ESP8266 in DeepSleep mode all the time.</li>
<li>On a reset (waking up the device), connect to Wi-Fi and make an HTTP request.</li>
<li>Go back to DeepSleep.</li>
</ol>
<p>I decided to give it a try.  I took a look at the sketch first and saw that the setup function immediately put the device into sleep after connecting via wifi and making the HTTP request (the original post on Random Nerd Tutorials is how to make this run an IFTTT action).</p>
<pre><code>void setup() {
  Serial.begin(115200); 

  initWifi();
  makeIFTTTRequest();

  // Deep sleep mode until RESET pin is connected to a LOW signal (pushbutton is pressed)
  ESP.deepSleep(0);
}
</code></pre>
<p>The main loop function does nothing.</p>
<pre><code>void loop() {
  // sleeping so wont get here
}
</code></pre>
<p>And that&apos;s it.  So, you simply wire up a button to the ESP8266 reset pin and every time the thing resets, it connects via Wi-Fi and does an HTTP request.  Simple and brilliant.  Usually, you would run something in the main loop - it never occurred to me to NOT run anything in there and use DeepSleep.  The deep sleep feature in the 8266 makes running off a battery viable as it sips on a little juice at a time.</p>
<p><img src="https://www.thenoel.org/content/images/2018/02/esp8266_power.png" alt="ESP8266 DeepSleep Mode Button" loading="lazy"></p>
<p>As you can see in the chart, only the RTC is running in this mode.  So, it sips about only 20 microamps!  I confirmed this on my little USB tester.</p>
<p><img src="https://www.thenoel.org/content/images/2018/02/IMAG0840.jpg" alt="ESP8266 DeepSleep Mode Button" loading="lazy"></p>
<p>I actually thought something was wrong with my tester as I had expected to get some reading above 0.  It wasn&apos;t until I read the specs saying it would draw around 20 microamps.  So, &quot;0.00&quot; is about right.  :)</p>
<p>So, I wanted to try this with something in my home.  I set up a script to toggle my light and exposed it via vutil.  <a href="https://www.thenoel.org/stumbled-across-something-neat-vutil/">I posted about vutil previously here</a>.  After exposing the light control via HTTP, I just needed to alter the sketch a bit.</p>
<p>In the makeIFTTTRequest() function is a simple HTTP GET.  I need to change it to do an HTTP POST.  So, the request now looks like this:</p>
<pre><code>Serial.print(&quot;Request resource: &quot;); 
  Serial.println(resource);
  client.print(String(&quot;POST &quot;) + resource + 
                  &quot; HTTP/1.1\r\n&quot; +
                  &quot;Host: &quot; + server + &quot;\r\n&quot; + 
                  &quot;Accept: */*\r\n&quot; +
                  &quot;Content-Length: &quot; + content.length() + &quot;\r\n&quot; +
                  &quot;Content-Type: application/x-www-form-urlencoded\r\n&quot; +
                  &quot;\r\n&quot; +
                  content +
                  &quot;Connection: close\r\n\r\n&quot;);
</code></pre>
<p>The sketch variables at the top need to be changed for webserver and resource.  webserver should be the IP where you want the HTTP POST to hit and resource should be the REST API endpoint (for vutil, that&apos;s &quot;/execute/command&quot;).  You also need a new variable for the content that will eventually get posted.  I named it content.  So it looks like this now:</p>
<pre><code>// Replace with your unique URL resource
const char* resource = &quot;/execute/command&quot;;

// the webserver
const char* server = &quot;192.168.1.4&quot;;

//the POST content
String content = &quot;command=sh toggle_light.sh 11&quot;;
</code></pre>
<p>And since we are now using String, we need to include the String library at the top:</p>
<pre><code>#include &lt;String.h&gt;
</code></pre>
<p>After that, compile and upload to your ESP8266.  I have a cheap setup to easily boot or reset my ESP8266 and power it from a 5V source.  Please ignore the lousy soldering job.</p>
<p><img src="https://www.thenoel.org/content/images/2018/02/IMAG0841.jpg" alt="ESP8266 DeepSleep Mode Button" loading="lazy"></p>
<p>Here&apos;s a video of me trying it out on my prototype board.  I don&apos;t have an actual button wired up, but I just connect the wires connected to RESET and ground (pull low) to simulate a button press.</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/kcsRUofGaWc?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
*Oops - I said the wiring for reset is RST to voltage.  I meant RST to ground (pull low).  Sorry!*
<p>It works great!  If I monitor the serial connection while doing this, I can see what&apos;s going on.</p>
<pre><code>Connecting to: MYWIFISSID........
WiFi connected in: 2201, IP address: 192.168.1.129
Connecting to 192.168.1.4
Request resource: /execute/command
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 51
Date: Tue, 13 Feb 2018 09:05:36 GMT
Connection: keep-alive

{&quot;pid&quot;:17132,&quot;output&quot;:&quot;{\&quot;ResponseValue\&quot;:\&quot;OK\&quot;}&quot;}
</code></pre>
<p>So, it connects to Wi-fi, gets an IP, does the HTTP POST, gets a response, disconnects, and then it goes back to deep sleep (that&apos;s not reported in serial output, but you can print something out in the sketch if you really want to).  You could expand this to practically anything via HTTP or something with the GPIO.  The best part is you can run this off a battery since it sips so little juice in DeepSleep.</p>
<p>Thanks to the folks at <a href="https://randomnerdtutorials.com/">Random Nerd Tutorials</a> for teaching me something neat tonight.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[HomeGenie - A Look at My Home Setup]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p><a href="http://www.homegenie.it/">HomeGenie</a> is what I have been running for my Home Automation needs.  It does a lot, but I mainly chose it for these features:</p>
<ul>
<li><a href="http://www.z-wave.com/">Z-wave</a> support.</li>
<li>Multi-platform.  It&apos;s an app coded in C# and packages are built for all flavors of servers/arches including Windows/Linux and x86/</li></ul>]]></description><link>https://www.thenoel.org/homegenie-a-look-at-my-home-setup/</link><guid isPermaLink="false">5f19608e5d26b30001a91a08</guid><dc:creator><![CDATA[Noel]]></dc:creator><pubDate>Sun, 11 Feb 2018 10:56:01 GMT</pubDate><media:content url="https://www.thenoel.org/content/images/2018/02/61jDGMe4X2L.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://www.thenoel.org/content/images/2018/02/61jDGMe4X2L.png" alt="HomeGenie - A Look at My Home Setup"><p><a href="http://www.homegenie.it/">HomeGenie</a> is what I have been running for my Home Automation needs.  It does a lot, but I mainly chose it for these features:</p>
<ul>
<li><a href="http://www.z-wave.com/">Z-wave</a> support.</li>
<li>Multi-platform.  It&apos;s an app coded in C# and packages are built for all flavors of servers/arches including Windows/Linux and x86/arm (running with mono).</li>
<li>Support for generic IP cameras.</li>
<li>API to interact with devices.</li>
<li>A great <a href="https://play.google.com/store/apps/details?id=com.glabs.homegenieplus&amp;hl=en">Android interface app</a></li>
</ul>
<p>The developer <a href="https://github.com/genemars">Gene</a> is also pretty responsive to bug reports and feature requests.</p>
<p>With all of that said, I am in the middle of a transition to another home automation called <a href="https://home-assistant.io/">Home Assistant</a>  I&apos;ll talk about this more in a minute, but let&apos;s take a look at HomeGenie first.</p>
<p>Since the server can run in mono, I run it on a Raspberry Pi.  To control Z-Wave devices, I use a simple USB Z-wave stick like <a href="https://aeotec.com/z-wave-usb-stick">this</a>.  And with just those 2 pieces, this thing is already pretty powerful.</p>
<p><img src="https://www.thenoel.org/content/images/2018/02/IMAG0837.jpg" alt="HomeGenie - A Look at My Home Setup" loading="lazy"><br>
<em>This is how the Raspberry Pi 3 looks with the Z-wave USB stick.  The dust is not necessary.</em></p>
<p><img src="https://www.thenoel.org/content/images/2018/02/Screenshot_2018-02-11-02-08-32.png" alt="HomeGenie - A Look at My Home Setup" loading="lazy"><em>A screenshot of the Android interface customized for a room in my house.</em></p>
<p>Once you get it going, it&apos;s a simple matter of configuring it via the web GUI.  You can add new modules (switches, cameras, sensors, etc.) all via the GUI.</p>
<p><img src="https://www.thenoel.org/content/images/2018/02/2018-02-11-02_14_01-HomeGenie.png" alt="HomeGenie - A Look at My Home Setup" loading="lazy"><em>Screenshot of HomeGenie switches.</em></p>
<p>To get things to work with Alexa, I use the <a href="https://www.thenoel.org/control-practically-anything-with-alexa/">ha-bridge I mentioned in a previous post</a>.  HomeGenie provides a simple <a href="https://genielabs.github.io/HomeGenie/api/mig/mig_api_zwave.html#5">API</a> to get the status of switches, turn them off/on, or even dim (if the device supports dimming).  For example, I can turn a switch with Z-wave identifier 24 by doing an HTTP GET on this endpoint:</p>
<pre><code>http://host:8080/api/HomeAutomation.ZWave/24/Control.On
</code></pre>
<p>You would simply plug that into ha-bridge under the &quot;On Items&quot; section.  To dim, the endpoint would look like this:</p>
<pre><code>http://host:8080/api/HomeAutomation.ZWave/24/Control.Level/${intensity.percent}
</code></pre>
<p>You would plug that in the &quot;Dim Items&quot; section of ha-bridge.  &quot;intensity.percent&quot; is a variable that is determined by the number you tell Alexa.  So, for example, you can say &quot;Alexa, dim the lights to 30%&quot; and the number 30 will be used by ha-bridge making the final endpoint:</p>
<pre><code>http://host:8080/api/HomeAutomation.ZWave/24/Control.Level/30
</code></pre>
<p>Since you can control it via HTTP, you can also use curl to script some actions.  Here is a simple script I use to toggle the state of any light:</p>
<pre><code>#!/bin/bash

get_status() {
curl --silent http://host:8080/api/HomeAutomation.HomeGenie/Config/Modules.Get/HomeAutomation.ZWave/&quot;$1&quot; | jq &apos;.Properties[] | select(.Name == &quot;Status.Level&quot;) | .Value&apos;
}

turn_off() {
curl --silent http://host:8080/api/HomeAutomation.ZWave/&quot;$1&quot;/Control.Off
}

turn_on() {
curl --silent http://host:8080/api/HomeAutomation.ZWave/&quot;$1&quot;/Control.On
}


get_status &quot;$1&quot; | grep 0 &amp;&amp; turn_on &quot;$1&quot; || turn_off &quot;$1&quot;
</code></pre>
<p>Just use the Z-wave switch identity number as an input parameter.  BTW, the script above uses <a href="https://stedolan.github.io/jq/">jq</a> to help me take the JSON output of the API and mangle it for my needs.  I could probably post something later about how much I love to use <a href="https://stedolan.github.io/jq/">jq</a>.  If you haven&apos;t used jq before, I encourage you to try it.  It&apos;s neato burrito.</p>
<h1 id="anewchallengerhasenteredthering">A New Challenger Has Entered the Ring</h1>
<p>While I do love HomeGenie, I do plan on switching to something new and exciting called <a href="https://home-assistant.io/">Home Assistant</a>.  Development is hot and heavy at Home Assistant and they support <a href="https://home-assistant.io/components/">A TON OF devices</a>.  It seems like they have a release every week with more and more support for new and neat things.  I had looked into Home Assistant some time back, but the end-user interface didn&apos;t seem as &quot;nice&quot; as HomeGenie&apos;s.  That is quickly changing.  I am able to run Home Assistant now in a docker container to test things out.  One of the neat things that Home Assistant supports is the idea of a &quot;<a href="https://home-assistant.io/components/switch.command_line/">Command Line Switch</a>.&quot;  This lets you control practically anything that is accessible from a command line.  This allows me to control my existing HomeGenie setup from Home Assistant.</p>
<p><img src="https://www.thenoel.org/content/images/2018/02/2018-02-11-02_36_16-Home-Assistant.png" alt="HomeGenie - A Look at My Home Setup" loading="lazy"><br>
<em>A screenshot of the Home Assistant user interface.  This is probably old by now and they do have themes and a newer UI in the pipeline.</em></p>
<p>Home Assistant also has an Alexa/Hue Phillips emulator built-in so it negates the need for ha-bridge.  If I had to pick a winner, I would say Home Assistant is starting to pull away.</p>
<h1 id="onelastthinghomekitsupport">One Last Thing - HomeKit Support</h1>
<p>We have some Apple users in my household.  There is no iOS app for the HomeGenie interface and the web interface is too slow to run on mobile well.  I found this neat NodeJS server app that emulates the iOS HomeKit API called <a href="https://www.npmjs.com/package/homebridge">homebridge</a>.  Homebridge has a ton of plugins to integrate devices with HomeKit.  A <a href="https://www.npmjs.com/search?q=homebridge%20&amp;page=1&amp;ranking=optimal">simple search on npmjs.com</a> can list these plugins.  There is one particular plugin that takes your configuration from home assistant and puts it nicely in homebridge.  It&apos;s called <a href="https://www.npmjs.com/package/homebridge-homeassistant">homebridge-homeassistant</a>.</p>
<p><img src="https://www.thenoel.org/content/images/2018/02/IMG_0026.PNG" alt="HomeGenie - A Look at My Home Setup" loading="lazy"><em>A screenshot of HomeKit support for iOS users in my household.</em></p>
<p>It works well for my needs.  Even voice control with Siri works. But, things are a bit &quot;rube goldbergy&quot; - I have 3 servers running just to do all of this:</p>
<p>HomeGenie &lt;--&gt; Home Assistant &lt;--&gt; Homebridge</p>
<p>Once I switch over to Home Assistant, that should make things a lot simpler.  I hope.  :p</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[DIY Digital Pool Pump Control]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Most of the motivation behind my projects comes from being cheap.  There are usually easy solutions out there to problems I want to solve, but they are expensive.  For this blog post, I want to talk about my pool pump.  (and yes, Alexa will be mentioned in this post -</p>]]></description><link>https://www.thenoel.org/diy-digital-pool-control/</link><guid isPermaLink="false">5f19608e5d26b30001a91a05</guid><dc:creator><![CDATA[Noel]]></dc:creator><pubDate>Mon, 05 Feb 2018 05:40:18 GMT</pubDate><media:content url="https://www.thenoel.org/content/images/2018/02/IMG_20170917_001516.jpg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://www.thenoel.org/content/images/2018/02/IMG_20170917_001516.jpg" alt="DIY Digital Pool Pump Control"><p>Most of the motivation behind my projects comes from being cheap.  There are usually easy solutions out there to problems I want to solve, but they are expensive.  For this blog post, I want to talk about my pool pump.  (and yes, Alexa will be mentioned in this post - again!)</p>
<p>Most pool pumps out there use a mechanical timer to start and stop the pump at a set period of time.  The common one found in most equipment boxes is made by Intermatic.</p>
<p><img src="https://www.thenoel.org/content/images/2018/02/IMAG0822.jpg" alt="DIY Digital Pool Pump Control" loading="lazy"></p>
<p>That&apos;s a shot of my timer in my equipment box.  It&apos;s a solid device.  I have only had to replace 1 minor part in 10 years (the motor for the timer in the back).  It uses a couple of metal trippers labeled as &quot;on&quot; and &quot;off&quot; to push that orange lever to the right and turn on the system.  While it is solid, it&apos;s very basic.  It turns off, it turns on, it keeps time.  I can&apos;t do anything with it beyond that and it&apos;s not hooked up to my &quot;smart home.&quot;</p>
<p>There are solutions out there like these:</p>
<p><a href="https://www.amazon.com/Aeotec-Security-controller-electricity-consumption/dp/B00MBIRF5W">https://www.amazon.com/Aeotec-Security-controller-electricity-consumption/dp/B00MBIRF5W</a></p>
<p><a href="https://www.amazon.com/dp/B00YTCZZF0/ref=asc_df_B00YTCZZF05359821">https://www.amazon.com/dp/B00YTCZZF0/ref=asc_df_B00YTCZZF05359821</a></p>
<p>But, they are way too expensive.  I am a fan of <a href="http://www.z-wave.com/">Z-wave</a> (in that picture above, I actually use a Z-wave switch to power my pool lights), but there is a cheaper way to do this.  Just like <a href="https://www.thenoel.org/cheap-wall-scone-conversion-part-2-the-software/">my cheap wall sconces</a>, we just need a few cheap items:</p>
<ul>
<li>
<p>ESP8266 powered device like my favorite, NodeMCU:  <a href="https://www.amazon.com/Communication-Wireless-Interface-Internet-Development/dp/B01ISYTADW/">https://www.amazon.com/Communication-Wireless-Interface-Internet-Development/dp/B01ISYTADW/</a>  This is a great device as it has everything integrated:  a serial to USB port, headers pre-soldered, reset/flash buttons, and a 5v/3v regulator.  You can find them really cheap if you buy direct from China too at ~ $3.00 or so.  A Raspberry Pi Zero W works well too, but ESP8266 devices are cheaper and smaller.</p>
</li>
<li>
<p>A couple of solid state relays.  These worked well for me:  <a href="https://www.amazon.com/gp/product/B00RHBEDJE">https://www.amazon.com/gp/product/B00RHBEDJE</a> These are high amp (40) relays.  I need 2 because my pool pump, chlorinator, and heater are powered from a 2-pole 30-amp breaker.  So, each leg is split into 15-amps and each leg goes into 1 relay.  The trigger for the relay can be as low as 3v, which is perfect for GPIO output signals.</p>
</li>
</ul>
<p><img src="https://www.thenoel.org/content/images/2018/02/IMAG0819.jpg" alt="DIY Digital Pool Pump Control" loading="lazy"></p>
<ul>
<li>My favorite software to run ESP8266 devices, <a href="https://github.com/xoseperez/espurna">Espurna</a> (FREE!)</li>
</ul>
<p>This all works for under $30.</p>
<p>The wiring is simple.  Feed one line from the breaker into the relay&apos;s switching terminal (the line).  The other terminal outputs to your equipment (the load).  When the relay is activated, the line will power the load.  To trigger the relay, we attach the GPIO signal from the ESP8266 to (+) on the input.  The common/ground is attached to the (-) side.</p>
<p><img src="https://www.thenoel.org/content/images/2018/02/IMAG0825.jpg" alt="DIY Digital Pool Pump Control" loading="lazy"></p>
<p>Here is an ugly shot of things wired up, but before I put it neatly in the box.</p>
<p><img src="https://www.thenoel.org/content/images/2018/02/IMAG0824.jpg" alt="DIY Digital Pool Pump Control" loading="lazy"></p>
<p>The software/firmware is configured just like how it&apos;s described in my <a href="https://www.thenoel.org/cheap-wall-scone-conversion-part-2-the-software/">cheap sconce post</a>.  The difference here is to configure 2 relays in the hardware.h header file.  I chose to use GPIO 15 and 16, so the relay definitions look like this:</p>
<pre><code>    // Relays
    #define RELAY1_PIN          16
    #define RELAY1_TYPE         RELAY_TYPE_NORMAL
    #define RELAY2_PIN          15
    #define RELAY2_TYPE         RELAY_TYPE_NORMAL
</code></pre>
<p>After configuring the basics, I set the Switches to all be synchronized.  Both legs of power will always be turned on at the same time.</p>
<p><img src="https://www.thenoel.org/content/images/2018/02/2018-02-04-21_12_13-BACKYARDSPRINKLERS---ESPURNA-1.12.3.png" alt="DIY Digital Pool Pump Control" loading="lazy"></p>
<p>Before I slapped everything in the box neatly, I gave it a quick test.  Forgive the blurry video and my use of the word &quot;Alexa&quot; - alexa isn&apos;t in play yet here.</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/AF6BzQ6Sf5Y?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
<p>Now, just slap the thing in neatly.</p>
<img alt="DIY Digital Pool Pump Control" src="https://www.thenoel.org/content/images/2018/02/IMAG0827.jpg" style="width: 300px; height:300px">
<p>I had a concern about the nodemcu device getting a wi-fi signal in that metal box when closed.  After I closed things up, there were no issues.</p>
<p>This solution provides:</p>
<ul>
<li>
<p>An easy way for my family to turn on the pool pump when they want to go swimming.  Since it runs Espurna, I just have Alexa detect it and it can be turned on/off with a simple &quot;Alexa, turn on the pool pump&quot; command.</p>
</li>
<li>
<p>I can have multiple schedules for the timer.  Previously, I only had 1 set of off/on triggers.</p>
</li>
<li>
<p>I don&apos;t have to go outside to change the schedule.</p>
</li>
<li>
<p>Since it can be controlled via REST API, I could make this pump &quot;smarter&quot; and have it turn off when unnecessary or turn on when the temperatures are high (you need to circulate and chlorinate your water more as temps increase).</p>
</li>
</ul>
<p>After putting this all together, I just realized that I should have wired up a button to toggle the relays at the box.  This is if I don&apos;t have my phone near me and I want to activate the pump.  This should be a simple fix - I just need to make a momentary pushbutton, wire it up, and update the Espurna to take that as an input that toggles the relays.  When I get this done, I&apos;ll update this post.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Stumbled Across Something Neat - vutil]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>So, since I&apos;m trying to blog more, let me share some little neat thing I found tonight.  It&apos;s called <a href="https://github.com/vrest-io/vutil">vutil</a>.  It does a few things, but the neat thing I found is being able to execute system commands via HTTP requests.  So, you can then interface</p>]]></description><link>https://www.thenoel.org/stumbled-across-something-neat-vutil/</link><guid isPermaLink="false">5f19608e5d26b30001a91a04</guid><dc:creator><![CDATA[Noel]]></dc:creator><pubDate>Sat, 03 Feb 2018 09:23:43 GMT</pubDate><media:content url="https://www.thenoel.org/content/images/2018/02/xzLSO47.jpg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://www.thenoel.org/content/images/2018/02/xzLSO47.jpg" alt="Stumbled Across Something Neat - vutil"><p>So, since I&apos;m trying to blog more, let me share some little neat thing I found tonight.  It&apos;s called <a href="https://github.com/vrest-io/vutil">vutil</a>.  It does a few things, but the neat thing I found is being able to execute system commands via HTTP requests.  So, you can then interface with your computer via simple HTTP POST commands remotely.  This is very useful for things like home automation or to run simple commands on your computer remotely.</p>
<p>I tried it out on my Windows system in Cygwin with nodejs installed.  It&apos;s a simple setup:  Clone the repo, cd to the vutil dir, and then create a simple config.json file.  If you just want to run the command line feature, the config looks like this:</p>
<pre><code>{
  &quot;activatedModules&quot; : {
    &quot;dbquery&quot; : false,
    &quot;command&quot; : true,
    &quot;csv2json&quot; : false,
    &quot;request&quot; : false,
    &quot;file&quot; : false
  }
}
</code></pre>
<p>Finally, just run npm install while in the directory to get the pre-reqs installed.  Run the command like this to run it on any port you want:</p>
<pre><code>PORT=8677 node server.js
</code></pre>
<p>Now, all you have to do is POST to <a href="http://host/execute/command">http://host/execute/command</a> with a single body parameter named &quot;command&quot; and the value set to the shell command you want to run.  I tested a shutdown in Windows like this:</p>
<pre><code>curl -d &quot;command=shutdown /s /t 7200&quot; -X POST localhost:8677/execute/command &amp;
</code></pre>
<p>And... it worked!</p>
<p><img src="https://www.thenoel.org/content/images/2018/02/2018-02-03-01_04_48-Execute-a-system-command--bash-script-via-REST-API---vREST-Documentation---Optim.png" alt="Stumbled Across Something Neat - vutil" loading="lazy"></p>
<p>Since it&apos;s running in Cygwin, I can run Cygwin Bash in addition to Windows command-line.  Here is me sending &quot;pwd&quot; and the JSON output:</p>
<pre><code>curl -d &quot;command=pwd&quot; -X POST localhost:8677/execute/command
{&quot;pid&quot;:6348,&quot;output&quot;:&quot;/home/thenoel/vutil\n&quot;}
</code></pre>
<p>If you read my last few posts - I bet you know what I&apos;m going to say next:  ALEXA!  (yes, I love her.  yes, I would marry her if I could).  I mentioned in the <a href="https://www.thenoel.org/control-practically-anything-with-alexa/">Control Practically Anything with Alexa</a> post that the ha-bridge can output HTTP requests.  Using vutil, you could have 1 consistent way of interacting with your machines at home (instead of some using SSH, some using EventGhost, some using xyz).  For you Google Home users out there, I bet there is a way to configure it so that voice commands translate to HTTP requests.  But again, I&apos;m in love with Alexa - so who cares about Google Home?  (just kidding - maybe....)</p>
<p>Oh - one other thought:  <a href="http://tasker.dinglisch.net/">Tasker on Android</a>!  Tasker lets you send HTTP requests that can be triggered by tons of events including voice.  That would be neat to use with this.</p>
<p>With all this said, you probably don&apos;t want to run this anywhere important.  It doesn&apos;t have any built-in security (it&apos;s only restricted by the user context that node is running with), but you could reverse-proxy it with <a href="https://nginx.org/en/">ngnix</a> and turn on authentication + SSL.  If you want to expose this outside your home network, that&apos;s probably what you should do.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>