<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Home on Lloyd Rochester's Geek Blog</title><link>https://lloydroc.github.io/</link><description>Recent content in Home on Lloyd Rochester's Geek Blog</description><generator>Hugo</generator><language>en</language><copyright>Copyright © 2025, Lloyd Rochester.</copyright><lastBuildDate>Sat, 08 Feb 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://lloydroc.github.io/index.xml" rel="self" type="application/rss+xml"/><item><title>Hello World on SSD1306 using Arduino</title><link>https://lloydroc.github.io/post/hardware/ssd1306-arduino-hello-world/</link><pubDate>Sun, 12 May 2024 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/ssd1306-arduino-hello-world/</guid><description>&lt;h1 id="hahahugoshortcode70s0hbhb">Hello World on SSD1306 using Arduino&lt;/h1>
&lt;p>After looking through numerous libraries and examples to control the SSD1306 with Arduino, I&amp;rsquo;ve found nothing simple. There are some really powerful libraries with lots of support. In this post I&amp;rsquo;ll post the simplest possible &amp;ldquo;Hello World&amp;rdquo; example on an SSD1306 using an Arduino Due. Note, if you need to draw shapes, lines, movement you&amp;rsquo;ll have to extend this example.&lt;/p>
&lt;p>&lt;img src="https://lloydroc.github.io/assets/jpg/ssd1306_arduino_hello_world.jpg" alt="Hello World SSD1306 Arduino">&lt;/p></description></item><item><title>DNS Proxy in C</title><link>https://lloydroc.github.io/post/c/dns-proxy/</link><pubDate>Sat, 30 Dec 2023 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/dns-proxy/</guid><description>&lt;h1 id="hahahugoshortcode17s0hbhb">DNS Proxy in C&lt;/h1>
&lt;p>This post provides a simple example of a DNS proxy. A client would query a DNS record from our program as if it was a server. This query will be passed on to a DNS server and eventuall back to the client.&lt;/p>
&lt;h2 id="proxy-server-paradigm">Proxy Server Paradigm&lt;/h2>
&lt;p>A proxy server is an intermediary server. Instead of a client requesting direct to a server the request goes to a proxy server that will handle the request on behalf of the client.&lt;/p></description></item><item><title>Network Programming Rant</title><link>https://lloydroc.github.io/post/networking/network-programming-rant1/</link><pubDate>Wed, 28 Jun 2023 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/networking/network-programming-rant1/</guid><description>&lt;h1 id="hahahugoshortcode78s0hbhb">Network Programming Rant&lt;/h1>
&lt;p>When I mow the lawn I typically try to find a good podcast to listen to. Every once in a while I get lucky. This time I found a great pod cast on &lt;a href="#References">The Origins of the Internet Internet with John Day&lt;/a>. There are two episodes dedicated with (Professor John Day&amp;rsquo;s)[https://www.bu.edu/met/profile/john-day/] thoughts. Hearing what John Day had to say about the design and evolution of the Internet was intriguing to me. Many times when working with computers we just take for granted how things are and assume their design is the best approach. John has a deep understanding of the Internet&amp;rsquo;s origin and witnessed it&amp;rsquo;s infancy from ARPA Net to what it is and isn&amp;rsquo;t today.&lt;/p></description></item><item><title>Browser UI using sshuttle VPN in WSL</title><link>https://lloydroc.github.io/post/wsl/ui-vpn/</link><pubDate>Tue, 30 May 2023 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/wsl/ui-vpn/</guid><description>&lt;h1 id="hahahugoshortcode106s0hbhb">Browser UI using sshuttle VPN in WSL&lt;/h1>
&lt;figure>&lt;img src="https://lloydroc.github.io/assets/png/browser-remote-server-vpn-sshuttle-windows.png">&lt;figcaption>
 &lt;h4>Browser viewing a UI in Windows using sshuttle in WSL as a VPN&lt;/h4>
 &lt;/figcaption>
&lt;/figure>

&lt;p>In this post we will create VPN connections using &lt;code>sshuttle&lt;/code> in WSL for Windows 11. This post will focus on pointing a Browser to a URL in a private network in Windows. The private network - VPN - can be reached from &lt;code>sshuttle&lt;/code> running in WSL. For this setup we unfortunately need to have a &amp;ldquo;double networking hop&amp;rdquo; in that Windows needs to be configured to send traffic to WSL (1) and WSL needs will then use &lt;code>sshuttle&lt;/code> to (2) forward that traffic to the public network.&lt;/p></description></item><item><title>Learn the FFT</title><link>https://lloydroc.github.io/post/dsp/fast-fourier-transform/</link><pubDate>Sun, 12 Feb 2023 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/dsp/fast-fourier-transform/</guid><description>&lt;h1 id="hahahugoshortcode46s0hbhb">Learn the FFT&lt;/h1>
&lt;p>In this post I&amp;rsquo;d like to attempt to explain how the Fast Fourier Transform algorithm works. This post is inspired by many attempts others have made that don&amp;rsquo;t really do a good job explaining the FFT. Hopefully, I can do a better job. For explanation we&amp;rsquo;ll use the Cooley–Tukey algorithm which is the most common.&lt;/p>
&lt;figure>&lt;img src="https://lloydroc.github.io/assets/svg/fft-butterfly.svg">&lt;figcaption>
 &lt;h4>FFT Butterfly Diagram&lt;/h4>
 &lt;/figcaption>
&lt;/figure>

&lt;p>Above is the so-called Butterfly Diagram which we will arrive at. Refer to the &lt;a href="https://lloydroc.github.io/post/c/example-fft/">Example FFT Computation in C&lt;/a> to see a program that will compute the FFT.&lt;/p></description></item><item><title>Time Conversion in C</title><link>https://lloydroc.github.io/post/c/c-time-conversion/</link><pubDate>Tue, 27 Dec 2022 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/c-time-conversion/</guid><description>&lt;h1 id="hahahugoshortcode11s0hbhb">Time Conversion in C&lt;/h1>
&lt;p>In the Unix Operating System we have multiple ways that time can be represented: as a epoch, broken down and as a string. Conversion between these three representation can be cumbersom. This blog post outlines the ways time is represented in the C programming language and provides a reference for conversions. Many other languages will follow very closely or exactly to what is done in C.&lt;/p></description></item><item><title>Understanding Process Execution</title><link>https://lloydroc.github.io/post/c/execute-process/</link><pubDate>Tue, 29 Nov 2022 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/execute-process/</guid><description>&lt;h1 id="hahahugoshortcode20s0hbhb">Understanding Process Execution&lt;/h1>
&lt;p>In this post we will dive in to command execution from inside a program. The ability to execute commands from inside a program to obtain their output and exit code is very common for automation and testing use cases. Unfortunately, due to how Operating Systems work it is not a simple process to obtain the output and exit code from a running program.&lt;/p>
&lt;figure>&lt;img src="https://lloydroc.github.io/assets/png/remote-process-execution.png">&lt;figcaption>
 &lt;h4>Remote Process Execution&lt;/h4>
 &lt;/figcaption>
&lt;/figure>

&lt;p>Take for an example a program that from within we execute a command and capture the output in real time, as well as, capture the exit code once the program ends.&lt;/p></description></item><item><title>UART Theory and Programming on the Raspberry Pi</title><link>https://lloydroc.github.io/post/hardware/uart-raspberry-pi/</link><pubDate>Tue, 16 Aug 2022 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/uart-raspberry-pi/</guid><description>&lt;h1 id="hahahugoshortcode72s0hbhb">UART Theory and Programming on the Raspberry Pi&lt;/h1>
&lt;p>This post outlines how to control the UART in a Raspberry Pi using the C programming language. We will also explore parity checks and handling. Parity checking was the main driver for this post, however, if you&amp;rsquo;re looking for C code to control a UART that is also asynchronous please keep reading. This post contains a small command line tool that can asynchronously read and write to standard input and output through two connected UARTs. The command line tool has a number of options to set the speed, tty, parity and number of stop bits.&lt;/p></description></item><item><title>Understanding memory reallocation with realloc</title><link>https://lloydroc.github.io/post/c/understanding-realloc/</link><pubDate>Wed, 03 Aug 2022 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/understanding-realloc/</guid><description>&lt;h1 id="hahahugoshortcode36s0hbhb">Understanding memory reallocation with realloc&lt;/h1>
&lt;p>Let&amp;rsquo;s better understand how memory is allocated, then reallocated on the heap. When we allocate blocks of memory they are stacked on top of the heap with increasing memory addresses. What happens when we reallocate a memory block to make it larger when it&amp;rsquo;s isn&amp;rsquo;t the last item on the heap?&lt;/p>
&lt;h1 id="table-of-contents">Table of Contents&lt;/h1>
&lt;nav id="TableOfContents">&lt;/nav>
&lt;h1 id="heap-example">Heap Example&lt;/h1>
&lt;p>Let&amp;rsquo;s create an example using &lt;a href="https://man7.org/linux/man-pages/man3/malloc.3.html">malloc(3)&lt;/a> and &lt;a href="https://man7.org/linux/man-pages/man3/realloc.3p.html">realloc(3p)&lt;/a> that gives good insight. Here is how our example will play out:&lt;/p></description></item><item><title>Read a File into an Array in C</title><link>https://lloydroc.github.io/post/c/read-file-array/</link><pubDate>Mon, 01 Aug 2022 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/read-file-array/</guid><description>&lt;h1 id="hahahugoshortcode28s0hbhb">Read a File into an Array in C&lt;/h1>
&lt;p>In this post we&amp;rsquo;ll explore how to read a file into an array of strings. Doing this in C isn&amp;rsquo;t as trivial as it maybe in other languages because of memory allocation and the dynamic nature of a text file. The file will be read into a jagged array. This program uses &lt;a href="https://man7.org/linux/man-pages/man3/realloc.3p.html">realloc(3)&lt;/a> to make the most efficient use of the heap possible.&lt;/p></description></item><item><title>Timer example in systemd</title><link>https://lloydroc.github.io/post/unix/systemd-timer-example/</link><pubDate>Sat, 09 Jul 2022 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/unix/systemd-timer-example/</guid><description>&lt;h1 id="hahahugoshortcode95s0hbhb">Timer example in systemd&lt;/h1>
&lt;p>We can use &lt;code>systemd&lt;/code> instead of cron timers in Unix. Using &lt;code>systemd&lt;/code> timers is easy and provides numerous benefits over using Cron which are documented below. These timers more are complicated than cron, however, they are much more powerful.&lt;/p>
&lt;h1 id="creating-a-systemd-timer">Creating a &lt;code>systemd&lt;/code> timer&lt;/h1>
&lt;p>Let us look at the logical hierarchy of a timer on systemd and the files associated before we look at an example.&lt;/p>
&lt;h2 id="logical-requirements">Logical Requirements&lt;/h2>
&lt;p>To create a &lt;code>systemd&lt;/code> timer the following are required:&lt;/p></description></item><item><title>Differences between lists in Unix</title><link>https://lloydroc.github.io/post/unix/difference-lists/</link><pubDate>Mon, 27 Jun 2022 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/unix/difference-lists/</guid><description>&lt;h1 id="hahahugoshortcode86s0hbhb">Differences between lists in Unix&lt;/h1>
&lt;figure>&lt;img src="https://lloydroc.github.io/assets/png/unix-comm-command.png">&lt;figcaption>
 &lt;h4>Unix comm command - Difference between two lists&lt;/h4>
 &lt;/figcaption>
&lt;/figure>

&lt;p>Using the &lt;a href="https://man7.org/linux/man-pages/man1/comm.1.html">comm(1)&lt;/a> command in Unix we can output the difference between &lt;strong>sorted&lt;/strong> lists. The &lt;code>comm&lt;/code> command takes two sorted files as inputs and will output lines unique in &lt;code>FILE1&lt;/code>, lines unique in &lt;code>FILE2&lt;/code> and lines common to &lt;code>FILE1&lt;/code> and &lt;code>FILE2&lt;/code>. The &lt;code>comm&lt;/code> command requires the files to be sorted.&lt;/p>
&lt;h1 id="examples">Examples&lt;/h1>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span> comm -12 file1 file2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Print only lines present in both file1 and file2.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> comm -3 file1 file2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Print lines in file1 not in file2, and vice versa.&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;h1 id="example-with-files">Example with Files&lt;/h1>
&lt;p>Let&amp;rsquo;s see an example by creating two lists in file &lt;code>a.txt&lt;/code> and file &lt;code>b.txt&lt;/code>. Then use the &lt;code>comm&lt;/code> command to output what is only in &lt;code>a.txt&lt;/code>, in &lt;code>b.txt&lt;/code> and in both &lt;code>a.txt&lt;/code> and &lt;code>b.txt&lt;/code> - the union between them.&lt;/p></description></item><item><title>Realtime Lidar Measurements with NodeJS</title><link>https://lloydroc.github.io/post/hardware/realtime-lidar-nodejs/</link><pubDate>Sat, 19 Mar 2022 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/realtime-lidar-nodejs/</guid><description>&lt;p>In this blog post we will plot near realtime Lidar Measurements on a browser. We will use a Raspberry Pi connected to the TF Mini+ Lidar from Benewake. At the end post of this you&amp;rsquo;ll be able to see a Realtime Graph of Lidar measurements. Each measurement is in centimeters and has an associated strength reading.&lt;/p>
&lt;h1 id="end-result">End Result&lt;/h1>
&lt;p>Here is what the graph looks like on a browser. There is both a distance and strength measurement on a plot. On the y-axis for distance we have a measurement in centimeters. The signal strength is the second graph. The strength is a 16-bit value.&lt;/p></description></item><item><title>Unix Command for Epoch Time</title><link>https://lloydroc.github.io/post/unix/unix-command-epoch/</link><pubDate>Sun, 06 Feb 2022 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/unix/unix-command-epoch/</guid><description>&lt;h1 id="hahahugoshortcode99s0hbhb">Unix Command for Epoch Time&lt;/h1>
&lt;p>This post provides some examples using the Unix &lt;a href="https://man7.org/linux/man-pages/man1/date.1.html">date(1)&lt;/a> command to interact with Epoch Time. We commonly need to print or parse the Epoch.&lt;/p>
&lt;h1 id="table-of-contents">Table of Contents&lt;/h1>
&lt;nav id="TableOfContents">
 &lt;ul>
 &lt;li>&lt;a href="#parse-the-epoch-in-mac-os-x">Parse the Epoch in Mac OS X&lt;/a>&lt;/li>
 &lt;/ul>
&lt;/nav>
&lt;h1 id="print-the-epoch">Print the Epoch&lt;/h1>
&lt;p>Using the Unix &lt;code>date&lt;/code> command we can print the Epoch. We need to use the &lt;code>%s&lt;/code> format.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>$ date +%s
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">1644156059&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;p>The &lt;code>%s&lt;/code> format is &lt;em>seconds since the Epoch (1970-01-01 00:00 UTC)&lt;/em>. The Epoch is always in the UTC or &lt;em>Zulu&lt;/em> time zone.&lt;/p></description></item><item><title>Skull with Blinking Red Eyes for Halloween</title><link>https://lloydroc.github.io/post/hardware/skull_red_eyes_blinking_halloween/</link><pubDate>Mon, 25 Oct 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/skull_red_eyes_blinking_halloween/</guid><description>&lt;p>For Halloween I attempted to do a little electronics with my young daughters to make a scary Halloween Skull with Blinking Red Eyes.&lt;/p>
&lt;p>&lt;img src="https://lloydroc.github.io/assets/jpg/skull_red_eyes_grass.jpg" alt="Skull with Blinking Red Eyes for Halloween">&lt;/p>
&lt;h1 id="circuit-functions">Circuit Functions&lt;/h1>
&lt;p>The circuit is easy to build and consists of 4 parts.&lt;/p>
&lt;ol>
&lt;li>Photo Diode that triggers the circuit to be activated only at night&lt;/li>
&lt;li>LM555 Timer to blink the Red LEDs for the Skull&amp;rsquo;s eyes&lt;/li>
&lt;li>Transistors to Drive the diodes&lt;/li>
&lt;li>A +9V Battery for Power&lt;/li>
&lt;/ol>
&lt;h1 id="circuit">Circuit&lt;/h1>
&lt;p>Here is the circuit we created. From left to right you can see the Photo Diode, the LM555 in astable mode, and the NPN Transistor powering the two red LEDs.&lt;/p></description></item><item><title>Ebyte e32 Lora Module - Client Socket Examples</title><link>https://lloydroc.github.io/post/hardware/ebyte-e32-lora-socket-client-examples/</link><pubDate>Fri, 23 Jul 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/ebyte-e32-lora-socket-client-examples/</guid><description>&lt;h1 id="hahahugoshortcode56s0hbhb">Ebyte e32 Lora Module - Client Socket Examples&lt;/h1>
&lt;p>This post currently has a example client in Python that sends information through Unix Domain Sockets when the &lt;code>e32&lt;/code> is running as a service. Adding clients in other programming languages is a hopeful future addition. See &lt;a href="https://lloydroc.github.io/post/hardware/ebyte-e32-lora/">Getting Started&lt;/a>.&lt;/p>
&lt;h1 id="prerequisites">Prerequisites&lt;/h1>
&lt;p>Ensure either you have the &lt;code>e32&lt;/code> programming running with sockets enabled. Or, preferred, &lt;a href="https://lloydroc.github.io/post/hardware/ebyte-e32-lora-systemd-service/">running as a service&lt;/a>.&lt;/p>
&lt;p>More background on can be found in &lt;a href="https://lloydroc.github.io/post/hardware/ebyte-e32-lora-sockets/">e32 sockets&lt;/a>.&lt;/p></description></item><item><title>Ebyte e32 Lora Module - Wiring and Configuring the Raspberry Pi</title><link>https://lloydroc.github.io/post/hardware/ebyte-e32-lora-configuration-wiring/</link><pubDate>Sun, 18 Jul 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/ebyte-e32-lora-configuration-wiring/</guid><description>&lt;p>This post explains how to wire up the UART and the mode pins. We need 5 connections between the Raspberry Pi and EByte E32, as well as a power and a ground. See this &lt;a href="https://lloydroc.github.io/post/hardware/ebyte-e32-lora-getting-started">software installation&lt;/a> after the wiring is complete.&lt;/p>
&lt;h1 id="wiring">Wiring&lt;/h1>
&lt;p>Here is the wiring between the E32 and the Raspberry Pi. Please make sure the UART TX of the RPI is wired to the RX of the E32 and vice-versa.&lt;/p></description></item><item><title>Ebyte E32 Lora Module - systemd service</title><link>https://lloydroc.github.io/post/hardware/ebyte-e32-lora-systemd-service/</link><pubDate>Fri, 18 Jun 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/ebyte-e32-lora-systemd-service/</guid><description>&lt;h1 id="hahahugoshortcode58s0hbhb">Ebyte E32 Lora Module - systemd service&lt;/h1>
&lt;p>The &lt;code>e32&lt;/code> program is intended to be run as a service in the backround with &lt;a href="https://lloydroc.github.io/post/hardware/ebyte-e32-lora-sockets">communication through sockets&lt;/a>. This way you can write software in any langauge and just have to deal with the easy job of reading and writing to a socket. Once the &lt;code>e32&lt;/code> service is started and running it can be accessed at any time by a client. In this post we&amp;rsquo;ll document the actual systemd service. We have some &lt;a href="https://lloydroc.github.io/post/hardware/ebyte-e32-lora-socket-client-examples">client examples&lt;/a> demonstrating clients interfacing with the socket.&lt;/p></description></item><item><title>Ebyte E32 Lora Module - Transfer Files</title><link>https://lloydroc.github.io/post/hardware/ebyte-e32-lora-transfer-files/</link><pubDate>Fri, 18 Jun 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/ebyte-e32-lora-transfer-files/</guid><description>&lt;h1 id="hahahugoshortcode59s0hbhb">Ebyte E32 Lora Module - Transfer Files&lt;/h1>
&lt;p>This post explains how to transfer files over Lora using the &lt;code>e32&lt;/code> program. See &lt;a href="https://lloydroc.github.io/post/hardware/ebyte-e32-lora-getting-started/">getting started&lt;/a> for the background.&lt;/p>
&lt;h1 id="prerequisites">Prerequisites&lt;/h1>
&lt;p>We must first assume the &lt;code>e32&lt;/code> is not &lt;a href="https://lloydroc.github.io/post/hardware/ebyte-e32-lora-getting-started/">running as a service&lt;/a>. If not sure run a &lt;code>sudo systemctl stop e32&lt;/code> to stop it.&lt;/p>
&lt;h1 id="transferring-files-between-two-raspberry-pi-boards">Transferring Files Between two Raspberry Pi Boards&lt;/h1>
&lt;p>We obviously need at least two Ebyte e32 lora modules for this.&lt;/p>
&lt;h2 id="receiving">Receiving&lt;/h2>
&lt;p>From one Raspberry Pi with the &lt;code>e32&lt;/code> installed. We need to be receiving before we transmit the file.&lt;/p></description></item><item><title>Stack Protection with a Canary</title><link>https://lloydroc.github.io/post/c/stack-protection-canary/</link><pubDate>Fri, 11 Jun 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/stack-protection-canary/</guid><description>&lt;h1 id="hahahugoshortcode41s0hbhb">Stack Protection with a Canary&lt;/h1>
&lt;p>Buffer overflows can be detected by inserting a &lt;em>canary&lt;/em> into a function. These canaries are inserted when a function&amp;rsquo;s stack frame is created. Before a function&amp;rsquo;s return we check for the canary on the stack frame. If the canary isn&amp;rsquo;t found then buffer overflow or &lt;em>stack smashing&lt;/em> is detected.&lt;/p>
&lt;h1 id="example">Example&lt;/h1>
&lt;p>Let&amp;rsquo;s first create a deliberate buffer overflow. Then we can see how it behaves with and without stack protection.&lt;/p></description></item><item><title>Ebyte e32 - Sockets</title><link>https://lloydroc.github.io/post/hardware/ebyte-e32-lora-sockets/</link><pubDate>Tue, 08 Jun 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/ebyte-e32-lora-sockets/</guid><description>&lt;h1 id="hahahugoshortcode57s0hbhb">Ebyte e32 - Sockets&lt;/h1>
&lt;p>The &lt;a href="https://lloydroc.github.io/post/hardware/ebyte-e32-lora/">e32 program&lt;/a> can run as a &lt;a href="https://lloydroc.github.io/post/c/unix-daemon-example">daemon&lt;/a> and listen on &lt;a href="https://lloydroc.github.io/post/c/unix-domain-socket-datagram/">Unix Domain Sockets&lt;/a> for data to transmit and receive. This post documents the functionality of the sockets the &lt;code>e32&lt;/code> software is listening on.&lt;/p>
&lt;h1 id="intention-of-the-sockets">Intention of the Sockets&lt;/h1>
&lt;p>The software for the &lt;code>e32&lt;/code> is written in the C Programming Language. I&amp;rsquo;m a huge fan of C, but it isn&amp;rsquo;t for everyone, nor, is it for every application. The sockets are created so we can interface any program to the e32. Instead of having to write C code to do what you want, you can just use the &lt;code>e32&lt;/code> as a &lt;em>driver&lt;/em> and write a &lt;a href="https://lloydroc.github.io/post/hardware/ebyte-e32-lora-socket-client-examples/">client in any language&lt;/a>. When this client writes and reads from the socket it&amp;rsquo;s transmitting and receiving wireless data. Since the sockets are Unix Domain Sockets they are reliable.&lt;/p></description></item><item><title>Finding Libriaries and Headers for C Programs in Unix</title><link>https://lloydroc.github.io/post/c/finding-c-headers-and-libraries/</link><pubDate>Thu, 27 May 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/finding-c-headers-and-libraries/</guid><description>&lt;p>Need to list the installed libraries on a Unix system? Want to use a library in C and don&amp;rsquo;t know the linker flags to use? Need to find where header files are located for a package? This post answers these questions.&lt;/p>
&lt;h1 id="an-example-from-the-beginning">An example from the beginning&lt;/h1>
&lt;p>Let&amp;rsquo;s say I want to write a C program that uses &lt;code>libxml2&lt;/code>. We know we&amp;rsquo;re going to need &lt;code>#include&lt;/code> directives for the &lt;code>libxml2&lt;/code> package to refer to the header files. When we compile the program we need to have a linker flag with &lt;code>-l&lt;/code> to link in it&amp;rsquo;s shared library. Keep this example in mind as you read this post. Here are the steps to arrive with what we need:&lt;/p></description></item><item><title>Using libgpiod to detect input events</title><link>https://lloydroc.github.io/post/hardware/libgpiod-event-rpi/</link><pubDate>Mon, 17 May 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/libgpiod-event-rpi/</guid><description>&lt;h1 id="hahahugoshortcode61s0hbhb">Using libgpiod to detect input events&lt;/h1>
&lt;p>One of the most fundamental requirements for GPIO is the ability to execute user defined code when an &lt;em>external event&lt;/em> has happened. This is typically done when a GPIO pin, configured as an input, changes from high-to-low, or low-to-high. In this case we detect on the falling edge or rising edge of this pin change. For example a sensor we communicate through GPIO has data ready. In the micro-controller world this is called as an interrupt where the CPU will change it program counter and handle the interrupt. The interrupt makes sense when we have no Operating System. In the case of Linux and the Raspberry Pi it&amp;rsquo;s not an interrupt but considered an &lt;em>event&lt;/em> as we likely have in interrupt deep inside the kernel code, however, we&amp;rsquo;re several levels of abstraction past this. Unix has the &amp;ldquo;Universal File Model&amp;rdquo; so this input pin is mapped to a file. With Unix we have many multiple ways to know if &amp;ldquo;events&amp;rdquo; have happened to this file. Examples of events are that the file is ready for reading, writing, or other events have happened.&lt;/p></description></item><item><title>GPIO Input with libgpiod</title><link>https://lloydroc.github.io/post/hardware/libgpiod-input-rpi/</link><pubDate>Mon, 10 May 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/libgpiod-input-rpi/</guid><description>&lt;h1 id="hahahugoshortcode63s0hbhb">GPIO Input with libgpiod&lt;/h1>
&lt;p>We can use the &lt;code>libgpiod&lt;/code> library to configure a GPIO line as input and read it&amp;rsquo;s value. We&amp;rsquo;ll create a switch circuit so we can test the value is a logic high or low. More info on &lt;code>libgpiod&lt;/code> can be found in my &lt;a href="https://lloydroc.github.io/post/hardware/libgpiod-intro-rpi/">libgpiod intro&lt;/a> for installation and usage.&lt;/p>
&lt;p>Here is a previous post to &lt;a href="https://lloydroc.github.io/post/hardware/libgpiod-blink-led-rpi/">blink an LED&lt;/a> using libgpiod.&lt;/p>
&lt;h1 id="input-circuit">Input Circuit&lt;/h1>
&lt;p>Into our Raspberry Pi we&amp;rsquo;ll use GPIO 4 and configure this pin as an input. We&amp;rsquo;re going to add some resistors to control the current into this circuit. When the switch is in one direction you can see current will essentially not flow.&lt;/p></description></item><item><title>Blinking an LED with libgpiod</title><link>https://lloydroc.github.io/post/hardware/libgpiod-blink-led-rpi/</link><pubDate>Mon, 03 May 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/libgpiod-blink-led-rpi/</guid><description>&lt;h1 id="hahahugoshortcode60s0hbhb">Blinking an LED with libgpiod&lt;/h1>
&lt;p>In the previous post we &lt;a href="https://lloydroc.github.io/post/hardware/libgpiod-intro-rpi/">introduced&lt;/a> &lt;code>libgpiod&lt;/code>. In this post we&amp;rsquo;ll use the command line tools to blink an LED. Finally, we&amp;rsquo;ll write some C code to blink the LED using the &lt;code>libgpiod&lt;/code> library.&lt;/p>
&lt;h1 id="table-of-contents">Table of Contents&lt;/h1>
&lt;nav id="TableOfContents">
 &lt;ul>
 &lt;li>&lt;a href="#led-driver-circuit">LED Driver Circuit&lt;/a>&lt;/li>
 &lt;/ul>

 &lt;ul>
 &lt;li>&lt;a href="#building-and-running">Building and Running&lt;/a>&lt;/li>
 &lt;/ul>
&lt;/nav>
&lt;h2 id="led-driver-circuit">LED Driver Circuit&lt;/h2>
&lt;p>Skip this section if you already have a good circuit to drive an LED. A simple NPN Transistor is a cheap and robust LED drive that only requires two resistors.&lt;/p></description></item><item><title>The new GPIO Interface on the Raspberry PI: libgpiod</title><link>https://lloydroc.github.io/post/hardware/libgpiod-intro-rpi/</link><pubDate>Sun, 02 May 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/libgpiod-intro-rpi/</guid><description>&lt;h1 id="hahahugoshortcode64s0hbhb">The new GPIO Interface on the Raspberry PI: libgpiod&lt;/h1>
&lt;p>Allegedly, The &lt;a href="https://www.kernel.org/doc/html/latest/admin-guide/gpio/sysfs.html">GPIO Sysfs Interface&lt;/a> is deprecated. The deprecated Sysfs would interact with GPIO using the &lt;code>/sys/class/gpio&lt;/code> pseudo-filesytem. The Application Binary Interface - ABI - provides a character device based device driver and tools. The ABI is the new way to interact with GPIO on the Raspberry Pi. I really don&amp;rsquo;t like the name ABI, as it&amp;rsquo;s WAY too generic of a name. Rather, I believe the proper name for this project is &lt;code>libgpiod&lt;/code>.&lt;/p></description></item><item><title>Raspberry Pi SPI Explained</title><link>https://lloydroc.github.io/post/hardware/raspberry-pi-spi/</link><pubDate>Wed, 21 Apr 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/raspberry-pi-spi/</guid><description>&lt;h1 id="hahahugoshortcode67s0hbhb">Raspberry Pi SPI Explained&lt;/h1>
&lt;p>This post attempts to provide some finer details when using SPI on Raspberry Pi as it pertains to using the Chip Select pins and multiple SPI Interfaces. Note, I will not use &lt;code>MOSI&lt;/code> and &lt;code>MISO&lt;/code> to ditch the old master/slave nomenclature and use &lt;code>SPO&lt;/code> and &lt;code>SPI&lt;/code> instead.&lt;/p>
&lt;p>Here is a quick diagram which will be explained in the following sections.&lt;/p>
&lt;p>&lt;img src="https://lloydroc.github.io/assets/svg/rpi-spi.svg" alt="Raspberry Pi SPI">&lt;/p>
&lt;h1 id="the-basics-of-spi-on-the-raspberry-pi">The Basics of SPI on the Raspberry Pi&lt;/h1>
&lt;p>If you use &lt;code>raspi-config&lt;/code> you can enable SPI.&lt;/p></description></item><item><title>Implementing a Timeout for a read in C</title><link>https://lloydroc.github.io/post/c/timeout-on-read/</link><pubDate>Mon, 12 Apr 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/timeout-on-read/</guid><description>&lt;h1 id="hahahugoshortcode35s0hbhb">Implementing a Timeout for a read in C&lt;/h1>
&lt;p>Need to wait a specified amount of time for a read call to return before giving up and continuing on?&lt;/p>
&lt;p>In Unix when we &lt;code>read&lt;/code> from a file we can have a non-blocking read where if the file is not ready the &lt;code>read&lt;/code> call will pass through. We can also specify a blocking read where the &lt;code>read&lt;/code> will wait forever. What if we want &lt;code>read&lt;/code> to wait a specified amount of time not zero or infinity?&lt;/p></description></item><item><title>Audio Clip Capture by Threshold</title><link>https://lloydroc.github.io/post/hardware/audio-clip/</link><pubDate>Sat, 10 Apr 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/audio-clip/</guid><description>&lt;h1 id="hahahugoshortcode55s0hbhb">Audio Clip Capture by Threshold&lt;/h1>
&lt;p>Updated December 28th 2022&lt;/p>
&lt;p>&lt;img src="https://lloydroc.github.io/assets/png/audio-threshold-recording.png" alt="Raspberry Pi E32 Lora Receive">&lt;/p>
&lt;p>Here is a command line tool to capture audio clips based on two thresholds. Keep the tool running and it will write a number of audio files with audio that is loud enough for long enough. How loud and how long are the thresholds that are inputs to the program. For example we may want to record audio clips that only exceed 3 seconds. The loudness level is meant to keep us from recording noise.&lt;/p></description></item><item><title>Movement in Emacs</title><link>https://lloydroc.github.io/post/emacs/movement/</link><pubDate>Tue, 06 Apr 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/emacs/movement/</guid><description>&lt;h1 id="hahahugoshortcode50s0hbhb">Movement in Emacs&lt;/h1>
&lt;p>A little cheat sheet for movement in &lt;code>emacs&lt;/code>. Tried to capture all the ways you can move up, down, left and right in a buffer.&lt;/p>
&lt;h1 id="moving-by-character-and-line">Moving by Character and Line&lt;/h1>
&lt;p>Think &lt;em>next&lt;/em> and &lt;em>previous&lt;/em> for lines, and &lt;em>backward&lt;/em> and &lt;em>forward&lt;/em> for characters.&lt;/p>
&lt;pre tabindex="0">&lt;code> Previous Line C-p
 ^
 |
Previous Character C-b &amp;lt;---+---&amp;gt; Next Character C-f
 |
		 v
 Next Line C-n
&lt;/code>&lt;/pre>&lt;h1 id="moving-by-word-and-sentence">Moving by Word and Sentence&lt;/h1>
&lt;pre tabindex="0">&lt;code> Backward Sentence M-a
 ^
 |
Backward Word M-b &amp;lt;---+---&amp;gt; Forward Word M-f
 |
		 v
 Forward Sentence M-e
&lt;/code>&lt;/pre>&lt;h1 id="moving-to-beginning-of-line-and-buffer">Moving to Beginning of Line and Buffer&lt;/h1>
&lt;pre tabindex="0">&lt;code> Buffer Start M-&amp;lt;
 ^
 |
Line Beginning C-a &amp;lt;---+---&amp;gt; Line End C-e
 |
		 v
 Buffer End M-&amp;gt;
&lt;/code>&lt;/pre>&lt;h1 id="moving-to-first-non-whitespace-character">Moving to first non-whitespace Character&lt;/h1>
&lt;p>The &lt;code>M-m&lt;/code> will run &lt;code>back-to-indentation&lt;/code>.&lt;/p></description></item><item><title>BPSK Receiver Theory</title><link>https://lloydroc.github.io/post/dsp/psk-receiver-theory/</link><pubDate>Wed, 17 Feb 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/dsp/psk-receiver-theory/</guid><description>&lt;p>Let&amp;rsquo;s look at some BPSK Receiver Theory. This is the 3rd post in the PSK Series. We&amp;rsquo;ll cover the theory before we go into the implementation.&lt;/p>
&lt;h1 id="psk-series">PSK Series&lt;/h1>
&lt;p>Here is a summary of where we are in the PSK Series.&lt;/p>
&lt;ol>
&lt;li>&lt;a href="https://lloydroc.github.io/post/dsp/psk-transmit-theory/">BPSK Transmit Theory&lt;/a> - This post shows graphs and has audio files of what this tool does.&lt;/li>
&lt;li>&lt;a href="https://lloydroc.github.io/post/dsp/psk-transmitter-implementation/">BPSK Implementation&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://lloydroc.github.io/post/dsp/psk-receiver-theory/">BPSK Receiver Theory&lt;/a> - This Post&lt;/li>
&lt;li>BPSK Receiver Implementation - Coming Soon&lt;/li>
&lt;li>QPSK - Coming Soon&lt;/li>
&lt;/ol>
&lt;h1 id="what-are-we-going-to-receive">What are we going to receive?&lt;/h1>
&lt;p>See my previous post on &lt;a href="https://lloydroc.github.io/post/dsp/psk-transmit-theory/">BPSK Transmitter Theory&lt;/a> for what the waveform transmitted. For this post we&amp;rsquo;ll receive and decode this waveform. Effectively, we&amp;rsquo;re sending symbols that are Root Raised Cosine waveforms multiplied with sinusoids. Below is the encoded text &lt;code>t&lt;/code> represented by our alphabet as \( 10100 \). Note, the amplitude of \( ~1000 \), all the &amp;ldquo;peaks&amp;rdquo; both positive and negative, and the duration between the peaks. We&amp;rsquo;ll delve into all these details shortly.&lt;/p></description></item><item><title>BPSK Transmitter Implementation</title><link>https://lloydroc.github.io/post/dsp/psk-transmitter-implementation/</link><pubDate>Sun, 24 Jan 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/dsp/psk-transmitter-implementation/</guid><description>&lt;h1 id="hahahugoshortcode49s0hbhb">BPSK Transmitter Implementation&lt;/h1>
&lt;p>In the previous post we discussed &lt;a href="https://lloydroc.github.io/post/dsp/psk-transmit-theory/">BPSK Transmit Theory&lt;/a>. This post will discuss the implementation of it. This implementation will be in the C programming language and it will also be a command line tool.&lt;/p>
&lt;h1 id="psk-series">PSK Series&lt;/h1>
&lt;p>I&amp;rsquo;m doing a series on PSK here is where we are:&lt;/p>
&lt;ol>
&lt;li>&lt;a href="https://lloydroc.github.io/post/dsp/psk-transmit-theory/">BPSK Transmit Theory&lt;/a> - This post shows graphs and has audio files of what this tool does.&lt;/li>
&lt;li>&lt;a href="https://lloydroc.github.io/post/dsp/psk-transmitter-implementation/">BPSK Implementation&lt;/a> - This Post.&lt;/li>
&lt;li>BPSK Receiver Theory - Coming Soon&lt;/li>
&lt;li>BPSK Receiver Theory - Coming Soon&lt;/li>
&lt;li>QPSK - Coming Soon&lt;/li>
&lt;/ol>
&lt;h1 id="using-the-command-line-tool">Using the Command Line Tool&lt;/h1>
&lt;p>I like to start out with how the tool is used as it gives insight about the implementation. It&amp;rsquo;s quite simple, provide text input as a program argument and the tool will output a &lt;code>.wav&lt;/code> file with the content. The example below converts the text &lt;code>hello world&lt;/code> to the &lt;code>psk31.wav&lt;/code> audio file.&lt;/p></description></item><item><title>BPSK Transmitter Theory</title><link>https://lloydroc.github.io/post/dsp/psk-transmit-theory/</link><pubDate>Thu, 14 Jan 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/dsp/psk-transmit-theory/</guid><description>&lt;h1 id="hahahugoshortcode48s0hbhb">BPSK Transmitter Theory&lt;/h1>
&lt;p>In this post we&amp;rsquo;ll get into the theory of Binary Phase Shift Key - BPSK. We&amp;rsquo;ll then get into the implementation of the transmitter, followed by the same for the receiver. The transmitter will have text as input, for output we will produce an audio .wav file and a CSV file for analysis. I created a bunch of graphs which really illustrate some of the theory.&lt;/p>
&lt;h1 id="transmit-process">Transmit Process&lt;/h1>
&lt;p>Let&amp;rsquo;s start with the overall transmit process.&lt;/p></description></item><item><title>Convolution Examples</title><link>https://lloydroc.github.io/post/dsp/convolution-examples/</link><pubDate>Mon, 11 Jan 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/dsp/convolution-examples/</guid><description>&lt;h1 id="hahahugoshortcode45s0hbhb">Convolution Examples&lt;/h1>
&lt;p>Understanding &lt;a href="https://lloydroc.github.io/post/c/convolution/">convolution&lt;/a> is not complete without some examples to visual the results. These examples are meant to aid in one&amp;rsquo;s ability to visualize the result of a convolution. It&amp;rsquo;s most important to flip one function horizontally and slide it through the other. As this function slides through we multiply and sum to obtain the result of the convolution.&lt;/p>
&lt;p>Convolution is used &lt;em>mainly&lt;/em> in two ways:&lt;/p>
&lt;ol>
&lt;li>To mathematically determine how correlated two functions are&lt;/li>
&lt;li>To shape a function by convolving it with another function. Examples would be filtering, smoothing, etc &amp;hellip;&lt;/li>
&lt;/ol>
&lt;p>Note: There are some typos in the frequency labels for some of the sinusoids I need to fix. You can trust the graphs.&lt;/p></description></item><item><title>USB 3D Sound on the Raspberry Pi</title><link>https://lloydroc.github.io/post/unix/raspberry-pi-3d-sound-alsa/</link><pubDate>Fri, 01 Jan 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/unix/raspberry-pi-3d-sound-alsa/</guid><description>&lt;h1 id="hahahugoshortcode92s0hbhb">USB 3D Sound on the Raspberry Pi&lt;/h1>
&lt;p>I recently bought the USB 3D Sound Card to play around with some C ALSA Programming on the Raspberry Pi. It worked without a problem and wanted to jot down some notes in this post on it&amp;rsquo;s specifications and how to use it. I didn&amp;rsquo;t have to make any modifications to the Raspberry Pi at all and sound worked right out of the box. I ran this on a Raspberry Pi B+ on Raspian.&lt;/p></description></item><item><title>Timestamps in C</title><link>https://lloydroc.github.io/post/c/c-timestamp-epoch/</link><pubDate>Wed, 02 Dec 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/c-timestamp-epoch/</guid><description>&lt;h1 id="hahahugoshortcode14s0hbhb">Timestamps in C&lt;/h1>
&lt;p>In this post I&amp;rsquo;ll provide some ways to create, convert and print timestamps using C. We&amp;rsquo;ll first create a Unix epoch which corresponds to seconds since January 1st 1970 at 00:00:00 UTC. We will also represent the epoch in milliseconds, as a double, and finally convert to an ISO 8601 Timestamp. We&amp;rsquo;ll conclude with the challenge of using fractional seconds.&lt;/p>
&lt;h1 id="table-of-contents">Table of Contents&lt;/h1>
&lt;nav id="TableOfContents">&lt;/nav>
&lt;h1 id="epoch-using-clock_gettime-from-timeh">Epoch using &lt;code>clock_gettime&lt;/code> from &lt;code>time.h&lt;/code>&lt;/h1>
&lt;p>Get the epoch in seconds and nanoseconds using &lt;code>clock_gettime&lt;/code>. This is POSIX.1-2001. We will use &lt;code>CLOCK_REALTIME&lt;/code> since all implementations will support this per &lt;code>man 3 clock_gettime&lt;/code>.&lt;/p></description></item><item><title>Unix Process Tutorial</title><link>https://lloydroc.github.io/post/unix/unix-process-tutorial/</link><pubDate>Sat, 28 Nov 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/unix/unix-process-tutorial/</guid><description>&lt;h1 id="hahahugoshortcode100s0hbhb">Unix Process Tutorial&lt;/h1>
&lt;p>In this blog post I&amp;rsquo;ll go over a quick tutorial on Unix Processes. We&amp;rsquo;ll start with some theory and then go into some real world examples. It&amp;rsquo;s meant to be quick, to the point, and provide the necessary information to have a good understanding about how Unix Processes are designed.&lt;/p>
&lt;h1 id="sshing-into-a-unix-machine">SSH&amp;rsquo;ing into a Unix Machine&lt;/h1>
&lt;p>Let&amp;rsquo;s start with a common scenario. This scenario is to simply &lt;code>ssh&lt;/code> into another Unix machine. From a Unix process perspective what happens?&lt;/p></description></item><item><title>COI with Dovecot</title><link>https://lloydroc.github.io/post/unix/coi-with-dovecot/</link><pubDate>Fri, 20 Nov 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/unix/coi-with-dovecot/</guid><description>&lt;h1 id="hahahugoshortcode87s0hbhb">COI with Dovecot&lt;/h1>
&lt;p>I recently discovered &lt;a href="https://www.coi-dev.org">Chat Over IMAP&lt;/a>. It looks like a promising technology that has a lot to offer. I&amp;rsquo;m currently hosting email on my &lt;a href="https://lloydroc.github.io/">lloydroc.github.io&lt;/a> domain with Postfix/Dovecot and in this post I&amp;rsquo;ll modify my Dovecot configuration to work with COIand then try the &lt;a href="https://delta.chat">Delta Chat&lt;/a> application. I had originally planned for an hour or two of work, however, to get COI configured on Dovecot literally less than 5 minutes!&lt;/p></description></item><item><title>Improved Scanning of JSON with Flex/Bison</title><link>https://lloydroc.github.io/post/flex-bison/json-parse-better-scanner/</link><pubDate>Tue, 27 Oct 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/flex-bison/json-parse-better-scanner/</guid><description>&lt;h1 id="hahahugoshortcode53s0hbhb">Improved Scanning of JSON with Flex/Bison&lt;/h1>
&lt;p>Using Flex/Bison in the last post we &lt;a href="https://lloydroc.github.io/post/flex-bison/json-parse-ast/">Parsed JSON into an AST&lt;/a>. In the first post we setup a &lt;a href="https://lloydroc.github.io/post/flex-bison/json-parse/">Simple Example to Parse JSON&lt;/a>. In this post we will improve our Flex Scanner to tokenize and validate more JSON cases. We will continue to align with the grammar at &lt;a href="https://www.json.org/">json.org&lt;/a>. We will add rules and tokens for &lt;code>DQUOTE&lt;/code> (double-quote), &lt;code>string&lt;/code>, &lt;code>HEX&lt;/code>, and &lt;code>CHARACTERS&lt;/code> not in our previous implementation.&lt;/p></description></item><item><title>Parse JSON into an Abstract Syntax Tree using Flex/Bison</title><link>https://lloydroc.github.io/post/flex-bison/json-parse-ast/</link><pubDate>Sun, 25 Oct 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/flex-bison/json-parse-ast/</guid><description>&lt;h1 id="hahahugoshortcode52s0hbhb">Parse JSON into an Abstract Syntax Tree using Flex/Bison&lt;/h1>
&lt;p>In a previous post we &lt;a href="https://lloydroc.github.io/post/flex-bison/json-parse/">Parsed JSON using Flex/Bison&lt;/a>. This example was very basic. We used a FLEX scanner to tokenize our JSON and created grammar rules in BISON to parse this token stream. This post will take it further and create an Abstract Syntax Tree (AST). The AST is a power data structure typically used in compilers that will store the structure of our JSON. Effectively we will read in the JSON structure a tree-like data structure in C.&lt;/p></description></item><item><title>TF Mini Plus Unix Agent for the Raspberry Pi</title><link>https://lloydroc.github.io/post/hardware/tf-mini-lidar-unix-agent/</link><pubDate>Mon, 12 Oct 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/tf-mini-lidar-unix-agent/</guid><description>&lt;h1 id="hahahugoshortcode71s0hbhb">TF Mini Plus Unix Agent for the Raspberry Pi&lt;/h1>
&lt;p>In this post we will create a Unix agent for the TF Mini+ LiDAR Range Finder. We&amp;rsquo;ll run the agent on a Raspberry Pi B+ as a daemon. This agent will send out UDP datagrams with each LiDAR Reading. Also, we can use the &lt;code>tfmini&lt;/code> program as a command line tool to read from the LiDAR and change the configuration. Overall, I&amp;rsquo;ve noticed the TF Mini+ is quite accurate and snappy.&lt;/p></description></item><item><title>Disassembly of Recursion in C</title><link>https://lloydroc.github.io/post/c/arm-assembly-recursion/</link><pubDate>Fri, 25 Sep 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/arm-assembly-recursion/</guid><description>&lt;h1 id="hahahugoshortcode19s0hbhb">Disassembly of Recursion in C&lt;/h1>
&lt;p>Let&amp;rsquo;s disassemble a recursive function in C to ARM assembly. We can use the textbook example of a recursive factorial function. We&amp;rsquo;ll play around with optimization levels and touch on Tail Recursion or Tail Calls at the end of the blog post.&lt;/p>
&lt;h2 id="c-code">C Code&lt;/h2>
&lt;p>Below is the C code we&amp;rsquo;ll use to disassemble. This code is a text book function that implements a factorial using recursion.&lt;/p></description></item><item><title>Retry in Bash</title><link>https://lloydroc.github.io/post/unix/bash-retry/</link><pubDate>Mon, 21 Sep 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/unix/bash-retry/</guid><description>&lt;h1 id="hahahugoshortcode88s0hbhb">Retry in Bash&lt;/h1>
&lt;p>In this blog post we&amp;rsquo;ll have two examples in &lt;code>bash&lt;/code> that will retry in the following ways:&lt;/p>
&lt;ul>
&lt;li>Retry a command N times before failing&lt;/li>
&lt;li>Retry command for X minutes before failing&lt;/li>
&lt;/ul>
&lt;p>In both of these examples we&amp;rsquo;ll use &lt;code>true&lt;/code> and &lt;code>false&lt;/code> as examples to test the script. These would need to be changed for your use case.&lt;/p>
&lt;h1 id="retry-a-command-x-times">Retry a Command X Times&lt;/h1>
&lt;p>A script to run a command N times. We will fail after 3 attempts, and delay for 10 seconds between attempts.&lt;/p></description></item><item><title>Ebyte e32 LoRa Module - Getting Started</title><link>https://lloydroc.github.io/post/hardware/ebyte-e32-lora-getting-started/</link><pubDate>Tue, 15 Sep 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/ebyte-e32-lora-getting-started/</guid><description>&lt;h1 id="hahahugoshortcode54s0hbhb">Ebyte e32 LoRa Module - Getting Started&lt;/h1>
&lt;p>This page documents software for the Ebyte e32 Lora module that runs on the Raspberry Pi which can be found in this &lt;a href="https://github.com/lloydroc/ebyte-sx1276">github repo&lt;/a>. See below for &lt;a href="#software-installation">software installation&lt;/a>.&lt;/p>
&lt;p>&lt;img src="https://lloydroc.github.io/assets/jpg/ebyte-e32-lora-module.jpg" alt="Ebyte e32 LoRa Module">&lt;/p>
&lt;h2 id="resources">Resources&lt;/h2>
&lt;p>Wire up the Ebyte e32 Lora Module to the Raspberry Pi first. Then check out the other resources listed below:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://lloydroc.github.io/post/hardware/ebyte-e32-lora-configuration-wiring/">Wiring and Pi Configuration&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://lloydroc.github.io/post/hardware/ebyte-e32-lora-systemd-service/">Running as a Service&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://lloydroc.github.io/post/hardware/ebyte-e32-lora-sockets/">Using Sockets&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://lloydroc.github.io/post/hardware/ebyte-e32-lora-socket-client-examples/">Client Example using Sockets&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://lloydroc.github.io/post/hardware/ebyte-e32-lora-transfer-files/">Transfer Files&lt;/a>&lt;/li>
&lt;/ul>
&lt;h1 id="software-installation">Software Installation&lt;/h1>
&lt;p>Before you install the &lt;code>e32&lt;/code> program be sure to have completed the &lt;a href="https://lloydroc.github.io/post/hardware/ebyte-e32-lora-configuration-wiring/">Wiring and Pi Configuration&lt;/a>. These instructions are to be run on your Raspberry Pi. Download &lt;a href="https://lloydroc.github.io/code/e32-1.10.2.tar.gz">e32&lt;/a>. See instructions below.&lt;/p></description></item><item><title>Favorite Idioms</title><link>https://lloydroc.github.io/post/idioms/</link><pubDate>Wed, 19 Aug 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/idioms/</guid><description>&lt;p>Some of my favorite idioms. Sorry I don&amp;rsquo;t have the author of them currently, and the context will have to be determined for each of them.&lt;/p>
&lt;ul>
&lt;li>Open the Kimono&lt;/li>
&lt;li>Always better to keep your pants on with a belt and suspenders&lt;/li>
&lt;li>Not even pregnant and already asking the sex&lt;/li>
&lt;li>When knee deep in alligators you need to drain the swamp&lt;/li>
&lt;li>When someone comes in your office with a Monkey; make sure they leave with the monkey&lt;/li>
&lt;li>Look a gift horse in the mouth&lt;/li>
&lt;li>Spend all our time chasing the hogs and never fix the fence&lt;/li>
&lt;li>Just because it&amp;rsquo;s an ugly baby doesn&amp;rsquo;t mean were not going to deliver it&lt;/li>
&lt;li>It only takes one doctor to deliver a baby&lt;/li>
&lt;li>Clean up after the elephant&lt;/li>
&lt;li>The most dangerous thing about being a life guard is saving someone else&amp;rsquo;s life&lt;/li>
&lt;li>A bird in one hand is worth two in the bush&lt;/li>
&lt;li>All stick and no carrot&lt;/li>
&lt;li>Tell me what time it is; don&amp;rsquo;t build me a watch&lt;/li>
&lt;li>The #1 rule of the wing walker is to make sure you have firm grasp in one hand before releasing the other&lt;/li>
&lt;li>There are lies and there are statistics, what is the difference?&lt;/li>
&lt;li>Catching a falling knife&lt;/li>
&lt;li>Iron fist in a velvet glove&lt;/li>
&lt;li>Move heaven and earth to get something done&lt;/li>
&lt;li>Fruit from the poison tree&lt;/li>
&lt;li>Say FU in 1000 words&lt;/li>
&lt;li>Can&amp;rsquo;t unring a bell&lt;/li>
&lt;li>Drowning in a tea-cup&lt;/li>
&lt;li>Gold ring in a pigs snout&lt;/li>
&lt;li>Bring a knife to a gun fight&lt;/li>
&lt;li>Hard to dance with a devil on your back&lt;/li>
&lt;li>Beat your swords into plowshares&lt;/li>
&lt;li>When x gets its prostate checked it&amp;rsquo;s y who gets tickled&lt;/li>
&lt;li>I like the dreams of the future rather than the history of the past&lt;/li>
&lt;li>Trash can of history&lt;/li>
&lt;li>They&amp;rsquo;re all pregnant and know one knows who the father is&lt;/li>
&lt;li>See the forest from the trees&lt;/li>
&lt;li>Be fruitful and multiply&lt;/li>
&lt;li>The harvest is plentiful but he laborers are few&lt;/li>
&lt;li>Like putting an anorexic on a diet&lt;/li>
&lt;li>Can&amp;rsquo;t Stop looking at the windsheild wipers and see where going&lt;/li>
&lt;li>A rut is only a few feet shallower than a grave.&lt;/li>
&lt;li>Adapted like a poisonous snake - looks the same - but when comes time to execute it can&amp;rsquo;t&lt;/li>
&lt;li>Sunshine is the best disinfectant&lt;/li>
&lt;li>Dumpster Fire&lt;/li>
&lt;li>Those who do not understand Autoconf are condemned to reinvent it, poorly.&lt;/li>
&lt;li>No plan ever survives first contact with the enemy&lt;/li>
&lt;li>Everyone has a plan until they get punched in the face&lt;/li>
&lt;li>There isn&amp;rsquo;t a cow on the ice. Meaning it&amp;rsquo;s not an emergency.&lt;/li>
&lt;li>Stand on the shoulders of giants&lt;/li>
&lt;li>Never argue with an idiot. They will drag you down to their level and beat you with experience. &amp;ndash;Twain&lt;/li>
&lt;/ul></description></item><item><title>Systemd: Timers</title><link>https://lloydroc.github.io/post/unix/systemd_timers/</link><pubDate>Tue, 30 Jun 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/unix/systemd_timers/</guid><description>&lt;h1 id="hahahugoshortcode98s0hbhb">Systemd: Timers&lt;/h1>
&lt;p>In the fourth post on how to create a service in &lt;code>systemd&lt;/code> we will create a timer that will run every minute sending messages to our example &lt;code>foo&lt;/code> service over a socket. We&amp;rsquo;re essentially creating a &lt;code>cron&lt;/code> job socket client.&lt;/p>
&lt;p>Previous posts:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://lloydroc.github.io/post/autotools/systemd-service-daemon-autotools/">Project Creation&lt;/a> of an autotools project and start/stop a daemon service.&lt;/li>
&lt;li>&lt;a href="https://lloydroc.github.io/post/unix/systemd_journal/">Journalling/Syslog&lt;/a> to enable logging, notify of state changes and accept reloads.&lt;/li>
&lt;li>&lt;a href="https://lloydroc.github.io/post/unix/systemd_sockets/">Socket&lt;/a> creation of a Unix Domain Socket for other processes to send messages to our service through remote procedure calls.&lt;/li>
&lt;/ul>
&lt;h1 id="what-the-example-will-do">What the example will do?&lt;/h1>
&lt;p>We already have a Unix Domain Socket created by &lt;code>systemd&lt;/code> that is listening on &lt;code>/var/log/foo.socket&lt;/code>. We also have a service called &lt;code>foo.service&lt;/code> that is listening to this socket . When messages are received on the socket the service will log them to the journal and syslog.&lt;/p></description></item><item><title>Systemd: A Service and a Socket</title><link>https://lloydroc.github.io/post/unix/systemd_sockets/</link><pubDate>Fri, 26 Jun 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/unix/systemd_sockets/</guid><description>&lt;h1 id="hahahugoshortcode97s0hbhb">Systemd: A Service and a Socket&lt;/h1>
&lt;p>This is the third post on how to create a &lt;em>service&lt;/em> in &lt;code>systemd&lt;/code>. See the &lt;a href="https://lloydroc.github.io/post/autotools/systemd-service-daemon-autotools/">first post&lt;/a> to create a autotools project and start/stop a daemon service. Or the &lt;a href="https://lloydroc.github.io/post/unix/systemd_journal/">second post&lt;/a> to enable logging, notify of state changes and accept reloads. In this post we&amp;rsquo;ll create a Unix Domain Socket so that other processes can send messages to our service through remote procedure calls.&lt;/p>
&lt;p>The socket we will use in this post is a Unix Socket with domain &lt;code>AF_UNIX&lt;/code> of type &lt;code>SOCK_DGRAM&lt;/code>. This type of socket is well suited for example purposes and is also ideal for remote procedure call applications. It is limited to communication on the same host, not over the internet. Unix Domain sockets are always reliable and are guaranteed to be delivered in order without duplication. Since this example uses a datagram socket we can receive the full message on each reception. Typically, the size of a datagram socket is under 2048 bytes see &lt;a href="https://www.man7.org/linux/man-pages/man7/socket.7.html">socket(7)&lt;/a> and look for the &lt;code>SO_SNDBUF&lt;/code> option for more details on maximum datagram size.&lt;/p></description></item><item><title>Status, Reloading and Journalling in Systemd</title><link>https://lloydroc.github.io/post/unix/systemd_journal/</link><pubDate>Tue, 23 Jun 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/unix/systemd_journal/</guid><description>&lt;h1 id="hahahugoshortcode96s0hbhb">Status, Reloading and Journalling in Systemd&lt;/h1>
&lt;p>This is the second post on how to create a &lt;em>service&lt;/em> in &lt;code>systemd&lt;/code>. In the &lt;a href="https://lloydroc.github.io/post/autotools/systemd-service-daemon-autotools/">first post&lt;/a> we created an &lt;em>autotools&lt;/em> project and were able to start, stop and get basic status on the service. In this post we&amp;rsquo;ll build on the &lt;em>autotools&lt;/em> project to add logging to &lt;code>syslog&lt;/code> and &lt;code>journald&lt;/code>. We will also give an example on how we could reload the service with a &lt;code>systemctl reload foo&lt;/code>. We will also use the &lt;a href="https://www.freedesktop.org/software/systemd/man/sd_notify.html#">sd_notify(3)&lt;/a> API to notify the service manager the status of what the service is doing.&lt;/p></description></item><item><title>Systemd and Autotools</title><link>https://lloydroc.github.io/post/autotools/systemd-service-daemon-autotools/</link><pubDate>Mon, 22 Jun 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/autotools/systemd-service-daemon-autotools/</guid><description>&lt;h1 id="hahahugoshortcode8s0hbhb">Systemd and Autotools&lt;/h1>
&lt;p>This post starts a tutorial series on how to create a &lt;code>systemd&lt;/code> service in Linux. This first post is likely the hardest part as we create an &lt;a href="https://lloydroc.github.io/post/autotools/hello-world/">autotools&lt;/a> project with the source code and &lt;code>systemd&lt;/code> unit files. Having this setup in &lt;code>autotools&lt;/code> saves significant time installing unit files that &lt;code>systemd&lt;/code> requires, building our C code, installing, and uninstalling our program. If you can get through this first post the following posts should come easily.&lt;/p></description></item><item><title>LSM9DS1 Command Line Tool for Raspberry Pi</title><link>https://lloydroc.github.io/post/hardware/lsm9ds1-rpi/</link><pubDate>Wed, 03 Jun 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/lsm9ds1-rpi/</guid><description>&lt;h1 id="hahahugoshortcode66s0hbhb">LSM9DS1 Command Line Tool for Raspberry Pi&lt;/h1>
&lt;p>I recently created a &lt;a href="https://github.com/lloydroc/rpi_lsm9ds1">LSM9DS1 Command Line Tool&lt;/a> for the Raspberry Pi. This tool was used to capture Accelerometer and Gyroscope data. I did an experiment to see what the readings look like, how the sensor behaves and the noise levels. This experiment is far from perfect but gives good insight and understanding.&lt;/p>
&lt;h1 id="sensor-setup">Sensor Setup&lt;/h1>
&lt;p>The LSM9DS1 was taped to the tread of a \( 16&amp;quot; \)stroller tire. The location was directly on top of the tread so the wheel had to be spun up in the air. The wheel was parallel to the ground as the stroller was on it&amp;rsquo;s side. The axis of the Accelerometer had Z facing outward, X facing along the rotation of the wheel, and Y facing perpendicular to the rotation of the wheel.&lt;/p></description></item><item><title>Viterbi Example</title><link>https://lloydroc.github.io/post/c/viterbi-example/</link><pubDate>Fri, 01 May 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/viterbi-example/</guid><description>&lt;h1 id="hahahugoshortcode44s0hbhb">Viterbi Example&lt;/h1>
&lt;p>Here we go! In this post I&amp;rsquo;m going to go through how Viterbi Decoders work. There is a lot to cover since we need to touch on Convolutional Coding, State Machines, Trellis Diagrams, Hamming Distances and Trellis Diagrams. I&amp;rsquo;ll illustrate this with the absolute simplest example possible and walk you through every step of the way. I highly recommending taking out a pencil and paper for this.&lt;/p>
&lt;h1 id="what-is-viterbi-decoding">What is Viterbi Decoding?&lt;/h1>
&lt;p>Viterbi Decoding allows us to detect and correct errors that were transmitted through a noisy channel.&lt;/p></description></item><item><title>I/O Multiplexing in Unix</title><link>https://lloydroc.github.io/post/unix/synchronous-io-multiplexing/</link><pubDate>Sun, 26 Apr 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/unix/synchronous-io-multiplexing/</guid><description>&lt;h1 id="hahahugoshortcode93s0hbhb">I/O Multiplexing in Unix&lt;/h1>
&lt;p>In Unix a process performs I/O on a single file descriptor at a time. When we talk about I/O on a file think &lt;code>read()&lt;/code> and &lt;code>write()&lt;/code> calls which are blocking. To get around blocking on a I/O call there are a number of ways. You can imagine how blocking on a single I/O call could bring the performance of a program to it&amp;rsquo;s knees. In this post we&amp;rsquo;ll quickly compare non-blocking I/O Models. Namely, &lt;code>select()&lt;/code>, &lt;code>poll()&lt;/code>, Signal Driven I/O, and &lt;code>epoll()&lt;/code>.&lt;/p></description></item><item><title>SSD1306 Display Module to Raspberry Pi Wiring</title><link>https://lloydroc.github.io/post/c/rpi-ssd1306-wiring/</link><pubDate>Wed, 22 Apr 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/rpi-ssd1306-wiring/</guid><description>&lt;p>I recently bought a DIY Display Module using the SSD1306 Driver from Alibaba AliExpress. In this post we discuss the physical wiring from the display module to the Raspberry Pi and the SPI Mode to interface with it. The goal is to control it in a C program.&lt;/p>
&lt;h2 id="hardware-required">Hardware Required&lt;/h2>
&lt;ul>
&lt;li>SSD1306 Module 7-pin 1.3&amp;quot; with with 128x32 OLED Display&lt;/li>
&lt;li>Raspberry Pi B+&lt;/li>
&lt;li>Connecting Wires&lt;/li>
&lt;/ul>
&lt;p>The module I got was a GME12864-83 1.3&amp;quot; SPI OLED SH1106 for $3.52 USD from the S+S+S+.&lt;/p></description></item><item><title>A CLI Tool to Recommend Text</title><link>https://lloydroc.github.io/post/c/recommend-command-line/</link><pubDate>Tue, 14 Apr 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/recommend-command-line/</guid><description>&lt;h1 id="hahahugoshortcode29s0hbhb">A CLI Tool to Recommend Text&lt;/h1>
&lt;p>Computers are fast at comparing one string to another, however, when we need to find which string is &lt;em>closest&lt;/em> to other strings things become more challenging. In this post we&amp;rsquo;ll create an command line utility that will recommend a string by comparing it to a list of strings. We&amp;rsquo;ll recommend the string that is the &lt;em>closest&lt;/em> one to our input string.&lt;/p>
&lt;p>Spell checkers and search engines have similar algorithms to this to recommend and match queries for search results.&lt;/p></description></item><item><title>The Stack of Frames in C with ARM Assembly Example</title><link>https://lloydroc.github.io/post/c/stack-of-frames-arm/</link><pubDate>Fri, 03 Apr 2020 08:34:05 -0600</pubDate><guid>https://lloydroc.github.io/post/c/stack-of-frames-arm/</guid><description>&lt;p>Function calls in the C programming language make heavy use of the stack, also called the call stack. When functions are called they create the so-called stack of frames. Each function call creates a frame, and these frames are allocated on the stack. This stack frame is used to allocate memory for local variables and intermediate values. The stack frame also contains the previous frame pointer and program counter&amp;rsquo;s value to execute from once the frame is popped off the stack. We will disassemble C function calls to understand the stack of frames in ARM assembly.&lt;/p></description></item><item><title>Converting C Conditionals to ARM Assembly</title><link>https://lloydroc.github.io/post/c/arm-assembly-conditionals/</link><pubDate>Fri, 27 Mar 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/arm-assembly-conditionals/</guid><description>&lt;h1 id="hahahugoshortcode12s0hbhb">Converting C Conditionals to ARM Assembly&lt;/h1>
&lt;p>In this post we can explore how to the &lt;code>gcc&lt;/code> compiler converts to C to ARM assembly language. We&amp;rsquo;ll specifically look at &lt;em>conditional logic&lt;/em>. We&amp;rsquo;ll look at examples of &lt;code>if&lt;/code> statements, &lt;code>if&lt;/code> statements with &lt;code>else if&lt;/code> and &lt;code>else&lt;/code>, then end with a &lt;code>switch&lt;/code> statement. To convert C to ARM assembly we will use the &lt;code>-S&lt;/code> flag on GCC. All these examples were done on a Raspberry Pi running Raspbian.&lt;/p></description></item><item><title>Unix Command Line Tool Timeline</title><link>https://lloydroc.github.io/post/unix/command-line-tool-timeline/</link><pubDate>Wed, 25 Mar 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/unix/command-line-tool-timeline/</guid><description>&lt;p>A compact timeline of Unix command line tools, ordered by the earliest release or broad adoption date.&lt;/p>
&lt;p>These entries focus on the core command line utilities that power Unix shells and classic Unix-style workflows. The list intentionally avoids large application suites, window managers, or programming languages used only incidentally as commands.&lt;/p>
&lt;h2 id="timeline">Timeline&lt;/h2>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>Year&lt;/th>
 &lt;th>Tool&lt;/th>
 &lt;th>Notes&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>1971&lt;/td>
 &lt;td>&lt;code>sh&lt;/code>&lt;/td>
 &lt;td>The original Bourne shell, the foundation of Unix command-line scripting.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>1971&lt;/td>
 &lt;td>&lt;code>cat&lt;/code>, &lt;code>cp&lt;/code>, &lt;code>mv&lt;/code>, &lt;code>rm&lt;/code>, &lt;code>ls&lt;/code>, &lt;code>mkdir&lt;/code>, &lt;code>rmdir&lt;/code>, &lt;code>pwd&lt;/code>, &lt;code>chmod&lt;/code>&lt;/td>
 &lt;td>Core file and directory utilities from early Unix releases.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>1973&lt;/td>
 &lt;td>&lt;code>grep&lt;/code>&lt;/td>
 &lt;td>Pattern searching on files, one of the most widely used Unix commands.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>1974&lt;/td>
 &lt;td>&lt;code>awk&lt;/code>&lt;/td>
 &lt;td>A powerful text-processing tool designed for Unix data manipulation.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>1974&lt;/td>
 &lt;td>&lt;code>sed&lt;/code>&lt;/td>
 &lt;td>Stream editing for filtering and transforming text.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>1974&lt;/td>
 &lt;td>&lt;code>find&lt;/code>&lt;/td>
 &lt;td>Recursive file discovery and selection.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>1975&lt;/td>
 &lt;td>&lt;code>sort&lt;/code>, &lt;code>uniq&lt;/code>, &lt;code>cut&lt;/code>, &lt;code>paste&lt;/code>, &lt;code>head&lt;/code>, &lt;code>tail&lt;/code>&lt;/td>
 &lt;td>Classic text processing commands for pipeline workflows.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>1975&lt;/td>
 &lt;td>&lt;code>tar&lt;/code>&lt;/td>
 &lt;td>Archive creation and extraction, important for backups and distribution.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>1979&lt;/td>
 &lt;td>&lt;code>make&lt;/code>&lt;/td>
 &lt;td>Build automation for compiling and managing source trees.&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;h2 id="scope">Scope&lt;/h2>
&lt;p>This page is meant to capture the history of Unix-style shell tools, not every executable that happens to offer a CLI. If a tool feels like an integral Unix utility, it belongs here; if it is primarily a larger application or programming environment, it does not.&lt;/p></description></item><item><title>Delay Lines in C</title><link>https://lloydroc.github.io/post/c/delay-line/</link><pubDate>Mon, 23 Mar 2020 08:43:05 +0000</pubDate><guid>https://lloydroc.github.io/post/c/delay-line/</guid><description>&lt;h1 id="hahahugoshortcode16s0hbhb">Delay Lines in C&lt;/h1>
&lt;p>There are many scenarios where a delay line is needed in signal processing. Scenarios ranging from Digital Filters, Convolution, Reverberation, Echo and others. Delay lines have a fixed length of &lt;strong>N&lt;/strong> samples. When delay lines take in a new sample they discard the oldest sample. In this post we discuss how delay lines work and implement a delay line in the C programming language.&lt;/p>
&lt;h1 id="a-theoretical-delay-line">A Theoretical Delay Line&lt;/h1>
&lt;p>For our purposes we will store primitive data types in an array. We&amp;rsquo;ll spare for this example both non-primitive data types, as well as, non-contiguous memory. The primitive data type in this array would be any of the following types: &lt;strong>int&lt;/strong>, &lt;strong>char&lt;/strong>, &lt;strong>complex&lt;/strong>, &lt;strong>double&lt;/strong>, or &lt;strong>float&lt;/strong>. The memory for the delay line is monotonically increasing and continuous, meaning all memory addresses for samples are next to one another. Essentially, we&amp;rsquo;ll have a &lt;code>int delay[N]&lt;/code> to declare our delay line. The delay line will store &lt;strong>N&lt;/strong> samples. With each new sample we&amp;rsquo;ll throw out the oldest sample. Below is a figure to depict the state of the delay line on each new sample received.&lt;/p></description></item><item><title>UART Between Raspberry Pi and Arduino</title><link>https://lloydroc.github.io/post/hardware/uart-rpi-and-arduino/</link><pubDate>Wed, 18 Mar 2020 14:02:54 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/uart-rpi-and-arduino/</guid><description>&lt;p>Using a 2-wire serial connection we can communicate from a Raspberry Pi (RPi) to an Arduino. For the Raspberry Pi we&amp;rsquo;ll use the built in UART accessed through a &lt;code>tty&lt;/code>, and the Arduino we&amp;rsquo;ll use the &lt;a href="https://www.arduino.cc/reference/en/language/functions/communication/serial/">Serial&lt;/a> Communication Library.&lt;/p>
&lt;h1 id="what-this-example-does">What this Example Does?&lt;/h1>
&lt;p>This example will use a RPi and Arduino to send a fixed message from the RPi to the Arduino. The Arduino will then echo what it receives back the RPi. The hardware used was a RPi B+ and the Arduino Due. The code is all in C/C++.&lt;/p></description></item><item><title>Daemon Example in C</title><link>https://lloydroc.github.io/post/c/unix-daemon-example/</link><pubDate>Thu, 05 Mar 2020 08:24:36 +0000</pubDate><guid>https://lloydroc.github.io/post/c/unix-daemon-example/</guid><description>&lt;h1 id="hahahugoshortcode37s0hbhb">Daemon Example in C&lt;/h1>
&lt;p>In this post we&amp;rsquo;ll look at daemon creation and demonstrate how to programmatically create daemons. We&amp;rsquo;ll go into the SysV recommendation of &amp;ldquo;double forking&amp;rdquo; for daemon creation.&lt;/p>
&lt;h1 id="table-of-contents">Table of Contents&lt;/h1>
&lt;nav id="TableOfContents">
 &lt;ul>
 &lt;li>&lt;a href="#creating-a-daemon-programmatically">Creating a daemon programmatically&lt;/a>&lt;/li>
 &lt;li>&lt;a href="#creating-a-daemon-with-systemd">Creating a daemon with Systemd&lt;/a>&lt;/li>
 &lt;li>&lt;a href="#using-glibcs-daemon-function-to-create-a-daemon">Using glibc&amp;rsquo;s daemon function to create a daemon&lt;/a>
 &lt;ul>
 &lt;li>&lt;a href="#analysis-of-the-daemon">Analysis of the Daemon&lt;/a>&lt;/li>
 &lt;/ul>
 &lt;/li>
 &lt;li>&lt;a href="#manually-creating-a-daemon-in-c-using-a-double-fork">Manually Creating a Daemon in C using a Double Fork&lt;/a>&lt;/li>
 &lt;li>&lt;a href="#c-code-double-fork-daemon-example">C Code &amp;ldquo;Double Fork&amp;rdquo; Daemon Example&lt;/a>
 &lt;ul>
 &lt;li>&lt;a href="#double-fork-steps">Double Fork Steps&lt;/a>&lt;/li>
 &lt;li>&lt;a href="#process-ids-from-a-double-fork">Process IDs from a Double Fork&lt;/a>&lt;/li>
 &lt;li>&lt;a href="#c-code-to-use-the-daemon-example">C Code to use the Daemon Example&lt;/a>&lt;/li>
 &lt;/ul>
 &lt;/li>
 &lt;li>&lt;a href="#header-file-for-daemon-example">Header file for Daemon Example&lt;/a>
 &lt;ul>
 &lt;li>&lt;a href="#header-file-for-daemon-example-1">Header file for Daemon Example&lt;/a>&lt;/li>
 &lt;/ul>
 &lt;/li>
 &lt;li>&lt;a href="#running-the-example">Running the example&lt;/a>
 &lt;ul>
 &lt;li>&lt;a href="#analyzing-the-daemon-process">Analyzing the Daemon Process&lt;/a>&lt;/li>
 &lt;/ul>
 &lt;/li>
 &lt;li>&lt;a href="#known-issues">Known Issues&lt;/a>&lt;/li>
 &lt;li>&lt;a href="#the-linux-programming-interface-book">The Linux Programming Interface Book&lt;/a>&lt;/li>
 &lt;li>&lt;a href="#where-to-go-from-here">Where to go from here?&lt;/a>&lt;/li>
 &lt;/ul>
&lt;/nav>
&lt;h1 id="what-are-daemons">What are Daemons?&lt;/h1>
&lt;p>Daemons are long running processes that run in the background with no controlling terminal - tty. Use cases for daemons are when the program needs to be available at all times and managed by the scheduler. Popular examples are nginx, postfix, httpd, sshd, cron, inetd. Many of these end in &amp;ldquo;d&amp;rdquo;, which is a convention for the name of a daemon. Daemons typically do not have the ability to write to &lt;code>stdout&lt;/code>, or &lt;code>stderr&lt;/code>, and have no means to connect to &lt;code>stdin&lt;/code> because they have no controlling terminal. Having no controlling terminal is a big deal in daemons. If they could connect to a controlling terminal they could be used in nefarious ways. We guarantee the daemon cannot take on a controlling terminal by doing the so-called &amp;ldquo;double fork&amp;rdquo;. Usually, output from the daemon is done by writing to log files. These logs are typically written in the in &lt;code>/var/log&lt;/code> directory. Input to a daemon, when necessary, is typically through sockets and signals. Let&amp;rsquo;s write an example daemon in C that runs on Unix.&lt;/p></description></item><item><title>Unix UDP Example in C</title><link>https://lloydroc.github.io/post/c/unix-udp-example/</link><pubDate>Thu, 27 Feb 2020 17:14:45 +0000</pubDate><guid>https://lloydroc.github.io/post/c/unix-udp-example/</guid><description>&lt;h1 id="hahahugoshortcode39s0hbhb">Unix UDP Example in C&lt;/h1>
&lt;p>In this post we&amp;rsquo;ll create an example client and server that communicate over UDP in C using Unix as the Operating System. UDP is a connection-less, unreliable datagram packet service. The term connection-less means there is no handshake between the client and server before information is exchanged. The term &amp;ldquo;fire and forget&amp;rdquo; applies here since the client sends and beforehand has no negotiation with the server. The term unreliable means there is no guarantee of delivery, ordering or duplicate protection. UDP is best for time-sensitive applications where it is preferable to discard packets rather than waiting for delayed ones.&lt;/p></description></item><item><title>Listing files in a Directory using C</title><link>https://lloydroc.github.io/post/c/list-directory/</link><pubDate>Mon, 24 Feb 2020 17:40:14 +0000</pubDate><guid>https://lloydroc.github.io/post/c/list-directory/</guid><description>&lt;h1 id="hahahugoshortcode25s0hbhb">Listing files in a Directory using C&lt;/h1>
&lt;p>Use the glibc &lt;code>scandir&lt;/code> function from &lt;code>&amp;lt;dirent.h&amp;gt;&lt;/code> to list all the files in a directory using the C programming language. The &lt;code>scandir&lt;/code> function allows for sorting, comparing and filtering the names of files in the directory. There are default options to list alphabetically through the &lt;code>alphasort()&lt;/code> glibc standard function. We&amp;rsquo;ll make an example in C that shows how to list all the files in a directory and give the name and type of each file in the directory.&lt;/p></description></item><item><title>Parse JSON with Flex and Bison</title><link>https://lloydroc.github.io/post/flex-bison/json-parse/</link><pubDate>Sat, 22 Feb 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/flex-bison/json-parse/</guid><description>&lt;h1 id="hahahugoshortcode51s0hbhb">Parse JSON with Flex and Bison&lt;/h1>
&lt;p>A simple example that will parse JSON in C using Flex and Bison. Forewarning, while this example works well it&amp;rsquo;s not going to handle every JSON case. I&amp;rsquo;ll highlight the limitations of what cannot be parsed towards the end of the post. It&amp;rsquo;s a perfect example to build upon and extend though.&lt;/p>
&lt;h1 id="flex-scanner-to-parse-json">FLEX Scanner to Parse JSON&lt;/h1>
&lt;p>The scanner will create a token stream. Tokens are just regex matches made by flex that can also have values. For example a &lt;code>DECIMAL&lt;/code> token we return a float by calling &lt;code>atof(yytext)&lt;/code>. Whereas, we also tokenize &lt;code>{&lt;/code> to &lt;code>LCURLY&lt;/code>, but there is no value. The &lt;code>ECHO&lt;/code> macro is turned off, and can be turned on for further debug info.&lt;/p></description></item><item><title>Unix Virtual Network Device Types</title><link>https://lloydroc.github.io/post/unix/virtual_networking_device_types/</link><pubDate>Fri, 07 Feb 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/unix/virtual_networking_device_types/</guid><description>&lt;h1 id="hahahugoshortcode102s0hbhb">Unix Virtual Network Device Types&lt;/h1>
&lt;p>This blog post attempts to list and describe the majority of Virtual Network Device types in Unix. Networking with Linux is a hot topic especially in the IoT and Datacenter areas. Read on and you&amp;rsquo;ll see a large array of Device Types found in Unix.&lt;/p>
&lt;h2 id="background-on-network-configuration-in-unix">Background on Network Configuration in Unix&lt;/h2>
&lt;p>The &lt;code>iproute2&lt;/code> framework replaces &lt;code>ifconfig&lt;/code> as well as many other commands. The command family &lt;code>ip link&lt;/code> deals with network device configuration in Unix. We can use &lt;code>iproute2&lt;/code> to add, change, and delete network configurations. When adding a network using &lt;code>iproute2&lt;/code> we can do a &lt;code>ip link add name NAME type TYPE&lt;/code> where &lt;code>TYPE&lt;/code> is one of the many Linux Networking Device Types.&lt;/p></description></item><item><title>Creating IP Tunnels in Linux with iproute2</title><link>https://lloydroc.github.io/post/unix/iproute2_create_tunnel/</link><pubDate>Tue, 04 Feb 2020 07:40:31 +0000</pubDate><guid>https://lloydroc.github.io/post/unix/iproute2_create_tunnel/</guid><description>&lt;h1 id="hahahugoshortcode90s0hbhb">Creating IP Tunnels in Linux with iproute2&lt;/h1>
&lt;p>In this post we&amp;rsquo;ll use &lt;em>iproute2&lt;/em> to create tunnels between two unix hosts. This will be the simplest form of an &lt;em>IP-in-IP&lt;/em> tunnel.&lt;/p>
&lt;h2 id="how-the-tunnels-will-work">How the Tunnels will work&lt;/h2>
&lt;p>In this example we have two Unix hosts with IP addresses &lt;em>10.255.254.96&lt;/em> and &lt;em>10.255.254.196&lt;/em> on a &lt;em>10.255.254.0/24&lt;/em> network and a gateway address of &lt;em>10.255.254.2&lt;/em>. These two hosts are on the same network. For this tunnel example we are going to add &lt;em>dummy&lt;/em> interfaces to each of our hosts and assign addresses &lt;em>192.168.2.111&lt;/em> and &lt;em>192.168.2.222&lt;/em> addresses to each of them respectively. Once the tunnels are up we will be able to send a ping from the first tunnel to the second tunnel as if the hosts are on the same network. This is known as encapsulation, since inside an IPv4 packet with a source of &lt;em>10.255.254.96&lt;/em> and destination of &lt;em>10.255.254.196&lt;/em> we have another IPv4 packet encapsulated inside with a source of &lt;em>192.168.2.111&lt;/em> and destination of &lt;em>192.168.2.222&lt;/em>.&lt;/p></description></item><item><title>Comparing Linux Distributions in Docker</title><link>https://lloydroc.github.io/post/docker/linux_distribution_compare/</link><pubDate>Mon, 03 Feb 2020 07:12:23 +0000</pubDate><guid>https://lloydroc.github.io/post/docker/linux_distribution_compare/</guid><description>&lt;p>I have the situation where I need to compare packages, settings, configurations across multiple Linux distributions. Docker is a great tool to pull images from all of the linux distributions to compare and contrast nearly anything you can think of. In this post we&amp;rsquo;ll create a simple docker compose file and run containers from the centos, alpine, ubuntu, archlinux, busybox and debian images.&lt;/p>
&lt;h3 id="the-docker-composeyaml-file">The docker-compose.yaml file&lt;/h3>
&lt;p>First we&amp;rsquo;ll need to install &lt;code>docker-ce&lt;/code> and &lt;code>docker-compose&lt;/code>. Then create a simple &lt;code>docker-compose.yaml&lt;/code> with the following content:
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">version&lt;/span>: &lt;span style="color:#e6db74">&amp;#39;3&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">services&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">ubuntu&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">container_name&lt;/span>: &lt;span style="color:#ae81ff">ubuntu&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">image&lt;/span>: &lt;span style="color:#ae81ff">ubuntu:latest&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">command&lt;/span>: &lt;span style="color:#ae81ff">tail -f /dev/null&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">centos&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">container_name&lt;/span>: &lt;span style="color:#ae81ff">centos&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">image&lt;/span>: &lt;span style="color:#ae81ff">centos:latest&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">command&lt;/span>: &lt;span style="color:#ae81ff">tail -f /dev/null&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">busybox&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">container_name&lt;/span>: &lt;span style="color:#ae81ff">busybox&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">image&lt;/span>: &lt;span style="color:#ae81ff">busybox:latest&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">command&lt;/span>: &lt;span style="color:#ae81ff">tail -f /dev/null&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">alpine&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">container_name&lt;/span>: &lt;span style="color:#ae81ff">alpine&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">image&lt;/span>: &lt;span style="color:#ae81ff">alpine:latest&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">command&lt;/span>: &lt;span style="color:#ae81ff">tail -f /dev/null&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">archlinux&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">container_name&lt;/span>: &lt;span style="color:#ae81ff">arch&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">image&lt;/span>: &lt;span style="color:#ae81ff">archlinux:latest&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">command&lt;/span>: &lt;span style="color:#ae81ff">tail -f /dev/null&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">debian&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">container_name&lt;/span>: &lt;span style="color:#ae81ff">debian&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">image&lt;/span>: &lt;span style="color:#ae81ff">debian:latest&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">command&lt;/span>: &lt;span style="color:#ae81ff">tail -f /dev/null&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/p></description></item><item><title>Regular Expressions in C</title><link>https://lloydroc.github.io/post/c/regex_pcre/</link><pubDate>Sat, 01 Feb 2020 13:29:10 +0000</pubDate><guid>https://lloydroc.github.io/post/c/regex_pcre/</guid><description>&lt;p>In this blog post we will construe some simple examples of regular expressions in C, also known as a &lt;code>regex&lt;/code>. We will use the popular libraries PCRE and PCRE2. If you don&amp;rsquo;t know what a regex is or have never used them, then you can close this tab right now! Learning regular expressions in in C is probably the wrong way to go. Start with something more easy like Python, Perl, or anything else because doing them in C is difficult. If you know regular expressions from other languages, learning them in C will strengthen your understanding of the concept. This example is meant to be easy to understand, simple and useful.&lt;/p></description></item><item><title>HTML Select List for All Timezones</title><link>https://lloydroc.github.io/post/programming/html_select_all_timezones/</link><pubDate>Fri, 31 Jan 2020 06:23:05 +0000</pubDate><guid>https://lloydroc.github.io/post/programming/html_select_all_timezones/</guid><description>&lt;h1 id="hahahugoshortcode80s0hbhb">HTML Select List for All Timezones&lt;/h1>
&lt;p>I needed an HTML &lt;code>select&lt;/code> for every Timezone and really couldn&amp;rsquo;t find what I was looking for. Here is an abbreviated version so you know what I&amp;rsquo;m talking about:&lt;/p>
&lt;h3 id="abbreviated-html-select-of-timezones">Abbreviated HTML Select of Timezones&lt;/h3>
&lt;p>A smaller HTML select with timezones which maybe a good starting point in the USA.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-html" data-lang="html">&lt;span style="display:flex;">&lt;span>&amp;lt;&lt;span style="color:#f92672">select&lt;/span> &lt;span style="color:#a6e22e">id&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;timezone&amp;#34;&lt;/span> &lt;span style="color:#a6e22e">name&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;timezone&amp;#34;&lt;/span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;custom-select&amp;#34;&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">option&lt;/span> &lt;span style="color:#a6e22e">value&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;Pacific/Honolulu&amp;#34;&lt;/span>&amp;gt;Pacific/Honolulu GMT-10:00&amp;lt;/&lt;span style="color:#f92672">option&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">option&lt;/span> &lt;span style="color:#a6e22e">value&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;America/Anchorage&amp;#34;&lt;/span>&amp;gt;America/Anchorage GMT-9:00&amp;lt;/&lt;span style="color:#f92672">option&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">option&lt;/span> &lt;span style="color:#a6e22e">value&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;America/Los_Angeles&amp;#34;&lt;/span>&amp;gt;America/Los_Angeles GMT-8:00&amp;lt;/&lt;span style="color:#f92672">option&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">option&lt;/span> &lt;span style="color:#a6e22e">value&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;America/Boise&amp;#34;&lt;/span>&amp;gt;America/Boise GMT-7:00&amp;lt;/&lt;span style="color:#f92672">option&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">option&lt;/span> &lt;span style="color:#a6e22e">value&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;America/Denver&amp;#34;&lt;/span>&amp;gt;America/Denver GMT-7:00&amp;lt;/&lt;span style="color:#f92672">option&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">option&lt;/span> &lt;span style="color:#a6e22e">value&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;America/Phoenix&amp;#34;&lt;/span>&amp;gt;America/Phoenix GMT-7:00&amp;lt;/&lt;span style="color:#f92672">option&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">option&lt;/span> &lt;span style="color:#a6e22e">value&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;America/Chicago&amp;#34;&lt;/span>&amp;gt;America/Chicago GMT-6:00&amp;lt;/&lt;span style="color:#f92672">option&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">option&lt;/span> &lt;span style="color:#a6e22e">value&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;America/Detroit&amp;#34;&lt;/span>&amp;gt;America/Detroit GMT-5:00&amp;lt;/&lt;span style="color:#f92672">option&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">option&lt;/span> &lt;span style="color:#a6e22e">value&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;America/New_York&amp;#34;&lt;/span>&amp;gt;America/New_York GMT-5:00&amp;lt;/&lt;span style="color:#f92672">option&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&amp;lt;/&lt;span style="color:#f92672">select&lt;/span>&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;h3 id="abbreviated-html-select-of-timezones-in-action">Abbreviated HTML Select of Timezones in Action&lt;/h3>
&lt;select id="timezone" name="timezone" class="custom-select">
 &lt;option value="Pacific/Honolulu">Pacific/Honolulu GMT-10:00&lt;/option>
 &lt;option value="America/Anchorage">America/Anchorage GMT-9:00&lt;/option>
 &lt;option value="America/Los_Angeles">America/Los_Angeles GMT-8:00&lt;/option>
 &lt;option value="America/Boise">America/Boise GMT-7:00&lt;/option>
 &lt;option value="America/Denver">America/Denver GMT-7:00&lt;/option>
 &lt;option value="America/Phoenix">America/Phoenix GMT-7:00&lt;/option>
 &lt;option value="America/Chicago">America/Chicago GMT-6:00&lt;/option>
 &lt;option value="America/Detroit">America/Detroit GMT-5:00&lt;/option>
 &lt;option value="America/New_York">America/New_York GMT-5:00&lt;/option>
&lt;/select>
&lt;p>What I especially liked about the &lt;code>value&lt;/code> field here is it standard across platforms and programming languages. The reason is because this the &lt;code>value&lt;/code> field if from the &lt;a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">tz database&lt;/a>. Other &lt;code>value&lt;/code>s you will see for the HTML &lt;code>option&lt;/code> have offsets and all sorts of different ideas. These usually fail because when dealing with time one has to account for the dreaded Daylight Savings Time.&lt;/p></description></item><item><title>User Name Search with Apache Lucene</title><link>https://lloydroc.github.io/post/java/lucene_lower_case_whitespace_analyzer/</link><pubDate>Thu, 30 Jan 2020 10:53:31 +0000</pubDate><guid>https://lloydroc.github.io/post/java/lucene_lower_case_whitespace_analyzer/</guid><description>&lt;h1 id="hahahugoshortcode77s0hbhb">User Name Search with Apache Lucene&lt;/h1>
&lt;p>I wanted to use Apache Lucene to search User Names. It&amp;rsquo;s definitely not straightforward. This post explains how to do it by defining our own custom &lt;code>Analyzer&lt;/code> and explaining how we form the &lt;code>Document&lt;/code>, index the user names and query with a &lt;code>PrefixQuery&lt;/code>.&lt;/p>
&lt;p>First of all if you&amp;rsquo;re using Apache Lucene you&amp;rsquo;re my type of person! It&amp;rsquo;s an awesome project, but the documentation and examples are severely lacking.&lt;/p></description></item><item><title>VIM formatting JSON</title><link>https://lloydroc.github.io/post/vim/format_json/</link><pubDate>Tue, 28 Jan 2020 08:44:41 +0000</pubDate><guid>https://lloydroc.github.io/post/vim/format_json/</guid><description>&lt;h1 id="hahahugoshortcode103s0hbhb">VIM formatting JSON&lt;/h1>
&lt;p>Have you ever needed to format some gnarly JSON that is unreadable and/or too large to look through? It&amp;rsquo;s super easy to format it with &lt;code>vim&lt;/code>. We can use the popular &lt;code>jq&lt;/code> tool - link at the end of this blog post.&lt;/p>
&lt;h2 id="simple-steps-to-format-json-in-vim">Simple Steps to format JSON in VIM&lt;/h2>
&lt;p>Here is an example with a file called &lt;code>hello.json&lt;/code>.&lt;/p>
&lt;ul>
&lt;li>Open a file &lt;code>vim hello.json&lt;/code>&lt;/li>
&lt;li>Open the file in VIM &lt;code>vim hello.json&lt;/code>&lt;/li>
&lt;li>We can format with the command &lt;code>:%!jq . -&lt;/code>&lt;/li>
&lt;li>Save the file &lt;code>:wq&lt;/code>&lt;/li>
&lt;/ul>
&lt;h2 id="explanation">Explanation&lt;/h2>
&lt;p>All we need is the command &lt;code>:%!jq . -&lt;/code>. Let&amp;rsquo;s break this command down.&lt;/p></description></item><item><title>Why static declarations are confusing in C</title><link>https://lloydroc.github.io/post/c/static-variables/</link><pubDate>Thu, 22 Aug 2019 18:32:31 +0000</pubDate><guid>https://lloydroc.github.io/post/c/static-variables/</guid><description>&lt;p>The &lt;code>static&lt;/code> variable in C is unnecessarily confusing because it is used for both the memory management model and for linkage. Since these two concerns are mutually exclusive another keyword would have really cleared things up in the linkage case.&lt;/p>
&lt;h3 id="a-single-keyword-for-memory-management-and-linkage">A single keyword for memory management and linkage?&lt;/h3>
&lt;p>As you may know in C there are 3 methods of memory management models: automatic, static and manual. Automatic variables are what most programming languages use. Manual is memory allocated with &lt;code>malloc()&lt;/code> and de-allocated with &lt;code>free()&lt;/code>. It&amp;rsquo;s manual meaning you control allocation and de-allocation of memory. It&amp;rsquo;s static memory management we&amp;rsquo;re focused on in this post.&lt;/p></description></item><item><title>Implementing FIR Filters in C</title><link>https://lloydroc.github.io/post/c/fir-filter/</link><pubDate>Mon, 19 Aug 2019 16:00:21 +0000</pubDate><guid>https://lloydroc.github.io/post/c/fir-filter/</guid><description>&lt;h1 id="hahahugoshortcode23s0hbhb">Implementing FIR Filters in C&lt;/h1>
&lt;p>Implementing FIR filters in C is much easier if we make use of the static variables declared in our functions. In this blog post we will create some simple example FIR filters, and get their impulse response. To understand this post you will have to have the basic theory of FIR filtering down.&lt;/p>
&lt;h3 id="fir-filter-implementation">FIR Filter Implementation&lt;/h3>
&lt;p>There are a lot of ways to implement a FIR filter in C. The method provided makes the implementation simple because we can simply put the last time sample into the filter and the filtered result will come out. The filter function itself will handle the delay line of the time samples. It&amp;rsquo;s a bit abstract so let&amp;rsquo;s take an example of just creating a delay line of samples. Then later we&amp;rsquo;ll add in the FIR filter coefficients.&lt;/p></description></item><item><title>pthread barrier example</title><link>https://lloydroc.github.io/post/c/pthread-barrier-example/</link><pubDate>Mon, 12 Aug 2019 14:30:06 +0000</pubDate><guid>https://lloydroc.github.io/post/c/pthread-barrier-example/</guid><description>&lt;p>A Barrier in computing is a synchronization method where a group of threads cannot proceed until a condition allows the blocked threads to proceed. In this post we will construct an example of a Barrier that relates to men and women at the dinner table using pthreads. We will men waiting to get their food, but the men will be blocked until the woman has eaten, thus, trigger the start state of the Barrier. Ladies First!&lt;/p></description></item><item><title>Example FFT in C</title><link>https://lloydroc.github.io/post/c/example-fft/</link><pubDate>Thu, 08 Aug 2019 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/example-fft/</guid><description>&lt;h1 id="hahahugoshortcode22s0hbhb">Example FFT in C&lt;/h1>
&lt;p>In this post we&amp;rsquo;ll provide the simplest possible Fast Fourier Transform (FFT) example in C. After understanding this example it can be adapted to modify for performance or computer architecture.&lt;/p>
&lt;h1 id="table-of-contents">Table of Contents&lt;/h1>
&lt;nav id="TableOfContents">
 &lt;ul>
 &lt;li>&lt;a href="#fft-example-usage">FFT Example Usage&lt;/a>&lt;/li>
 &lt;li>&lt;a href="#c-header-of-the-fft">C Header of the FFT&lt;/a>
 &lt;ul>
 &lt;li>&lt;a href="#rearranging-the-input">Rearranging the Input&lt;/a>&lt;/li>
 &lt;li>&lt;a href="#c-header-to-use-the-fft">C Header to use the FFT&lt;/a>&lt;/li>
 &lt;/ul>
 &lt;/li>
 &lt;li>&lt;a href="#c-implementation-of-the-fft">C Implementation of the FFT&lt;/a>&lt;/li>
 &lt;li>&lt;a href="#test-cases-for-the-fft">Test Cases for the FFT&lt;/a>&lt;/li>
 &lt;/ul>
&lt;/nav>
&lt;h2 id="fft-example-usage">FFT Example Usage&lt;/h2>
&lt;p>In the example below we&amp;rsquo;ll perform an FFT on a complex (real + imaginary) array of 32 elements. After the FFT has completed it will write over the provided arrays as the FFT is done &lt;em>in place&lt;/em>. Note, we&amp;rsquo;re using floating point here and not fixed width. Thus, if you don&amp;rsquo;t have a math coprocessor it will be very slow.&lt;/p></description></item><item><title>pbcopy/pbpaste in WSL</title><link>https://lloydroc.github.io/post/unix/wsl-pbcopy-pbpaste/</link><pubDate>Tue, 30 Jul 2019 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/unix/wsl-pbcopy-pbpaste/</guid><description>&lt;h1 id="hahahugoshortcode101s0hbhb">pbcopy/pbpaste in WSL&lt;/h1>
&lt;p>If you&amp;rsquo;re looking to replicate the pbcopy and pbpaste commands in WSL then you&amp;rsquo;ve found the right place! In this post we will make some simple shell scripts to replicate pbcopy and pbpaste in OS X. If you&amp;rsquo;re accustomed to pbcopy/pbpaste in Mac OS X, it&amp;rsquo;s hard to not have the equivalent in WSL. One spoiler alert the commands just are not as fast as they are in OS X.&lt;/p></description></item><item><title>A Useful Linked List</title><link>https://lloydroc.github.io/post/c/useful-linked-list/</link><pubDate>Fri, 26 Jul 2019 22:23:08 +0000</pubDate><guid>https://lloydroc.github.io/post/c/useful-linked-list/</guid><description>&lt;h1 id="hahahugoshortcode43s0hbhb">A Useful Linked List}&lt;/h1>
&lt;p>In this post we will create a useful Linked List in the C Programming Language. This is opposed to all the useless linked lists that I&amp;rsquo;ve seen on the internet. They are numerious, typically written by academics that haven&amp;rsquo;t much experience programming. It&amp;rsquo;s not the logic or syntax that is bad, but the API and functions they create that make the usage of the Linked List obtuse and awkward. This implementation of a Linked List in C is something meant to be used over and over again in projects.&lt;/p></description></item><item><title>Learning how the Internet Works</title><link>https://lloydroc.github.io/post/networking/learn-how-internet-works/</link><pubDate>Fri, 26 Jul 2019 07:28:41 +0000</pubDate><guid>https://lloydroc.github.io/post/networking/learn-how-internet-works/</guid><description>&lt;h1 id="hahahugoshortcode85s0hbhb">Learning how the Internet Works&lt;/h1>
&lt;p>The Internet is the most complex public service ever created! The Internet is truly amazing. Curriculums from four year College Institutions focused on Computer Science and/or Programming Background don&amp;rsquo;t spend much time teaching &lt;em>The Internet&lt;/em>.&lt;/p>
&lt;p>Recently, I found myself tired of the Interenet being a black box and pursued a deeper understanding. I wanted to post about how I obtained a deeper understanding of the internet and jot down some of my notes and references.&lt;/p></description></item><item><title>SQLite Transactions Part 1</title><link>https://lloydroc.github.io/post/c/sqlite-transactions-part-1/</link><pubDate>Tue, 09 Jul 2019 06:43:41 +0000</pubDate><guid>https://lloydroc.github.io/post/c/sqlite-transactions-part-1/</guid><description>&lt;p>In the world of software these days it is expected that applications do multiple things at once. With that said it&amp;rsquo;s pretty typical that multiple processes or threads have read and write access to a database. In this post we will go over transactions in SQLite which prohibits changes made to the database unless they are inside a transaction.&lt;/p>
&lt;h2 id="defining-a-database-transaction">Defining a Database Transaction&lt;/h2>
&lt;p>Let&amp;rsquo;s first define a database transaction which is essentially to carry out or conduct to a conclusion. In the context of a database a transaction is a grouping of SQL commands. We can consider this transaction to be atomic in the sense that all the commands will execute successfully or it will fail.&lt;/p></description></item><item><title>Adding SQLite to a C Project</title><link>https://lloydroc.github.io/post/c/add-sqlite-project/</link><pubDate>Sat, 06 Jul 2019 10:43:41 +0000</pubDate><guid>https://lloydroc.github.io/post/c/add-sqlite-project/</guid><description>&lt;h1 id="hahahugoshortcode13s0hbhb">Adding SQLite to a C Project&lt;/h1>
&lt;p>Let&amp;rsquo;s add SQLite to your C project. It&amp;rsquo;s easy and straightforward. We&amp;rsquo;ll use the SQLite.org recommended way by adding the so-called &amp;ldquo;amalgamation&amp;rdquo; to our C project and compile from source. In the words of &lt;a href="https://sqlite.org/howtocompile.html">SQLite.org&lt;/a> &amp;ldquo;the use of the amalgamation is recommended for all applications.&amp;rdquo; In this blog post we&amp;rsquo;ll download, compile and use SQLite in our C project.&lt;/p>
&lt;h2 id="step-1---download-the-sqlite-amalgamation">Step 1 - Download the SQLite Amalgamation&lt;/h2>
&lt;p>In Step 1 we&amp;rsquo;ll download the amalgamation and look at the contents of the files. This is done by doing to the &lt;a href="https://www.sqlite.org/download.html">SQLite downloads&lt;/a> and downloading the zip file in the &amp;ldquo;C Source Code as an amalgamation&amp;rdquo; section. Let&amp;rsquo;s download the zip file and see what is inside it:&lt;/p></description></item><item><title>Enable CORS when not Supported</title><link>https://lloydroc.github.io/post/networking/nginx-cors-proxy/</link><pubDate>Fri, 05 Jul 2019 07:40:01 +0000</pubDate><guid>https://lloydroc.github.io/post/networking/nginx-cors-proxy/</guid><description>&lt;p>Some services don&amp;rsquo;t support &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS">CORS&lt;/a>, but we can use NGINX to make CORS supported with this simple hack! To enable CORS on any service we need to have NGINX configured as a &lt;a href="https://lloydroc.github.io/post/networking/couchdb-nginx-proxy/">Reverse Proxy&lt;/a> and have NGINX add a successful pre-flight response to the CORS pre-flight request. Read on to get this simple example to work.&lt;/p>
&lt;p>Let&amp;rsquo;s back all the way up on why CORS is needed? Security! What if we could write Javacript on a server somewhere and that Javascript could use any back-end server it wanted for requests? That would introduce huge security vulnerabilities. For example, I could write a webpage that looks like a store, but not have a back-end for the store at all and send bogus orders to another store somewhere else on the internet that my site isn&amp;rsquo;t affiliated with. CORS gives us security that a front-end and back-end match up. From the back-end we can control what front-end has access to the back-end and also what requests that front-end can make.&lt;/p></description></item><item><title>Flex/Bison Autotools Project Creation</title><link>https://lloydroc.github.io/post/autotools/flex-bison-project/</link><pubDate>Tue, 25 Jun 2019 11:15:00 +0000</pubDate><guid>https://lloydroc.github.io/post/autotools/flex-bison-project/</guid><description>&lt;p>Let&amp;rsquo;s create a basic Flex/Bison Project with Autotools. The GNU Documentation for Automake specifies &lt;a href="https://www.gnu.org/software/automake/manual/html_node/Yacc-and-Lex.html">Flex/Bison Support&lt;/a>. We will take it a step further and provide a complete example with a Flex Scanner and Bison parser.&lt;/p>
&lt;p>See the previous post &lt;a href="https://lloydroc.github.io/post/autotools/create-project/">Autotools Project Create Template&lt;/a>. This allows us to create a boilerplate Autotools project. Then we can add the Flex/Bison support on top of the basic autotools project.&lt;/p>
&lt;p>Let&amp;rsquo;s create a project called &lt;code>fbbasic&lt;/code> with the Autotools Project Creation Template:&lt;/p></description></item><item><title>Copy Paste with Neovim in WSL</title><link>https://lloydroc.github.io/post/vim/wsl-neovim-copy-paste/</link><pubDate>Tue, 25 Jun 2019 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/vim/wsl-neovim-copy-paste/</guid><description>&lt;figure>&lt;img src="https://lloydroc.github.io/assets/svg/yank.svg">
&lt;/figure>

&lt;h1 id="hahahugoshortcode104s1hbhb">Copy Paste with Neovim in WSL&lt;/h1>
&lt;p>Copy (Yank) and Paste doesn&amp;rsquo;t work in &lt;a href="https://neovim.io/doc/user/provider.html">neovim&lt;/a> because it cannot access the System Clipboard on WSL - Windows Subsystem Linux. This simple small hack solves this issue. This hack works without having to install X Windows or any other tools.&lt;/p>
&lt;p>&lt;strong>Update &lt;a href="https://github.com/neovim/neovim/wiki/FAQ#how-to-use-the-windows-clipboard-from-wsl">Neovim Official Solution&lt;/a>&lt;/strong>. The solution posted in this blog post works, however, at the time there was no official solution. Now see the official solution using the &lt;code>win32yank&lt;/code> binary. I honestly have not tried the solution posted herein for sometime as I no longer have WSL. There maybe a &lt;code>neovim&lt;/code> clipboard provider that works and is built in. In the solution provided we create a pair of Unix scripts to act as that provider if you don&amp;rsquo;t have the &lt;code>win32yank&lt;/code> binary.&lt;/p></description></item><item><title>Autotools Project Creation Template</title><link>https://lloydroc.github.io/post/autotools/create-project/</link><pubDate>Mon, 24 Jun 2019 07:26:00 +0000</pubDate><guid>https://lloydroc.github.io/post/autotools/create-project/</guid><description>&lt;h1 id="hahahugoshortcode6s0hbhb">Autotools Project Creation Template&lt;/h1>
&lt;p>This post has a simple bash script to create a basic Hello World autotools project with a single command. The justification for this autotools script is I&amp;rsquo;ve not seen a consolidated script that keeps it simple in one place. The script creates a boiler plate autotools hello world project. Here is what it does:&lt;/p>
&lt;ul>
&lt;li>Creation of &lt;code>configure.ac&lt;/code> with project name, version, and email&lt;/li>
&lt;li>Creation of root &lt;code>Makefile.am&lt;/code> which just points to the &lt;code>src/Makefile.am&lt;/code>&lt;/li>
&lt;li>Creation of &lt;code>src/Makefile.am&lt;/code> which will make a binary and has a single source file &lt;code>main.c&lt;/code>&lt;/li>
&lt;li>Creation of a &lt;code>autogen.sh&lt;/code> which will run &lt;code>autoreconf --install&lt;/code>&lt;/li>
&lt;li>Creation of a &lt;code>.gitignore&lt;/code> so we know what autotools files should be under version control&lt;/li>
&lt;li>Creation of a &lt;code>main.c&lt;/code> which just prints &amp;ldquo;hello world&amp;rdquo; to stdout.&lt;/li>
&lt;/ul>
&lt;p>After we have created the files above all we need to do is run a &lt;code>./autogen.sh&lt;/code> and our project will be ready to run the infamous &lt;code>./configure&lt;/code>, &lt;code>make&lt;/code> and &lt;code>make install&lt;/code>.&lt;/p></description></item><item><title>Passing Datagrams Between Python and C</title><link>https://lloydroc.github.io/post/c/unix-domain-socket-datagram/</link><pubDate>Tue, 18 Jun 2019 06:45:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/unix-domain-socket-datagram/</guid><description>&lt;p>Let&amp;rsquo;s discuss how to pass data from a C program to a Python Script and vice-versa. This subject involves IPC - Inter-Process Communications. In this blog post we&amp;rsquo;ll discuss the more exotic IPC mechanism of the &lt;strong>Unix domain datagram socket&lt;/strong>. Specifically, this is domain &lt;code>AF_UNIX&lt;/code> and type &lt;code>SOCK_DGRAM&lt;/code> type of socket. Before you consider this method let&amp;rsquo;s address some of it&amp;rsquo;s benefits and limitations of using Unix Domain Sockets for Interprocess Communications:&lt;/p></description></item><item><title>C Double Pointers</title><link>https://lloydroc.github.io/post/c/double-pointer/</link><pubDate>Mon, 17 Jun 2019 16:45:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/double-pointer/</guid><description>&lt;h1 id="hahahugoshortcode18s0hbhb">C Double Pointers&lt;/h1>
&lt;figure>&lt;img src="https://lloydroc.github.io/assets/svg/c-double-pointers.svg">&lt;figcaption>
 &lt;h4>double pointers in c&lt;/h4>
 &lt;/figcaption>
&lt;/figure>

&lt;p>Updated December 19, 2022&lt;/p>
&lt;p>Examples and explanations of single pointers are used throughout many programming languages including C. This blog post explains and explores use cases for double pointers in the C programming language. Toward the end we&amp;rsquo;ll look at a &lt;code>glibc&lt;/code> example that uses a triple pointer.&lt;/p>
&lt;h1 id="use-cases">Use Cases&lt;/h1>
&lt;p>The primary use cases I&amp;rsquo;ve found are the following:&lt;/p>
&lt;ul>
&lt;li>Arrays of strings &lt;code>char *&lt;/code>. These strings are typically not fixed length. Thus, &lt;code>char *buf[N]&lt;/code> is a bit misleading since &lt;code>N&lt;/code> will vary.&lt;/li>
&lt;li>Functions that allocate memory for the caller. In this case the caller is expected to free the allocated memory after finished.&lt;/li>
&lt;/ul>
&lt;h1 id="mental-model">Mental Model&lt;/h1>
&lt;p>What is the difference between a &lt;code>char **foo&lt;/code> and &lt;code>char *foo[]&lt;/code>? Let&amp;rsquo;s take an example program:&lt;/p></description></item><item><title>Autotools Hello World</title><link>https://lloydroc.github.io/post/autotools/hello-world/</link><pubDate>Thu, 30 May 2019 14:46:00 +0000</pubDate><guid>https://lloydroc.github.io/post/autotools/hello-world/</guid><description>&lt;h1 id="hahahugoshortcode10s0hbhb">Autotools Hello World&lt;/h1>
&lt;h1 id="dont-listen-to-the-autotools-haters">Don&amp;rsquo;t Listen to the Autotools Haters&lt;/h1>
&lt;p>Being an avid C and Unix Geek, I decided to ignore all the hate out there about GNU Autotools and try it for myself. For those of you that don&amp;rsquo;t know the GNU Autotools suite consists of Autoconf, Automake and Libtool. You&amp;rsquo;ll see some major criticisms out there from people saying it&amp;rsquo;s way too complex, challenging, hard to use as well as all sorts of other criticisms. Let&amp;rsquo;s face it though, build systems are complex. I&amp;rsquo;ve used all sorts of them. Communities love to re-invent the wheel and build their own tool but at the end of the day to support everything is a massive endeavor.&lt;/p></description></item><item><title>Processing Emails with a script in Postfix</title><link>https://lloydroc.github.io/post/unix/process-mail-script-postfix/</link><pubDate>Sat, 27 Apr 2019 07:56:00 +0000</pubDate><guid>https://lloydroc.github.io/post/unix/process-mail-script-postfix/</guid><description>&lt;p>Updated Feb 7, 2020&lt;/p>
&lt;p>After thinking about this post more, it&amp;rsquo;s true you can process emails with a script in Postfix. The post provides the right answer to the &lt;strong>wrong question&lt;/strong>!! You can certainly process emails with Postfix but it&amp;rsquo;s hard, brittle, reduces performance and really isn&amp;rsquo;t recommended. What is better is to have a client program that reads the mail and does what you desire. This client can be put on a cron job, triggered or run however you want. The client is very flexible and so many different programming languages support them. This gives a lot of power to mark emails read, manage folders, etc &amp;hellip; It&amp;rsquo;s just a cleaner, better, easier to use and test architecture than having a script in Postfix. So I&amp;rsquo;ll leave this up, but, I wouldn&amp;rsquo;t use it unless there is some reason I cannot think of how it would be better.&lt;/p></description></item><item><title>Java Cyclic Barrier</title><link>https://lloydroc.github.io/post/java/cyclic-barrier/</link><pubDate>Mon, 25 Feb 2019 08:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/java/cyclic-barrier/</guid><description>&lt;h1 id="hahahugoshortcode76s0hbhb">Java Cyclic Barrier&lt;/h1>
&lt;p>Imagine a scenario where you have N threads and can only do something when M of them are ready. Java already has this built in since 1.5 with the &lt;a href="https://docs.oracle.com/javase/10/docs/api/java/util/concurrent/CyclicBarrier.html#await(long,java.util.concurrent.TimeUnit)">CyclicBarrier&lt;/a>.&lt;/p>
&lt;p>From the Javadoc we see the CyclicBarrier is &lt;em>A synchronization aid that allows a set of threads to all wait for each other to reach a common barrier point. CyclicBarriers are useful in programs involving a fixed sized party of threads that must occasionally wait for each other. The barrier is called cyclic because it can be re-used after the waiting threads are released.&lt;/em>&lt;/p></description></item><item><title>Java Multicore Example</title><link>https://lloydroc.github.io/post/java/multicore/</link><pubDate>Sun, 24 Feb 2019 14:57:00 +0000</pubDate><guid>https://lloydroc.github.io/post/java/multicore/</guid><description>&lt;h1 id="hahahugoshortcode75s0hbhb">Java Multicore Example&lt;/h1>
&lt;p>Any program these days that does any significant computational load should utilize the available processor cores. In this post we&amp;rsquo;ll show an example using Java where we schedule &lt;a href="https://docs.oracle.com/javase/10/docs/api/java/util/concurrent/Callable.html">Callables&lt;/a> on all available processor cores. In Java a Callable is task that returns a result and may throw an exception. It is very similar to a &lt;a href="https://docs.oracle.com/javase/10/docs/api/java/lang/Thread.html">Thread&lt;/a>, but gives a much easier way to return the result asynchronous computation. I typically don&amp;rsquo;t see many reasons to not use Callables over Threads, since even if you don&amp;rsquo;t want or need to return the result you can still return some sort of status code. This blurb is directly from the Javadoc &lt;em>The Callable interface is similar to Runnable, in that both are designed for classes whose instances are potentially executed by another thread. A Runnable, however, does not return a result and cannot throw a checked exception.&lt;/em>&lt;/p></description></item><item><title>PSK31 Convolutional Decoder Implementation in C</title><link>https://lloydroc.github.io/psk31/cnvdec/</link><pubDate>Wed, 13 Feb 2019 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/psk31/cnvdec/</guid><description>&lt;h1 id="psk31-convolutional-decoder">PSK31 Convolutional Decoder&lt;/h1>
&lt;p>In my humble opinion decoding a convolutionally encoded PSK31 output stream is the most challenging part of all. Decoding is also where all the magic happens. The Viterbi Decoder corrects the erroneous bits and allows reception of the intended bit stream.&lt;/p>
&lt;p>If this is the first time you&amp;rsquo;ve heard of a &lt;a href="https://en.wikipedia.org/wiki/Viterbi_decoder">Viterbi Decoder&lt;/a> please look at the former link from Wikipedia as well as these great examples that are in links below. What these examples allow you do is better visualize the entire state machine since they have a very small value for &lt;code>K&lt;/code> and only &lt;code>4&lt;/code> states. What we have here in QPSK31 is &lt;code>32&lt;/code> states and it makes it a bit inconvenient to use this as the first example to learn Viterbi Decoding. Also, be very comfortable with &lt;a href="https://lloydroc.github.io/psk31/cnvenc/">PSK31 Convolutional Encoding&lt;/a> and the state machine it uses, the generator functions, shift register and process to encode a bit stream with the PSK31 convolutional encoder.&lt;/p></description></item><item><title>PSK31 Convolutional Encoder implementation in C</title><link>https://lloydroc.github.io/psk31/cnvenc/</link><pubDate>Wed, 13 Feb 2019 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/psk31/cnvenc/</guid><description>&lt;h1 id="hahahugoshortcode109s0hbhb">PSK31 Convolutional Encoder implementation in C&lt;/h1>
&lt;h1 id="psk31-convolution-encoding">PSK31 Convolution Encoding&lt;/h1>
&lt;p>Convolutional Codes are often charactarized by three aspects:&lt;/p>
&lt;ol>
&lt;li>&lt;code>n&lt;/code> Base Code Rate - Number of bits into the encoder&lt;/li>
&lt;li>&lt;code>k&lt;/code> Output Symbol Rate - Number of bits out for an input&lt;/li>
&lt;li>&lt;code>K&lt;/code> Memory Depth&lt;/li>
&lt;/ol>
&lt;p>For QPSK31 we have &lt;code>[n,k,K] = [1,2,5]&lt;/code>. We give the encoder 1-bit of input, out comes 2-bits, and 5-bits of input are stored in our shift register. For the 2-bits of output 1-bit is In-Phase and the other is Quadrature. Let&amp;rsquo;s look at a diagram that allows us to envision &lt;code>[n,k,K]&lt;/code>.&lt;/p></description></item><item><title>Root Raised Cosine Filter in C</title><link>https://lloydroc.github.io/psk31/rrc/</link><pubDate>Wed, 13 Feb 2019 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/psk31/rrc/</guid><description>&lt;h1 id="hahahugoshortcode110s0hbhb">Root Raised Cosine Filter in C&lt;/h1>
&lt;h1 id="root-raised-cosine-filtering">Root Raised Cosine Filtering&lt;/h1>
&lt;p>The PSK31 Standard uses &lt;a href="https://en.wikipedia.org/wiki/Root-raised-cosine_filter">Root Raised Cosine Filters&lt;/a> as a matched filter. Our PSK31 signal is convolved by the Root Raised Cosine waveform to mimimize Inter-Symbol Interference. For this project we can easily compute the RRC filter and then convolve it with our output stream. For the computation of the RRC we need a couple of constants specific to the PSK31 standard.&lt;/p></description></item><item><title>Simple SQLite C API Example</title><link>https://lloydroc.github.io/post/c/sqlite-api/</link><pubDate>Sat, 02 Feb 2019 16:45:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/sqlite-api/</guid><description>&lt;p>When getting started on the SQLite C API they recommend 2 basic ways: &lt;code>sqlite3_exec()&lt;/code> and &lt;code>sqlite3_get_table()&lt;/code> both are convenience wrappers around the core API Calls. They give good examples for the &lt;code>sqlite3_exec()&lt;/code> call, and the &lt;code>sqlite3_get_table()&lt;/code> is deprecated in the documentation. Using &lt;code>sqlite3_exec()&lt;/code> employs a callback function which gives the advantage of speed and low memory usage - due to being able to process each row at a time. It however, does not allow for knowing when all the rows are returned, as well as, being synchronous.&lt;/p></description></item><item><title>Simple Convolution in C</title><link>https://lloydroc.github.io/post/c/convolution/</link><pubDate>Wed, 17 Oct 2018 06:10:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/convolution/</guid><description>&lt;h1 id="hahahugoshortcode15s0hbhb">Simple Convolution in C&lt;/h1>
&lt;p>Updated April 21, 2020&lt;/p>
&lt;p>In this blog post we&amp;rsquo;ll create a simple 1D convolution in C. We&amp;rsquo;ll show the classic example of convolving two squares to create a triangle. When convolution is performed it&amp;rsquo;s usually between two discrete signals, or time series. In this example we&amp;rsquo;ll use C arrays to represent each signal.&lt;/p>
&lt;p>When implementing convolution it&amp;rsquo;s important to know the length of convolution result, since the resulting array is bigger than the two input arrays. This can cause memory problems. Computing the length of the convolution result is actually a simple computation. If you have array &lt;strong>H&lt;/strong> convolved with array &lt;strong>X&lt;/strong>, where the lengths are 5 and 5 respectively, the resulting size of &lt;strong>Y=H*X&lt;/strong> (&lt;strong>H&lt;/strong> convolved with &lt;strong>X&lt;/strong> to make &lt;strong>Y&lt;/strong>) will be &lt;strong>Length(H) + Length(X) - 1&lt;/strong>. For this example the resulting length of two size 5 arrays will be 5+5-1 = 9. This convolution is typically done where &lt;strong>H&lt;/strong> is a digital filter and &lt;strong>X&lt;/strong> is a time series to be filtered. The output array &lt;strong>Y&lt;/strong> is the time series that results after filtering. For our example we have input arrays &lt;strong>H&lt;/strong> and &lt;strong>X&lt;/strong>. The output of array of our convolution will be called &lt;strong>Y&lt;/strong>.&lt;/p></description></item><item><title>NGINX/CouchDB Reverse Proxy</title><link>https://lloydroc.github.io/post/networking/couchdb-nginx-proxy/</link><pubDate>Wed, 10 Oct 2018 03:10:00 +0000</pubDate><guid>https://lloydroc.github.io/post/networking/couchdb-nginx-proxy/</guid><description>&lt;p>Using NGINX as a front-end server to forward to multiple back-end services works great by configuring NGINX as a reverse proxy. The reverse proxy configuration will have NGINX serve HTTP/HTTPS URLs and forward them to them to network addresses such as a database listening on HTTP at a specific port, API servers, static websites, etc. Basically we can turn NGINX into an HTTP router. NGINX is also a great front man for back-end services such as HTTPS and HTTP/2. For instance if you had a Database, API Server and static site you could have an SSL certificate just for NGINX and they would all be behind HTTPS and the reverse proxy would convert the HTTPS and send HTTP. That&amp;rsquo;s a post for another time however.&lt;/p></description></item><item><title>Viterbi Error Correction</title><link>https://lloydroc.github.io/post/telecom/viterbi-error-correction/</link><pubDate>Sat, 06 Oct 2018 08:30:48 +0000</pubDate><guid>https://lloydroc.github.io/post/telecom/viterbi-error-correction/</guid><description>&lt;h1 id="hahahugoshortcode83s0hbhb">Viterbi Error Correction&lt;/h1>
&lt;p>I&amp;rsquo;ve built a little PSK31 convolutional &lt;a href="https://lloydroc.github.io/psk31/cnvenc/">encoder&lt;/a> and &lt;a href="https://lloydroc.github.io/psk31/cnvdec/">decoder&lt;/a> and originally wanted to make a graph showing the error correction capabilities as a function of encoder output length and number of bit errors into the decoder. Making a long story short; I couldn&amp;rsquo;t devise a good method of creating this graph and stuck to hand making error cases to see the performance of the decoder. Note, the quantization for both the encoder and decoder are hard metrics using the Hamming Distance which doesn&amp;rsquo;t perform as good as soft metrics. First, let&amp;rsquo;s define the convolution encoder input and output.&lt;/p></description></item><item><title>Number of Programming Languages</title><link>https://lloydroc.github.io/post/programming/programming-and-spoken-languages/</link><pubDate>Fri, 21 Sep 2018 09:14:48 +0000</pubDate><guid>https://lloydroc.github.io/post/programming/programming-and-spoken-languages/</guid><description>&lt;h1 id="hahahugoshortcode81s0hbhb">Number of Programming Languages&lt;/h1>
&lt;p>What are the similarities and differences between spoken languages and programming languages?&lt;/p>
&lt;p>What are the effects of having a large number of programming languages?&lt;/p>
&lt;p>When I mow the lawn or drive to work I often listen to Podcasts if I don&amp;rsquo;t listen to audio books. I recently came across a Podcast &lt;a href="http://freakonomics.com/podcast/why-dont-we-speak-language/">Freakonomics - Why Don’t We All Speak the Same Language? (Earth 2.0 Series)&lt;/a> and being a programmer myself I related the discussion of human languages to programming languages. Here are the points from the Podcast relevant to this dicussion on human languages that I want to use to relate to my view on Programming Languages:&lt;/p></description></item><item><title>First Post</title><link>https://lloydroc.github.io/post/first-post/</link><pubDate>Sun, 16 Sep 2018 14:40:48 +0000</pubDate><guid>https://lloydroc.github.io/post/first-post/</guid><description>&lt;p>Hello All! This is the first time I&amp;rsquo;ve tried blogging. I &amp;ldquo;do&amp;rdquo; IT for a living and am involved in all sorts of Software. I&amp;rsquo;m usually tinkering around doing technical projects with software and hardware so I figure I&amp;rsquo;d blog about it. Mostly to just blog on what I&amp;rsquo;ve been doing, hopefully I&amp;rsquo;ll get a good discussion going and maybe help someone along the way. There are a couple of Open Source projects I&amp;rsquo;d like to get kicked off. We&amp;rsquo;ll see where it goes &amp;hellip;&lt;/p></description></item><item><title>PSK31</title><link>https://lloydroc.github.io/post/telecom/psk31/</link><pubDate>Sun, 16 Sep 2018 14:40:48 +0000</pubDate><guid>https://lloydroc.github.io/post/telecom/psk31/</guid><description>&lt;h1 id="hahahugoshortcode82s0hbhb">PSK31&lt;/h1>
&lt;p>A little side project - that actually turned in to a larger project is an implementation of the &lt;a href="http://www.arrl.org/psk31-spec">PSK31 Specification&lt;/a>. I&amp;rsquo;m hoping to create an Open Source Project likely called &lt;code>OpenPSK31&lt;/code> or something similar. This specification could use some improvements with all the advancements we have in computational power and software over years since the specification was created in 1998. I&amp;rsquo;ve created a place on this site for &lt;a href="https://lloydroc.github.io/psk31">PSK31&lt;/a> to document the project I&amp;rsquo;ve done. Not all the content is there yet, but I&amp;rsquo;ll be blogging about the updates as they come in. A fully working PSK31 system has a lot of moving parts and I hope to power through and get something that can both send and receive PSK31. The focus will be on the QPSK31 part of the specification so the convolutional encoding and decoding is used to correct bit errors.&lt;/p></description></item><item><title>About</title><link>https://lloydroc.github.io/about/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/about/</guid><description>&lt;p>Welcome to my Geek Blog!&lt;/p>
&lt;h1 id="about">About&lt;/h1>
&lt;p>I’m a Husband and Father of two Beautiful Girls who lives in Colorado. I currently work in IT. My background is in Computer Engineering and I’m interested in all things involving Software and Hardware.&lt;/p>
&lt;p>&lt;img src="https://lloydroc.github.io/assets/jpg/lloydrochester.jpg" alt="lloyd">&lt;/p>
&lt;h1 id="opinions">Opinions&lt;/h1>
&lt;p>The opinions in this blog are my own and don’t represent that of my current, or past employers.&lt;/p>
&lt;h1 id="contact-me">Contact Me&lt;/h1>
&lt;p>Contact me at &lt;code>lloyd.rochester@gmail.com&lt;/code>. However, don&amp;rsquo;t contact me if you&amp;rsquo;re a student and want me to do your homework!&lt;/p></description></item><item><title>License</title><link>https://lloydroc.github.io/license/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/license/</guid><description>&lt;h1 id="hahahugoshortcode4s0hbhb">License&lt;/h1>
&lt;p>The work contained in this blog is licensed under a
&lt;a href="http://creativecommons.org/licenses/by/4.0/">&lt;img src="https://i.creativecommons.org/l/by/4.0/88x31.png" alt="Creative Commons License">&lt;/a>&lt;/p>
&lt;p>Lloyd Rochester&amp;rsquo;s Geek Blog is licensed under a &lt;a href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License&lt;/a>. Based on a work at [/].&lt;/p></description></item><item><title>Navigate</title><link>https://lloydroc.github.io/nav/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/nav/</guid><description>&lt;h1>&lt;a href="https://lloydroc.github.io/categories">categories&lt;/a>&lt;/h1>
 
 &lt;a href="https://lloydroc.github.io/categories/alsa/">
 &lt;span class="layui-badge " style="margin: 5px">alsa&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/categories/autotools/">
 &lt;span class="layui-badge " style="margin: 5px">autotools&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/categories/c/">
 &lt;span class="layui-badge " style="margin: 5px">c&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/categories/database/">
 &lt;span class="layui-badge " style="margin: 5px">database&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/categories/dsp/">
 &lt;span class="layui-badge " style="margin: 5px">dsp&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/categories/emacs/">
 &lt;span class="layui-badge " style="margin: 5px">emacs&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/categories/flex/bison/">
 &lt;span class="layui-badge " style="margin: 5px">flex/bison&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/categories/hardware/">
 &lt;span class="layui-badge " style="margin: 5px">hardware&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/categories/java/">
 &lt;span class="layui-badge " style="margin: 5px">java&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/categories/networking/">
 &lt;span class="layui-badge " style="margin: 5px">networking&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/categories/programming/">
 &lt;span class="layui-badge " style="margin: 5px">programming&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/categories/psk/">
 &lt;span class="layui-badge " style="margin: 5px">psk&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/categories/systemd/">
 &lt;span class="layui-badge " style="margin: 5px">systemd&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/categories/telecommunication/">
 &lt;span class="layui-badge " style="margin: 5px">telecommunication&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/categories/unix/">
 &lt;span class="layui-badge " style="margin: 5px">unix&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/categories/vim/">
 &lt;span class="layui-badge " style="margin: 5px">vim&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/categories/virtualization/">
 &lt;span class="layui-badge " style="margin: 5px">virtualization&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/categories/windows/">
 &lt;span class="layui-badge " style="margin: 5px">windows&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/categories/wsl/">
 &lt;span class="layui-badge " style="margin: 5px">wsl&lt;/span>
 &lt;/a>
 

 &lt;h1>&lt;a href="https://lloydroc.github.io/tags">tags&lt;/a>&lt;/h1>
 
 &lt;a href="https://lloydroc.github.io/tags/alsa/">
 &lt;span class="layui-badge " style="margin: 5px">alsa&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/animation/">
 &lt;span class="layui-badge " style="margin: 5px">animation&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/arduino/">
 &lt;span class="layui-badge " style="margin: 5px">arduino&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/arm/">
 &lt;span class="layui-badge " style="margin: 5px">arm&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/assembly/">
 &lt;span class="layui-badge " style="margin: 5px">assembly&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/coi/">
 &lt;span class="layui-badge " style="margin: 5px">coi&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/concurrent/">
 &lt;span class="layui-badge " style="margin: 5px">concurrent&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/convolution/">
 &lt;span class="layui-badge " style="margin: 5px">convolution&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/cors/">
 &lt;span class="layui-badge " style="margin: 5px">cors&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/couchdb/">
 &lt;span class="layui-badge " style="margin: 5px">couchdb&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/dns/">
 &lt;span class="layui-badge " style="margin: 5px">dns&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/docker/">
 &lt;span class="layui-badge " style="margin: 5px">docker&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/ebyte-e32-lora/">
 &lt;span class="layui-badge " style="margin: 5px">ebyte-e32-lora&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/gpio/">
 &lt;span class="layui-badge " style="margin: 5px">gpio&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/idioms/">
 &lt;span class="layui-badge " style="margin: 5px">idioms&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/iproute2/">
 &lt;span class="layui-badge " style="margin: 5px">iproute2&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/json/">
 &lt;span class="layui-badge " style="margin: 5px">json&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/lidar/">
 &lt;span class="layui-badge " style="margin: 5px">lidar&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/lora/">
 &lt;span class="layui-badge " style="margin: 5px">lora&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/lucene/">
 &lt;span class="layui-badge " style="margin: 5px">lucene&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/nginx/">
 &lt;span class="layui-badge " style="margin: 5px">nginx&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/postfix/">
 &lt;span class="layui-badge " style="margin: 5px">postfix&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/psk/">
 &lt;span class="layui-badge " style="margin: 5px">psk&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/python/">
 &lt;span class="layui-badge " style="margin: 5px">python&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/range-finder/">
 &lt;span class="layui-badge " style="margin: 5px">range finder&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/raspberry-pi/">
 &lt;span class="layui-badge " style="margin: 5px">raspberry-pi&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/reverse-proxy/">
 &lt;span class="layui-badge " style="margin: 5px">reverse proxy&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/signal-processing/">
 &lt;span class="layui-badge " style="margin: 5px">signal-processing&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/sockets/">
 &lt;span class="layui-badge " style="margin: 5px">sockets&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/sqlite/">
 &lt;span class="layui-badge " style="margin: 5px">sqlite&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/ssd1306/">
 &lt;span class="layui-badge " style="margin: 5px">ssd1306&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/thread/">
 &lt;span class="layui-badge " style="margin: 5px">thread&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/tunnel/">
 &lt;span class="layui-badge " style="margin: 5px">tunnel&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/viterbi/">
 &lt;span class="layui-badge " style="margin: 5px">viterbi&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/wireless/">
 &lt;span class="layui-badge " style="margin: 5px">wireless&lt;/span>
 &lt;/a>
 
 &lt;a href="https://lloydroc.github.io/tags/wsl/">
 &lt;span class="layui-badge " style="margin: 5px">wsl&lt;/span>
 &lt;/a></description></item></channel></rss>