<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: classx</title>
    <description>The latest articles on DEV Community by classx (@classx).</description>
    <link>https://dev.to/classx</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F330802%2F4be61383-1502-4e67-815c-5242bb15a0ec.jpeg</url>
      <title>DEV Community: classx</title>
      <link>https://dev.to/classx</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/classx"/>
    <language>en</language>
    <item>
      <title>How I Use AI</title>
      <dc:creator>classx</dc:creator>
      <pubDate>Thu, 16 Jul 2026 14:11:17 +0000</pubDate>
      <link>https://dev.to/classx/how-i-use-ai-290j</link>
      <guid>https://dev.to/classx/how-i-use-ai-290j</guid>
      <description>&lt;p&gt;AI assistants have become a core part of our daily coding routines. However, the biggest challenge when working with them is context loss and the LLM's tendency to "hallucinate," rewriting half the codebase just to implement one minor feature.&lt;/p&gt;

&lt;p&gt;Over my time working with &lt;strong&gt;Copilot-cli&lt;/strong&gt;, I’ve developed a rock-solid workflow that solves these exact problems. In this article, I’ll share two essential tools that dramatically improve generation quality, along with a set of strict rules (a system prompt) that keep Copilot on a short leash.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 1. Plan First, Code Later: &lt;code&gt;rfc-cli&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The most common mistake is asking Copilot to write code right away. Without a clear plan, the AI quickly loses track of the big picture. That’s why the very first thing I do before opening a chat and writing a prompt is creating an RFC (Request for Comments).&lt;/p&gt;

&lt;p&gt;To manage this, I use &lt;a href="https://github.com/classx/rfc-cli" rel="noopener noreferrer"&gt;rfc-cli&lt;/a&gt; — an excellent CLI tool designed to manage architecture design records and RFCs directly inside the repository.&lt;/p&gt;

&lt;h3&gt;
  
  
  My RFC Workflow:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Creation:&lt;/strong&gt; I initialize a new document using &lt;code&gt;rfc-cli new&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Drafting:&lt;/strong&gt; I sketch out the architecture, goals, and planned changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lifecycle:&lt;/strong&gt; The document strictly follows a state machine: &lt;code&gt;draft&lt;/code&gt; → &lt;code&gt;review&lt;/code&gt; → &lt;code&gt;accepted&lt;/code&gt; → &lt;code&gt;implemented&lt;/code&gt;. Skipping stages is a no-go.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validation:&lt;/strong&gt; After any changes, I validate the document structure with &lt;code&gt;rfc-cli check NNNN&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Moreover, all RFCs are stored directly inside the project repository. This is a massive win for project history: the team (and my future self six months from now) can always look back and understand exactly &lt;em&gt;how&lt;/em&gt; and &lt;em&gt;why&lt;/em&gt; each technical decision was made.&lt;/p&gt;

&lt;p&gt;When Copilot joins the task, it already has an &lt;code&gt;accepted&lt;/code&gt; RFC to refer to. This completely eliminates any guesswork or arguments about how a feature should be built.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2. Beating AI Amnesia: &lt;code&gt;mem-cli&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Copilot-cli is great, but its context window is not infinite. As soon as you start a new session, it forgets what you decided three hours ago, the quirks of your database schema, or your team's local coding conventions.&lt;/p&gt;

&lt;p&gt;To preserve state between sessions, I use &lt;a href="https://github.com/classx/mem-cli" rel="noopener noreferrer"&gt;mem-cli&lt;/a&gt;. This is a simple yet incredibly effective MCP (Model Context Protocol) server that acts as a long-term memory layer.&lt;/p&gt;

&lt;p&gt;Whenever a critical detail pops up during development (e.g., &lt;em&gt;"always use port 8080"&lt;/em&gt; or &lt;em&gt;"do not touch component X, it is currently undergoing a rewrite"&lt;/em&gt;), I simply save this fact to &lt;code&gt;mem-cli&lt;/code&gt;. Copilot queries this memory dynamically and stays up to date with the actual state of the project.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3. The Copilot Rulebook (System Prompt)
&lt;/h2&gt;

&lt;p&gt;Last but certainly not least: the rules of the game. I feed Copilot a strict set of instructions that it is forbidden to violate. My system prompt is divided into three main blocks:&lt;/p&gt;

&lt;h3&gt;
  
  
  🛠 Code
&lt;/h3&gt;

