<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Saad A. on Medium]]></title>
        <description><![CDATA[Stories by Saad A. on Medium]]></description>
        <link>https://medium.com/@sigmaworks?source=rss-8dccf5c6823d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*D7EZSnnMduLO0q7fcT3QHw.jpeg</url>
            <title>Stories by Saad A. on Medium</title>
            <link>https://medium.com/@sigmaworks?source=rss-8dccf5c6823d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 10:50:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sigmaworks/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Bringing Up a Unitree R1 Humanoid, Part 4: Walking From Code, WebRTC, and the Last Mile to Students]]></title>
            <link>https://medium.com/@sigmaworks/bringing-up-a-unitree-r1-humanoid-part-4-walking-from-code-webrtc-and-the-last-mile-to-students-66d5263b4d25?source=rss-8dccf5c6823d------2</link>
            <guid isPermaLink="false">https://medium.com/p/66d5263b4d25</guid>
            <category><![CDATA[unitree-robotics]]></category>
            <category><![CDATA[unitree-r1]]></category>
            <category><![CDATA[nvidia-jetson]]></category>
            <category><![CDATA[unitree]]></category>
            <dc:creator><![CDATA[Saad A.]]></dc:creator>
            <pubDate>Sun, 15 Nov 2026 00:05:01 GMT</pubDate>
            <atom:updated>2026-11-15T00:08:27.589Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 4 of 4. Part 1 covers safe startup and networking. Part 2 covers offline speech AI and facial recognition. Part 3 covers motion control and safe deployment.</em></p><p>Part 3 ended with one open problem: Adam, iCode Redmond’s Unitree R1 humanoid, could stand up, lie down, and wave from code, but every walking command from the SDK came back with an undocumented error, 127.</p><p>That’s solved now. Adam walks, turns, gestures, and speaks from <strong>C++, Python, and block code</strong>, and students can send their programs to him from a laptop over the classroom Wi-Fi. That was our goal from the very first day: a humanoid that students can safely program in a real classroom. Adam is ready.</p><p>This post covers how we got there. Like the rest of this series, most of it came from reading error codes, reading source code, and testing on the robot. If you own an R1, I hope it saves you some time.</p><h3>The stack at a glance (what’s new)</h3><ul><li><strong>iCode Nexus:</strong> a desktop app where students write programs in blocks, Python, or C++, test them in a 3D simulator, and send them to the robot</li><li><strong>WebRTC:</strong> the laptop talks to the robot body over Wi-Fi with unitree_webrtc_connect (built on aiortc)</li><li><strong>Robot software:</strong> the latest Unitree release on the R1, plus an updated launch package on the Jetson that receives, compiles, and runs student programs</li><li><strong>Speech:</strong> Inflect TTS by default, with Piper as an option</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U49Rd13xQIKE9yZnTIVDhQ.png" /><figcaption>Figure 1: Representing the various cogs in the system at play to send code to Adam over WiFi</figcaption></figure><h3>How a student program reaches Adam</h3><p>Before Nexus, a program had to be copied to the Jetson over Ethernet and started from a terminal. Now the whole trip happens from the student’s laptop:</p><ol><li>The student builds a program (blocks compile to C++)</li><li>They run it in the simulator first. Nexus won’t send it to the robot until the sim run passes</li><li>They join the robot queue. Only one student holds the robot at a time, and each turn expires</li><li><strong>Send</strong> uploads the file to the robot body over WebRTC, which hands it to a service on the Jetson</li><li><strong>Run</strong> compiles it on the Jetson and runs it, streaming the output back to the student’s screen</li></ol><p>This pattern replaced the Flask job queue from Part 3. Teachers still control who holds the robot, and the physical remote can still stop anything.</p><h3>Walking from code: three problems, not one</h3><p>In Part 3, I listed everything we had ruled out for 127: the Python binding, speed values, JSON formatting, request priority, FSM order, and the remote holding control. Our leading theory was outdated firmware. That turned out to be part of the answer, but not all of it. Walking only worked once we fixed three things together.</p><p><strong>Problem 1: outdated robot software.</strong> Our unit reported sport API version 1.0.0.0, and several APIs in the current SDK returned 3203 (not implemented). We updated the robot to Unitree’s latest release.</p><p><strong>Problem 2: an outdated launch package on the Jetson.</strong> The Jetson side also needed an update. The new launch package is what receives student programs and gives them access to walking and speech.</p><p><strong>Problem 3: the phone app was holding the robot.</strong> This one took the longest to spot. The robot body only accepts <strong>one WebRTC connection at a time</strong>, and the Unitree phone app takes it as soon as it connects. While the app was open, our laptop couldn’t get through. The fix is simple once you know: force quit the Unitree app before using Nexus.</p><p><strong>Lesson learned:</strong> When one fix doesn’t work, don’t throw it away. Each of these fixes did nothing on its own. Together, they worked.</p><h3>Getting the robot body on the campus Wi-Fi</h3><p>There’s a catch with problem 3: you still need the phone app once. The robot body joins a Wi-Fi network through the Unitree app, so the order matters:</p><ol><li>Open the Unitree app and connect to the robot</li><li>Set the robot’s Wi-Fi to the campus network (client mode, not hotspot)</li><li><strong>Force quit the app</strong> so it releases the WebRTC connection</li><li>Give the robot body a fixed address on the network, so Nexus can still find it after a restart</li></ol><p>To check whether the robot body is reachable, scan your Wi-Fi subnet for the robot’s WebRTC port. Before we joined the robot to the campus Wi-Fi, this printed nothing at all, which told us the body simply wasn’t on the network:</p><pre># from a Mac on the same Wi-Fi; replace 192.168.3 with your subnet<br>( for i in $(seq 1 254); do ( nc -z -G 1 192.168.3.$i 9991 2&gt;/dev/null &amp;&amp; echo &quot;found 192.168.3.$i&quot; ) &amp; done; wait )</pre><p><strong>Lesson learned:</strong> The robot has two networks. In Part 1, I wrote that robot control over DDS lives only on the internal eth10 bus. That’s still true on the Jetson. But the laptop-to-robot path in Nexus runs over Wi-Fi to the <strong>robot body</strong>, not the Jetson. Our Jetson’s USB Wi-Fi adapter had nothing to do with it.</p><h3>A crash that wasn’t the robot’s fault</h3><p>Our first Nexus runs on a Mac crashed with “Python quit unexpectedly.” The warning in the app pointed at SSL:</p><pre>NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+,<br>currently the &#39;ssl&#39; module is compiled with &#39;LibreSSL 2.8.3&#39;</pre><p>The app’s Python environment had been built on macOS’s built-in Python 3.9, which uses an old SSL library. We rebuilt the environment on a modern Python and reinstalled the robot library. One dependency, pyaudio, also needs PortAudio installed first, or it fails to build with &#39;portaudio.h&#39; file not found:</p><pre>brew install portaudio<br>/usr/local/bin/python3 -m venv yip-webrtc-venv<br>ARCHFLAGS=&quot;-arch arm64&quot; \<br>CFLAGS=&quot;-I$(brew --prefix portaudio)/include&quot; \<br>LDFLAGS=&quot;-L$(brew --prefix portaudio)/lib&quot; \<br>yip-webrtc-venv/bin/pip install unitree_webrtc_connect</pre><pre># check: should print Python 3.10+ and OpenSSL, not LibreSSL<br>yip-webrtc-venv/bin/python -c &quot;import sys, ssl; print(sys.version); print(ssl.OPENSSL_VERSION)&quot;</pre><p><strong>Lesson learned:</strong> When an error mentions your laptop’s software, fix the laptop before you suspect the robot.</p><h3>One more voice</h3><p>In Part 2, Adam spoke through our own pipeline: Piper on the Jetson, streamed to the speaker with PlayStream. Nexus’s speech blocks use a separate path that comes with the launch package. It uses Inflect TTS by default and switches to Piper with YIP_SPEAK_ENGINE=piper. Our Piper install didn’t make Nexus speak, because the two pipelines don’t share anything. The launch update did.</p><p>A small say block becomes this C++ on the Jetson:</p><pre>yip::Robot robot(iface, /*init_factory=*/false);<br>(void)robot.radio_off();               // free the speaker<br>(void)robot.say(&quot;Hello from iCode&quot;, 85);</pre><h3>Quick reference</h3><ul><li><strong>Walking from the SDK returns 127?</strong> Update the robot’s software, update the Jetson-side launch package, and close the Unitree phone app</li><li><strong>One WebRTC peer at a time:</strong> the phone app, another laptop, or Nexus. Force quit the app before connecting from a laptop</li><li><strong>Wi-Fi setup:</strong> join the robot body to your network with the phone app, then quit the app. Give the body a fixed address</li><li><strong>Is the body on Wi-Fi?</strong> Scan your subnet for port 9991</li><li><strong>Mac crashes or LibreSSL warnings?</strong> Build the Python environment on a modern Python, not the built-in 3.9. Install PortAudio before pyaudio</li><li><strong>Startup and safety:</strong> same as Part 1. Gantry, zero torque, locked standing, feet on the floor, run mode, then let go</li></ul><h3>What I’m taking away</h3><p>The last mile was mostly not robotics. It was software versions, a phone app holding a connection, a network the robot wasn’t on yet, and a Python environment built on the wrong interpreter. None of these showed up as a clear error. The robot just said 127.</p><p>What worked was the same as in Parts 1 to 3: change one thing at a time, write down what you’ve ruled out, and read the actual error text instead of guessing. The difference this time was that the fix took several changes at once. The list of ruled-out causes is what kept us from giving up on each fix too early.</p><p>Adam started this project needing a cable for every command. Now a student can build a program out of blocks, test it in a simulator, and watch a humanoid robot run it in front of them. That’s what we set out to build.</p><p>Huge thanks to iCode Redmond for the opportunity, and to the team behind iCode Nexus. If you’re working with an R1 and stuck on any of this, feel free to reach out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pm8f4XyhWZ9t2wdu" /><figcaption>Our fully-functioning Adam, pictured up above, in all of his glory</figcaption></figure><p>#Robotics #HumanoidRobotics #Unitree #EdTech #STEMEducation #WebRTC #EmbeddedSystems #NVIDIAJetson #Python #Cpp #AIEngineering</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66d5263b4d25" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bringing Up a Unitree R1 Humanoid, Part 3: Motion Control and Safe Deployment]]></title>
            <link>https://medium.com/@sigmaworks/bringing-up-a-unitree-r1-humanoid-part-3-motion-control-and-safe-deployment-f75855739beb?source=rss-8dccf5c6823d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f75855739beb</guid>
            <dc:creator><![CDATA[Saad A.]]></dc:creator>
            <pubDate>Sat, 14 Nov 2026 23:58:03 GMT</pubDate>
            <atom:updated>2026-11-15T00:07:09.008Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 3 of 4. Part 1 covers safe startup and networking. Part 2 covers offline speech AI and facial recognition. Part 4 covers walking from code and getting student programs to the robot.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f3exLLeOa5fuC9mIdv9UfA.png" /><figcaption>The behind-the-scenes stack that helps Adam move safely in the classroom, broken down into FSM modes</figcaption></figure><p>At iCode Redmond, our goal was to turn our Unitree R1 humanoid, “Adam,” into a robot students can safely program in a real classroom. Parts 1 and 2 got Adam connected, talking, and recognizing faces.</p><p>This post covers the hardest part, making Adam move from code, and how we made it safe for students and teammates to deploy new behaviors.</p><h3>Motion control: the hardest part</h3><p>Getting Adam to move his whole body from code took the most debugging. The SDK returns numeric status codes, and several were undocumented.</p><h3>The finite-state machine (FSM)</h3><p>Posture and movement are controlled by a locomotion finite-state machine. Each state has a numeric ID, and the order you move through them matters:</p><ul><li><strong>0:</strong> zero torque (motors off)</li><li><strong>1:</strong> damp (joints go soft)</li><li><strong>4:</strong> stand up</li><li><strong>701:</strong> lie down → stand up</li><li><strong>702:</strong> stand up → lie down, in a controlled way</li><li><strong>811:</strong> run mode (locomotion), where the robot balances and can walk and gesture. Related locomotion states include 816</li></ul><p>We read the current state with GetFsmId() and only move forward when the robot has actually reached each step:</p><pre>loco_.Damp();        wait(1.5f);   // FSM 1<br>loco_.StandUp();     wait(6.0f);   // FSM 4<br>loco_.SetFsmId(701);               // robot enters run mode (811) on its own<br>// lie down in a controlled way:<br>loco_.SetFsmId(702);</pre><h3>Reading the error codes</h3><ul><li><strong>3203</strong> means RPC_ERR_SERVER_API_NOT_IMPL: the robot does not implement that API</li><li><strong>1001</strong> came from re-sending the state the robot was already in, so our stand-up code now skips steps it has already reached</li><li><strong>127</strong> is undocumented. It came back whenever we sent walking commands from the SDK</li></ul><p>We also found a bug in the SDK itself: WaveHand() had no return statement, so it always printed None. We called the underlying RPC directly to see the real status code.</p><h3>Moving to C++ and finding the right service</h3><p>The Python SDK’s R1 client was behind the C++ one, so we built unitree_sdk2 from source on the Jetson and wrote a C++ command-line tool, r1_move. The key finding: arm gestures don’t go to the sport service at all. They go to a separate arm service (rt/api/arm/request) using API 7106:</p><pre>class ArmClient : public unitree::robot::Client {<br>public:<br>  ArmClient() : Client(&quot;arm&quot;, false) {}<br>  void Init() {<br>    SetApiVersion(&quot;1.0.0.0&quot;);<br>    UT_ROBOT_CLIENT_REG_API_NO_PROI(7106);   // execute preset action<br>  }<br>  int32_t ExecuteAction(int id) {<br>    std::string data;<br>    return Call(7106, &quot;{\&quot;action_id\&quot;:&quot; + std::to_string(id) + &quot;}&quot;, data);<br>  }<br>};<br>// wave: ExecuteAction(26), then release: ExecuteAction(99)</pre><p>With this, Adam now stands up, lies down, and waves from terminal commands, confirmed on the robot:</p><pre>./r1_move eth10 stand_up<br>./r1_move eth10 wave<br>./r1_move eth10 lie_down</pre><h3>Still open: walking from code</h3><p>Walking works from the remote’s joystick, but SDK velocity commands (SetVelocity, Move) return 127 even in run mode (811). We ruled out the Python binding, the speed values, JSON formatting, request priority, FSM order, and the remote holding control. Our unit reports sport API version 1.0.0.0, and several APIs in the current SDK return 3203. Our leading theory is that this firmware doesn’t accept velocity commands from the SDK, so a firmware update is the next step.</p><h3>A classroom code runner</h3><p>We wanted students to program Adam directly, but safely. So we built a small Flask web app that works like a supervised job queue:</p><ul><li>Students submit short command sequences from a browser (walk_forward, turn_left, wave, speak(“…”), and more)</li><li>A teacher approves each job before it runs. Only one job runs at a time, with a 10-second timeout</li><li>Pressing any button or joystick on the remote stops the job and clears the queue</li></ul><p>Every submission is checked against an allowlist with hard limits. There is no eval or exec, so a student can never run arbitrary code on the robot:</p><pre>MAX_DISTANCE_M = 0.3<br>MAX_TURN_DEG = 90.0<br>MAX_SPEAK_CHARS = 150</pre><pre>COMMAND_SPEC = {                 # name: (needs_arg, min, max)<br>    &quot;walk_forward&quot;: (True, 0.0, MAX_DISTANCE_M),<br>    &quot;turn_left&quot;:    (True, 0.0, MAX_TURN_DEG),<br>    &quot;wave&quot;:         (False, None, None),<br>    ...<br>}<br>LINE_RE = re.compile(r&quot;^\s*([a-z_]+)\s*\(\s*([0-9]*\.?[0-9]*)\s*\)\s*$&quot;)</pre><p>Our first dashboard reloaded the whole page every few seconds, which erased what students were typing. We rewrote it to poll quietly with fetch() and redraw only the job list:</p><pre>async function poll() {<br>  const res = await fetch(&#39;/queue&#39;, {cache: &#39;no-store&#39;});<br>  renderJobs(await res.json());     // update the list, leave the form alone<br>}<br>setInterval(poll, 2000);</pre><p>Students reach the app over classroom Wi-Fi, but robot control still has to run on the internal eth10 bus (see Part 1). We also added a simulator mode so new features never touch the real robot first:</p><pre>python3 app.py --mode simulator             # test without the robot<br>python3 app.py --mode real --iface eth10    # drive the real robot</pre><h3>Automating safe deployment with a Claude Skill</h3><p>By this point, every new feature followed the same routine: write it, answer the same safety questions, pick a free button, and copy the files to the Jetson. So I built a Claude Skill, an AI agent workflow that turns this routine into a short interview:</p><ol><li><strong>Describe the behavior:</strong> what it does, what triggers it, how it ends, and where it runs</li><li><strong>Safety review:</strong> it walks through joint limits, the emergency stop, clear space, nearby people, what happens if no stop signal arrives, and whether the behavior was tested first. It names the specific risks for that behavior and won’t continue until each one is handled</li><li><strong>Button assignment:</strong> it keeps a keybinds.md file of every binding, rejects buttons already in use or reserved by the controller, and records the new one</li><li><strong>File transfer:</strong> it checks the Ethernet link and SSH first, then copies the files with scp and reports exactly where they landed</li></ol><p><strong>Why this matters:</strong> The skill makes every deployment consistent. The safety review happens every time, not just when someone remembers. Button conflicts are caught before they reach the robot, and the keybind file doubles as documentation of everything Adam can do. A new teammate can deploy a behavior safely without learning all of our history.</p><p>It also never runs code on the robot by itself: file transfer is its last step, so a person always controls the first physical test. It cut our deployment time down to a few prompts, and it removed the easiest ways to make a mistake.</p><h3>Safety rules we follow</h3><ul><li>Test only in an empty, carpeted room, with a spotter</li><li>In run mode, the robot’s feet must stay on the ground. If they lose contact, it thinks it’s falling and its limbs can flail. Always follow the startup procedure from Part 1</li><li>Whole-body moves (stand_up, lie_down) require typing “clear floor” to confirm</li><li>Ctrl+C sends StopMove() immediately, and a sequence stops at the first failed step</li><li>Damp() makes the robot go limp. Never use it to “stop” a standing robot</li><li>Low speed caps on everything that moves, and an instructor override on the remote for every behavior</li><li>Test new classroom features in simulator mode before they drive the real robot</li></ul><h3>Quick reference</h3><ul><li><strong>Gestures:</strong> use the arm service (API 7106), not LocoClient</li><li><strong>Posture:</strong> stand up with Damp → StandUp → SetFsmId(701) → 811. Lie down with SetFsmId(702)</li><li><strong>Error 1001:</strong> you re-sent the current state; skip steps already reached</li><li><strong>Error 3203:</strong> the API isn’t implemented on your firmware</li><li><strong>Student code:</strong> allowlist plus hard limits, never eval or exec</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f75855739beb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bringing Up a Unitree R1 Humanoid, Part 2: Offline Speech AI and Facial Recognition on the Edge]]></title>
            <link>https://medium.com/@sigmaworks/bringing-up-a-unitree-r1-humanoid-part-2-offline-speech-ai-and-facial-recognition-on-the-edge-e8d16d1c0ed3?source=rss-8dccf5c6823d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8d16d1c0ed3</guid>
            <category><![CDATA[icode]]></category>
            <category><![CDATA[unitree-r1]]></category>
            <category><![CDATA[unitree]]></category>
            <category><![CDATA[unitree-robotics]]></category>
            <dc:creator><![CDATA[Saad A.]]></dc:creator>
            <pubDate>Sat, 14 Nov 2026 23:57:00 GMT</pubDate>
            <atom:updated>2026-11-15T00:05:50.614Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 2 of 4. Part 1 covers safe startup and networking. Part 3 covers motion control and safe deployment. Part 4 covers walking from code and getting student programs to the robot.</em></p><p>At iCode Redmond, we spent the summer turning our Unitree R1 humanoid, “Adam,” into a robot students can program in a real classroom. In Part 1, we got connected, mapped free buttons on the remote, and ran behaviors as systemd services.</p><p>This post is about what Adam can now do with that foundation: speak English, hold a short conversation, and recognize faces. All of it runs on the robot’s onboard Jetson, a CPU-only, TX2-class board with no internet.</p><h3>The edge AI stack</h3><ul><li><strong>Speech AI:</strong> whisper.cpp (ggml-base.en), llama.cpp (llama-server running Llama 3.2 1B Instruct, Q4_K_M), and Piper TTS</li><li><strong>Computer vision:</strong> OpenCV with a Haar cascade face detector and an LBPH face recognizer</li><li><strong>Constraints:</strong> no GPU acceleration, no internet, ARM CPU</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XFjSqmcvTz93kJOf19XEpA.png" /><figcaption>Figure 1: The stack involved in getting offline speech and vision to Adam’s NVIDIA Jetson</figcaption></figure><h3>Giving Adam a voice</h3><h3>Problem: Adam only spoke Chinese</h3><p>The SDK’s built-in AudioClient.TtsMaker(text, speaker_id) spoke everything in Chinese on our firmware, no matter the language of the text or the speaker_id. So we switched to generating the English audio ourselves and streaming it to the speaker.</p><p>A nice side effect: because we make the audio, we can choose any voice, including its gender. On macOS, say -v Alex produces a male voice, and Piper, the offline neural TTS engine we use on the robot, has many voice models to choose from.</p><h3>Streaming raw PCM to the speaker</h3><p>The robot’s speaker expects 16 kHz, mono, 16-bit PCM. We convert the audio to that format, then stream it with AudioClient.PlayStream():</p><pre>def play_pcm(audio_client, pcm_data, stream_name=&quot;icode_greeter&quot;):<br>    chunk_size = 16000 * 2          # 1 second of 16 kHz mono 16-bit audio<br>    stream_id = str(int(time.time() * 1000))<br>    for offset in range(0, len(pcm_data), chunk_size):<br>        audio_client.PlayStream(stream_name, stream_id,<br>                                pcm_data[offset:offset+chunk_size])<br>        time.sleep(1.0)             # pace at real time<br>    audio_client.PlayStop(stream_name)</pre><p><strong>Lesson learned:</strong> Pace the stream at real time. Sending audio faster than it plays overflows the robot’s buffer and cuts the speech short.</p><p>Wired to a double-press of F1 and run as a systemd service, this gave us our first feature: Adam greets people on command, with no laptop attached.</p><h3>Offline conversation</h3><p>Next, we extended the voice into a short conversation that runs fully offline. Double-pressing F3 starts one turn: Adam records 6 seconds from a USB headset mic, transcribes it with whisper.cpp, sends the text to a local Llama 3.2 1B model on llama-server, and speaks the reply with Piper.</p><ul><li>The Jetson has no internet, so we compiled whisper.cpp and llama.cpp from source on the robot’s ARM CPU with CMake</li><li>We chose a small 4-bit model so it fits a CPU-only board. Replies take a few seconds</li><li>llama-server exposes an OpenAI-compatible endpoint, so asking the model is a simple local HTTP request</li></ul><h3>Facial recognition</h3><p>The R1 has cameras in its eyes, so we built facial recognition that runs entirely on the robot.</p><p><strong>Enrollment:</strong> enroll_faces.py grabs frames with VideoClient.GetImageSample() and finds faces with a Haar cascade. It saves 25 cropped 200×200 grayscale samples per person while they slowly turn their head, so the model learns more than one angle.</p><p><strong>Training:</strong> We use OpenCV’s LBPH recognizer because it is light enough for a CPU-only board and trains in seconds:</p><pre>recognizer = cv2.face.LBPHFaceRecognizer_create()<br>recognizer.train(images, np.array(labels))<br>recognizer.save(&quot;face_model.yml&quot;)</pre><p><strong>Lesson learned:</strong> The Jetson’s OpenCV had no cv2.face module and the robot had no internet. We downloaded the opencv-contrib-python wheel for aarch64 on a Mac and installed it offline.</p><h3>Follow-me</h3><p>The robot has no depth sensor, so we estimate distance from how tall the face looks in the frame. On each frame, a proportional controller turns toward the face and moves forward only while the person is far enough away:</p><pre>vyaw = max(-MAX_VYAW, min(MAX_VYAW, yaw_error * 1.5))   # steer toward face<br>if height_ratio &lt; TARGET_FACE_HEIGHT_RATIO - HEIGHT_MARGIN:<br>    vx = MAX_VX                                          # far away: approach<br>loco_client.SetVelocity(vx, 0.0, vyaw)</pre><p><strong>What we saw:</strong> Adam detected and recognized our faces. The hip turn toward us was hard to notice, because the robot’s hips are mostly locked in place while it stands, but the recognition itself was working.</p><h3>Quick reference</h3><ul><li><strong>Voice:</strong> if TtsMaker only speaks Chinese, stream your own 16 kHz mono PCM with PlayStream, paced at real time. Pick any voice or gender you like</li><li><strong>No internet?</strong> Compile whisper.cpp and llama.cpp from source on the Jetson; use a small 4-bit model</li><li><strong>Missing cv2.face?</strong> Install the aarch64 opencv-contrib-python wheel offline</li><li><strong>No depth sensor?</strong> Use face height in the frame as a distance proxy</li></ul><h3>What’s next</h3><p>Everything here runs offline on a CPU-only board, which forced us to pick small, light models at every step. The trade-off is a few seconds of latency per reply.</p><p>In Part 3, I’ll cover the hardest part of the project: motion control. That includes the locomotion state machine, undocumented error codes, a hidden arm service, and how we let students program Adam safely.</p><p>#EdgeAI #ComputerVision #LLM #OpenCV #SpeechRecognition #NVIDIAJetson #Unitree</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8d16d1c0ed3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bringing Up a Unitree R1 Humanoid, Part 1: Safe Startup and Networking]]></title>
            <link>https://medium.com/@sigmaworks/bringing-up-a-unitree-r1-humanoid-part-1-safe-startup-and-networking-1c3afb853044?source=rss-8dccf5c6823d------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c3afb853044</guid>
            <category><![CDATA[education]]></category>
            <category><![CDATA[unitree]]></category>
            <category><![CDATA[unitree-r1]]></category>
            <category><![CDATA[robotics]]></category>
            <dc:creator><![CDATA[Saad A.]]></dc:creator>
            <pubDate>Sat, 14 Nov 2026 23:52:35 GMT</pubDate>
            <atom:updated>2026-11-14T23:52:35.998Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 1 of 4. Part 2 covers offline speech AI and facial recognition. Part 3 covers motion control and safe deployment. Part 4 covers walking from code and getting student programs to the robot.</em></p><p>This summer at iCode Redmond, we took on a new challenge: turning our Unitree R1 humanoid robot, “Adam,” into something students can safely program in a real classroom. The R1 is new, and there is very little public documentation for it. Most of what we learned came from reading SDK source code, reading error codes, and testing on the robot.</p><p>This first post covers the foundation everything else depends on: starting the robot safely, getting a laptop talking to it, and running code on it with no laptop attached. If you own an R1 (or a similar Unitree robot), I hope it saves you a few weeks.</p><h3>The stack at a glance</h3><ul><li><strong>Hardware:</strong> Unitree R1 EDU with an onboard NVIDIA Jetson “pack” (Tegra186, TX2-class). No GPU acceleration and no internet on the robot.</li><li><strong>SDKs:</strong> unitree_sdk2_python and the C++ unitree_sdk2, both built on DDS (CycloneDDS 0.10.2)</li><li><strong>Ops:</strong> Linux, systemd, SSH/scp</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*W_h4rNI0FfknCWyE" /><figcaption>Figure 1: How the Mac, the Jetson pack, and the robot body connect.</figcaption></figure><h3>Step zero: a safe startup</h3><p>The most important thing we learned has nothing to do with code. When the R1 is in run mode, its feet must be touching the ground at all times. If they aren’t, the robot thinks it is losing its balance and tries to correct itself, and its arms and legs can flail violently. So we always start up the same way:</p><ol><li>Power on the robot while it hangs on its gantry stand</li><li>Switch to zero torque</li><li>Switch to locked standing</li><li>Lift the robot off the stand and set its feet on the floor. Don’t let go yet: locked standing doesn’t mean it can support itself</li><li>Switch to run mode</li><li>Now let go. The robot can stand on its own</li></ol><p>We also only test in an empty, carpeted room, so a fall is less likely to hurt anyone or damage the robot.</p><h3>Getting connected</h3><p>The R1 has two computers on its internal network, and each has its own IP address:</p><ul><li><strong>192.168.123.164:</strong> the Jetson pack, where our code runs</li><li><strong>192.168.123.161:</strong> the robot body, which runs Unitree’s own motion and control software</li></ul><p>Neither address is wrong, but the port you plug into decides which one you can reach. To reach the Jetson at .164, plug your Ethernet cable into the Jetson pack. To reach the body at .161, plug into the robot itself.</p><p>The robot also has no DHCP server, so your laptop will sit at a “Self-assigned IP” forever. Set a static IP on the same subnet yourself:</p><pre>sudo networksetup -setmanual &quot;AX88179B&quot; 192.168.123.222 255.255.255.0<br>ping -c 3 192.168.123.164<br>ssh unitree@192.168.123.164</pre><p><strong>The fix that finally worked:</strong> Even with the right IP and a static address, our network still wasn’t working. The real cause was physical: a loose cable between the robot body and the Jetson pack. Once we reseated every cable and made sure each one was in the right port on both the Jetson and the robot, everything connected. If your network is acting strangely, check the cables before you touch any settings.</p><h3>Picking the right interface for DDS</h3><p>Every SDK script needs the right network interface for the DDS layer. On the Jetson, the robot’s internal control bus is eth10:</p><pre>from unitree_sdk2py.core.channel import ChannelFactoryInitialize</pre><pre>ChannelFactoryInitialize(0, &quot;eth10&quot;)</pre><p>Later we added a USB Wi-Fi adapter so students could reach a web app on the robot over classroom Wi-Fi. We compiled its out-of-tree rtl8812au driver on the Jetson against the running 5.10.104-tegra kernel.</p><p><strong>Lesson learned:</strong> Wi-Fi (wlan0) only carries web traffic. Robot control over DDS lives only on the internal eth10 bus. When we started our app with --iface wlan0, the web server came up fine, but every robot command silently failed. Robot control has to use eth10, no matter which network people browse from.</p><h3>Reading the remote from your own code</h3><p>Our first real feature was a greeting: press a button on the remote, and Adam speaks. Before the speaking part (covered in Part 2), we needed a free button.</p><p>Most printed buttons on the remote trigger built-in firmware gestures (wave, handshake, clap, dance), and the firmware handles them before your code sees them. F1 and F3 have no built-in gesture, so they are free to use.</p><p>The robot publishes the raw remote state on the rt/lowstate DDS topic, in LowState_.wireless_remote. We wrote a small script that prints any byte that changes, then pressed each button to map it. F1 is byte 2, bit 6. We trigger on a double-press to avoid accidents:</p><pre>from unitree_sdk2py.core.channel import ChannelSubscriber<br>from unitree_sdk2py.idl.unitree_hg.msg.dds_ import LowState_</pre><pre>def on_low_state(msg: LowState_):<br>    wr = msg.wireless_remote<br>    f1_down = bool((wr[2] &gt;&gt; 6) &amp; 1)   # F1 = byte 2, bit 6<br>    # rising edge, then a second one within ~0.6 s = double-press</pre><pre>sub = ChannelSubscriber(&quot;rt/lowstate&quot;, LowState_)<br>sub.Init(on_low_state, 10)</pre><h3>Cutting the cable with systemd</h3><p>At first, the greeting needed a laptop attached. To make it work with no cable, we run the script as a systemd service on the Jetson. It starts on boot and restarts if it crashes. Now Adam responds whenever someone double-presses F1.</p><pre>[Service]<br>ExecStart=/usr/bin/python3 /home/unitree/icode_auto_greeter/icode_remote_greeter.py eth10<br>Restart=always<br>RestartSec=3<br>User=unitree</pre><p><em>[Figure: From a button press to Adam speaking, with no laptop attached]</em></p><p>This became the pattern for everything that followed: build a behavior, map it to a free button, and deploy it as a service.</p><h3>Quick reference</h3><ul><li><strong>Startup:</strong> gantry → zero torque → locked standing → lift down, keep holding → run mode → let go</li><li><strong>IPs:</strong> Jetson pack is .164 (plug into the Jetson), robot body is .161 (plug into the robot). There’s no DHCP, so set a static IP on 192.168.123.0/24</li><li><strong>Network down?</strong> Reseat every cable, especially the one between the robot body and the Jetson pack</li><li><strong>Interface:</strong> pass eth10 to ChannelFactoryInitialize, never wlan0</li><li><strong>Remote triggers:</strong> read rt/lowstate → wireless_remote. F1 and F3 are free</li><li><strong>Always-on behaviors:</strong> run them as systemd services so they survive reboots and need no laptop</li></ul><h3>What’s next</h3><p>The biggest lesson from bring-up: check the physical layer first. Our worst networking problem was a loose cable, not a setting.</p><p>In Part 2, I’ll cover what we built on top of this foundation: giving Adam an English voice, an offline conversation powered by whisper.cpp and Llama 3.2, and facial recognition that runs entirely on the robot.</p><p>#Robotics #HumanoidRobotics #EmbeddedSystems #NVIDIAJetson #Networking #Unitree</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c3afb853044" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Teamwork Makes the Dream Work]]></title>
            <link>https://medium.com/@sigmaworks/teamwork-makes-the-dream-work-1e3ac6955eb8?source=rss-8dccf5c6823d------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e3ac6955eb8</guid>
            <category><![CDATA[team-writing]]></category>
            <category><![CDATA[personal-reflection]]></category>
            <dc:creator><![CDATA[Saad A.]]></dc:creator>
            <pubDate>Mon, 11 May 2026 05:27:58 GMT</pubDate>
            <atom:updated>2026-05-11T05:28:56.415Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="The above images shows multiple people performing a handstack with the text, “TEAMWORK MAKES THE DREAM WORK” overlaid in the center." src="https://cdn-images-1.medium.com/max/480/0*WT3piCzRYRX-jV2k.jpg" /><figcaption>The above images shows multiple people performing a handstack with the text, “TEAMWORK MAKES THE DREAM WORK” overlaid in the center.</figcaption></figure><p>Over the last week, my teammate and I performed a brief but comprehensive evaluation of the Valve employee guidebook. As both of us were familiar with Valve and its numerous products (including Steam!), we were both keen on the subject and set right to work.</p><p>My teammate and I were pretty much on the same wavelength throughout the preparation phase. While he worked on the cover slide, I worked on the literary analysis. When he added the images, I added the alt text. It was perfect clockwork from both his end and mine. Thanks to being highly efficient, we were able to wrap up the preparation of our presentation quite quickly. We decided to split the slides up for the presentation, with my teammate taking slides 1 and 3, while I would speak for slides 2 and 4.</p><p>Monday arrived and we were first up to present. We breezed through the slides with ease and we were so thorough and confident in our presentation that we even had time to take questions from our Professor and peers at the end. After delivering effective and accurate answers, we satisfied our Professor’s criteria and hence finished up our slideshow presentation.</p><figure><img alt="Gear cogs, a great representation of how my teammate and I worked in sync, similar to how a clock works." src="https://cdn-images-1.medium.com/max/900/0*tKgR36cM7G1y6WU5" /><figcaption>Gear cogs, a great representation of how my teammate and I worked in sync, similar to how a clock works.</figcaption></figure><p>Overall, I loved working with a teammate since we were both cooperative with one another. By being on the same frequency throughout the preparation and presentation phases, we were able to deliver strong responses to both the presentation’s rubric and to the in-person audience that we presented to. My teammate and I were competent and we both understood of what the assignment required us to do, which greatly made things more organized and streamlined.</p><p>Based on this experience, I see myself as a cooperative and mindful individual when it comes to working with others. I make sure to stay two steps ahead and plan for both the expected (such as the assignment’s rubric) and the unexpected (such as the in-person questions from the audience). I also see myself as a capable team player since I made sure to do my part to the best of my capabilities, which allowed us to give a wonderful presentation and demonstrate expertness over the subject content by answering questions at the end. In conclusion, I enjoyed presenting with my competent teammate and I look forward to future team writing tasks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e3ac6955eb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Convictions, Outlook, & Beliefs]]></title>
            <link>https://medium.com/@sigmaworks/convictions-outlook-beliefs-62b8c562e2bd?source=rss-8dccf5c6823d------2</link>
            <guid isPermaLink="false">https://medium.com/p/62b8c562e2bd</guid>
            <dc:creator><![CDATA[Saad A.]]></dc:creator>
            <pubDate>Mon, 13 Apr 2026 07:43:47 GMT</pubDate>
            <atom:updated>2026-04-13T07:43:47.390Z</atom:updated>
            <content:encoded><![CDATA[<p>Technical Writing Manifesto</p><figure><img alt="Numerous words synonymous to authorship, leadership, design, and control, organized in an artistic fashion." src="https://cdn-images-1.medium.com/max/648/0*Zlm72sy4P73sLmbJ.jpg" /><figcaption>Artistic representation of words synonymous to authorship, leadership, and control.</figcaption></figure><p>As a technical writer, I understand that with excellent authorship comes great recognition and authority. The world as we know it today is incredibly divided on what’s “right” or “wrong” when it comes to digital ethics. After all, as a writer I have so much control in my content such as choosing about what I should include in my articles or such as deciding upon how accessible my articles may be for the public masses to read.</p><p>I believe I have a commitment to share my stance on technical writing. Hence, the purpose of writing this, ‘manifesto’ of sorts. My goal, when it comes to technical writing, is to educate people and enlighten them about new features in the realm of technology. I will solely write to be the bearer of news, positive or negative, as I believe it is the inherent right of the people to know about technological matters that may or may not involve them. To add on, this means that I won’t necessarily sugarcoat hard-to-swallow facts, and I will research every perspective, angle, and belief to the best of my ability so that I may be able to produce impartial pieces of literature. Everything I will write will be one hundred percent organic with no usage of artificial intelligence whatsoever, as I strongly believe in naturally brainstorming different ideas to exercise your right to formulate unique opinions. Literature should also be widely available for everyone to read, which is why I am utilizing Medium as my blogging platform since it is free to use for everyone.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62b8c562e2bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Structures — An Overview]]></title>
            <link>https://medium.com/@sigmaworks/data-structures-an-overview-aa2cefdf70b6?source=rss-8dccf5c6823d------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa2cefdf70b6</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Saad A.]]></dc:creator>
            <pubDate>Wed, 13 Aug 2025 04:21:04 GMT</pubDate>
            <atom:updated>2025-08-13T04:21:04.073Z</atom:updated>
            <content:encoded><![CDATA[<h3>Data Structures — An Overview</h3><p><strong>Data Structures — An Overview</strong></p><p><strong>By Saad A.</strong></p><h3>What are Data Structures?</h3><p>Data structures are ‘places’ where you can store data of all types (integers, strings, etc.). They are especially useful when you need to sort or save several variables in your work environment. This article will aim to introduce you, an aspiring software engineer, to a few types of data structures. I’ll be praising and criticizing the abilities of each and every single data structure type along the way, and I’ll also explain the uniqueness of each data structure type. Moreover, I’ll also be attaching Python program code on how to make each data structure in this article.</p><h3>Arrays</h3><p>There’s a very strong chance that the first data structure type you’ll ever learn will be arrays. It’s important to note that arrays in Python are called lists, and that they have the same function and purpose that will be mentioned later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*V4deXv-xjR20JwzP" /></figure><p>Arrays are useful because you can store things inside of them. You have the ability to shuffle the contents of arrays and add or remove elements from arrays. Additionally, array manipulation is an important concept you’ll learn in programming as you can run loops and sequences via arrays. Arrays are also commonly used in object-oriented programming, which is a very big part of a software developer’s career.</p><p>It is important to realize that when programming arrays, you have to set a limit of how many elements may be stored in the array itself. This is both a positive and a negative thing. It’s positive in the sense that you have more control over the size of the array, but negative at the same time since it takes away from its ‘dynamic-ness.’ There are also numerous types of arrays, such as 1D and 2D. Think of 1D arrays as one column or one row, and 2D arrays as a table of columns or a table of rows.</p><h3>Stacks</h3><p>Remember that computer science uses very literal, real-life terms. Stacks are a good example of this. Imagine you have a couple of books scattered around your room, and you want to sort them into one, neat pile. What do you do? You would probably begin stacking the books upwards into a tower-like shape. Something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/0*Nr9YPb1yM-hIuGHn" /></figure><p>And, well that’s actually exactly what a stack in computer science is. Stacks are made via arrays. Except the manipulation that you could give to a normal array does not apply to a stack. Stacks follow a “Last in, first out,” rule, often shortened to ‘LIFO.’</p><p>Let’s go back to our previous book stack example. Note how when you wanted to add a book to the stack, you would add it on top of the book stack? Moreover, you also probably know that when you want to remove a book from the stack, you wouldn’t just remove a book from the bottom of the stack (that would cause the stack to fall!). Instead, you would remove the top-most book instead and work your way downwards.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/0*v251U26ZIw2ohSdZ" /></figure><p>Now imagine these books as data elements, and it should begin making a lot more sense.</p><p>Here’s an image detailing the data structure to the left of your screen.</p><p>Stacks are used when we want elements to be ‘pushed’ in chronologically, and then ‘popped’ out in the exact reverse order. Editing softwares and emails use stacks. Ever accidentally send someone an email and have had to click the ‘Undo’ button to reverse the message? That is one instance where you’ve used a stack. You pushed in a message and quickly popped it out.</p><h3>Queues</h3><p>A queue is another type of data structure that’s used widely across applications on your device. As you can guess, a queue is another term in computer science that is used literally. Like a stack, you program a queue on the basis of an array. However, instead of the LIFO ideology that comes with the stack, Queues follow a “First in, first out” ruling (also known as FIFO). It makes sense too. Imagine yourself in a line at your local grocery store. In an ideal world (where nobody is cutting anyone else in line), you all get your turn based on your position in line (ie. in order). That’s exactly how a queue works in programming.</p><p>Here’s an excellent diagram of the FIFO ideology that comes with the internal workings of a queue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/0*eTwcmMwsF7LUDpLY" /></figure><p>As you can see, you have several elements titled ‘Job’ in the queue. If you were to enqueue (add) a new element, you’d end up with ‘Job 6’ (provided that the queue has not been maxed out at its limit. Remember, queues are built off of arrays, and arrays have limits). Likewise, if you were to dequeue (remove) a Job, you would dequeue Job 5, as that is at the end of the queue. It is this FIFO mechanism that separates a queue from a stack.</p><h3>Circular Queues</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/290/0*YKEOOyyhZyUOmwiX" /></figure><p>The above image I showed is a linear queue. As in, there’s a start and an end to said queue (the start being the ‘Front’ and the end being the ‘Rear’ pointers that are seen). In circular queues, the queue itself is circular. It loops back into itself. Other than that, the same rules apply, the next element is always added at the end of a queue and the first element to be removed will always be removed from the front of the queue. A diagram is shown which may assist you in your understanding.</p><p>Queues are often used in print jobs. You may have noticed that you could send a hundred print jobs to your printer at home or in a library, and that the printer will always deliver the printouts in the same chronological order that you sent them in (provided that the papers don’t jam!).</p><h3>Linked Lists</h3><p>A linked list is another form of data structure. This type of data structure may be a little bit advanced for beginners, so I’d highly recommend that one should fully understand what stacks, queues, and arrays are before moving further into this article.</p><p>Linked lists are well-known for being designed to be dynamic. I’ve used that term before and you’ve probably rightfully wondered what I meant by that. In arrays, stacks, and queues, you are limited to a predetermined size of how many elements you can keep in your data structure. This is not entirely bad, but there are certain softwares that cannot optimally use such a data structure without crashing or failing, as in some scenarios the computer may not know how much data it has to handle.</p><p>This is where dynamic data structures begin. Linked list is a dynamic data structure. It is made up of ‘nodes’ which consist of a data element and a ‘pointer.’ The pointer points to the position at which the next data element (which is in another node) is. The data element is the data stored at that node. The last node in a linked list always points to the ‘null’ position, signifying that the node is the last one present.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*rYsC22KkZmBEuU_N" /></figure><p>Because there is no limit to adding nodes that consist of elements and pointers, you can keep on adding data elements and the pointers will appropriately increment and point to the new node that you’ve just added. There are also other forms of linked lists, such as a doubly linked list or a circular linked list, that I won’t be able to get into today due to the sake of time and readability. Linked lists are commonly applied in music players like Spotify, where you can make playlists of your favorite songs and keep on adding as many as you like.</p><h3>Binary Trees</h3><p>The last data structure that I’ll be talking about will be binary trees. Like linked lists, binary trees are another dynamic data structure type. They also have no limits applied to them. The difference between using a binary tree and a linked list really comes down to the efficiency of its usage, as both can be applied in similar situations while maintaining different levels of usefulness and reliability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/0*3_TTdIOpSSCBSVPc" /></figure><p>As can be seen in the image above, binary trees also have nodes. At the top most position, you have your starting value, also known as the root position. When a computer parses through a binary tree, it goes to that root position. It then analyzes the data elements stored below it. If the data element that the computer is ‘searching’ for in the binary tree is closer/more relative to the data element it is comparing to, then the computer will take that route down below. It will continue doing this until the target value is achieved or until it reaches the ‘null’ position that is at the end of each leaf node of a binary tree.</p><p>Because binary trees and linked lists are similar, but they have their own purposes. Linked lists are primarily preferred for storing and removing data frequently. You won’t necessarily always have to parse through linked list nodes to find a specific element. However, binary trees are designed for efficiently searching through large swathes of data to quickly find the target value. They are especially useful in loops, an algorithm that you would typically use to parse through several values to find the exact one you’d be looking for.</p><p>Binary trees are widely used in artificial intelligence as they are pivotal in allowing large-language models like ChatGPT or Gemini in finding the correct/nearest correct answer and returning it to the user. However, like linked lists, they’re difficult to program for beginners.</p><h3>Program Code</h3><p>I’ll be attaching some program code for the data structures that I have covered today. I’ll also be adding comments beneath each of them to describe to you what is going on. Keep in mind, these are all in Python.</p><h3>Arrays:</h3><p><em>1D:</em></p><blockquote>stackData = [0]*10</blockquote><p>In the above image, I have made an array called ‘stackData.’ The array has ten integers in it, all initialized to zero. Basically, this is what stackData is equal to:</p><p>[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]</p><p>We can use this array to make a stack out of it. More on the next page.</p><p><em>2D:</em></p><blockquote>Array = [[0]*10 for x in range(10)]</blockquote><blockquote>for rows in range(10):</blockquote><blockquote>for col in range(10):</blockquote><blockquote>Array[rows][col] = random.randint(1,100)</blockquote><p>In the above image, I’ve made an array titled ‘Array.’ It has 10 rows and 10 columns, and in each slot, there will be a randomized number.</p><h3>Stacks:</h3><blockquote>stackData = [0]*10</blockquote><blockquote>stackPointer = 0</blockquote><blockquote>def Output():</blockquote><blockquote>global stackPointer</blockquote><blockquote>global stackData</blockquote><blockquote>for i in range(0,10):</blockquote><blockquote>print(stackData[i])</blockquote><blockquote>def Push(integer):</blockquote><blockquote>global stackPointer</blockquote><blockquote>global stackData</blockquote><blockquote>maxStorage = len(stackData)</blockquote><blockquote>if stackPointer &gt; 9:</blockquote><blockquote>return False</blockquote><blockquote>else:</blockquote><blockquote>stackData[stackPointer] = integer</blockquote><blockquote>stackPointer = stackPointer + 1</blockquote><blockquote>return True</blockquote><blockquote>def Pop():</blockquote><blockquote>global stackPointer</blockquote><blockquote>global stackData</blockquote><blockquote>if stackPointer == 0:</blockquote><blockquote>return False</blockquote><blockquote>else:</blockquote><blockquote>stackPointer = stackPointer — 1</blockquote><blockquote>temp = stackData[stackPointer]</blockquote><blockquote>return temp</blockquote><p>I know, it’s a lot of text, but I promise it isn’t as scary as it looks. So, we’ve taken the initial array that we made and we’ve added on the features of a stack to it.</p><p>I made three different functions for this stack. The first one, Output(), displays the contents of the stack. The second one, Push(), is used to push data into the stack. And the last one, Pop(), pops data out of the stack.</p><p>Note how I’ve used pointers to allow the computer to keep track of where the data elements currently are. Also note that I’ve used Boolean to determine whether the stack is full or empty. This is done by taking the length of the stack and comparing it with the stackPointer’s value. If the stackPointer is greater than the length of the stack, then you’re at the stack’s limit and you cannot add anything else. If the stackPointer is equal to zero, then there are no elements in the stack and the stack is empty.</p><p>This program code should highlight the LIFO nature of stacks and how stacks have limited storage.</p><h3>Queues:</h3><blockquote>queue = [None] * 5</blockquote><blockquote>def enqueue(q, value):</blockquote><blockquote>q.append(value)</blockquote><blockquote>def dequeue(q):</blockquote><blockquote>if len(q) == 0:</blockquote><blockquote>return None</blockquote><blockquote>return q.pop(0)</blockquote><p>In the above image, I’ve made an array titled queue of length 5. It’s initialized completely. For simplicity’s sake, I haven’t used any pointers whatsoever and I’ve only included the bare bones of making a queue through the enqueue and dequeue functions. Notice how in dequeue, if the length of the queue is zero, the value that will be returned will be ‘None’ which will terminate the execution and inform the user that the queue is now empty.</p><p>Additionally, I would normally add the upper limit for the queue in the enqueue function (which would tell the user that the queue is at its maximum limit, the same way that it would tell the user in a stack as well). However, to keep things simple, I’ve only added the appending program code for it.</p><h3>Linked Lists:</h3><blockquote>class Node: #record structure</blockquote><blockquote>def __init__(self):</blockquote><blockquote>self.data = “ “</blockquote><blockquote>self.pointer = 0</blockquote><blockquote>linkedlist = [Node() for i in range(10)] #global array</blockquote><blockquote>freePointer = 1 #global pointer</blockquote><blockquote>startPointer = 0 #global pointer</blockquote><blockquote>def display():</blockquote><blockquote>print(‘FreePointer: ‘, freePointer, ‘StartPointer: ‘, startPointer)</blockquote><blockquote>print(‘Index’, ‘Data’, ‘Pointer’)</blockquote><blockquote>for i in range(1,10):</blockquote><blockquote>print(i, linkedlist[i].data,’ ‘, linkedlist[i].pointer)</blockquote><blockquote>def initialize():</blockquote><blockquote>for i in range(1,9):</blockquote><blockquote>linkedlist[i].pointer = i + 1</blockquote><blockquote>def insert():</blockquote><blockquote>global freePointer, startPointer</blockquote><blockquote>if freePointer != 0:</blockquote><blockquote>inputData = input(“enter data: “)</blockquote><blockquote>linkedlist[freePointer].data = inputData</blockquote><blockquote>newNode = freePointer</blockquote><blockquote>freePointer = linkedlist[freePointer].pointer</blockquote><blockquote>linkedlist[newNode].pointer = newNode</blockquote><blockquote>startPointer = newNode</blockquote><blockquote>else:</blockquote><blockquote>print(‘list is full’)</blockquote><blockquote>def printList():</blockquote><blockquote>currentPointer = startPointer</blockquote><blockquote>while currentPointer !=0:</blockquote><blockquote>print(linkedlist[currentPointer].data)</blockquote><blockquote>currentPointer = linkedlist[currentPointer].pointer</blockquote><p>To form this linked list, I’ve utilized object-oriented programming and I made two classes, one for the node, and one for the linked list itself. You’ll see that I have declared an array for the node class and have initialized the nodes that would be added. I also added the Insert() function which would allow new nodes to be added to the linked list. The printList() function allows the linked list to be printed out. Note how I’ve used several pointers to compare the positions of the new values. Additionally, we’re also utilizing the freePointer, which is essential in adding or removing data from the linked list. It’s a lot of code to memorize, which is why memorizing code is never the way and instead you should always learn how the program actually functions.</p><h3>Binary Tree:</h3><blockquote>class Node:</blockquote><blockquote>def __init__(self, data):</blockquote><blockquote>self.data = data</blockquote><blockquote>self.left = None</blockquote><blockquote>self.right = None</blockquote><blockquote>class BinaryTree:</blockquote><blockquote>def __init__(self, root_value):</blockquote><blockquote>self.root = Node(root_value)</blockquote><blockquote>def insert_left(self, current_node, value):</blockquote><blockquote>current_node.left = Node(value)</blockquote><blockquote>def insert_right(self, current_node, value):</blockquote><blockquote>current_node.right = Node(value)</blockquote><p>I’ve made two classes with object-oriented programming to form this binary tree. Like the linked list, there’s a node class and then there itself is the binary tree class. I’ve mentioned how there will be two ‘branches’ to the tree, a right branch and a left branch. There will be a common root value which will be the starting value at the top of the binary tree, and thanks to the insert_left() and insert_right() functions, we’ll be able to add data to both the left and right branches of this tree.</p><p>The tree would only stop parsing through its contents at run-time when it reaches a null value for the node. I haven’t specified that in my above program to keep it simple, however it is similar to the linked list’s way of ending the program via the null counter.</p><h3>Conclusion</h3><p>This article should’ve given you a good overview of how these introductory-level and intermediary-level data structures work. You should now have a rough idea of where each data structure can be applied and why certain data structures work in certain situations more efficiently compared to others.</p><p>There are many, many more data structures that you will learn along the way. Some may be more efficient, but a lot of them will be related to one another and it’s hence important that you learn as many data structures as you can during your career as a software engineer.</p><p>Data structures are present in many forms all around us. From print jobs, to your Spotify playlists, to even basic text editor functions such as the ‘redo’ or ‘undo’ processes. Data structures are the building blocks of computer science, and several careers revolve around manipulating these data structures, so learning and mastering them is absolutely a big deal!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa2cefdf70b6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LOG ROTATION IN LINUX]]></title>
            <link>https://medium.com/@sigmaworks/log-rotation-in-linux-569139cfd945?source=rss-8dccf5c6823d------2</link>
            <guid isPermaLink="false">https://medium.com/p/569139cfd945</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[cronjob]]></category>
            <category><![CDATA[logrotation]]></category>
            <category><![CDATA[logrotate]]></category>
            <dc:creator><![CDATA[Saad A.]]></dc:creator>
            <pubDate>Fri, 08 Aug 2025 22:36:34 GMT</pubDate>
            <atom:updated>2025-08-08T22:36:34.457Z</atom:updated>
            <content:encoded><![CDATA[<p>By: Saad A.</p><p><strong>LOG ROTATION IN LINUX</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*G-NScy38XGRSX29-" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*uUg6JeqZIcnTXvKo" /></figure><h3>Introduction</h3><p>Log rotation is a system administrator’s life-saver. Paired with the cron, log rotations help keep a system efficient and lightweight. You may know that a lot of applications or systems create logs of certain events that happen (e.g. a web server may document how many times a website was visited in a day). Well, these logs are periodically recorded in a text file. However, after a certain duration of time, these files become quite large and heavy. They take up a lot of storage and they generally cause the system to slow down.</p><p>This is where the log rotation command steps in. After a certain amount of time, the log rotation command can be called to “rotate” the file (as can be seen in the above diagram). Rotation, in this context, means to make a compressed copy of the initial log file. This can only be done so many times, however, as the log file will inevitably be deleted at the end of the cycle.</p><h3>How To Use the Log Rotation Command</h3><p>The log rotation command is primarily used on Linux and its numerous distros. That being said, the log rotation command can be implemented onto other operating systems, too. The only thing that would be different would be the environment of the system.</p><p>The command you’re looking for is called ‘<strong>logrotate</strong>’. System administrators can utilize this command under the /var/log directories.</p><p>Within the /var/log directories should be your server or application that is writing to a log file which is saved underneath that server/application’s directory (example: /var/log/server/logfile.log). The log file will have to be configured in a certain way for the computer to understand what is being asked of it. A template example configuration of a log file may be as follows:</p><p><em>/var/log/server/filelog.log (</em></p><p><em>[Insert Frequency of Rotations Here]</em></p><p><em>[Insert Number of Rotations Here]</em></p><p><em>[Insert Max File Size of Rotations Here]</em></p><p><em>[Insert Compress Command Here]</em></p><p><em>[Insert a Delayed Compression Command Here]</em></p><p><em>[Insert a Command Which Ignores the Rotation if the File is Missing]</em></p><p><em>[Insert a Command Which Won’t Rotate a File If It’s Empty]</em></p><p><em>[Insert a Command Which Details Where the File Will be Saved/Who Owns It]</em></p><p><em>endscript</em></p><p><em>)</em></p><p>This might seem a little bit confusing at first, so here’s an actual application of logrotation which utilizes the data fields that I’ve put in between the [ ] brackets.</p><p>Example 0.1:</p><p><em>/var/log/server/filelog.log (</em></p><p><em>daily</em></p><p><em>rotate 12</em></p><p><em>size 500M</em></p><p><em>compress</em></p><p><em>delaycompress</em></p><p><em>missingok</em></p><p><em>notifempty</em></p><p><em>create 0786 linux-user</em></p><p><em>endscript</em></p><p><em>)</em></p><p>Here’s a run-down of what the code above does. First, we have the directory path and <em>‘(‘ </em>which tells us where we’re operating in and the beginning of the configuration, respectively. Then we have ‘daily’, which means that the file will be rotated once every day. There will be 12 rotations (<em>rotate 12)</em> and the file will only be rotated if the file size exceeds 500M (<em>size 500M)</em>. The old logs will be compressed (<em>compress</em>) and we will delay the compression of the new logs until the next rotation cycle (<em>delaycompress</em>). There won’t be a rotation if the file is missing (<em>missingok</em>). Additionally, there also won’t be a rotation if the file is empty (<em>notifempty). </em>Moreover, there will be 786 files and they will be owned by ‘linux-user’ (<em>create 0786 linux-user). ‘Endscript’ </em>and ‘<em>)’ </em>dictate the end of the file.</p><p>Keep in mind, all of these commands are optional. Some, such as daily, missingok, notifempty, create, etc, can all be omitted. There are other commands such as dateformat (which provides a custom date format) and postrotate (which tells the system what to do after a rotation has occurred) that may also be added as well. The example I gave up above is just one type of log file configuration that you can perform. The bare minimum for a log configuration file to function as intended is one command. Here’s another example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/0*6d-WGMmjLCt-YKie" /></figure><h3>Calling the logrotate command in the Command-Line Interface (CLI)</h3><p>Great! You should now have a configuration file set up and ready to be used in the actual command which calls the log rotation mechanism.</p><p>The command is as follows:</p><p><em>logrotate [insert name of configuration file, e.g. logfile.log]</em></p><p>This will call the mechanism. However, you can also tweak this line for maximum efficiency, too. If you do <em>logrotate -d </em>then you will actually enter debug mode. This means that you will be previewing the results of a logrotate command without actually rotating the file. If you want to forcefully rotate a file, type in <em>logrotate -f.</em></p><p>Another helpful addition is the verbose option. This is accessed through <em>logrotate -v. </em>Verbose, in conventional English, means to express something in multiple words. This is applied here as well, as you can instead type in the path to the configuration file with this add-on. Here’s an example:</p><p>Example 0.2:</p><p><em>logrotate -v /etc/logrotate.conf</em></p><p>‘/etc/’ is a very important directory which stores log files alongside other system-related files which ensure the system runs efficiently and effectively.</p><p>Bear in mind that rotated log files will almost always have to be deleted as they’ll eat up a ton of your disk space. This is why we often place a limit of how many iterations or rotations we want to see from a specific file.</p><h3>Using Log Rotation and the Cron, Side-by-Side</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XwBgQxMoMkxKb9yH" /></figure><p>If you haven’t read my article about the Cron and the Cron Daemon (Crond), I strongly recommend you to do so. This is because a lot of knowledge about Crontabs and Crond will be used in this section.</p><p>The Cron can be used to enforce rotations as well. Recall that the Crontab is just a fancy system scheduler which can call upon functions just like logrotation and have them be executed at specific timings, days, weeks, months, and even years. Log rotation commands usually need to be manually typed in, but the Crontab changes this as it automatically calls on processes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/0*8esbNphszaeE1i5d" /></figure><p>The format for a Cron Job is minutes, hours, date, day, and the task. Each of the aforementioned fields are represented by asterisks (*). Let’s say we want the system to forcefully rotate a file with the criteria from Example 0.1’s configuration file at 3:50PM everyday. To do this, we would type in:</p><p><em>crontab-e</em></p><p>(press the ‘Enter’ key)</p><p><em>50 15 * * * /linux-user/sbin/logrotate -f /etc/logfile.log/exampledirectoryname</em></p><p>With this Cron Job, the files will be rotated everyday from the criteria of Example 0.1 until the maximum file size has been reached. It will be saved in the <em>exampledirectoryname </em>directory that has been mentioned in the pathfile.</p><h3>Tips On Using the ‘logrotate’ Command</h3><p>Congratulations on learning the logic and practicality of log rotation. As a conclusion to this article, here are some important things to keep in mind when utilizing the command. This section may also serve as the answers to some questions you may have whizzing around your mind, right now.</p><ol><li>Yes, you can run the logrotate command manually. The Cron Job is just something that assists system administrators in automatically implementing log rotations for efficiency.</li><li>Do not run the log rotation command too frequently. This is to avoid disk space being eaten up by several files that have little to no difference in terms of content. The only exception to this rule is when you have an application that is rapidly changing in short windows of time. This is where you would want to run the command frequently, to capture these changes in different rotations.</li><li>Nowadays, several systems already have the log rotation command automatically happening behind the scenes through the system daemon (systemd) and automated timers controlled by the said daemon. Check the systemd to make sure you’re not actually duplicating a log rotation that has already been set up for you!</li><li>Try to always utilize <em>logrotate -d </em>before rotating files. Debugging is always beneficial in case of an unnecessary error or a logical mistake from the programmer’s end as they can be spotted in debug mode.</li><li>Always keep a reasonable limit of how many times you want the file to be rotated. Try to keep this number below 10 to avoid disk space being used up and henceforth causing your system to slow down.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=569139cfd945" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Beginner’s Guide to Crontab]]></title>
            <link>https://medium.com/@sigmaworks/a-beginners-guide-to-crontab-81a01d75633f?source=rss-8dccf5c6823d------2</link>
            <guid isPermaLink="false">https://medium.com/p/81a01d75633f</guid>
            <category><![CDATA[crontab]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Saad A.]]></dc:creator>
            <pubDate>Fri, 08 Aug 2025 12:15:08 GMT</pubDate>
            <atom:updated>2025-08-08T12:15:08.879Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*49sMvlOAJFZraGtf" /></figure><p><strong>Crontab: A Quick Guide</strong></p><p>By Saad A.</p><p>System administrators on Linux have to oversee the execution and processes of several applications within a system. Having to manually verify and update each and every single process would be painstakingly difficult and simply inefficient. That’s where crontab, today’s topic, comes into play.</p><p><strong><em>What are Cron(d), Crontab, and how do they work?</em></strong></p><p>When researching Crontab, you may see several terms that sound similar to the word, such as ‘cron,’ or ‘cron job.’ This may leave you confused as to what they are. To put it simply, cron is a type of daemon (pronounced day-muhn). Now, “what is a daemon?” is a totally acceptable follow-up question that you may ask. Daemons are automated background system processes happening in the background. They make sure everything is in working order and handle any ‘flags’ or issues raised by the system. Cron, as previously mentioned, is a type of daemon that runs scheduled tasks such as backing up scripts or programs. Other types of daemons that you may have used before would be ‘cupsd’ which manages printer-related services, and ‘systemd,’ which manages start-up tasks of the system.</p><p>The cron daemon may also be called, ‘crond’ on Linux/Unix systems as the letter d tends to be added at the end of various background processes to stand for ‘daemon.’</p><p>The crond will always re-wake itself every minute to check if there are any new processes and if there’s anything to do on its internal schedule from the crontab (e.g. run backups, update programs, resolve any flags).</p><p>This may lead you to wonder what the crontab is. The crontab is essentially a planner or a scheduler that the cron daemon uses to check whether or not it should be doing something. For example, let’s say Bob is a system administrator at a company. Bob is instructed by his boss to make backups of the data every Friday evening. Now, Bob wants to keep his job, but he also understands that he is human and he may forget to make said backups. Thus, Bob utilizes the crontab. On Monday, Bob utilizes the crontab and tells the system, “Hey, I want you to automatically back the system’s data up every Friday at 5PM.” The crontab adds this task to its planner for Friday. From then onwards, after every minute passes, the crond will keep on calling the crontab and ask, “is there any task to fulfill?” to which the crontab will appropriately respond given the current date and time. When Friday 5PM rolls around, the crond will ask the crontab, “Hey, do we have any tasks we need to fulfill?” the crontab will respond by giving it the command to make system backups of the company’s data.</p><p><strong><em>How do I utilize the Cron and make ‘Cron Jobs’?</em></strong></p><p>Great! You now know what the cron is and how the cron daemon and crontable work side by side with one another. You might tell yourself, “Hey! This is pretty cool. How can I use this on my UNIX/Linux system?”</p><p>Well, the syntax for the cron is often called a, “cron job.” To create a cron job, you must access your command-line interface (CLI). This is probably the ‘terminal’ on your computer.</p><p>The default format for a cron job is as follows:</p><p>* * * * * [insert task here].</p><p>You probably noticed the five stars (asterisks) prior to the insertion of the task. Each individual star represents data that is to be input to the computer for execution purposes.</p><p>The first star represents the minute at which the task is to be executed. You can only enter values from 0–59 in this field.</p><p>The second star represents the hour at which the task is to be executed. 0–23 are the only acceptable values that can be input.</p><p>The third star represents the dates at which the task will be executed. The acceptable value range is 1–31.</p><p>The fourth star tells the computer the day at which the task will be carried out. The value range for this field is 0–7.</p><p>And the fifth star is actually the task itself. This is where you get the opportunity to tell the computer system about the task that you want to have scheduled.</p><p>To make sure the crond is running properly, you can run the ‘ps’ command to verify. The ‘ps’ command basically gives a list of running processes. The ps-aux command will give a list of all of the running processes from all of the users. Type in:</p><p>ps-aux | grep crond</p><p>If the crond is running, you will see something similar (credit to LinuxHandbook):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/0*_A8OY746gT9aepQt" /></figure><p><strong><em>Reserved Strings &amp; Shortcuts:</em></strong></p><p>To make the issuing of cron jobs even more simpler, there are certain syntaxes that are reserved as they are ‘keywords’ for the system’s crontab scheduling feature.</p><p>Certain keywords such as @reboot, @hourly, and @daily are all reserved words that hold an important meaning for the computer system.</p><p>@reboot tells the system to perform the task every time the BIOS is ran (aka, every time the system is turned on and off).</p><p>@daily and @midnight tells the system to perform the task every day.</p><p>@hourly tells the system to perform the task every hour.</p><p>@monthly tells the system to perform the task every month.</p><p>@yearly and @annually tells the system to perform the task every year.</p><p>These are keywords and shortcuts to prevent system administrators from having to awkwardly write “0 * * * *” (which is the crontab command for ‘once an hour’) or “0 0 * * *” (which is the crontab command for ‘once every day’). However, it should be noted that these lengthy commands are just as acceptable as their shortcut counterparts are, and they can be written in the terminal with no problem whatsoever.</p><p>There are other shortcuts that can be used as well to make the listing of crontabs easier. Below is an excellent image from Linuxopsys which lists each of these shortcuts and what they mean/do:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/0*z9OFA5j19ahn7XcB" /></figure><p>Now, how can we <em>make </em>a cron job? We know how to type it, but we can’t just plainly type in the date and time and the task into the command line. We need to tell the computer that what we are about to tell it is a cron job prior to telling it about the cron job itself. In response, the computer will automatically make a crontab file for us.</p><p>To edit (or create) a crontab, we will type in: crontab-e.</p><p>To display a crontab’s contents, type in: crontab-l.</p><p>To display the last time you made changes to the crontab file, type in: crontab-v.</p><p>To remove the current cron job, type in: crontab-r.</p><p>To prompt user confirmation when removing said cron job, type in: crontab-i.</p><p><strong><em>Examples of Cron Jobs (Note that the tasks have example files in them):</em></strong></p><p>To start, first type: crontab-e. This will make your crontab file.</p><p>To update the system at 3:50 PM every day, type in:</p><p>50 15 * * * /opt/scripts/upgrade.sh</p><p>(Remember, * alone means to perform the task on every possible field value. Refer back up to the picture of the table if you’re puzzled.)</p><p>To empty the trash at 12:00 AM every Friday, type in:</p><p>0 0 * * 5 /opt/scripts/cleantemp.sh</p><p>If you want to delete empty directories taking up dead space daily at 9:00 PM, type in:</p><p>0 21 * * 1–5 /opt/scripts/clear-empty-dirs.sh</p><p>(Remember, you can give ranges in the field values too. 1–5 here means Monday through Friday).</p><p>And that’s pretty much it! The crontab isn’t too difficult to make and it’s one of the first functions that intermediate Linux users learn about. This short guide should have made you familiar with what daemons, cron, crontab, and cron jobs are.</p><p>Now it’s your turn to open up your terminal and start playing around with crontabs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81a01d75633f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LINUX
DISTROS]]></title>
            <link>https://medium.com/@sigmaworks/linux-distros-b16bc4fc24ee?source=rss-8dccf5c6823d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b16bc4fc24ee</guid>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[debian]]></category>
            <category><![CDATA[fedora]]></category>
            <category><![CDATA[elementary-os]]></category>
            <dc:creator><![CDATA[Saad A.]]></dc:creator>
            <pubDate>Tue, 05 Aug 2025 15:57:21 GMT</pubDate>
            <atom:updated>2025-08-05T15:57:21.052Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>___</strong></p><p><strong>By Saad A.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kIMJHo0RzS1DQXTR" /></figure><h3>What is Linux and what’s all the fuss about, “distros”?</h3><p>Linux is a popular operating system that is used by many people from all walks of life. Linux-based operating systems are often praised for being open-sourced. This means that anyone can edit the system’s source code and hence improve it by themselves without having to pay for a service.</p><p>However, Linux itself isn’t its own branded operating system, like Windows or MacOS. Linux instead presents itself for usage via its distributions, also known as “distros.” That may sound confusing at first, so here’s an easier analogy. Toyota’s a popular car brand, but if you bought a Toyota, you wouldn’t say, “I bought a Toyota,” only, right? You would probably include the make or model of the car too. Therefore, you would probably say, “I bought a Toyota Camry,” to properly convey your message. The same applies to Linux too. Instead of saying, “I downloaded Linux,” you would say, “I downloaded Ubuntu,” or, “I downloaded ElementaryOS” (these are two popular Linux distros that we will get into later on in this article). In the upcoming pages, I’ll give you the pros and cons of some of the most popular free Linux distros in the market right now.</p><h3>Distro #1: Ubuntu</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6kIIpBk-pmoqplPp" /></figure><h3>Ubuntu</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/0*VJCTUc5BaQv2bMtk" /></figure><p>Ubuntu is one of the most common Linux distros that are used worldwide. There are several reasons for this. For starters, Ubuntu has a very clean graphical user-interface (GUI). It’s very easy for newer Linux users to use and it draws many similarities to Apple’s MacOS.</p><p>Apart from this, Ubuntu has a massive community which allows newer users to be able to find answers to most of their questions they have relating to the distro. StackOverflow and Ask Ubuntu are great forums for new users to browse as they have most frequently-asked questions (FAQs) documented and answered on their website. YouTube also consists of several Ubuntu resources where people explain how to install and run common programs. Ubuntu also inherits Debian’s management “packages,” which means there are little to zero bugs or problems.</p><h3>Distro #2: Debian</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WNExWRkoD7BwhVEy" /></figure><h3>Debian</h3><p>Debian is another fantastic Linux distro that is widely renowned for having concrete foundations and hardly any software problems. In fact, the software packages used in Debian which enable its highly regarded stability are actually reused by several other distros too (including Ubuntu!), thus reiterating Debian’s reliability as an operating system. Debian is sort of a “grandparent distro,” in the industry as numerous distros utilize Debian-based protocols.</p><p>Apart from its stability, Debian is also popular since it is 100% open-sourced and transparent. Volunteers from around the globe edit and improve Debian’s source code. Think of it as a community garden where everybody sows the seeds, waters the plants, and picks the fruits of their efforts. Moreover, Debian also hosts several cloud and web servers thanks to its reliability and efficiency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AVyiEYLuVvIteBPF" /></figure><h3>Distro #3: Fedora</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/0*YMleV8OoB4qbs0Mf" /></figure><h3>Fedora</h3><p>If you’re looking for a developer-friendly distro, look no further. Fedora is another distro that has been optimized for aspiring software developers. The system is a ‘testing playground’ for Linux-based developers as Fedora is one of the first distros that receive the newest updates, whether they are software updates or kernel updates. These updates are commonly in their testing or ‘beta’ stages but are still stable enough for a small community to use and give feedback.</p><p>Open-source contributors adore Fedora for coming with several packages such as SELinux and Flatpak Support and tools such as Python or Git as it helps them greatly in editing source code. There is also built-in support for other tools like kubernetes and Podman. Additionally, the creators of Fedora, Red Hat, are heavily involved in community matters and listen to feedback given. This is one part about Fedora that makes it unique from other distros as typically other corporate companies are not too heavily involved in their own distros.</p><h3>Distro #4: Arch</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vo0ZKDMXywu-DI6M" /></figure><h3>Arch:</h3><p>Arch, also commonly known as Arch Linux, is used due to its ‘minimalist’ aspect which appeals to users. Unlike other distros, Arch actually lets you <em>choose </em>what applications and softwares you would like to install when you download the distro the first time. This means that there are no unnecessary preloaded apps that you would never use, thus saving much storage on the user’s end.</p><p>As you can view in the image to the left, the home screen looks especially clean and minimalistic. The dock (taskbar) is not overcrowded with numerous applications, sparing it from the tackiness that you would see on MacOS or Windows. Arch is also a pretty ‘light’ system. It isn’t a huge system that you’d have to spend hours installing, and plus, the Arch Wiki is maintained by several users that are trained in the operating system. They’re almost always online and ready to help anybody facing issues with Arch. Arch is hence, a great distro for newer users looking to enter the Linux ecosystem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SCfYaQ1SmrlzhNmX" /></figure><h3>Distro #5: Mint</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ka5e_IemmprA_jpF" /></figure><h3>Mint:</h3><p>Linux Mint, or simply Mint, is a beginner-friendly distro that is similar to the Windows graphical user-interface. Therefore, several people transitioning from Windows into the Linux ecosystem choose to install Mint as it offers the most similar views and appeal that they would receive on Windows.</p><p>As you can see on the right, Mint is also super minimalistic. The taskbar strongly resembles the same taskbar that Windows has, and numerous applications such as LibreOffice (the equivalent of Microsoft Office, except it’s free!) and FireFox comes preloaded in the system, hence sparing the user from having to scour for alternatives online after installing Mint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gE0My5NyJynRnQXg" /></figure><p>Moreover, Mint is another ‘light’ software that is able to work on older, slower computer systems. Mint also doesn’t force updates for its users, allowing for more control on the system.</p><h3>Honorable Mention: ElementaryOS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/0*jnF1QSJghMxwfbaA" /></figure><h3>ElementaryOS:</h3><p>ElementaryOS is a personal favorite of mine. It is stunningly beautiful, its interface similar to MacOS but not an identical copy, either. If you’re transitioning from MacOS to Linux, I strongly recommend installing ElementaryOS. Not only is it lightweight, it’s completely free as well. The small things such as the icon animations and the user-interface design make all the difference for some users, including me. It shows the refined, less complex side of Linux. Some would describe ElementaryOS as one of the more ‘luxurious’ Linux distros that you would really only install for its gorgeous interface and awesome preloaded apps such as the audio mixer.</p><p>ElementaryOS also comes equipped with its own applications store (AppCenter) where you can install other applications such as but not limited to: games, audio players, and text editors. Adding onto this, it’s extremely lightweight. Your 2009 Dell Inspiron would definitely run this without breaking a sweat. And since it’s based off of Ubuntu (which itself is based off of Debian), ElementaryOS inherits the stability and privacy that all of the other previously mentioned distros have. Updates are also not forced upon users, either.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ecZ5ym6epiP3O65G" /></figure><h3>Closing Remarks:</h3><p>Every Linux distro is different and special in its own unique way. Whether you’re a developer or a newbie to computers in general, there will always be a Linux distro ready to quench your thirst and meet your demands. Of course, if you’re a developer, you would probably be better off using Fedora or Arch, and if you’re a newcomer, you may want to look into Ubuntu or ElementaryOS.</p><p>At the end of the day, it doesn’t really matter which specific distro you use, as they all effectively provide the same features. Additionally, there are hundreds of other distros that I could not mention in this article (for the sake of readability and time). Other popular distros are Kali (which is great for ethical hackers and cybersecurity analysts), EndeavorOS, Zorin Linux (another beginner-friendly distro), and OpenSUSE (optimized for system administration and analysts).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b16bc4fc24ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>