&lt;p&gt;The biggest issue with LLMs is over-engineering. To keep Copilot from getting "too creative," I set strict boundaries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Minimalism:&lt;/strong&gt; Any change must be the absolute minimum required to solve the task. No side-effect modifications in unrelated files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No Initiative:&lt;/strong&gt; Do not change the architecture, do not duplicate existing components (reuse them!), and do not add new libraries or dependencies without an explicit, well-justified reason.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quality:&lt;/strong&gt; Avoid code duplication at all costs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🌿 Git Workflow
&lt;/h3&gt;

&lt;p&gt;Everything here is automated to the limit. Copilot knows exactly how I manage branches and releases (set up for a Rust-based project):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;No direct commits to main:&lt;/strong&gt; Always work in a separate branch. Before creating a new branch, tag the main branch with a &lt;code&gt;pre_&lt;/code&gt; prefix.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Granular tasks:&lt;/strong&gt; Each feature gets its own branch. Each sub-task gets a sub-branch (format: &lt;code&gt;phase-N/X.Y-description&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quality Gates:&lt;/strong&gt; Run tests before every single &lt;code&gt;git commit&lt;/code&gt;. Before merging into &lt;code&gt;main&lt;/code&gt;, run the full suite: &lt;code&gt;build&lt;/code&gt; + &lt;code&gt;test&lt;/code&gt; + &lt;code&gt;lint&lt;/code&gt;. The &lt;code&gt;main&lt;/code&gt;/&lt;code&gt;master&lt;/code&gt; branch must always remain green and deployable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Releasing:&lt;/strong&gt; Merge using &lt;code&gt;--no-ff&lt;/code&gt;. Before merging into the main branch, bump the version in &lt;code&gt;Cargo.toml&lt;/code&gt; and write a detailed changelog entry in &lt;code&gt;CHANGELOG.md&lt;/code&gt; (in English). After the merge, tag the commit as &lt;code&gt;vX.Y.Z&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  🧠 Working Style
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Autonomy:&lt;/strong&gt; I don't want Copilot asking for permission at every step (e.g., &lt;em&gt;"May I create this file?"&lt;/em&gt;). It must work autonomously until the task is complete.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Awareness:&lt;/strong&gt; Before starting any work, it must read the RFC and the PLAN (if they exist).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Order:&lt;/strong&gt; Always write detailed, clear commit messages.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Combining &lt;code&gt;rfc-cli&lt;/code&gt; for upfront planning, &lt;code&gt;mem-cli&lt;/code&gt; for long-term memory, and a strict system prompt transforms Copilot-cli from a fancy autocomplete tool into a highly reliable, predictable, and disciplined junior developer that writes code exactly the way I want it.&lt;/p&gt;

</description>
      <category>githubcopilot</category>
      <category>ai</category>
      <category>mcp</category>
      <category>cli</category>
    </item>
    <item>
      <title>The Ultra-Minimalist, Blazing-Fast Terminal Text Editor for Focused Note-Taking</title>
      <dc:creator>classx</dc:creator>
      <pubDate>Thu, 16 Jul 2026 13:46:21 +0000</pubDate>
      <link>https://dev.to/classx/the-ultra-minimalist-blazing-fast-terminal-text-editor-for-focused-note-taking-1fk7</link>
      <guid>https://dev.to/classx/the-ultra-minimalist-blazing-fast-terminal-text-editor-for-focused-note-taking-1fk7</guid>
      <description>&lt;p&gt;If you’re anything like me, you probably have a love-hate relationship with note-taking apps.&lt;/p&gt;

&lt;p&gt;Rich text editors with endless formatting options often end up being a distraction. On the flip side, launching a heavy IDE just to jot down a quick thought feels like overkill. While Vim or Nano are great, they aren’t strictly optimized for simple, distraction-free note management.&lt;/p&gt;

&lt;p&gt;That is where &lt;strong&gt;&lt;a href="https://github.com/classx/be-cli" rel="noopener noreferrer"&gt;classx/be-cli&lt;/a&gt;&lt;/strong&gt; comes in. It’s a focus-based, dead-simple terminal text editor built for capture. And yes, it's written in &lt;strong&gt;Rust&lt;/strong&gt;!&lt;/p&gt;




&lt;h3&gt;
  
  
  Why &lt;code&gt;be-cli&lt;/code&gt;?
&lt;/h3&gt;

&lt;p&gt;The philosophy behind &lt;code&gt;be-cli&lt;/code&gt; is simple: &lt;strong&gt;Zero friction. Max focus.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here is what makes it stand out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Built with Rust:&lt;/strong&gt; Thanks to Rust, it compiles down to a single, lightweight binary. No heavy runtime dependencies, no garbage collection pauses—just pure performance and memory safety.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keyboard-First Workflow:&lt;/strong&gt; No mouse allowed. Keep your hands on the home row and let your thoughts flow seamlessly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero Distractions:&lt;/strong&gt; It strips away the clutter. No complex markdown rendering previews, sidebars, or cloud-sync progress bars in your face. Just you and your text.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blazing Fast:&lt;/strong&gt; It loads instantly in your terminal. Perfect for offloading your working memory before you lose that train of thought.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Quick Start 🚀
&lt;/h3&gt;

&lt;p&gt;Since it's a Rust project, you can easily install it via Cargo or grab the binary directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/classx/be-cli.git
&lt;span class="nb"&gt;cd &lt;/span&gt;be-cli
make release &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; make &lt;span class="nb"&gt;install&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed, just run &lt;code&gt;be&lt;/code&gt; in your terminal to start writing.&lt;/p&gt;




&lt;h3&gt;
  
  
  Who is this for?
&lt;/h3&gt;

&lt;p&gt;If your terminal is your second home and you want a dedicated, lightweight space to jot down ideas without leaving your command-line environment, you should definitely give &lt;code&gt;be-cli&lt;/code&gt; a spin.&lt;/p&gt;

&lt;p&gt;Check out the repository on GitHub: &lt;a href="https://www.google.com/search?q=https://github.com/classx/be-cli" rel="noopener noreferrer"&gt;classx/be-cli&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What does your note-taking setup look like? Are you team Obsidian, team Vim, or do you prefer lightweight Rust CLI tools like this one? Let's discuss in the comments!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>rust</category>
      <category>focus</category>
      <category>productivity</category>
      <category>cli</category>
    </item>
    <item>
      <title>Dark Matter — Rust-based CLI vault for secure GPG-encrypted config files</title>
      <dc:creator>classx</dc:creator>
      <pubDate>Mon, 14 Jul 2025 11:45:16 +0000</pubDate>
      <link>https://dev.to/classx/dark-matter-rust-based-cli-vault-for-secure-gpg-encrypted-config-files-h3g</link>
      <guid>https://dev.to/classx/dark-matter-rust-based-cli-vault-for-secure-gpg-encrypted-config-files-h3g</guid>
      <description>&lt;p&gt;Hi everyone! I'm currently learning Rust, and as a hands-on project I built a small command-line utility for Linux called Dark Matter. It's a minimal yet functional vault tool that encrypts sensitive project files using GPG and tracks them in a local SQLite database.&lt;/p&gt;

&lt;p&gt;Key Features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Secure GPG encryption using gpgme&lt;/li&gt;
&lt;li&gt;Add / update / remove / export encrypted files&lt;/li&gt;
&lt;li&gt;GPG key verification and diagnostics&lt;/li&gt;
&lt;li&gt;Local SQLite database for file metadata&lt;/li&gt;
&lt;li&gt;100% command-line based — no external/cloud dependencies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Requirements: GPG installed and a valid keypair&lt;/p&gt;

&lt;p&gt;Rust toolchain&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;libgpgme-dev (on Debian/Ubuntu)&lt;/li&gt;
&lt;li&gt;sqlite-dev&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/classx/dark-matter" rel="noopener noreferrer"&gt;https://github.com/classx/dark-matter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm still new to Rust, so I’d love feedback — bug reports, feature suggestions, or advice on improving the code. Any contributions or reviews are welcome!&lt;/p&gt;

</description>
      <category>rust</category>
      <category>vault</category>
      <category>security</category>
    </item>
    <item>
      <title>How to copy commits from one Git repo to another?</title>
      <dc:creator>classx</dc:creator>
      <pubDate>Mon, 05 Jun 2023 13:05:38 +0000</pubDate>
      <link>https://dev.to/classx/how-to-copy-commits-from-one-git-repo-to-another-4345</link>
      <guid>https://dev.to/classx/how-to-copy-commits-from-one-git-repo-to-another-4345</guid>
      <description>&lt;p&gt;Clone basic repo&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/user1/project1
cd project1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add external repo&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote add oldrepo https://github.com/user1/project2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Get the old repo commits&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;examine the whole tree&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log --all --oneline --graph --decorate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy (cherry-pick) the commits from the old repo into your new local one&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git cherry-pick sha-of-commit-one
git cherry-pick sha-of-commit-two
git cherry-pick sha-of-commit-three
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;check your local repo is correct&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;send your new tree (repo state) to github&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;remove the now-unneeded reference to oldrepo&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote remove oldrepo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>git</category>
      <category>linux</category>
    </item>
    <item>
      <title>DEB package and strange dkms dependencies on Debian 10.10</title>
      <dc:creator>classx</dc:creator>
      <pubDate>Mon, 10 Apr 2023 20:18:29 +0000</pubDate>
      <link>https://dev.to/classx/deb-package-and-strange-dkms-dependencies-on-debian-1010-971</link>
      <guid>https://dev.to/classx/deb-package-and-strange-dkms-dependencies-on-debian-1010-971</guid>
      <description>&lt;p&gt;Imagine that you have Debian 10, kernel version 5.10, and a self-made DEB package that compiles and installs a kernel module using the dkms subsystem. As expected, the package has a dependency on dkms. However, when you tried to install this package with the command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apt install -y ./my-dkms-package.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you found that the installer sees that dkms is missing from the system and started its installation. However, dkms also has its dependencies, one of which is linux-headers-common for kernel version 4.19!&lt;/p&gt;

&lt;p&gt;Thus, despite having only the active kernel version 5.10 in your system, dependencies for kernel version 4.19 are being installed. &lt;br&gt;
And here comes the strange part - during the package installation and module compilation, headers from kernel version 4.19 are being used!&lt;/p&gt;

&lt;p&gt;After that, you see that an error occurs during compilation because (make.log)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/lib/module/linux-4.19 is not found
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and the installation cannot be completed. &lt;/p&gt;

&lt;p&gt;But as it turns out, there is a way to solve this problem! &lt;/p&gt;

&lt;p&gt;If you install dkms separately with the command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apt install dkms
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the installed dependencies from kernel version 4.19 will no longer interfere. And after that, you can install your package with the command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apt install -y ./my-dkms-package.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and all headers will be correct, i.e., for kernel version 5.10.&lt;/p&gt;

&lt;p&gt;So if you encounter such a problem, don't despair! Just install dkms separately, and everything will be fine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://memos.rpod.club/m/36"&gt;My original topic&lt;/a&gt;&lt;/p&gt;

</description>
      <category>debian</category>
      <category>dkms</category>
      <category>bug</category>
    </item>
    <item>
      <title>Disable bash script output, but save to file log</title>
      <dc:creator>classx</dc:creator>
      <pubDate>Wed, 21 Dec 2022 10:31:21 +0000</pubDate>
      <link>https://dev.to/classx/disable-bash-script-output-but-save-to-file-log-318b</link>
      <guid>https://dev.to/classx/disable-bash-script-output-but-save-to-file-log-318b</guid>
      <description>&lt;h3&gt;
  
  
  Option 1
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash
sudo apt install -y package_name | tee -a /tmp/app.log &amp;gt;/dev/null
sudo apt install -y package_name1 | tee -a /tmp/app.log &amp;gt;/dev/null
sudo apt install -y package_name2 | tee -a /tmp/app.log &amp;gt;/dev/null

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Option 2
&lt;/h3&gt;

&lt;p&gt;disable all output to tty but save to file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash
exec 1&amp;gt; &amp;gt;(tee -a /tmp/app.log &amp;gt;/dev/null)
sudo apt install -y package_name
sudo apt install -y package_name1
sudo apt install -y package_name2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Option 3
&lt;/h3&gt;

&lt;p&gt;enable all output to tty and save to file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash
exec 2&amp;gt; &amp;gt;(tee -a /tmp/app.log &amp;gt;&amp;amp;2) &amp;gt; &amp;gt;(tee -a /tmp/app.log")
sudo apt install -y package_name
sudo apt install -y package_name1
sudo apt install -y package_name2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As function&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function __application_log(){
    if [ "${__verbose_mode}" == "no"  ]; then
        exec 1&amp;gt; &amp;gt;(tee -a /tmp/app.log &amp;gt;/dev/null)
    else
        exec 2&amp;gt; &amp;gt;(tee -a /tmp/app.log &amp;gt;&amp;amp;2) &amp;gt; &amp;gt;(tee -a /tmp/app.log")
    fi
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>linux</category>
      <category>bash</category>
    </item>
    <item>
      <title>Jenkins - run shell command on the master</title>
      <dc:creator>classx</dc:creator>
      <pubDate>Thu, 01 Dec 2022 06:25:05 +0000</pubDate>
      <link>https://dev.to/classx/jenkins-run-shell-command-on-the-master-34go</link>
      <guid>https://dev.to/classx/jenkins-run-shell-command-on-the-master-34go</guid>
      <description>&lt;p&gt;Go to your jenkins instance&lt;/p&gt;

&lt;p&gt;&lt;a href="https://local-jenkins/script" rel="noopener noreferrer"&gt;https://local-jenkins/script&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;paste and run it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def proc = "ls -l".execute()
proc.waitFor()
def b = new StringBuffer()
proc.consumeProcessErrorStream(b)
println proc.exitValue() // print exit code
println proc.text // print output
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>jenkins</category>
      <category>shell</category>
      <category>snippet</category>
    </item>
    <item>
      <title>DEB/RPM meta package</title>
      <dc:creator>classx</dc:creator>
      <pubDate>Tue, 15 Mar 2022 06:34:08 +0000</pubDate>
      <link>https://dev.to/classx/debrpm-meta-package-18p8</link>
      <guid>https://dev.to/classx/debrpm-meta-package-18p8</guid>
      <description>&lt;p&gt;One way to install few packages on the one time, create meta package.&lt;br&gt;
It's easy! The ten line of script and enjoy.&lt;/p&gt;

&lt;p&gt;For example, create file my-meta-package.cfg&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Section: misc
Priority: optional
Standards-Version: 3.9.2

Package: my-meta-package
Version: 1.0.0-1
Maintainer: Your Name &amp;lt;yourname@example.com&amp;gt;
Depends: package-one, package-two, package-three
Description: My meta package
 The meta package
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;equivs-build my-meta-package.cfg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Should be get my-meta-package-1.0.0-1.noarch.deb package.&lt;/p&gt;

&lt;p&gt;Easy!&lt;br&gt;
If packages in repo and allowed to download can do for install&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install -y my-meta-package-1.0.0-1.noarch.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;add package-one, package-two, package-three will be installed as dependencies of my-meta-package.&lt;/p&gt;

&lt;p&gt;But here has problem if need install (for example) package-one with specific version.&lt;/p&gt;

&lt;p&gt;Doing simple change in the my-meta-package.cfg&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Depends: package-one (= 0.1.0), package-two, package-three
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;equivs-build my-meta-package.cfg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;still get my-meta-package-1.0.0-1.noarch.deb package.&lt;/p&gt;

&lt;p&gt;Try install it and if package-one (= 0.1.0) is latest version in the repo - enjoy. If not and in repo exist package-one version great that 0.1.0 - install meta package will be failed.&lt;/p&gt;

&lt;p&gt;RPM package behaves terribly similar. Difference - yum/dnf do not failed but install latest version.&lt;/p&gt;

&lt;p&gt;I don't know how fix this issue!!!&lt;/p&gt;

&lt;p&gt;Somebody know?&lt;/p&gt;

</description>
      <category>debian</category>
      <category>redhat</category>
      <category>packages</category>
      <category>devops</category>
    </item>
    <item>
      <title>Two problem DKMS on the Amazon Linux 2</title>
      <dc:creator>classx</dc:creator>
      <pubDate>Wed, 23 Feb 2022 05:55:19 +0000</pubDate>
      <link>https://dev.to/classx/two-problem-dkms-on-the-amazon-linux-2-4ec7</link>
      <guid>https://dev.to/classx/two-problem-dkms-on-the-amazon-linux-2-4ec7</guid>
      <description>&lt;p&gt;The best way to load the driver into the kernel is to use dkms.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 1
&lt;/h4&gt;

&lt;p&gt;to unzip source code to /usr/src&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 2
&lt;/h4&gt;

&lt;p&gt;register driver into dkms service&lt;br&gt;
&lt;code&gt;dkms add -m DRIVERNAME -v VERSION&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 3
&lt;/h4&gt;

&lt;p&gt;to build the source against the current kernel&lt;br&gt;
&lt;code&gt;dkms build -m DRIVERNAME -v VERSION&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 4
&lt;/h4&gt;

&lt;p&gt;install driver&lt;br&gt;
&lt;code&gt;dkms install -m DRIVERNAME -v VERSION&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 5
&lt;/h4&gt;

&lt;p&gt;Load driver&lt;br&gt;
&lt;code&gt;modprobe DRIVERNAME&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That all. &lt;/p&gt;

&lt;p&gt;From here began problems.&lt;br&gt;
I have checked step 4 on the Ubuntu 20, RedHat 8, CentOS 7, CentOS 8, and everywhere the driver does not load automatically on step 4 except for Amazon Linux.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>dkms</category>
      <category>amazonlinux</category>
    </item>
    <item>
      <title>Insmod: ERROR – Required key not available</title>
      <dc:creator>classx</dc:creator>
      <pubDate>Sun, 11 Jul 2021 06:37:08 +0000</pubDate>
      <link>https://dev.to/classx/insmod-error-required-key-not-available-2o7j</link>
      <guid>https://dev.to/classx/insmod-error-required-key-not-available-2o7j</guid>
      <description>&lt;p&gt;Problem:&lt;/p&gt;

&lt;p&gt;insmod: ERROR: could not insert module MODULENAME.ko: Required key not available&lt;/p&gt;

&lt;p&gt;Solution:&lt;/p&gt;

&lt;p&gt;1) sudo yum install mokutil&lt;br&gt;
2) sudo mokutil —disable-validation&lt;br&gt;
3) When executed, the terminal will let you set up 8-16 digit password (after you do, do not forget Oh ~)&lt;br&gt;
Next, restart the computer, a blue screen (do not be nervous, press any key to enter the selection interface :–)), options are as follows:&lt;br&gt;
– Continue boot&lt;br&gt;
– Change Secure Boot state&lt;br&gt;
– Enroll key from disk&lt;br&gt;
– Enroll hash from disk&lt;br&gt;
to select –&amp;gt;Change Secure Boot state&amp;lt;– , next in line before you enter the password.&lt;br&gt;
requiresEnter password character 7, Meaning that the password bit 7 (this point to note!).&lt;br&gt;
4) enter –&amp;gt; Disable Secure Boot selection &amp;lt;– screen,&lt;br&gt;
select yes (Do not simply press Enter, this would be lost, only to start all over again!).&lt;br&gt;
5) returned to the next screen beginning interface, reboot selection, re-enter the system&lt;/p&gt;

</description>
      <category>centos</category>
      <category>dkms</category>
      <category>devops</category>
      <category>linux</category>
    </item>
    <item>
      <title>Checkout git submodules by tag</title>
      <dc:creator>classx</dc:creator>
      <pubDate>Sun, 03 Jan 2021 16:02:26 +0000</pubDate>
      <link>https://dev.to/classx/checkout-git-submodules-by-tag-17ae</link>
      <guid>https://dev.to/classx/checkout-git-submodules-by-tag-17ae</guid>
      <description>&lt;p&gt;In the git documentation can read that the git submodule doesn't support update the submodule by tag.&lt;/p&gt;

&lt;p&gt;This is a simple solution:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# update submodule&lt;/span&gt;
git submodule update &lt;span class="nt"&gt;--init&lt;/span&gt;
&lt;span class="c"&gt;# set tag for boost submodules&lt;/span&gt;
&lt;span class="nv"&gt;DEFAULT_TAG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"boost-1.70.0"&lt;/span&gt;
&lt;span class="c"&gt;# update&lt;/span&gt;
git config &lt;span class="nt"&gt;-f&lt;/span&gt; .gitmodules &lt;span class="nt"&gt;--get-regexp&lt;/span&gt; &lt;span class="s1"&gt;'^submodule\..*\.url$'&lt;/span&gt; |
    &lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="nb"&gt;read&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; KEY MODULE_PATH&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
        &lt;/span&gt;&lt;span class="nv"&gt;NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;KEY&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="s1"&gt;'s/^submodule\.\(.*\)\.url$/\1/'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="nv"&gt;$NAME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;~ &lt;span class="s2"&gt;"boost"&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
          &lt;/span&gt;&lt;span class="nb"&gt;pushd&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;NAME&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
          git checkout &lt;span class="nt"&gt;-b&lt;/span&gt; new_branch_boost &lt;span class="nv"&gt;$DEFAULT_TAG&lt;/span&gt;                   
          &lt;span class="nb"&gt;popd
        &lt;/span&gt;&lt;span class="k"&gt;fi
    done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>git</category>
      <category>submodule</category>
      <category>devops</category>
      <category>bash</category>
    </item>
  </channel>
</rss>
