<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>MOSAID Articles &amp; Tutorials - Linux</title><link href="https://mosaid.xyz/" rel="alternate"></link><link href="https://mosaid.xyz/feeds/linux.atom.xml" rel="self"></link><id>https://mosaid.xyz/</id><updated>2026-06-29T13:29:16+00:00</updated><entry><title>KolourPaint: The MS Paint Replacement I Finally Found After 20 Years of Linux</title><link href="https://mosaid.xyz/articles/kolourpaint-the-ms-paint-replacement-i-finally-found-after-20-years-of-linux-26.html" rel="alternate"></link><published>2026-06-29T13:29:16+00:00</published><updated>2026-06-29T13:29:16+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2026-06-29:/articles/kolourpaint-the-ms-paint-replacement-i-finally-found-after-20-years-of-linux-26.html</id><summary type="html">&lt;p&gt;After decades on Linux, I never found a simple image editor that matched the speed and ease of MS Paint—until I discovered KolourPaint. This article walks through the journey of searching, the design philosophy that makes KolourPaint perfect for quick edits, and how it fits into a developer’s toolchain.&lt;/p&gt;</summary><content type="html">&lt;p&gt;
  &lt;strong style="background:#F5F6CE;"&gt;I’ve been using Linux as my daily driver for almost 20 years, and I haven’t touched Windows for over 15.&lt;/strong&gt;
  Despite that, one tiny thing kept nagging me: the absence of a truly simple, drop‑in replacement for Microsoft Paint.
  When you need to crop a screenshot, add an arrow, or scribble a quick annotation, you don’t want to launch a behemoth like GIMP.
  You want something that opens instantly, lets you make the edit, and gets out of your way.
&lt;/p&gt;

&lt;p&gt;
  For years I tried to fill the void.
  &lt;strong style="background:#F5F6CE;"&gt;GIMP is an amazing piece of software, but it’s a sledgehammer when all you need is a thumbtack.&lt;/strong&gt;
  Pinta came close, but it always felt a little “off” – minor UI glitches and a dependency stack that sometimes broke.
  MyPaint, drawing tablets, raw pixel editors – none of them replicated the immediacy of MS Paint.
  Then, by accident, I stumbled across KolourPaint.
&lt;/p&gt;

&lt;h2&gt;Discovery and First Impressions&lt;/h2&gt;
&lt;p&gt;
  I was scanning a forum thread about lightweight KDE applications when someone mentioned KolourPaint.
  &lt;strong style="background:#F5F6CE;"&gt;I installed it with zero expectations and found myself grinning within 30 seconds.&lt;/strong&gt;
  The layout, the tool palette, the default behaviour – it was as if MS Paint had been ported natively to Linux, with subtle improvements.
  No bloated menus, no confusing layer system, just a canvas and a set of tools that work exactly how you remember.
&lt;/p&gt;

&lt;p&gt;
  KolourPaint is part of the KDE ecosystem, but it runs perfectly on any desktop environment.
  &lt;strong style="background:#F5F6CE;"&gt;It respects the Unix philosophy: do one thing (simple image editing) and do it well.&lt;/strong&gt;
  The startup time is virtually instant, the memory footprint is negligible, and it integrates with your file manager as you’d expect.
&lt;/p&gt;

&lt;h2&gt;Feature Comparison: MS Paint vs. KolourPaint&lt;/h2&gt;
&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Feature&lt;/th&gt;
      &lt;th&gt;MS Paint (Classic)&lt;/th&gt;
      &lt;th&gt;KolourPaint&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Startup speed&lt;/td&gt;
      &lt;td&gt;Instant&lt;/td&gt;
      &lt;td&gt;Instant&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Basic drawing tools&lt;/td&gt;
      &lt;td&gt;Yes&lt;/td&gt;
      &lt;td&gt;Yes, with additional shapes&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Text tool&lt;/td&gt;
      &lt;td&gt;Limited&lt;/td&gt;
      &lt;td&gt;Rich text support, antialiasing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Transparency handling&lt;/td&gt;
      &lt;td&gt;No&lt;/td&gt;
      &lt;td&gt;Yes (alpha channel)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Colour palette&lt;/td&gt;
      &lt;td&gt;Fixed&lt;/td&gt;
      &lt;td&gt;Configurable, with colour picker&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Format support&lt;/td&gt;
      &lt;td&gt;BMP, PNG, JPEG, GIF&lt;/td&gt;
      &lt;td&gt;BMP, PNG, JPEG, GIF, TIFF, ICO, WebP, and more&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Undo/Redo&lt;/td&gt;
      &lt;td&gt;Limited&lt;/td&gt;
      &lt;td&gt;Unlimited history&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Keyboard shortcuts&lt;/td&gt;
      &lt;td&gt;Basic&lt;/td&gt;
      &lt;td&gt;Extensive, customisable&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;
  &lt;strong style="background:#F5F6CE;"&gt;The feature set is familiar enough to be comfortable, yet modern enough to handle real-world tasks.&lt;/strong&gt;
  I never have to think about “how do I do X?” because the answer is always the same as it was in MS Paint – it just works.
&lt;/p&gt;

&lt;h2&gt;Daily Workflow Integration&lt;/h2&gt;
&lt;p&gt;
  As a developer and technical writer, I constantly manipulate screenshots.
  A typical flow looks like this:
&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Capture:&lt;/strong&gt; Use Spectacle (or scrot) to grab a region.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Annotate:&lt;/strong&gt; Open the screenshot directly in KolourPaint with one click.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Add:&lt;/strong&gt; Arrows, rectangles, text, or highlights using the toolbox.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Export:&lt;/strong&gt; Save as optimised PNG and drop into my documentation.&lt;/p&gt;
&lt;p&gt;
  &lt;strong style="background:#F5F6CE;"&gt;This entire pipeline takes less than 30 seconds because KolourPaint introduces zero friction.&lt;/strong&gt;
  The ability to set a default save format (I always use PNG) means I never see a format dialog.
  The colour picker remembers my last used colours, so consistent branding is trivial.
&lt;/p&gt;

&lt;h2&gt;Why Lightweight Tools Matter&lt;/h2&gt;
&lt;p&gt;
  Power users often build complex toolchains, but the weak link is almost always the “tiny edit” step.
  &lt;strong style="background:#F5F6CE;"&gt;When a simple crop or annotation requires opening a 500 MB application, you’re pulled out of your flow.&lt;/strong&gt;
  Over a day, those context switches add up to hours of lost productivity.
  KolourPaint solves this by being intentionally minimal.
&lt;/p&gt;
&lt;p&gt;
  It doesn’t try to be a photo editor, a painting simulator, or a design suite.
  It’s a straight‑to‑the‑point editing surface for raster images.
  &lt;strong style="background:#F5F6CE;"&gt;That focus is exactly why it succeeds where GIMP, Pinta, and others fail for quick tasks.&lt;/strong&gt;
&lt;/p&gt;

&lt;h2&gt;Installation&lt;/h2&gt;
&lt;p&gt;
  KolourPaint is available in the repositories of virtually every major distribution.
  Installing it is a single command:
&lt;/p&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;
sudo apt install kolourpaint        # Debian / Ubuntu / Mint
sudo dnf install kolourpaint        # Fedora / RHEL
sudo pacman -S kolourpaint          # Arch Linux / Manjaro&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;
  No additional configuration is required.  Once installed, it appears in your application launcher and can be associated with all common image formats.
&lt;/p&gt;

&lt;h2&gt;Tradeoffs&lt;/h2&gt;
&lt;p&gt;
  No tool is perfect.
  &lt;strong style="background:#F5F6CE;"&gt;KolourPaint’s strength—its simplicity—is also its limitation.&lt;/strong&gt;
  It won’t replace advanced editors for compositing, colour grading, or professional graphic design.
  If you need non‑destructive layers or CMYK colour space, look elsewhere.
  But for the 90 % of edits that consist of cropping, resizing, simple drawing, and annotation, it’s ideal.
&lt;/p&gt;
&lt;p&gt;
  Another tradeoff: it’s a KDE application, so it pulls in several KDE libraries if you’re on a pure GTK‑based system.
  The footprint is still negligible by modern standards, but worth knowing.
&lt;/p&gt;

&lt;h2&gt;Final Thoughts&lt;/h2&gt;
&lt;p&gt;
  &lt;strong style="background:#F5F6CE;"&gt;After two decades, I finally have the one tool that makes me forget MS Paint ever existed.&lt;/strong&gt;
  KolourPaint respects my time, my muscle memory, and my workflow.
  It’s a testament to the fact that sometimes the best software isn’t the most feature‑rich; it’s the one that disappears and lets you do your work.
&lt;/p&gt;
&lt;p&gt;
  If you’ve ever missed the simplicity of MS Paint on Linux, do yourself a favour and install KolourPaint.
  You’ll wonder why you didn’t find it sooner.
&lt;/p&gt;</content><category term="Linux"></category><category term="kolourpaint"></category><category term="ms paint"></category><category term="image editor"></category><category term="linux"></category><category term="lightweight"></category><category term="workflow"></category><category term="simple editing"></category><category term="kde"></category></entry><entry><title>5 Ultra-Light Linux Distributions for 256 MB – 1 GB RAM Machines as a Child’s First Engineering Workstation</title><link href="https://mosaid.xyz/articles/5-ultra-light-linux-distributions-for-256-mb-1-gb-ram-machines-as-a-child%E2%80%99s-first-engineering-workstation-25.html" rel="alternate"></link><published>2026-06-21T15:08:50+00:00</published><updated>2026-06-21T15:08:50+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2026-06-21:/articles/5-ultra-light-linux-distributions-for-256-mb-1-gb-ram-machines-as-a-child’s-first-engineering-workstation-25.html</id><summary type="html">&lt;p&gt;A detailed comparison of five extremely lightweight Linux distributions that breathe life into old hardware with as little as 256 MB of RAM. This guide frames the repurposing of a forgotten laptop as a deliberate gift: a low-distraction, fully offline environment where children can learn programming, system administration, and engineering thinking, far away from the dopamine loops of smartphones.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Why Give a Child a Computer That “Can’t Do Anything”&lt;/h2&gt;

&lt;p&gt;Most parents face the same dilemma: a smartphone or tablet appears to be the easy gift—it keeps children occupied, it is “educational,” and it requires zero effort. But the device is also a slot machine. Every notification, every autoplaying video, every “like” is engineered to hold attention hostage. We are not giving them tools; we are handing them carefully optimised compulsion engines.&lt;/p&gt;

&lt;p&gt;&lt;strong style="background:#F5F6CE;"&gt;An old laptop running a deliberately lightweight Linux distribution is the exact opposite: it is a sandbox where curiosity, not compulsion, drives the interaction.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This article is not a nostalgic plea. It is an engineering walkthrough for parents (and mentors) who want to repurpose hardware with 256 MB, 512 MB, or 1 GB of RAM into a deterministic, offline-first learning workstation. We will examine five Linux distributions that treat scarce resources as a feature, not a bug, and discuss how each one can become the first real computer of a future developer.&lt;/p&gt;

&lt;h2&gt;The Hardware Landscape: Why 256 MB Still Matters&lt;/h2&gt;

&lt;p&gt;Many households have a forgotten netbook, a Pentium 4 desktop, or a single-board computer that was discarded because Windows XP or 7 became unusable. In engineering terms, these machines are not dead—they are thermally quiet, mechanically simple, and perfectly capable of running a fully-fledged POSIX environment if we shed the weight of modern graphical stacks.&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;256 MB RAM:&lt;/strong&gt; The absolute floor. A kernel, a window manager, a terminal, and a small editor can coexist. The experience is entirely text-centric, which is an asset for learning.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;512 MB RAM:&lt;/strong&gt; Comfortable for a lightweight desktop, a browser like NetSurf or Dillo for offline documentation, and an interpreted language environment (Python, Lua, or Guile).&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;1 GB RAM:&lt;/strong&gt; Enough to run a modern-ish browser with careful tab management, a full IDE like Geany, and a GCC toolchain without swapping to death.&lt;/p&gt;

&lt;p&gt;&lt;strong style="background:#F5F6CE;"&gt;Scarcity enforces good engineering habits: no resource is wasted, no daemon runs without justification, and every megabyte is accounted for.&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;Selection Criteria&lt;/h2&gt;

&lt;p&gt;We judged distributions by the following engineering requirements:&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Base memory footprint:&lt;/strong&gt; Must idle below 128 MB (ideally below 64 MB) after boot, leaving room for applications.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Deterministic behaviour:&lt;/strong&gt; No auto‑started services that silently consume cycles; reproducible builds are preferred.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Offline capability:&lt;/strong&gt; Full local package repositories or single‑file installers that do not demand constant internet access.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Child‑safe toolchain:&lt;/strong&gt; Easy to lock down (no app store, no advertising), with simple access to programming languages and build tools.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Community longevity:&lt;/strong&gt; Not a one‑person hobby project likely to vanish in six months.&lt;/p&gt;

&lt;p&gt;The five distributions below satisfy these constraints and represent different philosophies in minimalism.&lt;/p&gt;

&lt;h2&gt;1. Alpine Linux – The Purpose‑Built Base&lt;/h2&gt;

&lt;p&gt;Alpine is a security‑oriented distribution built around musl libc, BusyBox, and OpenRC. It is designed for containers and embedded systems, but a desktop mode is trivially constructed from its package repository. &lt;strong style="background:#F5F6CE;"&gt;A base Alpine installation can boot into a console using less than 40 MB of RAM.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Memory model:&lt;/strong&gt; No systemd, no dbus, no polkit by default. Every service is explicitly enabled. Adding a lightweight Wayland compositor like &lt;code&gt;sway&lt;/code&gt; or a stacking window manager like &lt;code&gt;i3&lt;/code&gt; yields a graphical environment that idles around 100 MB.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Package management:&lt;/strong&gt; APK is fast, transactional, and works entirely from local cache. You can mirror the repository on a USB stick.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;For a child:&lt;/strong&gt; Alpine teaches the anatomy of a Linux system. The child learns about runlevels, init scripts, and manual network configuration. Install &lt;code&gt;python3&lt;/code&gt;, &lt;code&gt;gcc&lt;/code&gt;, and &lt;code&gt;geany&lt;/code&gt; to create a minimal development desktop.&lt;/p&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

# After base Alpine install:
setup-xorg-base
apk add i3wm i3status dmenu rxvt-unicode
apk add python3 py3-pip gcc musl-dev make
apk add geany
# Start X and i3 manually – no display manager bloat
&lt;/code&gt;
&lt;/pre&gt;

&lt;h2&gt;2. Puppy Linux – The Portable Workshop&lt;/h2&gt;

&lt;p&gt;Puppy Linux is not a single distribution but a family of extremely compact live images that load entirely into RAM. Its core design principle—&lt;strong style="background:#F5F6CE;"&gt;run from RAM, save sessions only on demand&lt;/strong&gt;—makes it ideal for very old hardware and for children who might accidentally corrupt a persistent install.&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Memory footprint:&lt;/strong&gt; The official Fossapup64 9.5 runs comfortably in 512 MB of RAM, with reports of success on 256 MB using zram swap. The “pfix=ram” boot parameter prevents touching the hard disk at all.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Persistence model:&lt;/strong&gt; Sessions are saved into a single &lt;code&gt;.sfs&lt;/code&gt; file or a dedicated save folder. Corruption is trivial to revert.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Child‑friendliness:&lt;/strong&gt; Puppy comes with a curated set of lightweight applications (AbiWord, Gnumeric, mtPaint) and a simple menu. The JWM window manager is fast and unintimidating. Adding &lt;code&gt;devx.sfs&lt;/code&gt; gives a full GCC toolchain.&lt;/p&gt;

&lt;h2&gt;3. Tiny Core Linux – The LEGO Brick of Operating Systems&lt;/h2&gt;

&lt;p&gt;Tiny Core Linux (TCL) is the smallest desktop distribution in active maintenance. Its “Core” ISO is 17 MB; the “CorePlus” image with a graphical environment is around 160 MB. &lt;strong style="background:#F5F6CE;"&gt;TCL treats the operating system as a collection of interchangeable extensions, much like a set of precise engineering components.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Architecture:&lt;/strong&gt; The kernel and a minuscule root filesystem load into RAM. Everything else—window managers, editors, compilers—are extensions (&lt;code&gt;.tcz&lt;/code&gt; files) mounted on demand. This means a 256 MB machine can boot a full GUI with networking and still have free RAM for user applications.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Learning value:&lt;/strong&gt; Every component is explicit. The child will see exactly what a window manager is because they install &lt;code&gt;flwm_topside.tcz&lt;/code&gt; themselves. This demystifies the “magic” of a modern OS.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Toolchain:&lt;/strong&gt; The &lt;code&gt;compiletc.tcz&lt;/code&gt; meta‑extension pulls in GCC, make, headers, and libraries. Python, Lua, and Tcl are available as single extensions.&lt;/p&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

# Boot TinyCore, then:
tce-load -wi Xvesa flwm_topside aterm wbar
tce-load -wi compiletc
tce-load -wi python3.11
# Start the desktop with 'startx'
&lt;/code&gt;
&lt;/pre&gt;

&lt;h2&gt;4. antiX – The “Just Works” Lightweight Legacy&lt;/h2&gt;

&lt;p&gt;antiX is a Debian‑based distribution that explicitly targets 256 MB RAM systems. It ships with a choice of lightweight window managers—IceWM (default), Fluxbox, and JWM—and replaces systemd with &lt;code&gt;runit&lt;/code&gt; or &lt;code&gt;sysvinit&lt;/code&gt;. &lt;strong style="background:#F5F6CE;"&gt;antiX is the closest thing to a turn‑key Debian desktop that respects a 256 MB budget.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Memory:&lt;/strong&gt; Full‑featured IceWM desktop idles around 80 MB on a fresh boot. The &lt;code&gt;antiX-base&lt;/code&gt; ISO strips even more, ideal for custom setups.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Package ecosystem:&lt;/strong&gt; Being Debian‑compatible means access to &lt;code&gt;apt&lt;/code&gt; and tens of thousands of packages, but we must be selective. Avoid heavyweight default recommends (&lt;code&gt;--no-install-recommends&lt;/code&gt;) to keep the footprint low.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;For the child:&lt;/strong&gt; Install &lt;code&gt;geany&lt;/code&gt;, &lt;code&gt;python3&lt;/code&gt;, &lt;code&gt;idle3&lt;/code&gt;, and optionally &lt;code&gt;scratch&lt;/code&gt; (visual programming). The traditional desktop metaphor is immediately understandable, yet the system encourages exploration under the hood.&lt;/p&gt;

&lt;h2&gt;5. SliTaz – The Small‑Footprint Powerhouse&lt;/h2&gt;

&lt;p&gt;SliTaz is a French‑origin rolling‑release distribution that delivers a fully‑featured Openbox desktop inside a 50 MB ISO. Its package manager, &lt;code&gt;tazpkg&lt;/code&gt;, handles dependencies cleverly and supports converting packages from other distros. &lt;strong style="background:#F5F6CE;"&gt;SliTaz proves that a complete, fast desktop does not need even 256 MB of RAM—it thrives on 128 MB.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Design philosophy:&lt;/strong&gt; The system uses a hybrid init (BusyBox + custom scripts), a hand‑crafted control panel, and a collection of home‑grown tools that feel remarkably cohesive. The live session runs from RAM and can be installed in minutes.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Development environment:&lt;/strong&gt; The &lt;code&gt;slitaz-toolchain&lt;/code&gt; package provides GCC. Python, Ruby, and Lua are one command away. The built‑in web server (BusyBox httpd) lets a child share a local page instantly—a gateway to web development without the internet.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Caveat:&lt;/strong&gt; The community is smaller, and hardware support on extremely new machines can be patchy, but on old hardware it excels.&lt;/p&gt;

&lt;h2&gt;Turning an Old Laptop into a “First Computer” Gift&lt;/h2&gt;

&lt;p&gt;All five distributions share a critical property for a child’s learning environment: &lt;strong style="background:#F5F6CE;"&gt;they are quiet.&lt;/strong&gt; They do not ping notifications, they do not autoplay videos, they do not recommend “content.” When a child opens the terminal, it stays open. When they write code, it waits for them. This friction‑free, distraction‑free state is precisely the opposite of a smartphone experience.&lt;/p&gt;

&lt;p&gt;Practical steps for a parent or mentor:&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Choose the hardware:&lt;/strong&gt; A 2008–2012 laptop with at least 512 MB RAM, a functioning keyboard, and a working display. Replace the spinning disk with a cheap CompactFlash‑to‑IDE or SD‑to‑SATA adapter for silent operation and reliability.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Install the distribution of choice:&lt;/strong&gt; Use the minimal instructions above. Do not set up Wi‑Fi unless you intend to supervise—offline is safer and faster.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Preload learning materials:&lt;/strong&gt; Place offline documentation (&lt;code&gt;devdocs.io&lt;/code&gt; offline bundle, the Python tutorial, a copy of “The Linux Command Line”) directly in &lt;code&gt;/home/child/Documents&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Create a short, printed “starter card”&lt;/strong&gt; showing how to open the terminal, launch the editor, and run a simple Python script. This transforms the machine from an intimidating blank screen into a known‑good playground.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Set a challenge, not a lesson:&lt;/strong&gt; “Make the computer print your name one hundred times.” “Draw a square with turtle.” “Write a guessing game.” Problems drive learning; instructions alone do not.&lt;/p&gt;

&lt;h2&gt;Performance Considerations and Tuning&lt;/h2&gt;

&lt;p&gt;On sub‑1 GB systems, every service matters. Apply these tweaks regardless of distribution:&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Use &lt;code&gt;zram&lt;/code&gt; instead of disk swap.&lt;/strong&gt; A 128 MB zram device compresses to roughly 40–50 MB, effectively expanding usable RAM without touching slow storage.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Prefer static linking or minimal shared libraries.&lt;/strong&gt; Musl‑based systems (Alpine) naturally avoid glibc bloat. On Debian‑based distros, avoid installing unnecessary &lt;code&gt;-dev&lt;/code&gt; packages until needed.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Replace heavy browsers.&lt;/strong&gt; NetSurf, Dillo, or even &lt;code&gt;w3m&lt;/code&gt; for local HTML docs. Do not install Firefox or Chromium on a machine with less than 1 GB—they will swap the system into unusability.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Monitor with &lt;code&gt;htop&lt;/code&gt; or &lt;code&gt;btm&lt;/code&gt;.&lt;/strong&gt; Show the child what RAM and CPU look like. Make resource monitoring part of the learning ritual.&lt;/p&gt;

&lt;h2&gt;The Long‑Term Payoff: Raising Engineers Instead of Consumers&lt;/h2&gt;

&lt;p&gt;&lt;strong style="background:#F5F6CE;"&gt;A child who grows up on a minimal Linux machine learns that computers are not magic; they are mechanisms.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When a program crashes, they will not stare at a spinner—they will open &lt;code&gt;dmesg&lt;/code&gt;. When they need a new tool, they will not tap “Install”—they will compile it and learn about dependencies. These are the reflex habits of an engineer. The smartphone generation has been robbed of this; our job is to give it back.&lt;/p&gt;

&lt;p&gt;There is no guarantee that every child will become a programmer, but a deterministic, offline, open‑source machine teaches something far more valuable: &lt;strong&gt;the confidence that they can understand and control the systems around them.&lt;/strong&gt; That confidence transfers to any technical field—and it begins with a 256 MB laptop and a blinking cursor.&lt;/p&gt;

&lt;h2&gt;Tradeoffs and When This Approach Does Not Fit&lt;/h2&gt;

&lt;p&gt;We must be honest. These distributions are not substitutes for a modern desktop. Video editing, heavy web applications, and modern gaming are impossible. If the child requires a web browser for school‑mandated online platforms, a 1 GB machine with a minimal Chromium may just suffice, but expect slow performance. The goal is not to replace a mainstream PC; it is to provide &lt;strong&gt;a first‑principles computing experience&lt;/strong&gt; that intentionally excludes the distracting parts of the internet.&lt;/p&gt;

&lt;p&gt;Also, parental involvement remains necessary. A bare Linux command line can be intimidating; the “starter card” and some pair‑programming sessions make the difference between a cherished tool and a paperweight.&lt;/p&gt;

&lt;h2&gt;Final Thoughts&lt;/h2&gt;

&lt;p&gt;The five distributions surveyed—Alpine, Puppy, Tiny Core, antiX, and SliTaz—each take a different path to the same destination: a functional, responsive, and deeply educational environment on hardware the world has abandoned. They are not toys; they are precision instruments for teaching computation from the metal up.&lt;/p&gt;

&lt;p&gt;&lt;strong style="background:#F5F6CE;"&gt;The most valuable gift you can give a curious child is not a device designed to extract their attention, but a machine that rewards it.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Repurpose an old laptop. Install one of these distributions. Hand it over with a printed Python cheat sheet and a challenge. You might be surprised how fast they outgrow the hardware—and how soon they start asking for a more powerful machine, not to play games, but to run bigger simulations.&lt;/p&gt;</content><category term="Linux"></category><category term="lightweight linux"></category><category term="old hardware"></category><category term="256 mb ram"></category><category term="512 mb ram"></category><category term="1 gb ram"></category><category term="alpine linux"></category><category term="puppy linux"></category><category term="tiny core linux"></category><category term="antix"></category><category term="slitaz"></category><category term="kids programming"></category><category term="offline workstation"></category><category term="repurposing"></category><category term="engineering education"></category></entry><entry><title>5 Reasons Most People Stick With Windows Even Though Linux Is Free</title><link href="https://mosaid.xyz/articles/5-reasons-most-people-stick-with-windows-even-though-linux-is-free-21.html" rel="alternate"></link><published>2026-06-05T21:38:30+00:00</published><updated>2026-06-05T21:38:30+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2026-06-05:/articles/5-reasons-most-people-stick-with-windows-even-though-linux-is-free-21.html</id><summary type="html">&lt;p&gt;A pragmatic, engineer's-eye breakdown of the five biggest non‑technical and technical forces that keep Windows as the dominant desktop OS, despite Linux being free. We examine software ecosystems, gaming, corporate inertia, hardware support, and the hidden cost of «free» — not to bash either platform, but to understand why the year of the Linux desktop remains a mirage.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;The Linux Paradox&lt;/h2&gt;

&lt;p&gt;Every few years the same question resurfaces somewhere on the Internet: if Linux is free, open source, highly customizable, and capable of powering everything from smartphones to supercomputers, why do most people still use Windows? The question sounds straightforward, but it contains a hidden assumption that has distorted the discussion for decades. It assumes operating systems compete primarily through technical merit. Engineers tend to think this way because engineers spend their lives comparing architectures, evaluating tradeoffs, measuring performance, and optimizing systems. The desktop market, however, has never been governed solely by engineering considerations. It is governed by institutions, habits, incentives, compatibility requirements, training pipelines, and economic forces — many of them deliberately engineered by Microsoft itself.&lt;/p&gt;

&lt;p&gt;Viewed purely as an engineering artifact, Linux is an extraordinary achievement. A collaborative development model involving thousands of contributors has produced an operating system that dominates cloud infrastructure, powers most of the Internet, runs the overwhelming majority of supercomputers, forms the foundation of Android, and serves as the backbone of modern containerized workloads. Entire industries depend on Linux. Most people interact with Linux-powered systems dozens or hundreds of times every day without realizing it. The irony is that Linux won many of the most important battles in computing while simultaneously remaining a minority platform on personal desktops — a direct result of aggressive, decades-long market manipulation.&lt;/p&gt;

&lt;p&gt;This apparent contradiction becomes easier to understand once we stop thinking about operating systems as software products and start thinking about them as ecosystems. A desktop operating system is not merely a kernel, a graphical interface, and a collection of utilities. It is an ecosystem composed of software vendors, hardware manufacturers, educational institutions, certification programs, government procurement policies, support organizations, training materials, and millions of users whose workflows evolve around a common set of assumptions. &lt;strong style="background:#F5F6CE;"&gt;Once an ecosystem reaches sufficient scale, its momentum becomes one of its most valuable assets — and Microsoft understood this earlier than anyone else.&lt;/strong&gt; At that point, the platform is no longer succeeding because of its technical characteristics alone. It succeeds because every participant reinforces the decisions made by every other participant, often in ways that were anything but accidental.&lt;/p&gt;

&lt;h2&gt;Desktop Computing Is Not a Technical Market&lt;/h2&gt;

&lt;p&gt;One of the recurring mistakes Linux enthusiasts make is assuming that most computer users evaluate operating systems the same way engineers do. They imagine a consumer comparing filesystems, package managers, security models, kernel architectures, and resource utilization before selecting the objectively superior platform. In reality, the overwhelming majority of users rarely think about operating systems at all. They think about applications. A graphic designer cares about the availability of design tools. An accountant cares about spreadsheet compatibility. A business owner cares about whether documents can be exchanged seamlessly with clients. A student cares about using the same software required by teachers and classmates. The operating system is simply the environment in which these activities occur.&lt;/p&gt;

&lt;p&gt;This distinction is critical because it explains why software ecosystems tend to dominate technical discussions. From a user's perspective, the value of an operating system is often proportional to the applications available on it. Windows spent decades accumulating commercial software vendors, enterprise customers, educational partnerships, hardware certifications, and developer mindshare — often through practices that were later ruled anticompetitive. Every new participant increased the value of the ecosystem for everyone else. Software vendors targeted Windows because customers used Windows. Customers used Windows because software vendors targeted Windows. Hardware manufacturers optimized for Windows because that is where demand existed. Demand increased because hardware compatibility was strongest on Windows. &lt;strong style="background:#F5F6CE;"&gt;The resulting feedback loop became self-reinforcing long before Linux desktop distributions matured into their current state.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This phenomenon is not unique to operating systems. Similar dynamics appear throughout technology. &lt;strong style="background:#F5F6CE;"&gt;The most widely adopted solution is not always the most elegant solution. Sometimes it is simply the solution that accumulated enough momentum early enough — and wielded enough market power ruthlessly enough — to become the default choice for everyone who arrived later.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;The Power of Defaults&lt;/h2&gt;

&lt;p&gt;Perhaps the single greatest advantage Windows possesses has nothing to do with engineering. It is distribution. &lt;strong style="background:#F5F6CE;"&gt;Most users never consciously choose Windows. The decision is made for them long before they unbox their first computer.&lt;/strong&gt; A laptop arrives with Windows preinstalled, configured, documented, and supported. The user powers it on, creates an account, and immediately begins associating that environment with the concept of personal computing itself. There is no operating system selection process. There is no comparison. There is no migration decision. There is only the continuation of the default path — a path paved with exclusive OEM agreements that Microsoft fought viciously to maintain.&lt;/p&gt;

&lt;p&gt;Engineers often underestimate how powerful default choices are because they spend much of their careers deliberately evaluating alternatives. Most people do not. Human beings are remarkably efficient at preserving familiarity. Once a workflow functions adequately, the incentive to replace it diminishes dramatically. &lt;strong style="background:#F5F6CE;"&gt;A user who has spent ten years learning keyboard shortcuts, application behavior, troubleshooting techniques, and file management habits within one ecosystem will naturally perceive switching costs even when the alternative is objectively attractive. The technical superiority of a replacement matters far less than the practical inconvenience of abandoning accumulated experience — an inconvenience Microsoft has profited from for decades.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This principle scales beyond individuals. Entire organizations exhibit the same behavior. &lt;strong style="background:#F5F6CE;"&gt;Once procedures, documentation, training materials, and support workflows are built around a platform, changing that platform becomes increasingly difficult. The operating system becomes embedded within the organization's institutional memory, locking in the status quo with a grip that even a zero-cost alternative struggles to break.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;How Governments Were Bought to Embed Windows in Education&lt;/h2&gt;

&lt;p&gt;One of the most underappreciated — and ethically troubling — contributors to Windows dominance is the direct role Microsoft played in purchasing influence within educational systems. Across much of the world, students encounter Microsoft products long before they possess enough technical knowledge to understand what an operating system is. Computer laboratories are standardized around Windows not by accident but through deliberate government procurement agreements that Microsoft lobbied for aggressively. Office productivity courses are built around Microsoft Office because educational ministries signed multi-year licensing deals that made alternatives invisible. Training materials assume Windows screenshots, Windows terminology, and Windows workflows, conditioning an entire generation before they could form their own technical preferences.&lt;/p&gt;

&lt;p&gt;This process did not emerge from free market competition. It was engineered. Microsoft invested enormous resources in government relations, offering discounted or even free software licenses to ministries of education, local authorities, and public schools. These were not charitable donations; they were calculated investments designed to turn entire national education systems into Microsoft training pipelines. Students who learn computing exclusively through Microsoft products are unlikely to question those products later. By the time they reach adulthood, years of exposure have normalized a single vendor ecosystem as the default model of computing — a model that just happens to require a paid license for the operating system and core productivity tools.&lt;/p&gt;

&lt;p&gt;&lt;strong style="background:#F5F6CE;"&gt;The result is a taxpayer-funded indoctrination program that masquerades as education.&lt;/strong&gt; Governments, often under intense lobbying pressure and the promise of short-term cost savings, lock themselves into proprietary ecosystems that then become nearly impossible to escape. Schools teach technologies that employers expect, but employers expect those technologies precisely because schools have taught nothing else for two decades. &lt;strong style="background:#F5F6CE;"&gt;The cycle continuously reinforces itself, and Microsoft sits at the center, extracting rents from a captive market it helped create.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Computer science students sometimes escape this conditioning. They encounter Linux while studying operating systems, networking, distributed systems, cloud infrastructure, security, embedded systems, or software engineering. Yet even here an interesting paradox emerges. Many graduates become comfortable administering Linux servers while continuing to use Windows on their desktops — a testament to how thoroughly the educational pipeline has divorced tool choice from technical merit.&lt;/p&gt;

&lt;h2&gt;Why Linux Won the Server but Not the Desktop&lt;/h2&gt;

&lt;p&gt;The history of Linux demonstrates an important lesson about technology adoption. &lt;strong style="background:#F5F6CE;"&gt;Systems succeed when their strengths align with the incentives of the environments in which they operate.&lt;/strong&gt; Linux became dominant in servers because server administrators value characteristics that Linux provides exceptionally well. Automation, remote administration, transparency, scriptability, reproducibility, composability, and fine-grained control are all qualities that become increasingly valuable as infrastructure grows in scale. A data center containing thousands of machines rewards very different design decisions than a laptop sitting on an office desk — and, crucially, server purchasing decisions are rarely influenced by the backroom deals that shape consumer and educational markets.&lt;/p&gt;

&lt;p&gt;&lt;strong style="background:#F5F6CE;"&gt;Desktop users face a different optimization problem — one that Microsoft has actively shaped for decades through its control of OEM channels, educational partnerships, and file format standards.&lt;/strong&gt; They care about software compatibility, hardware support, document interoperability, gaming performance, organizational requirements, and familiarity. These priorities are neither irrational nor uninformed; they are the direct consequence of an ecosystem that was deliberately closed, proprietary, and exclusionary. Engineers sometimes frame the Linux-versus-Windows debate as though one platform must be universally superior. In reality, both platforms evolved to serve different ecosystems with different expectations — but one ecosystem was built to serve users, while the other was built to serve a corporation's bottom line.&lt;/p&gt;

&lt;h2&gt;The Difference Between Engineering Merit and Market Dominance&lt;/h2&gt;

&lt;p&gt;There is a tendency among technically inclined communities to assume that market outcomes directly reflect technical merit. History repeatedly demonstrates otherwise, and Microsoft's trajectory is perhaps the clearest proof. &lt;strong style="background:#F5F6CE;"&gt;The technologies that dominate industries are often the technologies that best align with existing incentives rather than those that achieve the highest score on an engineering checklist.&lt;/strong&gt; Compatibility, timing, ecosystem size, vendor relationships — including relationships with politicians and procurement officers — institutional adoption, and user familiarity frequently outweigh architectural elegance.&lt;/p&gt;

&lt;p&gt;This observation should not be interpreted as naivety about Linux's own shortcomings, but as a clear-eyed assessment of how anticompetitive behavior warps markets. &lt;strong style="background:#F5F6CE;"&gt;Microsoft did not simply out-engineer its competition. It out-lobbied, out-negotiated, and in many cases out-manipulated it.&lt;/strong&gt; The U.S. antitrust case of the late 1990s exposed tactics like per-processor licensing fees that penalized OEMs for offering alternative operating systems, exclusive deals that shut out competitors, and deliberate API obfuscation that sabotaged interoperability. European antitrust rulings later forced Microsoft to offer browser choice screens and document format disclosures. By then, however, the ecosystem was already entrenched, and the damage to competition on the desktop was largely done.&lt;/p&gt;

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

&lt;p&gt;&lt;strong style="background:#F5F6CE;"&gt;The question was never why Linux failed to replace Windows.&lt;/strong&gt; In many of the most strategically important areas of computing, Linux has already achieved extraordinary success — often in spite of Microsoft's best efforts to undermine it. &lt;strong style="background:#F5F6CE;"&gt;The more interesting question is why desktop computing evolved differently.&lt;/strong&gt; The answer lies not in licensing costs, kernel architectures, or benchmark results but in the cumulative effect of decades of ecosystem engineering, much of it anticompetitive. Windows benefits from institutional momentum accumulated through education systems that Microsoft effectively purchased, business adoption driven by lock-in rather than choice, software availability built on exclusionary contracts, and distribution channels maintained through sheer market coercion.&lt;/p&gt;

&lt;p&gt;&lt;strong style="background:#F5F6CE;"&gt;The story of desktop operating systems is therefore not a story about which platform is technically better. It is a story about how a determined corporation captured an entire market by any means necessary — including buying influence over the very institutions that should have been teaching the next generation to think critically about technology.&lt;/strong&gt; Viewed through that lens, &lt;strong style="background:#F5F6CE;"&gt;the persistence of Windows on the desktop is not a sign of its superiority. It is a monument to the power of institutional capture, and a reminder that in technology, as in politics, the best product does not always win.&lt;/strong&gt;&lt;/p&gt;</content><category term="Linux"></category><category term="linux"></category><category term="windows"></category><category term="operating systems"></category><category term="desktop linux"></category><category term="user experience"></category><category term="software compatibility"></category><category term="productivity"></category><category term="gaming"></category><category term="enterprise IT"></category><category term="microsoft"></category></entry><entry><title>Automating Beautiful Quote Images with LaTeX and Bash</title><link href="https://mosaid.xyz/articles/automating-beautiful-quote-images-with-latex-and-bash-18.html" rel="alternate"></link><published>2026-05-02T14:48:45+00:00</published><updated>2026-05-02T14:48:45+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2026-05-02:/articles/automating-beautiful-quote-images-with-latex-and-bash-18.html</id><summary type="html">&lt;p&gt;This tutorial explains how to build a powerful Bash script that converts text into visually styled quote images using LaTeX, ImageMagick, and TikZ. It covers background rendering, Arabic support, font control, and optimized image export for social media or design workflows.&lt;/p&gt;</summary><content type="html">&lt;h1&gt;Automating Beautiful Quote Images with LaTeX and Bash&lt;/h1&gt;

&lt;p&gt;In this tutorial, we explore a powerful Bash script that transforms plain text into visually rich quote images using LaTeX, TikZ, and ImageMagick. This workflow is especially useful for developers, writers, and content creators who want full control over typography and background styling without relying on external design tools.&lt;/p&gt;

&lt;h2&gt;🧠 Overview of the Workflow&lt;/h2&gt;

&lt;p&gt;The script follows a simple pipeline:&lt;/p&gt;

&lt;p&gt;&amp;#8226; Read input text from a file&lt;/p&gt;
&lt;p&gt;&amp;#8226; Apply LaTeX formatting with custom font and spacing&lt;/p&gt;
&lt;p&gt;&amp;#8226; Render a full-page background image using TikZ&lt;/p&gt;
&lt;p&gt;&amp;#8226; Compile the document using XeLaTeX&lt;/p&gt;
&lt;p&gt;&amp;#8226; Convert the resulting PDF into a high-quality image&lt;/p&gt;

&lt;p&gt;This makes it ideal for generating consistent visual quotes or banners for blogs and social media.&lt;/p&gt;

&lt;h2&gt;⚙️ Script Breakdown&lt;/h2&gt;

&lt;h3&gt;1. Input Handling and Configuration&lt;/h3&gt;

&lt;p&gt;The script begins by validating input and allowing optional font size customization:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
  &lt;code class="language-bash"&gt;if [ -z "$1" ]; then
    echo "Usage: $0 input.txt [fontsize]"
    exit 1
fi

INPUT_FILE="$1"
FONTSIZE="${2:-82}"
BASELINE=$(($FONTSIZE + 12))
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This gives flexibility to adjust typography dynamically without modifying the script.&lt;/p&gt;

&lt;h3&gt;2. Temporary Workspace and Output Paths&lt;/h3&gt;

&lt;p&gt;A temporary working directory is created to isolate compilation files:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;WORKDIR="/tmp/latex_render_$RANDOM"
OUTPUT_DIR="$HOME/Pictures/quotes"

mkdir -p "$WORKDIR"
mkdir -p "$OUTPUT_DIR"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This ensures clean execution without cluttering the filesystem.&lt;/p&gt;

&lt;h3&gt;3. Background Image Optimization&lt;/h3&gt;

&lt;p&gt;The script processes a background image using ImageMagick:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;magick "$BG_SRC" -resize 1920x -quality 70 "$BG_OPT"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This step reduces file size while maintaining visual quality, which is important for fast rendering.&lt;/p&gt;

&lt;h3&gt;4. LaTeX Document Generation&lt;/h3&gt;

&lt;p&gt;The core of the system is dynamically generating a LaTeX file with embedded content:&lt;/p&gt;

&lt;pre class="language-latex"&gt;&lt;code class="language-latex"&gt;\documentclass[12pt,a4paper,landscape]{article}

\usepackage{tikz}
\usepackage{graphicx}
\usepackage{fontspec}
\usepackage{polyglossia}

\setmainlanguage[numerals=maghrib]{arabic}
\newfontfamily\arabicfont[Script=Arabic]{Amiri}

\AtBeginDocument{\fontsize{82}{94}\selectfont}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This setup enables:&lt;/p&gt;

&lt;p&gt;&amp;#8226; Arabic text rendering via &lt;strong&gt;polyglossia&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;#8226; Custom font support with &lt;strong&gt;Amiri&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;#8226; High-quality typography scaling&lt;/p&gt;

&lt;h3&gt;5. Full-Page Background with TikZ&lt;/h3&gt;

&lt;p&gt;The script overlays a background image across the entire page:&lt;/p&gt;

&lt;pre class="language-latex"&gt;&lt;code class="language-latex"&gt;\begin{tikzpicture}[remember picture, overlay]
  \node at (current page.center) {
    \includegraphics[width=\paperwidth,height=\paperheight]{bg.jpg}
  };
\end{tikzpicture}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This approach ensures perfect full-page coverage without external design tools.&lt;/p&gt;

&lt;h3&gt;6. Compilation and Export&lt;/h3&gt;

&lt;p&gt;The LaTeX file is compiled twice for stability:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;for i in 1 2; do
    xelatex -output-directory="$WORKDIR" "$TEX_FILE"
done
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then converted into a final optimized image:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;magick -density 150 "$PDF_FILE" \
  -resize 1920x \
  -strip -quality 85 "$IMG_FILE"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This produces a lightweight yet sharp output image suitable for publishing.&lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/latex-quote-1.jpg" alt="Auto generated quote" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Auto generated quote&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/latex-quote-2.jpg" alt="Auto generated quote" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Auto generated quote&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2&gt;The Full script&lt;/h2&gt;

&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;
#!/usr/bin/env bash

set -e

# Check argument
if [ -z &amp;quot;$1&amp;quot; ]; then
    echo &amp;quot;Usage: $0 input.txt [fontsize]&amp;quot;
    exit 1
fi

INPUT_FILE=&amp;quot;$1&amp;quot;

# Optional font size (default = 82)
FONTSIZE=&amp;quot;${2:-82}&amp;quot;
BASELINE=$(($FONTSIZE + 12))  # decent spacing

# Timestamp (unique)
TIMESTAMP=$(date +&amp;quot;%Y%m%d_%H%M%S_%N&amp;quot;)

# Paths
WORKDIR=&amp;quot;/tmp/latex_render_$RANDOM&amp;quot;
OUTPUT_DIR=&amp;quot;$HOME/Pictures/quotes&amp;quot;

mkdir -p &amp;quot;$WORKDIR&amp;quot;
mkdir -p &amp;quot;$OUTPUT_DIR&amp;quot;

TEX_FILE=&amp;quot;$WORKDIR/output.tex&amp;quot;
PDF_FILE=&amp;quot;$WORKDIR/output.pdf&amp;quot;
IMG_FILE=&amp;quot;$OUTPUT_DIR/${TIMESTAMP}.jpg&amp;quot;

# Background image (optimized copy)
BG_SRC=&amp;quot;/home/mosaid/Desktop/latex/parchment/parchment.jpg&amp;quot;
BG_OPT=&amp;quot;$WORKDIR/bg.jpg&amp;quot;

# Resize + compress background
magick &amp;quot;$BG_SRC&amp;quot; -resize 1920x -quality 70 &amp;quot;$BG_OPT&amp;quot;

# Escape LaTeX special chars (basic)
CONTENT=$(sed &amp;#x27;s/[#$%&amp;amp;_{}]/\\&amp;amp;/g&amp;#x27; &amp;quot;$INPUT_FILE&amp;quot;)

# Create LaTeX file
cat &amp;gt; &amp;quot;$TEX_FILE&amp;quot; &amp;lt;&amp;lt;EOF
\documentclass[12pt,a4paper,landscape]{article}
\usepackage[left=1cm,right=1cm,top=1cm,bottom=1cm]{geometry}

\usepackage{tikz}
\usepackage{graphicx}
\usepackage{setspace}

\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\newfontfamily\arabicfont[Script=Arabic]{Amiri}

\setstretch{1.5}
\AtBeginDocument{\fontsize{$FONTSIZE}{$BASELINE}\selectfont}

\begin{document}

\begin{tikzpicture}[remember picture, overlay]
  \node at (current page.center) {
    \includegraphics[width=\paperwidth,height=\paperheight]{$BG_OPT}
  };
\end{tikzpicture}

\begin{center}
$CONTENT
\end{center}

\end{document}
EOF

# Compile LaTeX twice (TikZ stability)
for i in 1 2; do
    echo &amp;quot;$i compilation&amp;quot;
    xelatex -output-directory=&amp;quot;$WORKDIR&amp;quot; &amp;quot;$TEX_FILE&amp;quot; &amp;gt;/dev/null
    sleep .5
done

# Convert PDF → optimized image
magick -density 150 &amp;quot;$PDF_FILE&amp;quot; \
  -resize 1920x \
  -strip -quality 85 &amp;quot;$IMG_FILE&amp;quot;

echo &amp;quot;✅ Image generated: $IMG_FILE&amp;quot;

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

&lt;h2&gt;🚀 Why This Script Is Powerful&lt;/h2&gt;

&lt;p&gt;This system combines multiple tools into a single automated pipeline:&lt;/p&gt;

&lt;p&gt;&amp;#8226; LaTeX → professional typography&lt;/p&gt;
&lt;p&gt;&amp;#8226; TikZ → precise layout control&lt;/p&gt;
&lt;p&gt;&amp;#8226; ImageMagick → image optimization&lt;/p&gt;
&lt;p&gt;&amp;#8226; Bash → full automation&lt;/p&gt;

&lt;p&gt;The result is a reproducible and scriptable design system that does not depend on GUI tools.&lt;/p&gt;

&lt;h2&gt;📌 Final Thoughts&lt;/h2&gt;

&lt;p&gt;This workflow is especially useful for generating:&lt;/p&gt;

&lt;p&gt;&amp;#8226; Inspirational quote images&lt;/p&gt;
&lt;p&gt;&amp;#8226; Blog banners&lt;/p&gt;
&lt;p&gt;&amp;#8226; Social media visuals&lt;/p&gt;
&lt;p&gt;&amp;#8226; Arabic typography designs&lt;/p&gt;

&lt;p&gt;With small adjustments, this script can evolve into a full content generation engine for visual storytelling.&lt;/p&gt;</content><category term="Linux"></category><category term="bash"></category><category term="latex"></category><category term="imagemagick"></category><category term="tikz"></category><category term="automation"></category><category term="linux"></category><category term="scripting"></category><category term="image-generation"></category><category term="typography"></category><category term="xelatex"></category></entry><entry><title>Smart Brightness Control in Linux: Auto-Detect and Manage Backlight Like a Pro</title><link href="https://mosaid.xyz/articles/smart-brightness-control-in-linux--auto-detect-and-manage-backlight-like-a-pro-17.html" rel="alternate"></link><published>2026-04-28T21:02:10+00:00</published><updated>2026-04-28T21:02:10+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2026-04-28:/articles/smart-brightness-control-in-linux--auto-detect-and-manage-backlight-like-a-pro-17.html</id><summary type="html">&lt;p&gt;Learn how to build a smart Bash script that automatically detects and controls the correct brightness interface on Linux systems, with verbose debugging and multi-device support.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Managing screen brightness on Linux sounds trivial… until you realize your system exposes &lt;strong&gt;multiple brightness interfaces&lt;/strong&gt; and only one of them actually works correctly.&lt;/p&gt;

&lt;p&gt;I’ve personally run into systems where writing to &lt;code&gt;/sys/class/backlight/acpi_video0/brightness&lt;/code&gt; does absolutely nothing, while another hidden interface works perfectly.&lt;/p&gt;

&lt;p&gt;So instead of guessing every time, I built a &lt;strong&gt;smart brightness script&lt;/strong&gt; that:&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Automatically detects the correct device&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Ignores broken or misleading interfaces&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Provides verbose debugging output&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Supports get / set / increment / decrement&lt;/strong&gt;&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;🧠 Understanding the Problem&lt;/h2&gt;

&lt;p&gt;Linux exposes brightness controls through &lt;code&gt;/sys&lt;/code&gt;, typically under:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
/sys/class/backlight/
/sys/class/leds/
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The issue? You might see something like:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
/sys/class/backlight/intel_backlight
/sys/class/backlight/acpi_video0
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But only one of them actually controls your screen.&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;intel_backlight&lt;/strong&gt; → usually correct (GPU native)&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;acpi_video0&lt;/strong&gt; → often fake or limited&lt;/p&gt;

&lt;p&gt;This is why hardcoding paths is a bad idea.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;⚙️ The Smart Brightness Script&lt;/h2&gt;

&lt;p&gt;Here’s the full script I use. It automatically detects the best interface and gives you detailed output when needed.&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
#!/usr/bin/env bash

set -euo pipefail

STEP=5
VERBOSE=0

log() {
    [[ $VERBOSE -eq 1 ]] &amp;amp;&amp;amp; echo "[brightness] $*" &amp;gt;&amp;amp;2
}

percent_to_raw() {
    local percent=$1 max=$2
    echo $(( percent * max / 100 ))
}

raw_to_percent() {
    local val=$1 max=$2
    echo $(( val * 100 / max ))
}

get_candidates() {
    local d

    for d in /sys/class/backlight/*; do
        [[ -d "$d" &amp;amp;&amp;amp; -f "$d/brightness" &amp;amp;&amp;amp; -f "$d/max_brightness" ]] &amp;amp;&amp;amp; echo "$d"
    done

    for d in /sys/class/leds/*; do
        [[ -f "$d/brightness" &amp;amp;&amp;amp; -f "$d/max_brightness" ]] &amp;amp;&amp;amp; echo "$d"
    done
}

detect_device() {
    mapfile -t candidates &amp;lt; &amp;lt;(get_candidates)

    [[ ${#candidates[@]} -eq 0 ]] &amp;amp;&amp;amp; return 1

    log "Found ${#candidates[@]} candidates:"
    for d in "${candidates[@]}"; do
        log "  - $d"
    done

    for d in "${candidates[@]}"; do
        if [[ "$d" == *intel_backlight* || "$d" == *amdgpu* ]]; then
            log "Selected (GPU native): $d"
            echo "$d"
            return
        fi
    done

    for d in "${candidates[@]}"; do
        if [[ "$d" != *acpi_video* ]]; then
            log "Selected (non-ACPI fallback): $d"
            echo "$d"
            return
        fi
    done

    log "Selected (last resort): ${candidates[0]}"
    echo "${candidates[0]}"
}

get_brightness() {
    local dev=$1
    local val max percent

    val=$(&amp;lt;"$dev/brightness")
    max=$(&amp;lt;"$dev/max_brightness")
    percent=$(raw_to_percent "$val" "$max")

    echo "Device: $dev"
    echo "Raw: $val / $max"
    echo "Brightness: ${percent}%"
}

set_brightness() {
    local dev=$1 percent=$2
    local max raw

    max=$(&amp;lt;"$dev/max_brightness")
    raw=$(percent_to_raw "$percent" "$max")

    log "Writing $raw to $dev/brightness (=${percent}%)"
    echo "$raw" | sudo tee "$dev/brightness" &amp;gt;/dev/null

    [[ $VERBOSE -eq 1 ]] &amp;amp;&amp;amp; get_brightness "$dev"
}

list_devices() {
    local d val max percent

    mapfile -t candidates &amp;lt; &amp;lt;(get_candidates)

    [[ ${#candidates[@]} -eq 0 ]] &amp;amp;&amp;amp; {
        echo "No brightness devices found"
        exit 1
    }

    for d in "${candidates[@]}"; do
        val=$(&amp;lt;"$d/brightness")
        max=$(&amp;lt;"$d/max_brightness")
        percent=$(raw_to_percent "$val" "$max")

        echo "$d"
        echo "  Raw: $val / $max"
        echo "  Brightness: ${percent}%"
        echo
    done
}

main() {
    local cmd="get"

    if [[ "${1:-}" == "-v" ]]; then
        VERBOSE=1
        shift
    fi

    cmd=${1:-get}
    shift || true

    case "$cmd" in
        list)
            list_devices
            return
            ;;
    esac

    local dev
    dev=$(detect_device) || {
        echo "No brightness device found"
        exit 1
    }

    case "$cmd" in
        get)
            get_brightness "$dev"
            ;;
        set)
            [[ $# -lt 1 ]] &amp;amp;&amp;amp; { echo "Usage: $0 set &amp;lt;percent&amp;gt;"; exit 1; }
            set_brightness "$dev" "$1"
            ;;
        inc)
            local cur
            cur=$(raw_to_percent "$(&amp;lt;"$dev/brightness")" "$(&amp;lt;"$dev/max_brightness")")
            set_brightness "$dev" $(( cur + STEP ))
            ;;
        dec)
            local cur
            cur=$(raw_to_percent "$(&amp;lt;"$dev/brightness")" "$(&amp;lt;"$dev/max_brightness")")
            set_brightness "$dev" $(( cur - STEP ))
            ;;
        *)
            echo "Usage: $0 [-v] {get|set &amp;lt;n&amp;gt;|inc|dec|list}"
            exit 1
            ;;
    esac
}

main "$@"
&lt;/code&gt;&lt;/pre&gt;

&lt;hr&gt;

&lt;h2&gt;⚡ Usage Examples&lt;/h2&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Check current brightness&lt;/strong&gt;&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
./brightness.sh get
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Enable verbose debugging&lt;/strong&gt;&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
./brightness.sh -v get
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Set brightness to 50%&lt;/strong&gt;&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
./brightness.sh set 50
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Increment / decrement&lt;/strong&gt;&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
./brightness.sh inc
./brightness.sh dec
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;List all detected devices&lt;/strong&gt;&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
./brightness.sh list
&lt;/code&gt;&lt;/pre&gt;

&lt;hr&gt;

&lt;h2&gt;🔐 Optional: Remove the Need for sudo&lt;/h2&gt;

&lt;p&gt;You can allow brightness control without sudo using a udev rule:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
echo 'ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chmod 666 /sys/class/backlight/%k/brightness"' | sudo tee /etc/udev/rules.d/90-backlight.rules
&lt;/code&gt;&lt;/pre&gt;

&lt;hr&gt;

&lt;h2&gt;🧠 Final Thoughts&lt;/h2&gt;

&lt;p&gt;What I like about this approach is that it’s &lt;strong&gt;portable, predictable, and transparent&lt;/strong&gt;. Instead of relying on desktop environments or external tools, you get direct control over the kernel interface.&lt;/p&gt;

&lt;p&gt;And more importantly—you always know &lt;strong&gt;which device is actually being used&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you’re the kind of user who lives in the terminal or runs minimal setups like i3 or sway, this kind of script becomes essential.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;🚀 Next Steps&lt;/h2&gt;

&lt;p&gt;If you want to push this further, here are some ideas:&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Bind it to XF86 brightness keys&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Add smooth fade transitions&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Cache the detected device for faster execution&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Add external monitor support via ddcutil&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once you start owning your system at this level, going back to GUI sliders feels… limiting.&lt;/p&gt;</content><category term="Linux"></category><category term="linux"></category><category term="brightness"></category><category term="backlight"></category><category term="bash"></category><category term="scripting"></category><category term="sysfs"></category><category term="cli"></category><category term="power-users"></category><category term="automation"></category></entry><entry><title>Supercharging Zsh: Practical Functions and Keybindings for Power Users</title><link href="https://mosaid.xyz/articles/supercharging-zsh--practical-functions-and-keybindings-for-power-users-16.html" rel="alternate"></link><published>2026-04-25T22:45:50+00:00</published><updated>2026-04-25T22:45:50+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2026-04-25:/articles/supercharging-zsh--practical-functions-and-keybindings-for-power-users-16.html</id><summary type="html">&lt;p&gt;A deep dive into real-world Zsh functions, keybindings, and workflows that turn your shell into a powerful, efficient environment for advanced users.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;
If you're already using Zsh with Oh My Zsh, you're past the beginner stage. The real gains come from bending the shell to your workflow.
In this guide, I walk through a set of practical functions and keybindings from my own &lt;code&gt;.zshrc&lt;/code&gt; that significantly improve navigation, history usage, and editing efficiency.
&lt;/p&gt;

&lt;p&gt;
These are not gimmicks — they solve real friction points in daily terminal usage.
&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;1. Ranger-Powered Directory Switching (Ctrl+O)&lt;/h2&gt;

&lt;p&gt;
Switching directories is something you do constantly. Typing paths is slow. Even tab completion gets in the way when navigating deep trees.
&lt;/p&gt;

&lt;p&gt;
This function uses &lt;strong&gt;ranger&lt;/strong&gt; as an interactive directory selector:
&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
rrcd () {
    tmp="$(mktemp)"
    ranger --choosedir="$tmp"
    if [ -f "$tmp" ]; then
        dir="$(cat "$tmp")"
        rm -f "$tmp"
        [ -d "$dir" ] &amp;amp;&amp;amp; [ "$dir" != "$(pwd)" ] &amp;amp;&amp;amp; cd "$dir"
    fi
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Why it matters:&lt;/strong&gt; You get a full-screen file browser to jump anywhere instantly.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Bound to:&lt;/strong&gt; Ctrl+O&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
bindkey -s '^o' 'rrcd\n'
&lt;/code&gt;&lt;/pre&gt;

&lt;hr&gt;

&lt;h2&gt;2. Edit Command Line in Vim (Ctrl+E)&lt;/h2&gt;

&lt;p&gt;
Long commands are painful to edit inline. This solves it by opening your current command in Neovim:
&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
autoload edit-command-line; zle -N edit-command-line
bindkey '^e' edit-command-line
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Why it matters:&lt;/strong&gt; You get full Vim motions, search, macros — not just arrow keys.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;3. Smarter History with FZF&lt;/h2&gt;

&lt;h3&gt;Ctrl+R — Fuzzy Search History&lt;/h3&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
bindkey "^R" fzf-history-widget
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#8226; Ranking by relevance&lt;/p&gt;
&lt;p&gt;&amp;#8226; Full preview of matches&lt;/p&gt;
&lt;p&gt;&amp;#8226; Instant filtering&lt;/p&gt;

&lt;h3&gt;Directory Jump from History (Ctrl+S / Ctrl+A)&lt;/h3&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
fzf-cd-history() {
  local dir
  dir=$(fc -ln 1 | tac | grep --color=never '^cd ' | sed 's/^cd //' | \
        fzf --height 40% --cycle)

  if [[ -d "$dir" ]]; then
    cd "$dir"
  else
    local base="${dir##*/}"
    dir=$( (find ~ -type d -name "$base" 2&amp;gt;/dev/null) | \
          fzf --height 40% --cycle --no-sort --tac \
              --bind "change:reload(find ~ -type d -name '$base' 2&amp;gt;/dev/null || echo 'No results')" \
              --phony --header="Looking for '$base'..." )

    [[ -n "$dir" &amp;amp;&amp;amp; "$dir" != "Searching for directories"* ]] &amp;amp;&amp;amp; cd "$dir"
  fi
  zle reset-prompt
}
&lt;/code&gt;&lt;/pre&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
bindkey '^S' fzf-cd-history
bindkey '^A' fzf-cd-history
&lt;/code&gt;&lt;/pre&gt;

&lt;hr&gt;

&lt;h2&gt;4. Open Recent Files from Vim History (Ctrl+V)&lt;/h2&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
fzf-vim-history() {
  local file
  local files

  files=$(
    {
      nvim --headless +'lua for _,f in ipairs(vim.v.oldfiles) do print(f) end' +q 2&amp;gt;&amp;amp;1
    } | tr -d '\r' | awk '!seen[$0]++'
  )

  file=$(printf '%s\n' "$files" | fzf --no-sort --height 40% --cycle)

  if [[ -n "$file" ]]; then
    LBUFFER="v \"$file\""
    zle reset-prompt
  fi
}
&lt;/code&gt;&lt;/pre&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
bindkey '^V' fzf-vim-history
&lt;/code&gt;&lt;/pre&gt;

&lt;hr&gt;

&lt;h2&gt;5. Instant Sudo Toggle (Double ESC)&lt;/h2&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
sudo-command-line() {
    [[ -z $BUFFER ]] &amp;amp;&amp;amp; zle up-history
    if [[ $BUFFER == sudo\ * ]]; then
        LBUFFER="${LBUFFER#sudo }"
    else
        LBUFFER="sudo $LBUFFER"
    fi
}
zle -N sudo-command-line
bindkey "\e\e" sudo-command-line
&lt;/code&gt;&lt;/pre&gt;

&lt;hr&gt;

&lt;h2&gt;6. High-Performance History Configuration&lt;/h2&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
HISTSIZE=999999999
SAVEHIST=$HISTSIZE

setopt APPEND_HISTORY
setopt SHARE_HISTORY
setopt HIST_IGNORE_DUPS
setopt HIST_REDUCE_BLANKS
setopt HIST_IGNORE_SPACE
setopt HIST_NO_STORE
setopt HIST_SAVE_NO_DUPS
setopt HIST_EXPIRE_DUPS_FIRST
&lt;/code&gt;&lt;/pre&gt;

&lt;hr&gt;

&lt;h2&gt;7. Completion System Tuning&lt;/h2&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}'
zstyle ':completion:*' menu select=long
zstyle ':completion:*' verbose true
&lt;/code&gt;&lt;/pre&gt;

&lt;hr&gt;

&lt;h2&gt;8. Subtle UX Improvements&lt;/h2&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
bindkey '^[[1;5C' forward-word
bindkey '^[[1;5D' backward-word
bindkey "^[[A" history-search-backward
bindkey "^[[B" history-search-forward
&lt;/code&gt;&lt;/pre&gt;

&lt;hr&gt;

&lt;h2&gt;9. Notes Injection Before Commands&lt;/h2&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
my_preexec() {
    if [[ "$1" != "cat $HOME/.todo"* ]]; then
        [[ -f "$HOME/.todo" ]] &amp;amp;&amp;amp; cat "$HOME/.todo"
    fi
}
&lt;/code&gt;&lt;/pre&gt;

&lt;hr&gt;

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

&lt;p&gt;
This setup works because it removes friction:
&lt;/p&gt;

&lt;p&gt;&amp;#8226; Navigation becomes interactive&lt;/p&gt;
&lt;p&gt;&amp;#8226; History becomes searchable&lt;/p&gt;
&lt;p&gt;&amp;#8226; Editing becomes programmable&lt;/p&gt;

&lt;p&gt;
The shell stops being a command runner and becomes a real interface.
&lt;/p&gt;</content><category term="Linux"></category><category term="zsh"></category><category term="linux"></category><category term="shell"></category><category term="productivity"></category><category term="vim"></category><category term="fzf"></category><category term="terminal"></category><category term="power-users"></category></entry><entry><title>Automating Video Speed-Up and Audio Replacement with FFmpeg and Bash</title><link href="https://mosaid.xyz/articles/automating-video-speed-up-and-audio-replacement-with-ffmpeg-and-bash-15.html" rel="alternate"></link><published>2026-04-24T00:19:42+00:00</published><updated>2026-04-24T00:19:42+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2026-04-24:/articles/automating-video-speed-up-and-audio-replacement-with-ffmpeg-and-bash-15.html</id><summary type="html">&lt;p&gt;Learn how to build a powerful Bash script to automate video speed-up, remove original audio, and merge custom looping audio using FFmpeg, with practical explanations and improvements for power users.&lt;/p&gt;</summary><content type="html">&lt;p&gt;In this tutorial, we are not just writing a quick script — we are building a reusable video processing workflow around &lt;strong&gt;FFmpeg&lt;/strong&gt; and Bash.&lt;/p&gt;

&lt;p&gt;The goal is simple on the surface:&lt;/p&gt;

&lt;p&gt;&amp;#8226; Speed up a video&lt;/p&gt;
&lt;p&gt;&amp;#8226; Remove its original audio&lt;/p&gt;
&lt;p&gt;&amp;#8226; Replace it with a looping background track&lt;/p&gt;

&lt;p&gt;But instead of treating this as a one-off command, we will break down the &lt;strong&gt;why&lt;/strong&gt;, the &lt;strong&gt;mechanics&lt;/strong&gt;, and the &lt;strong&gt;trade-offs&lt;/strong&gt;, so you can extend this into your own pipelines.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;1. The Complete Script&lt;/h2&gt;

&lt;p&gt;Let’s start with the full working version:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;
#!/bin/bash

set -e

INPUT="$1"
SPEED_FACTOR="${2:-3}"

if [ -z "$INPUT" ]; then
    echo "Usage: $0 input_video.mkv [speed]"
    exit 1
fi

AUDIO_DIR="/home/mosaid/Documents/audio"

echo "Available audio files:"
mapfile -t AUDIO_FILES &amp;lt;&amp;lt;(find "$AUDIO_DIR" -maxdepth 1 -type f -name "*.mp3")

if [ ${#AUDIO_FILES[@]} -eq 0 ]; then
    echo "No mp3 files found."
    exit 1
fi

for i in "${!AUDIO_FILES[@]}"; do
    echo "$((i+1))) $(basename "${AUDIO_FILES[$i]}")"
done

read -rp "Choose an audio file: " AUDIO_CHOICE

AUDIO="${AUDIO_FILES[$((AUDIO_CHOICE-1))]}"

BASENAME="$(basename "${INPUT%.*}")"
MUTED="$(mktemp --suffix=.mp4)"
SPEED="$(mktemp --suffix=.mp4)"
FINAL="${BASENAME}-final.mp4"

ffmpeg -y -i "$INPUT" -c:v copy -an "$MUTED"

ffmpeg -y -i "$MUTED" -filter:v "setpts=PTS/${SPEED_FACTOR}" "$SPEED"

ffmpeg -y -stream_loop -1 -i "$AUDIO" -i "$SPEED" -shortest \
  -map 1:v -map 0:a -c:v copy -c:a aac "$FINAL"

rm -f "$MUTED" "$SPEED"

echo "Output: $FINAL"
    &lt;/code&gt;
&lt;/pre&gt;

&lt;hr&gt;

&lt;h2&gt;2. Understanding the Pipeline&lt;/h2&gt;

&lt;p&gt;This script is intentionally split into &lt;strong&gt;three distinct FFmpeg passes&lt;/strong&gt;. That is not accidental.&lt;/p&gt;

&lt;p&gt;&amp;#8226; Pass 1 → Strip audio&lt;/p&gt;
&lt;p&gt;&amp;#8226; Pass 2 → Modify video timing&lt;/p&gt;
&lt;p&gt;&amp;#8226; Pass 3 → Rebuild final container&lt;/p&gt;

&lt;p&gt;This separation keeps each step &lt;strong&gt;predictable&lt;/strong&gt; and avoids subtle FFmpeg sync issues that often appear in one-liners.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;3. Why We Remove Audio First&lt;/h2&gt;

&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;
ffmpeg -y -i "$INPUT" -c:v copy -an "$MUTED"
    &lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;-c:v copy&lt;/strong&gt; → No re-encoding (this is critical for performance)&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;-an&lt;/strong&gt; → Drop all audio streams&lt;/p&gt;

&lt;p&gt;Why do this first?&lt;/p&gt;

&lt;p&gt;&amp;#8226; It guarantees a clean base (no leftover streams)&lt;/p&gt;
&lt;p&gt;&amp;#8226; It avoids audio/video desync after time manipulation&lt;/p&gt;
&lt;p&gt;&amp;#8226; It keeps the pipeline deterministic&lt;/p&gt;

&lt;p&gt;Power-user insight:&lt;/p&gt;

&lt;p&gt;If you skip this step and try to manipulate both streams at once, FFmpeg may keep timestamps that no longer align.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;4. The Core Concept: setpts&lt;/h2&gt;

&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;
ffmpeg -y -i "$MUTED" -filter:v "setpts=PTS/${SPEED_FACTOR}" "$SPEED"
    &lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;This is the heart of the script.&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;PTS&lt;/strong&gt; = Presentation Timestamp&lt;/p&gt;
&lt;p&gt;&amp;#8226; Every frame has a timestamp that determines when it is displayed&lt;/p&gt;

&lt;p&gt;When you write:&lt;/p&gt;

&lt;p&gt;&amp;#8226; &lt;code&gt;PTS/3&lt;/code&gt; → Frames are shown 3× faster&lt;/p&gt;
&lt;p&gt;&amp;#8226; &lt;code&gt;PTS*2&lt;/code&gt; → Frames are shown slower&lt;/p&gt;

&lt;p&gt;So we are not "dropping frames" or "changing FPS" — we are modifying &lt;strong&gt;time itself&lt;/strong&gt; at the container level.&lt;/p&gt;

&lt;p&gt;This is why the operation is both:&lt;/p&gt;

&lt;p&gt;&amp;#8226; Efficient&lt;/p&gt;
&lt;p&gt;&amp;#8226; Precise&lt;/p&gt;

&lt;hr&gt;

&lt;h3&gt;Advanced Note&lt;/h3&gt;

&lt;p&gt;If you wanted to also adjust audio speed (instead of replacing it), you would need:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;
-filter:a "atempo=2.0"
    &lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;But here we intentionally discard audio entirely, which simplifies everything.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;5. Looping Audio Without Guessing Duration&lt;/h2&gt;

&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;
ffmpeg -y -stream_loop -1 -i "$AUDIO" -i "$SPEED" -shortest \
  -map 1:v -map 0:a -c:v copy -c:a aac "$FINAL"
    &lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;This is a very clean pattern that many people overlook.&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;-stream_loop -1&lt;/strong&gt; → Infinite loop&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;-shortest&lt;/strong&gt; → Output stops when video ends&lt;/p&gt;

&lt;p&gt;This avoids:&lt;/p&gt;

&lt;p&gt;&amp;#8226; Manually trimming audio&lt;/p&gt;
&lt;p&gt;&amp;#8226; Calculating durations&lt;/p&gt;
&lt;p&gt;&amp;#8226; Writing fragile logic&lt;/p&gt;

&lt;hr&gt;

&lt;h3&gt;Stream Mapping (Important)&lt;/h3&gt;

&lt;p&gt;&amp;#8226;&lt;code&gt;-map 1:v&lt;/code&gt; → Take video from second input&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;code&gt;-map 0:a&lt;/code&gt; → Take audio from first input&lt;/p&gt;

&lt;p&gt;Without this, FFmpeg may choose streams implicitly — which is unreliable in automation scripts.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;6. Temporary Files Strategy&lt;/h2&gt;

&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;
MUTED="$(mktemp --suffix=.mp4)"
SPEED="$(mktemp --suffix=.mp4)"
    &lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;Using &lt;code&gt;mktemp&lt;/code&gt; instead of fixed filenames is a small but important detail:&lt;/p&gt;

&lt;p&gt;&amp;#8226; Prevents collisions&lt;/p&gt;
&lt;p&gt;&amp;#8226; Makes the script safe for parallel execution&lt;/p&gt;
&lt;p&gt;&amp;#8226; Avoids accidental overwrites&lt;/p&gt;

&lt;p&gt;This is one of those habits that separates quick scripts from robust tooling.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;7. Interactive Selection vs Automation&lt;/h2&gt;

&lt;p&gt;The script uses:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;
mapfile -t AUDIO_FILES  &amp;lt;&amp;lt;(find "$AUDIO_DIR" -name "*.mp3")
    &lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;This is simple and portable — but not optimal for heavy usage.&lt;/p&gt;

&lt;h3&gt;Upgrade: fzf Integration&lt;/h3&gt;

&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;
AUDIO=$(find "$AUDIO_DIR" -type f -name "*.mp3" | fzf)
    &lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;&amp;#8226; Instant fuzzy search&lt;/p&gt;
&lt;p&gt;&amp;#8226; No manual indexing&lt;/p&gt;
&lt;p&gt;&amp;#8226; Better UX for large libraries&lt;/p&gt;

&lt;p&gt;This is the kind of improvement power users appreciate immediately.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;8. Performance Considerations&lt;/h2&gt;

&lt;p&gt;This pipeline is efficient because:&lt;/p&gt;

&lt;p&gt;&amp;#8226; No video re-encoding (stream copy)&lt;/p&gt;
&lt;p&gt;&amp;#8226; Only one transformation step (PTS)&lt;/p&gt;
&lt;p&gt;&amp;#8226; Lightweight final muxing&lt;/p&gt;

&lt;p&gt;However:&lt;/p&gt;

&lt;p&gt;&amp;#8226; The &lt;code&gt;setpts&lt;/code&gt; step &lt;strong&gt;does require re-encoding&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;#8226; That is unavoidable when modifying timestamps&lt;/p&gt;

&lt;p&gt;If performance becomes critical, you can:&lt;/p&gt;

&lt;p&gt;&amp;#8226; Use hardware acceleration (VAAPI / NVENC)&lt;/p&gt;
&lt;p&gt;&amp;#8226; Lower resolution before processing&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;9. Turning This Into a Real Tool&lt;/h2&gt;

&lt;p&gt;Right now, this is a script. With small changes, it becomes a proper CLI utility:&lt;/p&gt;

&lt;p&gt;&amp;#8226; Add flags (-i, -s, -a)&lt;/p&gt;
&lt;p&gt;&amp;#8226; Add logging&lt;/p&gt;
&lt;p&gt;&amp;#8226; Add dry-run mode&lt;/p&gt;
&lt;p&gt;&amp;#8226; Add batch processing&lt;/p&gt;

&lt;p&gt;Example batch usage:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;
for f in *.mkv; do
    ./process.sh "$f" 2
done
    &lt;/code&gt;
&lt;/pre&gt;

&lt;hr&gt;

&lt;h2&gt;10. Where This Fits in Real Workflows&lt;/h2&gt;

&lt;p&gt;This pattern is surprisingly useful:&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Lecture acceleration:&lt;/strong&gt; compress hours into minutes&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Content pipelines:&lt;/strong&gt; generate background visuals&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Automation:&lt;/strong&gt; integrate with cron or systemd&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Media cleanup:&lt;/strong&gt; replace poor audio tracks&lt;/p&gt;

&lt;p&gt;And more importantly:&lt;/p&gt;

&lt;p&gt;&amp;#8226; It composes well with other Unix tools&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;Final Thoughts&lt;/h2&gt;

&lt;p&gt;The real takeaway here is not the script itself — it is the approach:&lt;/p&gt;

&lt;p&gt;&amp;#8226; Break pipelines into deterministic steps&lt;/p&gt;
&lt;p&gt;&amp;#8226; Understand what FFmpeg is doing internally&lt;/p&gt;
&lt;p&gt;&amp;#8226; Prefer explicit mapping and control&lt;/p&gt;

&lt;p&gt;Once you think this way, FFmpeg stops being a "command generator" and becomes a &lt;strong&gt;reliable building block&lt;/strong&gt; in your system.&lt;/p&gt;

&lt;p&gt;From here, you can extend this into a full automation pipeline, integrate it into your desktop workflow, or even expose it as a service.&lt;/p&gt;</content><category term="Linux"></category><category term="ffmpeg"></category><category term="bash"></category><category term="scripting"></category><category term="linux"></category><category term="video-processing"></category><category term="automation"></category><category term="cli"></category><category term="power-users"></category></entry><entry><title>From Terminal to Desktop: Sticky Todo Reminders with Cron, systemd &amp; Conky</title><link href="https://mosaid.xyz/articles/from-terminal-to-desktop--sticky-todo-reminders-with-cron,-systemd-&amp;-conky-14.html" rel="alternate"></link><published>2026-04-19T12:12:38+00:00</published><updated>2026-04-19T12:12:38+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2026-04-19:/articles/from-terminal-to-desktop--sticky-todo-reminders-with-cron,-systemd-&amp;-conky-14.html</id><summary type="html">&lt;p&gt;Upgrade your terminal reminder system by combining cron, systemd user services, and Conky to display sticky desktop todo notes automatically.&lt;/p&gt;</summary><content type="html">&lt;p&gt;In the previous tutorial, I built a minimal terminal-based reminder system using cron and a simple &lt;code&gt;.todo&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Now, let’s take it further.&lt;/p&gt;

&lt;p&gt;In this guide, I’ll turn that idea into a &lt;strong&gt;desktop-integrated reminder system&lt;/strong&gt; using:&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Cron:&lt;/strong&gt; to generate reminders&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;systemd (user):&lt;/strong&gt; to monitor tasks&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Conky:&lt;/strong&gt; to display sticky notes on your desktop&lt;/p&gt;

&lt;p&gt;This creates a lightweight, always-visible reminder system—without relying on heavy applications.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;💡 Architecture Overview&lt;/h2&gt;

&lt;p&gt;The system works like this:&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Cron:&lt;/strong&gt; writes reminders to &lt;code&gt;~/.todo&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;systemd user service:&lt;/strong&gt; checks if tasks exist&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Conky:&lt;/strong&gt; displays them as sticky notes&lt;/p&gt;

&lt;p&gt;Everything stays simple, modular, and hackable.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;📁 Step 1: Base Todo System (Recap)&lt;/h2&gt;

&lt;p&gt;Create the file:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
   &lt;code class="language-bash"&gt;
touch ~/.todo
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Add a weekly cron job:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
   &lt;code class="language-bash"&gt;
crontab -e
&lt;/code&gt;&lt;/pre&gt;

&lt;pre class="language-bash"&gt;
   &lt;code class="language-bash"&gt;
0 9 * * 1 echo "$(date '+%F %R') - Run sudo pacman -Syu" &amp;gt;&amp;gt; /home/mosaid/.todo
&lt;/code&gt;&lt;/pre&gt;

&lt;hr&gt;

&lt;h2&gt;⚙️ Step 2: Create a systemd User Service&lt;/h2&gt;

&lt;p&gt;We now create a service that checks if the todo file has content.&lt;/p&gt;

&lt;p&gt;Create the file:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
   &lt;code class="language-bash"&gt;
mkdir -p ~/.config/systemd/user
vim ~/.config/systemd/user/todo-check.service
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Content:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
   &lt;code class="language-bash"&gt;
[Unit]
Description=Check TODO file and trigger display

[Service]
Type=oneshot
ExecStart=/usr/bin/bash -c '[ -s /home/mosaid/.todo ]'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This simply checks if the file is non-empty.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;⏱️ Step 3: Add a systemd Timer&lt;/h2&gt;

&lt;p&gt;Create a timer that runs every few minutes:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
   &lt;code class="language-bash"&gt;
vim ~/.config/systemd/user/todo-check.timer
&lt;/code&gt;&lt;/pre&gt;

&lt;pre class="language-bash"&gt;
   &lt;code class="language-bash"&gt;
[Unit]
Description=Run TODO check every 5 minutes

[Timer]
OnBootSec=1min
OnUnitActiveSec=5min

[Install]
WantedBy=timers.target
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Enable it:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
   &lt;code class="language-bash"&gt;
systemctl --user daemon-reexec
systemctl --user enable --now todo-check.timer
&lt;/code&gt;&lt;/pre&gt;

&lt;hr&gt;

&lt;h2&gt;🖥️ Step 4: Conky Sticky Notes&lt;/h2&gt;

&lt;p&gt;This is where things become visual.&lt;/p&gt;

&lt;p&gt;Create a Conky config:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
   &lt;code class="language-bash"&gt;
mkdir -p ~/.config/conky
vim ~/.config/conky/todo.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;pre class="language-bash"&gt;
   &lt;code class="language-bash"&gt;
conky.config = {
    alignment = 'top_right',
    gap_x = 20,
    gap_y = 50,
    background = true,
    double_buffer = true,
    own_window = true,
    own_window_type = 'desktop',
    own_window_transparent = true,
    use_xft = true,
    font = 'DejaVu Sans Mono:size=10',
    update_interval = 5,
};

conky.text = [[
${color cyan}---- TODO ----${color}
${execi 5 tail -n 10 /home/mosaid/.todo}
]];
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Run it:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
   &lt;code class="language-bash"&gt;
conky -c ~/.config/conky/todo.conf &amp;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You now have a &lt;strong&gt;live sticky todo list on your desktop&lt;/strong&gt;.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;✨ Step 5: Improve Visibility&lt;/h2&gt;

&lt;p&gt;Add colors and formatting:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
   &lt;code class="language-bash"&gt;
${color green}${time %Y-%m-%d}${color}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Or highlight updates:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
   &lt;code class="language-bash"&gt;
${execi 5 grep --color=always pacman /home/mosaid/.todo}
&lt;/code&gt;&lt;/pre&gt;

&lt;hr&gt;

&lt;h2&gt;🧠 Optional: Auto-Hide When Empty&lt;/h2&gt;

&lt;p&gt;You can extend the systemd service to kill Conky if no tasks exist:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
   &lt;code class="language-bash"&gt;
ExecStart=/usr/bin/bash -c '[ -s ~/.todo ] || pkill conky'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And restart it when tasks appear.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;🚀 Extensions&lt;/h2&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Multiple todo files:&lt;/strong&gt; work, personal, system&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Git sync:&lt;/strong&gt; share reminders across machines&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Notifications:&lt;/strong&gt; integrate with notify-send&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Conky themes:&lt;/strong&gt; match your desktop style&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;⚖️ Why This Setup is Powerful&lt;/h2&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Persistent:&lt;/strong&gt; visible on desktop at all times&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Lightweight:&lt;/strong&gt; near-zero resource usage&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Modular:&lt;/strong&gt; each component is independent&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Fully controllable:&lt;/strong&gt; no black boxes&lt;/p&gt;

&lt;p&gt;This is the kind of system that scales with your needs.&lt;/p&gt;

&lt;hr&gt;

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

&lt;p&gt;You’ve now transformed a simple terminal trick into a fully integrated desktop reminder system.&lt;/p&gt;

&lt;p&gt;It respects the Unix philosophy while giving you a modern workflow.&lt;/p&gt;

&lt;p&gt;Small tools. Big control.&lt;/p&gt;

&lt;hr&gt;</content><category term="Linux"></category><category term="arch linux"></category><category term="cron"></category><category term="systemd"></category><category term="conky"></category><category term="linux desktop"></category><category term="automation"></category><category term="shell productivity"></category><category term="todo system"></category></entry><entry><title>Build a Zero-Dependency Terminal Reminder System (Cron + Shell)</title><link href="https://mosaid.xyz/articles/build-a-zero-dependency-terminal-reminder-system-(cron-+-shell)-13.html" rel="alternate"></link><published>2026-04-19T11:52:30+00:00</published><updated>2026-04-19T11:52:30+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2026-04-19:/articles/build-a-zero-dependency-terminal-reminder-system-(cron-+-shell)-13.html</id><summary type="html">&lt;p&gt;Learn how to build a lightweight terminal-based reminder system using cron and your shell. No dependencies, no GUI—just pure Linux efficiency.&lt;/p&gt;</summary><content type="html">&lt;p&gt;As Linux users, we often rely on heavy tools for things that could be solved with a few lines of shell. In this tutorial, I’ll show you how I built a &lt;strong&gt;zero-dependency reminder system&lt;/strong&gt; that lives entirely in the terminal.&lt;/p&gt;

&lt;p&gt;No GUI. No background apps. No distractions. Just a clean, minimal workflow that reminds you of important tasks like system updates.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;💡 The Idea&lt;/h2&gt;

&lt;p&gt;The concept is simple:&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Step 1:&lt;/strong&gt; A cron job writes reminders to a file&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Step 2:&lt;/strong&gt; Your shell displays that file on startup&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Step 3:&lt;/strong&gt; You see reminders naturally when opening a terminal&lt;/p&gt;

&lt;p&gt;This turns your shell into a passive notification system.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;📁 Step 1: Create a Reminder File&lt;/h2&gt;

&lt;p&gt;We’ll store reminders in a simple file:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;touch ~/.todo
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This file will act as your lightweight task list.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;⏰ Step 2: Add a Weekly Cron Job&lt;/h2&gt;

&lt;p&gt;Edit your crontab:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
crontab -e
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Add the following line:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
0 9 * * 1 echo "$(date '+%Y-%m-%d %H:%M') - Run sudo pacman -Syu" &amp;gt;&amp;gt; /home/mosaid/.todo
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;0 9 * * 1:&lt;/strong&gt; Every Monday at 09:00&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;echo:&lt;/strong&gt; Adds a timestamped reminder&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;&amp;gt;&amp;gt;:&lt;/strong&gt; Appends instead of overwriting&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;🖥️ Step 3: Display Reminders in Your Shell&lt;/h2&gt;

&lt;p&gt;Now we make the reminders visible when opening a terminal.&lt;/p&gt;

&lt;p&gt;For Bash:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
echo 'cat ~/.todo' &amp;gt;&amp;gt; ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;For Zsh:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
echo 'cat ~/.todo' &amp;gt;&amp;gt; ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now every new terminal session will display your reminders automatically.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;✨ Step 4: Make It Cleaner&lt;/h2&gt;

&lt;p&gt;Instead of dumping the entire file, show only recent entries:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
tail -n 5 ~/.todo
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Update your shell config:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
echo 'echo "---- TODO ----"' &amp;gt;&amp;gt; ~/.bashrc
echo 'tail -n 5 ~/.todo' &amp;gt;&amp;gt; ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;hr&gt;

&lt;h2&gt;🎨 Optional: Highlight Important Tasks&lt;/h2&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
grep --color=always pacman ~/.todo
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This makes update reminders stand out visually.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;🧹 Optional: Clean Completed Tasks&lt;/h2&gt;

&lt;p&gt;Once you’ve updated your system, remove the reminder:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
sed -i '/pacman -Syu/d' ~/.todo
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can also automate cleanup if needed.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;🚀 Extending the System&lt;/h2&gt;

&lt;p&gt;This is where things get interesting. You can easily expand this idea:&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Backups:&lt;/strong&gt; Weekly backup reminders&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Disk cleanup:&lt;/strong&gt; Notify when to clean cache&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Security:&lt;/strong&gt; Remind yourself to check logs&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Multiple machines:&lt;/strong&gt; Sync &lt;code&gt;.todo&lt;/code&gt; with git&lt;/p&gt;

&lt;p&gt;You now have a fully customizable reminder system.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;⚖️ Cron vs Systemd Timers&lt;/h2&gt;

&lt;p&gt;Cron is simple and works everywhere, but modern systems also support systemd timers.&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Cron:&lt;/strong&gt; Easy, universal, quick setup&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Systemd timers:&lt;/strong&gt; More robust, better logging, tighter integration&lt;/p&gt;

&lt;p&gt;If you want a more advanced setup, consider migrating later.&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;🧠 Why This Works&lt;/h2&gt;

&lt;p&gt;This approach is powerful because:&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;No dependencies:&lt;/strong&gt; Uses only built-in tools&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Zero overhead:&lt;/strong&gt; No background services&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Contextual:&lt;/strong&gt; Appears exactly when you open a terminal&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Hackable:&lt;/strong&gt; Fully customizable to your workflow&lt;/p&gt;

&lt;p&gt;It embraces the Unix philosophy: do one thing well.&lt;/p&gt;

&lt;hr&gt;

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

&lt;p&gt;What started as a simple cron job becomes a flexible, minimal reminder system that integrates seamlessly into your daily workflow.&lt;/p&gt;

&lt;p&gt;Sometimes, the best tools aren’t the most complex—they’re the ones you fully control.&lt;/p&gt;</content><category term="Linux"></category><category term="arch linux"></category><category term="cron"></category><category term="bash"></category><category term="zsh"></category><category term="terminal productivity"></category><category term="linux automation"></category><category term="systemd"></category><category term="shell tricks"></category></entry><entry><title>Play Quranic Ayat and Surahs from the Command Line</title><link href="https://mosaid.xyz/articles/play-quranic-ayat-and-surahs-from-the-command-line-276.html" rel="alternate"></link><published>2025-01-25T09:43:19+00:00</published><updated>2025-01-25T09:43:19+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2025-01-25:/articles/play-quranic-ayat-and-surahs-from-the-command-line-276.html</id><summary type="html">&lt;p&gt;Learn how to automate Quran playback using Bash scripts. Play specific ayat or entire surahs from downloaded files with options for playback speed and ranges.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Play Quran Ayat with a Shell Script&lt;/h2&gt;
&lt;p&gt;If you're someone who enjoys listening to Quranic recitations and prefers an automated way to play specific ayat or surahs, this script might be your new favorite tool. It uses files downloaded from &lt;a href="https://everyayah.com/recitations_ayat.html" target="_blank"&gt;EveryAyah&lt;/a&gt; and organizes them for seamless playback.&lt;/p&gt;

&lt;h3&gt;Script Overview: play-ayat&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;play-ayat&lt;/code&gt; script lets you play Quranic ayat by specifying their numbers and optional ranges. Here's how it works:&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Arguments:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;- &lt;code&gt;first_number&lt;/code&gt;: The surah number (e.g., 001 for Al-Fatiha).&lt;/p&gt;
&lt;p&gt;- &lt;code&gt;second_number&lt;/code&gt;: The starting ayah number (e.g., 001).&lt;/p&gt;
&lt;p&gt;- &lt;code&gt;[end_range]&lt;/code&gt;: (Optional) The ending ayah number for a range of ayat to play.&lt;/p&gt;
&lt;p&gt;- &lt;code&gt;[speed]&lt;/code&gt;: (Optional) Playback speed (defaults to &lt;code&gt;1.15x&lt;/code&gt;).&lt;/p&gt;

&lt;h3&gt;How It Works&lt;/h3&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Single Ayah Playback:&lt;/strong&gt; When only the &lt;code&gt;first_number&lt;/code&gt; and &lt;code&gt;second_number&lt;/code&gt; are provided, the script constructs the filename using a padded three-digit format (e.g., &lt;code&gt;001001.mp3&lt;/code&gt; for Al-Fatiha, Ayah 1). It checks if the file exists and plays it using &lt;code&gt;mpv&lt;/code&gt; with custom player settings.&lt;/p&gt;
&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;

./play-ayat 1 1

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

&lt;p&gt;&amp;#8226;&lt;strong&gt;Range of Ayat:&lt;/strong&gt; If the &lt;code&gt;end_range&lt;/code&gt; is specified, the script builds a playlist (&lt;code&gt;ayatplaylist.m3u&lt;/code&gt;) containing all ayat in the specified range. This playlist is then fed into &lt;code&gt;mpv&lt;/code&gt; for playback.&lt;/p&gt;
&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;

./play-ayat 1 1 7

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

&lt;p&gt;&amp;#8226;&lt;strong&gt;Custom Playback Speed:&lt;/strong&gt; You can optionally pass a speed argument to modify the playback speed. For example, to slow it down:&lt;/p&gt;
&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;

./play-ayat 1 1 7 0.9

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

&lt;h3&gt;The &lt;code&gt;play-ayat&lt;/code&gt; script&lt;/h3&gt;

&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;

#!/bin/bash

# Check for at least two arguments
if [ &amp;quot;$#&amp;quot; -lt 2 ]; then
    echo &amp;quot;Usage: $0 &amp;lt;first_number&amp;gt; &amp;lt;second_number&amp;gt; [&amp;lt;end_range&amp;gt;]&amp;quot;
    exit 1
fi

# Extract arguments
first_number=$1
second_number=$2
end_range=$3
if [[ -n $4 ]]
  then speed=$4
  else speed=1.15
fi

# Variables
FILES_DIR=&amp;quot;$HOME/Music/Abdul Basit Mujawwad&amp;quot;
#FILES_DIR=&amp;quot;$HOME/Music/Minshawy Mujawwad&amp;quot;
#FILES_DIR=&amp;quot;$HOME/Music/Minshawy Murattal&amp;quot;
PLAYLIST_FILE=&amp;quot;/tmp/ayatplaylist.m3u&amp;quot;
PLAYER_CONFIG=&amp;quot;--no-terminal --no-config --no-pause --no-loop-file --speed=$speed&amp;quot;


# Format numbers to three digits
pfirst_number=$(printf &amp;quot;%03d&amp;quot; &amp;quot;$first_number&amp;quot;)
psecond_number=$(printf &amp;quot;%03d&amp;quot; &amp;quot;$second_number&amp;quot;)

# Check if end_range is provided
if [ -z &amp;quot;$end_range&amp;quot; ]; then
    # Single file case
    filename=&amp;quot;${pfirst_number}${psecond_number}.mp3&amp;quot;
    full_path=&amp;quot;${FILES_DIR}/${filename}&amp;quot;

    if [ -f &amp;quot;$full_path&amp;quot; ]; then
    mpv $PLAYER_CONFIG &amp;quot;$full_path&amp;quot; &amp;gt; /dev/null 2&amp;gt;&amp;amp;1
    fi
else
    # Range of files case
    # Clear or create playlist file
    echo &amp;quot;#EXTM3U&amp;quot; &amp;gt; &amp;quot;$PLAYLIST_FILE&amp;quot;
    for ((i=second_number; i&amp;lt;=end_range; i++)); do
        current_number=$(printf &amp;quot;%03d&amp;quot; &amp;quot;$i&amp;quot;)
        filename=&amp;quot;${pfirst_number}${current_number}.mp3&amp;quot;
        full_path=&amp;quot;${FILES_DIR}/${filename}&amp;quot;
        if [ -f &amp;quot;$full_path&amp;quot; ]; then
            echo &amp;quot;$full_path&amp;quot; &amp;gt;&amp;gt; &amp;quot;$PLAYLIST_FILE&amp;quot;
        fi
    done

    if [ -s &amp;quot;$PLAYLIST_FILE&amp;quot; ]; then
    mpv $PLAYER_CONFIG --playlist-start=0 &amp;quot;$PLAYLIST_FILE&amp;quot; &amp;gt; /dev/null 2&amp;gt;&amp;amp;1
    fi
fi



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

&lt;h3&gt;Extending the Script: play-surah&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;play-surah&lt;/code&gt; script takes this functionality further by automating the playback of an entire surah. Instead of specifying individual ayat, you can simply pass the surah number as the mandatory argument, and it will play all available ayat for that surah.&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Arguments:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;- &lt;code&gt;surah_number&lt;/code&gt;: The mandatory surah number (e.g., 001 for Al-Fatiha).&lt;/p&gt;
&lt;p&gt;- &lt;code&gt;[start_ayah]&lt;/code&gt;: (Optional) The starting ayah number.&lt;/p&gt;
&lt;p&gt;- &lt;code&gt;[end_ayah]&lt;/code&gt;: (Optional) The ending ayah number.&lt;/p&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Logic:&lt;/strong&gt; If no &lt;code&gt;start_ayah&lt;/code&gt; and &lt;code&gt;end_ayah&lt;/code&gt; are provided, the script loops from Ayah 1 to a reasonable maximum (e.g., 300). Files are checked for existence, and a playlist is dynamically generated.&lt;/p&gt;

&lt;h3&gt;Code Example for play-surah&lt;/h3&gt;

&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;

#!/bin/bash

# Check arguments
if [ &amp;quot;$#&amp;quot; -lt 1 ]; then
    echo &amp;quot;Usage: $0 &amp;lt;surah_number&amp;gt; [&amp;lt;start_ayah&amp;gt; &amp;lt;end_ayah&amp;gt;]&amp;quot;
    exit 1
fi

surah_number=$1
start_ayah=${2:-1}
end_ayah=${3:-300}
FILES_DIR=&amp;quot;$HOME/Music/Abdul Basit Mujawwad&amp;quot;
PLAYLIST_FILE=&amp;quot;/tmp/surahplaylist.m3u&amp;quot;
PLAYER_CONFIG=&amp;quot;--no-terminal --no-config --no-pause --no-loop-file&amp;quot;

# Format surah number
psurah_number=$(printf &amp;quot;%03d&amp;quot; &amp;quot;$surah_number&amp;quot;)

# Create playlist
echo &amp;quot;#EXTM3U&amp;quot; &amp;gt; &amp;quot;$PLAYLIST_FILE&amp;quot;
for ((i=start_ayah; i&amp;lt;=end_ayah; i++)); do
    payah_number=$(printf &amp;quot;%03d&amp;quot; &amp;quot;$i&amp;quot;)
    filename=&amp;quot;${psurah_number}${payah_number}.mp3&amp;quot;
    full_path=&amp;quot;${FILES_DIR}/${filename}&amp;quot;
    if [ -f &amp;quot;$full_path&amp;quot; ]; then
        echo &amp;quot;$full_path&amp;quot; &amp;gt;&amp;gt; &amp;quot;$PLAYLIST_FILE&amp;quot;
    fi
done

if [ -s &amp;quot;$PLAYLIST_FILE&amp;quot; ]; then
    mpv $PLAYER_CONFIG --playlist-start=0 &amp;quot;$PLAYLIST_FILE&amp;quot; &amp;gt; /dev/null 2&amp;gt;&amp;amp;1
else
    echo &amp;quot;No files found for Surah $surah_number in the specified range.&amp;quot;
fi



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

&lt;h3&gt;Usage Example for play-surah&lt;/h3&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Play all ayat of a surah:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;

./play-surah 1

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

&lt;p&gt;&amp;#8226;&lt;strong&gt;Play a specific range of ayat within a surah:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;

./play-surah 2 255 286

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

&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;These scripts bring simplicity and flexibility to Quranic recitation playback. Whether you're studying, meditating, or simply enjoying the beauty of the recitation, &lt;code&gt;play-ayat&lt;/code&gt; and &lt;code&gt;play-surah&lt;/code&gt; automate the process, saving you from manually selecting files.&lt;/p&gt;
&lt;p&gt;With a little creativity, you could further extend these scripts for more advanced features like randomizing ayat, creating thematic playlists, or even integrating them into a larger application. which I did, stay tuned for more &lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Quran playback"></category><category term="Bash script Quran"></category><category term="automate Quran audio"></category><category term="play ayat script"></category><category term="play surah script"></category><category term="mpv Quran recitation"></category><category term="EveryAyah automation"></category><category term="Quran shell script"></category></entry><entry><title>Discover GNOME with these 25 Stunning Desktop Screenshots</title><link href="https://mosaid.xyz/articles/discover-gnome-with-these-25-stunning-desktop-screenshots-267.html" rel="alternate"></link><published>2024-12-31T12:58:25+00:00</published><updated>2024-12-31T12:58:25+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-12-31:/articles/discover-gnome-with-these-25-stunning-desktop-screenshots-267.html</id><summary type="html">&lt;p&gt;Explore the simplicity and elegance of GNOME desktop environment with our curated gallery of 25 stunning images showcasing its design and functionality.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction to GNOME Desktop Environment&lt;/h2&gt;
&lt;p&gt;GNOME stands out as a modern, intuitive, and minimalistic desktop environment. Its focus on simplicity and productivity has made it a favorite among Linux users. In this gallery, we present 25 stunning images that demonstrate the elegance and functionality of the GNOME desktop.&lt;/p&gt;

&lt;h3&gt;Why GNOME?&lt;/h3&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Streamlined Interface:&lt;/strong&gt; GNOME is designed with a focus on user experience, offering a clean and uncluttered interface.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Efficient Workflow:&lt;/strong&gt; With features like Activities Overview and keyboard shortcuts, GNOME optimizes your productivity.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Modern Aesthetics:&lt;/strong&gt; Sleek design elements and polished animations make GNOME visually appealing.&lt;/p&gt;

&lt;h3&gt;Gallery: GNOME Desktop Highlights&lt;/h3&gt;
&lt;p&gt;Here are 25 images that showcase the best of GNOME Desktop:&lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-1.jpg" alt="Gnome Desktop Screenshot 1" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 1&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-2.jpg" alt="Gnome Desktop Screenshot 2" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 2&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-3.jpg" alt="Gnome Desktop Screenshot 3" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 3&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-4.jpg" alt="Gnome Desktop Screenshot 4" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 4&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-5.jpg" alt="Gnome Desktop Screenshot 5" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 5&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-6.jpg" alt="Gnome Desktop Screenshot 6" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 6&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-7.jpg" alt="Gnome Desktop Screenshot 7" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 7&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-8.jpg" alt="Gnome Desktop Screenshot 8" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 8&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-9.jpg" alt="Gnome Desktop Screenshot 9" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 9&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-10.jpg" alt="Gnome Desktop Screenshot 10" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 10&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-11.jpg" alt="Gnome Desktop Screenshot 11" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 11&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-12.jpg" alt="Gnome Desktop Screenshot 12" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 12&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-13.jpg" alt="Gnome Desktop Screenshot 13" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 13&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-14.jpg" alt="Gnome Desktop Screenshot 14" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 14&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-15.jpg" alt="Gnome Desktop Screenshot 15" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 15&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-16.jpg" alt="Gnome Desktop Screenshot 16" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 16&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-17.jpg" alt="Gnome Desktop Screenshot 17" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 17&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-18.jpg" alt="Gnome Desktop Screenshot 18" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 18&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-19.jpg" alt="Gnome Desktop Screenshot 19" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 19&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-20.jpg" alt="Gnome Desktop Screenshot 20" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 20&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-21.jpg" alt="Gnome Desktop Screenshot 21" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 21&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-22.jpg" alt="Gnome Desktop Screenshot 22" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 22&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-23.jpg" alt="Gnome Desktop Screenshot 23" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 23&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-24.jpg" alt="Gnome Desktop Screenshot 24" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 24&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/gnome/gnome-image-25.jpg" alt="Gnome Desktop Screenshot 25" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Gnome Desktop Screenshot 25&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;GNOME offers a balance of simplicity and power, making it an excellent choice for both new and experienced Linux users. Its elegant design and intuitive features are reflected in the gallery above. Ready to explore GNOME further? Visit the official &lt;a href="https://www.gnome.org/" target="_blank"&gt;GNOME website&lt;/a&gt; and experience it for yourself!&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="GNOME desktop"></category><category term="GNOME screenshots"></category><category term="GNOME gallery"></category><category term="Linux desktop environments"></category></entry><entry><title>Discover the Beauty of KDE Plasma with These 30 Screenshots</title><link href="https://mosaid.xyz/articles/discover-the-beauty-of-kde-plasma-with-these-30-screenshots-266.html" rel="alternate"></link><published>2024-12-30T21:13:58+00:00</published><updated>2024-12-30T21:13:58+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-12-30:/articles/discover-the-beauty-of-kde-plasma-with-these-30-screenshots-266.html</id><summary type="html">&lt;p&gt;Discover the beauty of KDE Plasma Desktop with our curated gallery of 30 stunning images showcasing its elegance, customization, and modern design.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction to KDE Plasma Desktop&lt;/h2&gt;
&lt;p&gt;KDE Plasma is celebrated for its versatility, stunning visuals, and user-centric design. In this gallery, we showcase 30 handpicked images that highlight the beauty and flexibility of KDE Plasma. Whether you're new to KDE or a seasoned user, these visuals will inspire you to explore this amazing desktop environment.&lt;/p&gt;

&lt;h3&gt;Why Choose KDE Plasma?&lt;/h3&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Customization:&lt;/strong&gt; From widgets to window decorations, KDE Plasma allows you to tailor your desktop to suit your preferences.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Performance:&lt;/strong&gt; Lightweight and efficient, KDE Plasma delivers a smooth experience even on older hardware.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Modern Aesthetics:&lt;/strong&gt; With stunning themes and polished icons, KDE Plasma offers a contemporary look and feel.&lt;/p&gt;

&lt;h3&gt;Gallery: The Elegance of KDE Plasma&lt;/h3&gt;
&lt;p&gt;Here are 30 stunning screenshots that showcase the best of KDE Plasma:&lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-1.jpg" alt="KDE Plasma Desktop Screenshot 1" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 1&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-2.jpg" alt="KDE Plasma Desktop Screenshot 2" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 2&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-3.jpg" alt="KDE Plasma Desktop Screenshot 3" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 3&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-4.jpg" alt="KDE Plasma Desktop Screenshot 4" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 4&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-5.jpg" alt="KDE Plasma Desktop Screenshot 5" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 5&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-6.jpg" alt="KDE Plasma Desktop Screenshot 6" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 6&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-7.jpg" alt="KDE Plasma Desktop Screenshot 7" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 7&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-8.jpg" alt="KDE Plasma Desktop Screenshot 8" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 8&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-9.jpg" alt="KDE Plasma Desktop Screenshot 9" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 9&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-10.jpg" alt="KDE Plasma Desktop Screenshot 10" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 10&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-11.jpg" alt="KDE Plasma Desktop Screenshot 11" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 11&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-12.jpg" alt="KDE Plasma Desktop Screenshot 12" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 12&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-13.jpg" alt="KDE Plasma Desktop Screenshot 13" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 13&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-14.jpg" alt="KDE Plasma Desktop Screenshot 14" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 14&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-15.jpg" alt="KDE Plasma Desktop Screenshot 15" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 15&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-16.jpg" alt="KDE Plasma Desktop Screenshot 16" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 16&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-17.jpg" alt="KDE Plasma Desktop Screenshot 17" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 17&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-18.jpg" alt="KDE Plasma Desktop Screenshot 18" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 18&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-19.jpg" alt="KDE Plasma Desktop Screenshot 19" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 19&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-20.jpg" alt="KDE Plasma Desktop Screenshot 20" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 20&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-21.jpg" alt="KDE Plasma Desktop Screenshot 21" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 21&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-22.jpg" alt="KDE Plasma Desktop Screenshot 22" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 22&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-23.jpg" alt="KDE Plasma Desktop Screenshot 23" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 23&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-24.jpg" alt="KDE Plasma Desktop Screenshot 24" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 24&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-25.jpg" alt="KDE Plasma Desktop Screenshot 25" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 25&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-26.jpg" alt="KDE Plasma Desktop Screenshot 26" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 26&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-27.jpg" alt="KDE Plasma Desktop Screenshot 27" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 27&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-28.jpg" alt="KDE Plasma Desktop Screenshot 28" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 28&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-29.jpg" alt="KDE Plasma Desktop Screenshot 29" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 29&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/kde/kde-image-30.jpg" alt="KDE Plasma Desktop Screenshot 30" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;KDE Plasma Desktop Screenshot 30&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;KDE Plasma is not just a desktop environment; it's an experience. With its unmatched flexibility, eye-catching design, and powerful tools, it caters to every user's needs. We hope this gallery inspires you to explore KDE Plasma further and customize your desktop to reflect your personality.&lt;/p&gt;
&lt;p&gt;If you’re new to KDE, visit the official &lt;a href="https://kde.org/" target="_blank"&gt;KDE Plasma website&lt;/a&gt; to learn more and get started today!&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="KDE Plasma"></category><category term="KDE Plasma desktop"></category><category term="KDE screenshots"></category><category term="KDE gallery"></category><category term="Linux desktop environments"></category></entry><entry><title>Why You Should Switch to Linux</title><link href="https://mosaid.xyz/articles/why-you-should-switch-to-linux-253.html" rel="alternate"></link><published>2024-06-05T19:10:12+00:00</published><updated>2024-06-05T19:10:12+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-06-05:/articles/why-you-should-switch-to-linux-253.html</id><summary type="html">&lt;p&gt;Discover why switching to Linux is more crucial than ever in the age of increasing privacy concerns with Windows. Explore the mature and versatile Linux ecosystem and protect your digital life.&lt;/p&gt;</summary><content type="html">&lt;p&gt;In the three decades since its inception, Linux has steadily grown from an obscure operating system used by a niche group of enthusiasts to a dominant force in the realm of servers and mobile devices. Today, Linux powers over 70% of the world's smartphones and servers, showcasing its robustness and reliability. However, its adoption on desktop computers remains relatively modest, with a market share of around 4%. Despite this, recent years have witnessed a resurgence in interest and development within the Linux ecosystem, making it more user-friendly and accessible than ever before.&lt;/p&gt;

&lt;h2&gt;Linux Today: A Mature and Versatile Ecosystem&lt;/h2&gt;
&lt;p&gt;Gone are the days when setting up wireless, Bluetooth, and printer devices on Linux was a frustrating ordeal. Today, most hardware works seamlessly with Linux, often requiring no more than a simple plug-and-play setup. The software landscape has also evolved significantly. Many popular applications now have native Linux versions, and where they don’t, robust alternatives or compatibility layers, such as Wine and Proton, fill the gap. Gaming on Linux, once a major hurdle, has seen substantial improvements thanks to platforms like Steam Play, which allow many Windows games to run on Linux with minimal hassle.&lt;/p&gt;

&lt;h2&gt;The Dark Cloud Over Windows&lt;/h2&gt;
&lt;p&gt;While Linux is on an upward trajectory, the future of Windows raises serious privacy concerns. Microsoft recently announced its “Copilot+ PC” initiative, a suite of powerful laptops designed to leverage the latest advancements in artificial intelligence, particularly the GPT-4o model from OpenAI. This model boasts impressive vision and audio capabilities, enabling real-time interactions that are deeply integrated into the operating system.&lt;/p&gt;
&lt;p&gt;One of the most alarming features introduced with this update is “Recall,” which takes periodic screenshots of your screen, ostensibly to help you retrieve information and activities from your past sessions. This feature records all your digital interactions, from typing passwords to browsing family photos, watching movies, and managing anonymous online accounts. Essentially, it captures a comprehensive log of your digital life.&lt;/p&gt;

&lt;h2&gt;The Privacy Nightmare&lt;/h2&gt;
&lt;p&gt;The implications of such pervasive monitoring are profound. Even if Microsoft assures users that this feature is opt-in and that privacy protections are in place, the potential for misuse and security breaches is immense. Imagine a world where every keystroke, every private moment spent on your computer, is recorded and stored. This isn't just a hypothetical scenario; it's a looming reality that Microsoft seems eager to normalize.&lt;/p&gt;

&lt;h2&gt;Why You Should Consider Linux&lt;/h2&gt;
&lt;div class="container"&gt;
        &lt;div class="row" style="display: flex; flex-wrap: wrap; margin: -5px;"&gt;
            &lt;div class="col-4" style="padding: 5px;"&gt;
                &lt;img src="/theme/images/articles/images/63-cinnamon-desktop.jpg" alt="Linux Mint" style="width: 100%; height: auto;"&gt;
            &lt;/div&gt;
            &lt;div class="col-4" style="padding: 5px;"&gt;
                &lt;img src="/theme/images/articles/images/181-desktop.jpg" alt="Linux Distribution 2" style="width: 100%; height: auto;"&gt;
            &lt;/div&gt;
            &lt;div class="col-4" style="padding: 5px;"&gt;
                &lt;img src="/theme/images/articles/images/181-zorin-16-2.jpg" alt="Zorin OS" style="width: 100%; height: auto;"&gt;
            &lt;/div&gt;
            &lt;div class="col-4" style="padding: 5px;"&gt;
                &lt;img src="/theme/images/articles/images/63-unity.png" alt="Ubuntu Unity Desktop" style="width: 100%; height: auto;"&gt;
            &lt;/div&gt;
            &lt;div class="col-4" style="padding: 5px;"&gt;
                &lt;img src="/theme/images/articles/images/116-img-2.png" alt="Linux Distribution 5" style="width: 100%; height: auto;"&gt;
            &lt;/div&gt;
            &lt;div class="col-4" style="padding: 5px;"&gt;
                &lt;img src="/theme/images/articles/images/181-screenlets-ubuntu.png" alt="Linux Distribution 6" style="width: 100%; height: auto;"&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;

&lt;p&gt;In light of these developments, the case for switching to Linux becomes compelling not just from a feature standpoint, but from a privacy perspective as well. Linux, with its open-source nature, offers transparency and control over your operating system that proprietary software simply cannot match. You decide what gets installed, what gets tracked, and how your data is handled. This level of control is crucial in an era where privacy is increasingly under threat.&lt;/p&gt;
&lt;p&gt;Switching to Linux might seem daunting if you're accustomed to the Windows ecosystem, but the transition is easier than you might think. Modern Linux distributions like Ubuntu, Fedora, and Manjaro provide user-friendly interfaces and extensive online support communities. Additionally, many of the tools and applications you rely on are either available on Linux or have suitable alternatives.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;The technological landscape is evolving rapidly, and with it, the norms and expectations around privacy and user control. Microsoft's latest moves with Windows highlight a future where convenience and AI integration come at the cost of personal privacy. By contrast, Linux offers a path that prioritizes user autonomy and security. As the digital world becomes more intrusive, embracing Linux isn't just a choice of operating system—it's a stand for privacy and control in an increasingly monitored world.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Linux desktop"></category><category term="Linux privacy"></category><category term="Windows privacy concerns"></category><category term="switch to Linux"></category><category term="Linux vs. Windows"></category><category term="Linux ecosystem"></category><category term="Linux security"></category><category term="open-source operating system"></category><category term="privacy protection"></category><category term="digital privacy"></category><category term="Linux distributions"></category><category term="Linux features"></category><category term="secure operating system"></category></entry><entry><title>How to Create an ISO from a Directory in Linux</title><link href="https://mosaid.xyz/articles/how-to-create-an-iso-from-a-directory-in-linux-252.html" rel="alternate"></link><published>2024-06-03T23:13:29+00:00</published><updated>2024-06-03T23:13:29+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-06-03:/articles/how-to-create-an-iso-from-a-directory-in-linux-252.html</id><summary type="html">&lt;p&gt;Learn how to create an ISO image from a directory in Linux using mkisofs or genisoimage with this step-by-step tutorial. Includes installation instructions and examples&lt;/p&gt;</summary><content type="html">&lt;p&gt;Creating an ISO image from a directory in Linux can be done using the &lt;code&gt;mkisofs&lt;/code&gt; or &lt;code&gt;genisoimage&lt;/code&gt; command. Follow these steps:&lt;/p&gt;

&lt;h2&gt;1. Install mkisofs or genisoimage&lt;/h2&gt;
&lt;p&gt;If you don't have &lt;code&gt;mkisofs&lt;/code&gt; or &lt;code&gt;genisoimage&lt;/code&gt; installed, you can install it using your package manager. For most Linux distributions, the package is named &lt;code&gt;genisoimage&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;For Debian-based distributions (like Ubuntu):&lt;/h3&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;

sudo apt-get install genisoimage

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

&lt;h3&gt;For Red Hat-based distributions (like Fedora):&lt;/h3&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;

sudo yum install genisoimage

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

&lt;h2&gt;2. Create the ISO&lt;/h2&gt;
&lt;p&gt;Use the &lt;code&gt;mkisofs&lt;/code&gt; or &lt;code&gt;genisoimage&lt;/code&gt; command to create the ISO. The basic syntax is:&lt;/p&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;

mkisofs -o output.iso /path/to/directory

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;

genisoimage -o output.iso /path/to/directory

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

&lt;h3&gt;Example:&lt;/h3&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;

mkisofs -o mydisk.iso /home/user/myfolder

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;

genisoimage -o mydisk.iso /home/user/myfolder

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

&lt;h2&gt;3. Additional Options&lt;/h2&gt;
&lt;p&gt;You can use various options with &lt;code&gt;mkisofs&lt;/code&gt; or &lt;code&gt;genisoimage&lt;/code&gt; to customize the ISO creation process. Some common options include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;-V "Volume Label"&lt;/code&gt;: Sets the volume label.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;-R&lt;/code&gt;: Enables Rock Ridge extensions, which are useful for retaining file permissions and longer filenames.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;-J&lt;/code&gt;: Enables Joliet extensions, which allow the ISO to be read by Windows systems.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Example with additional options:&lt;/h3&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;

mkisofs -o mydisk.iso -V "MY_DISK" -R -J /home/user/myfolder

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;

genisoimage -o mydisk.iso -V "MY_DISK" -R -J /home/user/myfolder

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

&lt;p&gt;After running the command, you will have an ISO file named &lt;code&gt;output.iso&lt;/code&gt; (or &lt;code&gt;mydisk.iso&lt;/code&gt; in the examples) that contains the contents of the specified directory.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="create ISO Linux"></category><category term="mkisofs tutorial"></category><category term="genisoimage tutorial"></category><category term="ISO image Linux"></category><category term="create ISO from directory"></category><category term="Linux ISO creation"></category><category term="mkisofs Linux"></category><category term="genisoimage Linux"></category><category term="Linux directory to ISO"></category><category term="step-by-step ISO creation Linux"></category></entry><entry><title>How to Use setfacl and getfacl: A Step-by-Step Guide</title><link href="https://mosaid.xyz/articles/how-to-use-setfacl-and-getfacl-a-step-by-step-guide-248.html" rel="alternate"></link><published>2024-05-25T15:33:25+00:00</published><updated>2024-05-25T15:33:25+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-05-25:/articles/how-to-use-setfacl-and-getfacl-a-step-by-step-guide-248.html</id><summary type="html">&lt;p&gt;Learn how to use setfacl and getfacl for managing Access Control Lists (ACLs) on Unix-based systems. This tutorial covers basic commands, syntax, and examples for setting and viewing ACLs to provide fine-grained file and directory permissions.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction to ACLs&lt;/h2&gt;
&lt;p&gt;Access Control Lists (ACLs) are used to provide more fine-grained permissions for files and directories than the traditional Unix permissions (read, write, execute). They allow you to specify permissions for individual users or groups.&lt;/p&gt;

&lt;h2&gt;setfacl and getfacl&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;setfacl&lt;/code&gt; is used to set ACLs on files and directories.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;getfacl&lt;/code&gt; is used to retrieve ACLs from files and directories.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Basic Syntax&lt;/h2&gt;
&lt;h3&gt;setfacl&lt;/h3&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

setfacl [options] acl_spec file...

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

&lt;h3&gt;getfacl&lt;/h3&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

getfacl [options] file...

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

&lt;h2&gt;Setting ACLs with setfacl&lt;/h2&gt;
&lt;h3&gt;Basic Usage&lt;/h3&gt;
&lt;p&gt;To add an ACL entry:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

setfacl -m u:username:permissions file

&lt;/code&gt;
&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;-m&lt;/code&gt;: Modify the ACL.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;u:username:permissions&lt;/code&gt;: Specify the user (&lt;code&gt;u&lt;/code&gt;), the username, and the permissions (&lt;code&gt;r&lt;/code&gt;, &lt;code&gt;w&lt;/code&gt;, &lt;code&gt;x&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Example:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

setfacl -m u:john:rwx myfile

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This grants user &lt;code&gt;john&lt;/code&gt; read, write, and execute permissions on &lt;code&gt;myfile&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;Setting ACLs for Groups&lt;/h3&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

setfacl -m g:groupname:permissions file

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Example:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

setfacl -m g:admins:rw myfile

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This grants the group &lt;code&gt;admins&lt;/code&gt; read and write permissions on &lt;code&gt;myfile&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;Setting Default ACLs on Directories&lt;/h3&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

setfacl -d -m u:username:permissions directory

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Example:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

setfacl -d -m u:john:rwx mydir

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This sets default permissions for &lt;code&gt;john&lt;/code&gt; on the directory &lt;code&gt;mydir&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;Removing ACL Entries&lt;/h3&gt;
&lt;p&gt;To remove an ACL entry:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

setfacl -x u:username file

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Example:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

setfacl -x u:john myfile

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This removes the ACL entry for user &lt;code&gt;john&lt;/code&gt; on &lt;code&gt;myfile&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To remove all ACL entries:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

setfacl -b file

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Example:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

setfacl -b myfile

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This removes all ACL entries from &lt;code&gt;myfile&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;Viewing ACLs with getfacl&lt;/h2&gt;
&lt;p&gt;To view the ACLs on a file or directory:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

getfacl file

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Example:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

getfacl myfile

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This outputs the ACLs for &lt;code&gt;myfile&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;Example Output&lt;/h3&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

# file: myfile
# owner: root
# group: root
user::rw-
user:john:rwx
group::r--
mask::rwx
other::r--

&lt;/code&gt;
&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;user::rw-&lt;/code&gt; - Permissions for the file owner.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;user:john:rwx&lt;/code&gt; - Specific permissions for user &lt;code&gt;john&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;group::r--&lt;/code&gt; - Permissions for the owning group.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;mask::rwx&lt;/code&gt; - The effective rights mask.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;other::r--&lt;/code&gt; - Permissions for others.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Recursive ACLs&lt;/h2&gt;
&lt;p&gt;To apply ACLs recursively to all files and directories within a directory:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

setfacl -R -m u:username:permissions directory

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Example:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

setfacl -R -m u:john:rwx mydir

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This applies the ACL for &lt;code&gt;john&lt;/code&gt; recursively within &lt;code&gt;mydir&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;Preserving Existing ACLs&lt;/h2&gt;
&lt;p&gt;To add or modify ACL entries without affecting existing ones, use the &lt;code&gt;-n&lt;/code&gt; option with &lt;code&gt;setfacl&lt;/code&gt;.&lt;/p&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

setfacl -n -m u:username:permissions file

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Example:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

setfacl -n -m u:john:rwx myfile

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

&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;ACLs provide a powerful way to manage permissions on a more granular level than standard Unix permissions. Using &lt;code&gt;setfacl&lt;/code&gt;, you can set and modify ACLs, while &lt;code&gt;getfacl&lt;/code&gt; allows you to view them. This capability is especially useful in environments where multiple users or groups need specific access to files and directories.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="setfacl tutorial"></category><category term="getfacl tutorial"></category><category term="Unix ACLs"></category><category term="Access Control Lists"></category><category term="Unix permissions"></category><category term="file permissions"></category><category term="directory permissions"></category><category term="setfacl examples"></category><category term="getfacl examples"></category><category term="manage Unix permissions"></category><category term="Unix file security"></category><category term="set ACLs Unix"></category><category term="get ACLs Unix"></category><category term="Unix user permissions"></category><category term="Unix group permissions"></category><category term="Linux"></category></entry><entry><title>How to Check SSD Health in Linux: A Comprehensive Guide</title><link href="https://mosaid.xyz/articles/how-to-check-ssd-health-in-linux-a-comprehensive-guide-244.html" rel="alternate"></link><published>2024-05-21T20:05:15+00:00</published><updated>2024-05-21T20:05:15+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-05-21:/articles/how-to-check-ssd-health-in-linux-a-comprehensive-guide-244.html</id><summary type="html">&lt;p&gt;Learn how to check SSD health and retrieve detailed information on your Linux system using tools like smartctl and nvme-cli. Ensure optimal SSD performance and longevity with regular monitoring&lt;/p&gt;</summary><content type="html">&lt;h1&gt;How to Check SSD Health and Information in Linux&lt;/h1&gt;
&lt;p&gt;Solid State Drives (SSDs) are crucial components in modern computers, offering faster data access speeds compared to traditional Hard Disk Drives (HDDs). To ensure optimal performance and longevity of your SSD, it is essential to regularly monitor its health and status. This article will guide you through the process of checking SSD health and retrieving relevant information on a Linux system.&lt;/p&gt;

&lt;h2&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;Before you begin, ensure you have access to a terminal and administrative privileges (root access or the ability to use &lt;code&gt;sudo&lt;/code&gt;). The steps outlined here are applicable to most Linux distributions.&lt;/p&gt;

&lt;h2&gt;Using &lt;code&gt;smartctl&lt;/code&gt; from the &lt;code&gt;smartmontools&lt;/code&gt; Package&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;smartctl&lt;/code&gt; tool, part of the &lt;code&gt;smartmontools&lt;/code&gt; package, is widely used for monitoring and managing storage devices. It supports most SSDs and provides comprehensive health information.&lt;/p&gt;

&lt;h3&gt;1. Install &lt;code&gt;smartmontools&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;First, install the &lt;code&gt;smartmontools&lt;/code&gt; package. The installation command varies depending on your Linux distribution:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Debian/Ubuntu:&lt;/strong&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
sudo apt-get update
sudo apt-get install smartmontools
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fedora:&lt;/strong&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
sudo dnf install smartmontools
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Arch Linux:&lt;/strong&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
sudo pacman -S smartmontools
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;2. Check SSD Health&lt;/h3&gt;
&lt;p&gt;After installation, you can use &lt;code&gt;smartctl&lt;/code&gt; to check the health status of your SSD. Replace &lt;code&gt;/dev/sdX&lt;/code&gt; with your SSD's device identifier (e.g., &lt;code&gt;/dev/sda&lt;/code&gt;, &lt;code&gt;/dev/nvme0n1&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;To view the overall health of the SSD, use the following command:&lt;/p&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
sudo smartctl -H /dev/sdX
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;3. Detailed SSD Information&lt;/h3&gt;
&lt;p&gt;For more detailed information, including SMART attributes, run:&lt;/p&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
sudo smartctl -a /dev/sdX
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command provides a comprehensive report, including the SSD model, firmware version, and various health indicators such as temperature, power-on hours, and error rates.&lt;/p&gt;

&lt;h3&gt;4. Running a Self-Test&lt;/h3&gt;
&lt;p&gt;You can also initiate self-tests to evaluate the SSD's condition. For a short self-test, use:&lt;/p&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
sudo smartctl -t short /dev/sdX
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For a longer, more thorough test, use:&lt;/p&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
sudo smartctl -t long /dev/sdX
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Check the test results with:&lt;/p&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
sudo smartctl -l selftest /dev/sdX
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Using &lt;code&gt;nvme-cli&lt;/code&gt; for NVMe SSDs&lt;/h2&gt;
&lt;p&gt;If your system uses NVMe SSDs, the &lt;code&gt;nvme-cli&lt;/code&gt; tool provides specific commands to retrieve detailed information and health status.&lt;/p&gt;

&lt;h3&gt;1. Install &lt;code&gt;nvme-cli&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;Install the &lt;code&gt;nvme-cli&lt;/code&gt; package using the appropriate command for your distribution:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Debian/Ubuntu:&lt;/strong&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
sudo apt-get update
sudo apt-get install nvme-cli
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fedora:&lt;/strong&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
sudo dnf install nvme-cli
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Arch Linux:&lt;/strong&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
sudo pacman -S nvme-cli
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;2. Check NVMe SSD Health&lt;/h3&gt;
&lt;p&gt;To check the health of an NVMe SSD, use:&lt;/p&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
sudo nvme smart-log /dev/nvme0n1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command provides detailed health information specific to NVMe drives, including temperature, available spare, data units read/written, and more.&lt;/p&gt;

&lt;h3&gt;3. Detailed NVMe Information&lt;/h3&gt;
&lt;p&gt;For detailed device information, use:&lt;/p&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
sudo nvme id-ctrl /dev/nvme0n1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command will output the controller information, giving you a deeper insight into your NVMe SSD.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Monitoring the health and status of your SSD in Linux is straightforward with tools like &lt;code&gt;smartctl&lt;/code&gt; and &lt;code&gt;nvme-cli&lt;/code&gt;. Regular checks can help you preemptively identify potential issues and maintain optimal performance. By following the steps outlined in this guide, you can ensure that your SSD remains in good health, prolonging its lifespan and reliability.&lt;/p&gt;
&lt;p&gt;Stay proactive about your SSD's health, and you'll enjoy a more stable and efficient computing experience.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="SSD health check Linux"></category><category term="smartctl Linux SSD"></category><category term="nvme-cli Linux"></category><category term="check SSD status Linux"></category><category term="SSD monitoring tools Linux"></category><category term="Linux SSD health guide"></category><category term="monitor SSD performance Linux"></category><category term="SSD lifespan Linux"></category><category term="check NVMe SSD Linux"></category><category term="Linux SSD information"></category></entry><entry><title>Simplify Your Firefox Migration Process: Copy .mozilla Folder</title><link href="https://mosaid.xyz/articles/simplify-your-firefox-migration-process-copy-mozilla-folder-240.html" rel="alternate"></link><published>2024-05-12T18:08:59+00:00</published><updated>2024-05-12T18:08:59+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-05-12:/articles/simplify-your-firefox-migration-process-copy-mozilla-folder-240.html</id><summary type="html">&lt;p&gt;Learn how to effortlessly transfer your Firefox profile to a new Linux installation or another computer by simply copying the .mozilla folder in your home directory. Preserve your settings, bookmarks, and passwords with ease!&lt;/p&gt;</summary><content type="html">&lt;h1&gt;Effortless Firefox Migration: How to Seamlessly Transfer Your Profile to a New Linux Install or Another Computer&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Introduction:&lt;/strong&gt; Migrating to a new Linux installation or another computer can be a daunting task, especially when it comes to preserving your Firefox settings, bookmarks, and passwords. However, there's a simple solution that can save you time and effort: copying the .mozilla folder in your home directory. In this article, we'll explore how you can effortlessly transfer your Firefox profile to ensure a seamless browsing experience on your new system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Locate Your Firefox Profile&lt;/strong&gt;&lt;br&gt;
The Firefox profile contains all your personal settings, bookmarks, history, extensions, and saved passwords. By default, this profile is stored in a hidden folder named .mozilla in your home directory. To locate it, open your file manager and enable the option to show hidden files. You should see the .mozilla folder in your home directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Copy the .mozilla Folder&lt;/strong&gt;&lt;br&gt;
Once you've located the .mozilla folder, simply copy it to an external storage device or transfer it over the network to your new Linux installation or another computer. You can do this using the command line or a graphical file manager, depending on your preference.&lt;/p&gt;

&lt;p&gt;If you're using the command line, you can use the following command to copy the .mozilla folder to an external drive:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cp -r ~/.mozilla /path/to/external/drive&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Replace "/path/to/external/drive" with the actual path to your external drive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Paste the .mozilla Folder&lt;/strong&gt;&lt;br&gt;
After copying the .mozilla folder, navigate to your new Linux installation or another computer and paste the folder into your home directory. Again, make sure to show hidden files in your file manager to see the .mozilla folder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Launch Firefox&lt;/strong&gt;&lt;br&gt;
Once you've pasted the .mozilla folder into your home directory, you're ready to launch Firefox. When you open Firefox on your new system, it will automatically detect the transferred profile and load all your settings, bookmarks, history, extensions, and saved passwords.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Verify Your Settings&lt;/strong&gt;&lt;br&gt;
After launching Firefox, take a moment to verify that all your settings, bookmarks, passwords, and extensions have been successfully transferred. You should see everything exactly as it was on your previous system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt; Transferring your Firefox profile to a new Linux installation or another computer doesn't have to be a complicated process. By simply copying the .mozilla folder from your home directory, you can ensure that all your settings, bookmarks, passwords, and extensions are seamlessly transferred to your new system. So the next time you're setting up a new Linux installation or migrating to another computer, remember this quick and easy method for preserving your Firefox profile.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="firefox"></category><category term="profile transfer"></category><category term="migration"></category><category term="Linux"></category><category term=".mozilla folder"></category><category term="bookmarks"></category><category term="passwords"></category><category term="Settings"></category><category term="seamless"></category><category term="effortless"></category><category term="copy"></category><category term="paste"></category><category term="new installation"></category><category term="computer"></category><category term="browser"></category><category term="data"></category><category term="backup"></category><category term="guide"></category></entry><entry><title>The Top Linux Distros for College Students</title><link href="https://mosaid.xyz/articles/the-top-linux-distros-for-college-students-239.html" rel="alternate"></link><published>2024-05-11T21:30:21+00:00</published><updated>2024-05-11T21:30:21+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-05-11:/articles/the-top-linux-distros-for-college-students-239.html</id><summary type="html">&lt;p&gt;Discover the best Linux distributions tailored for college students, including Ubuntu, Fedora, Debian, and more. Find the perfect distro to enhance your academic journey today&lt;/p&gt;</summary><content type="html">&lt;h1&gt;The Top Linux Distros for College Students: A Comprehensive Guide&lt;/h1&gt;

&lt;h2&gt;&lt;a target="_blank" href="https://ubuntu.com/"&gt;Ubuntu&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Ubuntu is often hailed as one of the most user-friendly Linux distributions, making it an excellent choice for students new to the Linux ecosystem. Its extensive software library, combined with a user-friendly interface, ensures that students can easily find and install the tools they need for their coursework. Ubuntu's LTS (Long Term Support) releases provide stability and reliability, making it a dependable companion throughout your college journey.&lt;/p&gt;

&lt;h2&gt;&lt;a target="_blank" href="https://getfedora.org/"&gt;Fedora&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;For students who crave the latest software and technologies, Fedora is an ideal choice. Known for its focus on innovation, Fedora offers cutting-edge features while maintaining a high level of stability. With a vibrant community and extensive documentation, Fedora is well-suited for students who want to stay at the forefront of technology.&lt;/p&gt;

&lt;h2&gt;&lt;a target="_blank" href="https://www.debian.org/"&gt;Debian&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Debian prides itself on stability and reliability, making it a solid choice for college students seeking a dependable operating system. With its vast repository of software packages, Debian provides access to a wide range of tools and applications for academic and personal use. Ideal for students interested in exploring the inner workings of Linux systems, Debian offers a rich learning experience alongside its robust performance.&lt;/p&gt;

&lt;h2&gt;&lt;a target="_blank" href="https://linuxmint.com/"&gt;Linux Mint&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Linux Mint is renowned for its user-friendly interface, reminiscent of traditional desktop environments like Windows. With a focus on simplicity and ease of use, Linux Mint provides a seamless transition for students migrating from other operating systems. Its stability, combined with a rich selection of pre-installed software, ensures that students can focus on their studies without worrying about technical hurdles.&lt;/p&gt;

&lt;h2&gt;&lt;a target="_blank" href="https://manjaro.org/"&gt;Manjaro&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Based on Arch Linux, Manjaro offers a balance between cutting-edge software and system stability. With access to the Arch User Repository (AUR), Manjaro provides a vast selection of software packages for students with diverse interests and needs. Its flexibility and customization options make it an attractive choice for students who want to tailor their operating system to suit their preferences.&lt;/p&gt;

&lt;h2&gt;&lt;a target="_blank" href="https://pop.system76.com/"&gt;Pop!_OS&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Developed by System76, Pop!_OS is designed with developers and power users in mind. Featuring a minimalist design and productivity-focused features like tiling window management, Pop!_OS enhances efficiency and workflow management for college students. With enhanced gaming support, it caters to students looking to strike a balance between work and play.&lt;/p&gt;

&lt;h2&gt;&lt;a target="_blank" href="https://elementary.io/"&gt;Elementary OS&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Combining elegance with simplicity, Elementary OS offers a visually stunning desktop environment that appeals to students with a penchant for design aesthetics. Its lightweight system requirements make it suitable for older hardware, ensuring smooth performance even on low-end laptops. With the AppCenter for easy software installation, Elementary OS provides a hassle-free experience for college students.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Choosing the right Linux distribution can significantly impact your college experience, empowering you with the tools and resources you need to succeed academically and professionally. Whether you prioritize stability, cutting-edge technology, or user-friendly design, there's a Linux distro tailored to meet your needs. Experiment with different distributions, explore their features, and discover the one that resonates with you. With Linux, the possibilities are endless, and your college journey awaits with open arms.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Linux"></category><category term="distributions"></category><category term="college students"></category><category term="Ubuntu"></category><category term="Fedora"></category><category term="Debian"></category><category term="Linux Mint"></category><category term="Manjaro"></category><category term="Pop!_OS"></category><category term="Elementary OS"></category><category term="academic"></category><category term="productivity"></category><category term="software"></category><category term="operating system"></category><category term="student life"></category></entry><entry><title>Rsync Command: The Ideal and Reliable Way to Copy Large Files</title><link href="https://mosaid.xyz/articles/rsync-command-the-ideal-and-reliable-way-to-copy-large-files-234.html" rel="alternate"></link><published>2024-05-04T18:37:45+00:00</published><updated>2024-05-04T18:37:45+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-05-04:/articles/rsync-command-the-ideal-and-reliable-way-to-copy-large-files-234.html</id><summary type="html">&lt;p&gt;Learn how to efficiently copy large files using Rsync, a reliable command-line utility. Discover its benefits, advanced options, and real-world examples for seamless file transfers.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;When transferring files to my Android phone or many of my external hard drives I never use the file manager nor do I use "cp" command, I noticed that with file managers the computer actually slows down and sometimes the file manager becomes non resposnive with large files. I always use &lt;code&gt;rsync&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;And it has been a life saver and reliable, when copying files to a remote server over the network even with network interruptions and low netowrk connection&lt;/p&gt;

&lt;h2&gt;What is Rsync?&lt;/h2&gt;
&lt;p&gt;Rsync is a command-line utility that synchronizes files and directories between two locations while minimizing data transfer by only copying the differences between them. This mechanism makes Rsync incredibly efficient, particularly for large files where transferring the entire file each time is impractical. Its cross-platform support ensures seamless operation across Linux, macOS, and Windows systems.&lt;/p&gt;

&lt;h2&gt;Benefits of Using Rsync&lt;/h2&gt;
&lt;p&gt;Rsync offers several advantages for large file copying:&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Efficiency:&lt;/strong&gt; Rsync's delta-transfer algorithm ensures that only the portions of files that have changed are transferred, reducing bandwidth usage.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Reliability:&lt;/strong&gt; Rsync's ability to resume interrupted transfers and handle network disruptions makes it a dependable choice for mission-critical operations.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Versatility:&lt;/strong&gt; Whether you're copying files over a network or to/from external devices, Rsync's adaptability shines through, providing consistent performance across various scenarios.&lt;/p&gt;

&lt;h2&gt;Real-World Examples Using Rsync&lt;/h2&gt;
&lt;h3&gt;Example 1: Copying Large Files Over a Network:&lt;/h3&gt;
&lt;p&gt;    Whenever I want to copy files to my website server I use the following command:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

sshpass -p "mypassword" \
    rsync -avPh --bwlimit=1000 --timeout=120 \
    --exclude '__pycache__' \
    -e "ssh -oHostKeyAlgorithms=+ssh-dss  -p&amp;lt;portnumber&amp;gt; " "local/directory/or/file" myusername@myserver.com:/path/to/my/remote/directory

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

&lt;p&gt;And it has been a life saver and reliable, even with network interruptions and low netowrk connection&lt;/p&gt;

&lt;h3&gt;Example 2: Copying Large Files to/from External Devices&lt;/h3&gt;
&lt;p&gt;Transferring media files to my Android phone via MTP or simply to an external drive can be unreliable with conventional methods. Rsync offers a robust solution, ensuring uninterrupted transfers even in the event of interruptions or connectivity issues.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Basic Usage:&lt;/strong&gt; Use the following syntax to copy files:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;rsync [options] source destination&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;When transferring files to my Android phone or many of my external hard drives I never use the file manager nor do I use "cp" command, I noticed that with file managers the computer actually slows down and sometimes the file manager becomes non resposnive with large files. I always use the following command:&lt;/p&gt;
&lt;pre class="language-bash"&gt;
        &lt;code class="language-bash"&gt;

rsync -ahrS --progress /path/to/source/  /path/to/destination
# or simply navigate to destination and
rsync -ahrS --progress /path/to/source/  .  # notice the dot ie current directory

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Advanced Options:&lt;/strong&gt; You can use additional options like &lt;code&gt;'-avz&lt;/code&gt;' for archiving and compressing data, '&lt;code&gt;-P&lt;/code&gt;' for progress updates, '&lt;code&gt;--partial&lt;/code&gt;' for resuming interrupted transfers, &lt;code&gt;--exclude '*.djvu'&lt;/code&gt; to exclude files with the .djvu extension, and '&lt;code&gt;--max-size=53m&lt;/code&gt;' to limit the transfer of files smaller than 53 megabytes. the last two are especially usefull when synchronizing(copying=) a directory&lt;/p&gt;

&lt;h2&gt;Best Practices&lt;/h2&gt;
&lt;ul&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Optimize Performance:&lt;/strong&gt; Experiment with compression and other options to maximize transfer speeds, especially over slower connections.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Secure Transfers:&lt;/strong&gt; Use SSH for secure data transfers, safeguarding your files during transit.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Selective Copying:&lt;/strong&gt; Leverage Rsync's options to exclude unnecessary files or directories, streamlining the copying process.&lt;/p&gt;
&lt;/ul&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;In the realm of large file copying, Rsync stands out as a beacon of reliability and efficiency. Whether you're synchronizing files over a network or transferring data to/from external devices, Rsync's prowess remains unmatched. By integrating Rsync into your workflow, you can streamline your file copying processes, ensuring swift and dependable transfers every time.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Rsync"></category><category term="large file copying"></category><category term="file transfer"></category><category term="efficient file copying"></category><category term="command-line utility"></category><category term="reliability"></category><category term="advanced options"></category><category term="real-world examples"></category><category term="seamless transfers"></category><category term="SSH"></category><category term="SSHpass"></category></entry><entry><title>Discover Feh Image Viewer's Montage Mode: Effortlessly Create Stunning Image Collages</title><link href="https://mosaid.xyz/articles/discover-feh-image-viewers-montage-mode-effortlessly-create-stunning-image-collages-233.html" rel="alternate"></link><published>2024-05-03T17:46:48+00:00</published><updated>2024-05-03T17:46:48+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-05-03:/articles/discover-feh-image-viewers-montage-mode-effortlessly-create-stunning-image-collages-233.html</id><summary type="html">&lt;p&gt;Explore Feh Image Viewer's powerful montage mode functionality, allowing users to effortlessly create visually captivating collages of images. With precise control over parameters and the ability to save montages directly to files, Feh offers simplicity and efficiency for both casual browsing and professional presentations.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction:&lt;/h2&gt;
&lt;p&gt;Discover the power of Feh Image Viewer, a versatile and lightweight tool designed for seamless image viewing, management, and presentation. With its minimalist design and command-line interface, Feh offers a streamlined experience suitable for both casual users and professionals alike. In this comprehensive guide, we'll explore how to harness the full potential of Feh Image Viewer, including its standout feature: the robust montage mode for effortlessly creating visually captivating image collages. Additionally, we'll walk you through the installation process on various Linux distributions, enabling you to unlock Feh's powerful functionality with ease and efficiency.&lt;/p&gt;

&lt;h2&gt;Installation&lt;/h2&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

# in Debian and Ubuntu based distros:
sudo apt install feh
# Arch linux:
sudo pacman -S feh
# fedora
sudo dnf install feh

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;Feh Image Viewer &lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Viewing Individual Images:&lt;/strong&gt;&lt;br&gt;
With Feh, viewing individual images is as simple as running the command &lt;code&gt;feh /path/to/image&lt;/code&gt;. This straightforward command allows users to open and view images quickly without any unnecessary overhead. Feh's minimalist interface ensures that the focus remains on the image itself, providing a distraction-free viewing experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Browsing Image Directories:&lt;/strong&gt;&lt;br&gt;
Feh also excels at handling directories of images. By passing a directory path as an argument (&lt;code&gt;feh /path/to/directory&lt;/code&gt;), Feh launches in a mode where it displays all images within that directory sequentially. Users can navigate through the images using keyboard shortcuts, allowing for efficient browsing of image collections without the need for a complex graphical user interface.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Montage Mode:&lt;/strong&gt;&lt;br&gt;
Feh's montage mode is a powerful feature that enables users to create visual collages or montages of images. By executing a command like this:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

feh --index-info "%u\n" \       # Set format for image information
    -x -m -W 1920 -H 1080 \     # Display images in index mode with montage layout,
                        # set width and height of montage window
    -E 180 -y 180  \            # Set height and width of thumbnails
    -f "$image_list" \          # Specify file containing list of images
    -o "montage_output.png" \   # Save the generated montage as PNG
    2&amp;gt; /dev/null             # Redirect error messages to /dev/null

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/233-montage_output.png" alt="Feh Montage" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Feh Montage&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Users can arrange images in a grid layout, specifying parameters such as width, height, and spacing. This mode is particularly useful for comparing multiple images side by side or creating thumbnails for image galleries.&lt;/p&gt;

&lt;h2&gt;Feh Desktop Backgrounder &lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Setting Desktop Background:&lt;/strong&gt;&lt;br&gt;
Feh offers seamless integration with desktop environments by allowing users to set images as desktop backgrounds directly from the command line. The command :&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

feh --image-bg bg_color --bg-max "/path/to/image"

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;sets the specified image as the desktop background, adjusting its size and position to fit the screen resolution. Users can also customize the background color (&lt;code&gt;bg_color&lt;/code&gt;) and choose between different scaling options (&lt;code&gt;--bg-max&lt;/code&gt;) to achieve the desired visual effect.&lt;/p&gt;

&lt;p&gt;In summary, Feh Image Viewer offers a versatile set of features for both image viewing and desktop background management. Whether you need a lightweight and efficient tool for browsing images or a flexible solution for customizing your desktop environment, Feh provides the necessary tools to meet your needs with simplicity and reliability.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Feh"></category><category term="Image Viewer"></category><category term="montage mode"></category><category term="image collage"></category><category term="collage creation"></category><category term="image organization"></category><category term="visual presentation"></category><category term="thumbnail layout"></category><category term="command-line tool"></category><category term="image browsing"></category><category term="image management"></category><category term="professional presentation"></category></entry><entry><title>Access Local Websites: Linux to Windows in VirtualBox</title><link href="https://mosaid.xyz/articles/access-local-websites-linux-to-windows-in-virtualbox-230.html" rel="alternate"></link><published>2024-04-30T20:56:51+00:00</published><updated>2024-04-30T20:56:51+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-04-30:/articles/access-local-websites-linux-to-windows-in-virtualbox-230.html</id><summary type="html">&lt;p&gt;Learn how to access local websites from Linux to Windows in VirtualBox. Follow our guide for seamless communication between host and guest machines using a host-only network.&lt;/p&gt;</summary><content type="html">&lt;h1&gt;How to Access a Local Website from a Linux Host Machine to a Windows Guest Machine in VirtualBox&lt;/h1&gt;
&lt;p&gt;If you're running a Windows virtual machine (VM) inside VirtualBox on your Linux host, you might want to access a local website or service hosted on the guest machine. In this guide, we'll walk through the steps to set up communication between your Linux host and Windows guest using a host-only network.&lt;/p&gt;

&lt;h2&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;    &lt;strong style="color: #000000;"&gt;    VirtualBox:&lt;/strong&gt; Ensure that you have VirtualBox installed on your Linux host machine.&lt;/p&gt;
&lt;p&gt;    &lt;strong style="color: #000000;"&gt;    Windows Guest VM:&lt;/strong&gt; Set up a Windows virtual machine in VirtualBox.&lt;/p&gt;

&lt;h2&gt;Steps:&lt;/h2&gt;

&lt;p&gt;    &lt;strong&gt;1. Create a Host-Only Network in VirtualBox:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;#8226; Open VirtualBox and go to &lt;em&gt;File&lt;/em&gt; &amp;gt; &lt;em&gt;Host Network Manager&lt;/em&gt;.&lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/230-netw1.jpg" alt="VirtualBox Network Manager" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;VirtualBox Network Manager&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&amp;#8226; In the &lt;em&gt;Host-Only Networks&lt;/em&gt; tab, click &lt;em&gt;Create&lt;/em&gt;. A host-only network will be created with the default name "&lt;code&gt;vboxnet0&lt;/code&gt;".&lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/230-netw2.jpg" alt="Host-Only Network Creation" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Host-Only Network Creation&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class="ni"&gt;&amp;amp;#8226;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;By&lt;span class="w"&gt; &lt;/span&gt;default,&lt;span class="w"&gt; &lt;/span&gt;it&lt;span class="w"&gt; &lt;/span&gt;will&lt;span class="w"&gt; &lt;/span&gt;have&lt;span class="w"&gt; &lt;/span&gt;an&lt;span class="w"&gt; &lt;/span&gt;IPv4&lt;span class="w"&gt; &lt;/span&gt;prefix&lt;span class="w"&gt; &lt;/span&gt;of&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;code&amp;gt;&lt;/span&gt;192.168.56.1/24&lt;span class="nt"&gt;&amp;lt;/code&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;and&lt;span class="w"&gt; &lt;/span&gt;DHCP&lt;span class="w"&gt; &lt;/span&gt;enabled.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;    &lt;strong&gt;2. Configure the Virtual Machine Settings:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;#8226; Open the settings for your Windows guest virtual machine.&lt;/p&gt;
&lt;p&gt;&amp;#8226; Keep the first network adapter (usually NAT) as it is.&lt;/p&gt;
&lt;p&gt;&amp;#8226; Enable the second network adapter and select &lt;em&gt;Attached to:&lt;/em&gt; "Host-Only Adapter".&lt;/p&gt;
&lt;p&gt;&amp;#8226; Choose the network name "vboxnet0" (the one you created in step 1).&lt;/p&gt;

&lt;figure&gt;
&lt;img src="/theme/images/articles/images/230-netw3.jpg" alt="Host-Only Adapter" style="max-width:100%;height:auto;" &gt;
&lt;figcaption&gt;Host-Only Network Adapter&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;    &lt;strong&gt;3. Start Your Virtual Machine:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;#8226; Now, whenever you run your Windows guest virtual machine, it will be connected to the host-only network.&lt;/p&gt;
&lt;p&gt;&amp;#8226; On the host machine (Linux), you'll find a local network for communication between the host and guest machines. in my case I got something like this&lt;/p&gt;

&lt;pre class="language-terminal" &gt;
    &lt;code class="language-terminal" &gt;

$ ip a | grep -oP '(?&amp;lt;=inet |addr:)(?:\d+\.){3}\d+'
127.0.0.1   # loopback adress
192.168.1.5 # my machine local IP adress in my Local network
192.168.56.1    # this is the IP address of the host-only network
192.168.56.101  # my machine IP adress in the host-only network

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;If I have a website running in my Linux (host) machine on port 8081 then I can access it in the guest VM like this
&lt;code&gt;192.168.56.1:8081&lt;/code&gt;
or &lt;code&gt;192.168.56.101:8081&lt;/code&gt;
or &lt;code&gt;192.168.1.5:8081&lt;/code&gt; when I am connected to a local network&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="VirtualBox"></category><category term="Linux"></category><category term="Windows"></category><category term="host machine"></category><category term="guest machine"></category><category term="local website"></category><category term="host-only network"></category><category term="communication"></category><category term="seamless"></category><category term="Virtual Machine (VM)"></category><category term="setup"></category><category term="connectivity"></category></entry><entry><title>Automated Backup Solutions: Safeguarding Your Daily Work</title><link href="https://mosaid.xyz/articles/automated-backup-solutions-safeguarding-your-daily-work-227.html" rel="alternate"></link><published>2024-04-16T22:19:46+00:00</published><updated>2024-04-16T22:19:46+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-04-16:/articles/automated-backup-solutions-safeguarding-your-daily-work-227.html</id><summary type="html">&lt;p&gt;Protect your important documents from loss or corruption with our guide to backing up files, especially those you edit daily. Learn how to automate backups and create a backup script to ensure your data's safety.&lt;/p&gt;</summary><content type="html">&lt;p&gt;In the digital age, where the bulk of our work and personal documents exist in electronic format, ensuring their safety and accessibility is paramount. Imagine investing hours into crafting a crucial report, a research paper, or a personal project only to lose it due to technical glitches, accidental deletions, or hardware failures. To prevent such nightmares, it's essential to establish a robust backup system. In this guide, we'll explore how to backup your important documents, focusing particularly on files you interact with daily, such as ongoing projects or works-in-progress.&lt;/p&gt;

&lt;h2&gt;Understanding the Importance of Regular Backups&lt;/h2&gt;

&lt;p&gt;Before delving into the specifics of backup methods, let's underscore why regular backups are indispensable:&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Data Loss Prevention:&lt;/strong&gt; Accidents happen. Whether it's a power outage, a software crash, or human error, the risk of losing valuable data is ever-present.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Protection Against Hardware Failure:&lt;/strong&gt; Hard drives can fail unexpectedly, resulting in permanent data loss. Backing up your files ensures that even if your primary storage device malfunctions, your data remains intact.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Version Control:&lt;/strong&gt; When working on documents that undergo frequent revisions, maintaining a history of changes allows you to revert to earlier versions if necessary.&lt;/p&gt;

&lt;h2&gt;Implementing a Backup Strategy&lt;/h2&gt;

&lt;p&gt;&amp;#8226;&lt;strong&gt;Identify Critical Files:&lt;/strong&gt; Begin by identifying the files and folders that are indispensable to you. This includes documents, presentations, spreadsheets, and any other data you interact with regularly.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Select a Backup Method:&lt;/strong&gt; There are various backup methods available, ranging from manual backups to automated solutions. Choose a method that aligns with your workflow and provides the level of redundancy you require.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Automate the Process:&lt;/strong&gt; Automating backups ensures consistency and minimizes the risk of human error. Utilize tools like cron jobs (for Unix-like systems) or task schedulers (for Windows) to schedule regular backups at convenient intervals.&lt;/p&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Utilize Versioning Systems:&lt;/strong&gt; Version control systems such as Git are invaluable for managing projects involving code or text-based documents. They track changes over time, allowing you to revert to previous versions effortlessly.&lt;/p&gt;

&lt;h3&gt;Example Backup Script for Daily Use&lt;/h3&gt;

&lt;p&gt;If you're working on documents regularly and want a straightforward backup solution, consider implementing a script similar to the following:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

#!/usr/bin/env bash

# Define backup directory
backup_dir="$HOME/backups"

# Create backup directory if it doesn't exist
mkdir -p "$backup_dir"

# Get current date and time
timestamp=$(date +%Y-%m-%d_%H-%M-%S)

# Get current directory name
current_dir=$(basename "$(pwd)")

# Create backup filename with directory name
backup_file="$backup_dir/${current_dir}_backup_$timestamp.tar.gz"

# Archive current directory and compress it
tar -czf "$backup_file" .

echo "Backup created: $backup_file"


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

&lt;p&gt;This script creates a compressed archive of the current directory and saves it in a designated backup directory. You can then schedule it to run daily using a cron job, ensuring that your files are backed up regularly without manual intervention.&lt;/p&gt;

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

&lt;p&gt;Protecting your important documents through regular backups is a simple yet crucial practice that can save you from potential disasters. By implementing a robust backup strategy and leveraging automation where possible, you can safeguard your work and enjoy peace of mind knowing that your data is secure and accessible whenever you need it. Remember, when it comes to backups, it's better to be safe than sorry.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="backup"></category><category term="important documents"></category><category term="data security"></category><category term="file backup"></category><category term="daily editing"></category><category term="backup script"></category><category term="automated backups"></category><category term="data protection"></category><category term="document backup"></category><category term="file safety"></category></entry><entry><title>Nmap: A Deep Dive into Network Security Auditing</title><link href="https://mosaid.xyz/articles/nmap-a-deep-dive-into-network-security-auditing-226.html" rel="alternate"></link><published>2024-04-16T21:53:46+00:00</published><updated>2024-04-16T21:53:46+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-04-16:/articles/nmap-a-deep-dive-into-network-security-auditing-226.html</id><summary type="html">&lt;p&gt;Explore the power of Nmap with this comprehensive guide to network discovery and security auditing. Learn about its key features, best practices, and applications for safeguarding your digital landscape.&lt;/p&gt;</summary><content type="html">&lt;p&gt;In today's interconnected digital landscape, understanding the intricacies of network security is paramount. Whether you're a seasoned cybersecurity professional or an enthusiastic novice, having the right tools at your disposal is crucial. Among these tools, Nmap stands out as a cornerstone for network exploration and security auditing. In this article, we'll delve into the depths of Nmap, exploring its features, applications, and best practices.&lt;/p&gt;

&lt;h2&gt;What is Nmap?&lt;/h2&gt;
&lt;p&gt;Nmap, short for Network Mapper, is an open-source tool designed for network exploration and security auditing. Developed by Gordon Lyon, commonly known by his pseudonym "Fyodor," Nmap has evolved over the years into a robust and versatile utility. It operates by sending packets to target hosts and analyzing their responses to provide valuable information about the network's topology, services, operating systems, and potential vulnerabilities.&lt;/p&gt;

&lt;h2&gt;Key Features of Nmap:&lt;/h2&gt;
&lt;h3&gt;Port Scanning&lt;/h3&gt;
&lt;p&gt;One of Nmap's primary functions is port scanning. It allows users to discover open ports on target systems, providing insights into the services running on those ports and potential entry points for attackers.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nmap -p 1-100 192.168.1.1&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Host Discovery&lt;/h3&gt;
&lt;p&gt;Nmap facilitates the discovery of hosts within a specified range of IP addresses. By sending ICMP echo requests, TCP SYN, ACK, or UDP probes, it identifies active hosts on the network.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nmap -sn 192.168.1.0/24&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Service Version Detection&lt;/h3&gt;
&lt;p&gt;Nmap can determine the versions of services running on open ports, aiding in vulnerability assessment and patch management.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nmap -sV 192.168.1.1&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;OS Fingerprinting&lt;/h3&gt;
&lt;p&gt;Through a series of probing techniques, Nmap can attempt to identify the operating systems of target hosts based on their responses to network packets.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nmap -O 192.168.1.1&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Scripting Engine&lt;/h3&gt;
&lt;p&gt;Nmap's scripting engine (NSE) allows users to automate and customize tasks, extending its functionality for specific purposes such as vulnerability scanning and network inventory.&lt;/p&gt;

&lt;h2&gt;Best Practices and Considerations:&lt;/h2&gt;
&lt;h3&gt;Permission and Legality&lt;/h3&gt;
&lt;p&gt;Always ensure you have proper authorization before scanning networks. Unauthorized scanning could lead to legal repercussions.&lt;/p&gt;
&lt;h3&gt;Stealth and Discretion&lt;/h3&gt;
&lt;p&gt;Depending on the context, choose scan types that prioritize stealth to avoid detection by intrusion detection systems (IDS) or firewall logs.&lt;/p&gt;
&lt;h3&gt;Documentation&lt;/h3&gt;
&lt;p&gt;Document scan results meticulously, including dates, times, and specific configurations used. This information is invaluable for audits and future reference.&lt;/p&gt;
&lt;h3&gt;Regular Updates&lt;/h3&gt;
&lt;p&gt;Keep Nmap and its associated scripts updated to leverage the latest features and security enhancements.&lt;/p&gt;

&lt;h2&gt;Conclusion:&lt;/h2&gt;
&lt;p&gt;Nmap stands as a stalwart in the realm of network exploration and security auditing, empowering users with insights into network topology, services, and potential vulnerabilities. Its versatility, coupled with a rich set of features, makes it an indispensable tool for cybersecurity professionals worldwide. By understanding its capabilities and adhering to best practices, users can harness the power of Nmap to fortify their networks against potential threats and vulnerabilities.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Nmap"></category><category term="network discovery"></category><category term="network security"></category><category term="cybersecurity"></category><category term="port scanning"></category><category term="host discovery"></category><category term="service version detection"></category><category term="OS fingerprinting"></category><category term="scripting engine"></category><category term="vulnerability scanning"></category><category term="network inventory"></category><category term="best practices"></category><category term="legal considerations"></category><category term="stealth scanning"></category><category term="documentation"></category><category term="updates"></category></entry><entry><title>Mastering Cron Jobs: A Step-by-Step Guide from Beginner to Advanced</title><link href="https://mosaid.xyz/articles/mastering-cron-jobs-a-step-by-step-guide-from-beginner-to-advanced-223.html" rel="alternate"></link><published>2024-04-11T10:51:10+00:00</published><updated>2024-04-11T10:51:10+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-04-11:/articles/mastering-cron-jobs-a-step-by-step-guide-from-beginner-to-advanced-223.html</id><summary type="html">&lt;p&gt;Learn about cron jobs and how to use them effectively in this beginner's guide. Understand cron job syntax, scheduling options, and examples for automating tasks on Unix-like operating systems.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction:&lt;/h2&gt;
&lt;p&gt;Cron jobs are an essential part of Unix-based operating systems, allowing users to schedule repetitive tasks to be executed automatically. These tasks can range from simple commands to more complex scripts. In this guide, we'll explore the fundamentals of cron jobs and explain various scheduling options using real-world examples.&lt;/p&gt;

&lt;h2&gt;1. What is a Cron Job?&lt;/h2&gt;
&lt;p&gt;A cron job is a time-based job scheduler in Unix-like operating systems. It enables users to schedule tasks to run periodically at fixed times, dates, or intervals without manual intervention.&lt;/p&gt;

&lt;h2&gt;2. Components of a Cron Job:&lt;/h2&gt;

&lt;div class=" table-responsive  scrollme "&gt;
    &lt;table class="table table-striped"&gt;
      &lt;thead&gt;
        &lt;tr&gt;
          &lt;th&gt;Field&lt;/th&gt;
          &lt;th&gt;Values&lt;/th&gt;
          &lt;th&gt;Meaning&lt;/th&gt;
          &lt;th&gt;Examples&lt;/th&gt;
        &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td&gt;Minute&lt;/td&gt;
          &lt;td&gt;0-59&lt;/td&gt;
          &lt;td&gt;The minute of the hour&lt;/td&gt;
          &lt;td&gt;* (every minute), */2 (every 2 minutes)&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;Hour&lt;/td&gt;
          &lt;td&gt;0-23&lt;/td&gt;
          &lt;td&gt;The hour of the day&lt;/td&gt;
          &lt;td&gt;* (every hour), 18 (6 PM), 0-23/2 (every 2 hours)&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;Day of the month&lt;/td&gt;
          &lt;td&gt;1-31&lt;/td&gt;
          &lt;td&gt;The day of the month&lt;/td&gt;
          &lt;td&gt;* (every day), */2 (every 2 days), 5 (5th day of the month)&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;Month&lt;/td&gt;
          &lt;td&gt;1-12 (or names)&lt;/td&gt;
          &lt;td&gt;The month of the year&lt;/td&gt;
          &lt;td&gt;* (every month), 1 (January), */2 (every 2 months), 5 (May)&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;Day of the week&lt;/td&gt;
          &lt;td&gt;0-7 (0 and 7 represent Sunday, or use names)&lt;/td&gt;
          &lt;td&gt;The day of the week&lt;/td&gt;
          &lt;td&gt;* (every day of the week), 1 (Monday), 0,6 (Sunday and Saturday)&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;

&lt;h2&gt;3. Basic Cron Job Syntax:&lt;/h2&gt;
&lt;pre&gt;* * * * * /path/to/command&lt;/pre&gt;
&lt;p&gt;The syntax consists of five fields separated by spaces. Each field represents a unit of time and specifies when the command should be executed.&lt;/p&gt;

&lt;h2&gt;4. Explaining Cron Job Fields:&lt;/h2&gt;
&lt;p&gt;In a cron expression, there are five fields separated by spaces. Each field represents a different unit of time and determines when the command will be executed. Here's an explanation of each field:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Minute:&lt;/strong&gt; Represents the minute of the hour (0-59). For example, if you specify `30` in this field, the command will run at the 30th minute of every hour.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Hour:&lt;/strong&gt; Represents the hour of the day (0-23). If you specify `3` in this field, the command will run at 3:00 AM.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Day of Month:&lt;/strong&gt; Represents the day of the month (1-31). If you specify `1`, the command will run on the 1st day of every month.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Month:&lt;/strong&gt; Represents the month of the year (1-12 or names). If you specify `3` or `March`, the command will run in March.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Day of Week:&lt;/strong&gt; Represents the day of the week (0-7 or names, where 0 and 7 represent Sunday). If you specify `5` or `Friday`, the command will run on Fridays.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By combining these fields with specific values or wildcards (*), you can create precise schedules for your cron jobs.&lt;/p&gt;

&lt;h2&gt;5. Examples of Common Cron Jobs:&lt;/h2&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7)
# |  |  |  |  |
# *  *  *  *  *  /path/to/command to be executed
  0 18  *  *  *  /path/to/command    # every day at 18:00
 30 18  *  *  *  /path/to/command    # every day at 18:30
  0  0  1  *  *  /path/to/command    # every 1st of month (evey month)
  0  0  1  1  *  /path/to/command    # every 1 of month 1 (January) ie every year
  0  0  5  1  *  /path/to/command    # every 5th of month 1 (January) ie every year
  0  0  5  *  *  /path/to/command    # every 5th of every month

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;6. Other  Symbols in Cron Expressions:&lt;/h2&gt;
&lt;p&gt;&amp;#8226;&lt;strong&gt;Comma (,):&lt;/strong&gt; Specifies a list of values within a field. Example: &lt;code&gt;0 0 1,15 * * /path/to/command&lt;/code&gt; (Runs on the 1st and 15th day of every month)&lt;/p&gt;
&lt;p&gt;  &amp;#8226;&lt;strong&gt;Hyphen (-):&lt;/strong&gt; Specifies a range of values within a field. Example: &lt;code&gt;0 9-17 * * * /path/to/command&lt;/code&gt; (Runs every hour from 9:00 AM to 5:00 PM)&lt;/p&gt;
&lt;p&gt;  &amp;#8226;&lt;strong&gt;Slash (/):&lt;/strong&gt; Specifies increments within a field. Example: &lt;code&gt;*/10 * * * * /path/to/command&lt;/code&gt; (Runs every 10 minutes)&lt;/p&gt;

&lt;h2&gt;7. More examples of Cron Jobs:&lt;/h2&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

# More example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7)
# |  |  |  |  |
# *  *  *  *  *  /path/to/command to be executed
*/2  *  *  *  *  /path/to/command    # Every 2 Minutes
  5  0  *  *  *  $HOME/bin/daily.job &amp;gt;&amp;gt; $HOME/tmp/out 2&amp;gt;&amp;amp;1  # run five minutes after midnight, every day

 15 14  1  *  *     $HOME/bin/monthly   # run at 2:15pm on the first of every month
  0 22  *  * 1-5    /path/to/command  # run at 10 pm on weekdays, annoy Joe
23 0-23/2 * * *     echo "run 23 minutes after midn, 2am, 4am ..., everyday"
  5  4  *  * sun    echo "run at 5 after 4 every sunday"

  0  0  1  1  *   [[ $(date "+\%Y") == 2030 ]] &amp;amp;&amp;amp;/path/to/command1
  0  0  1  1  *   (( $(date "+\%Y") % 3 == 0  )) &amp;amp;&amp;amp;/path/to/command2
  0  0  1  1  *   (( $(date "+\%Y") % 3 == 1  )) &amp;amp;&amp;amp;/path/to/command3

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;command1&lt;/code&gt; will run on the 2030-01-01T00:00:00&lt;br&gt;
&lt;code&gt;command2&lt;/code&gt; will run every 3 years ( every year number multiple of 3) on the first of January at midnight, it will run on 2019, 2022, 2025, ... . &lt;br&gt;
&lt;code&gt;command3&lt;/code&gt; does the same as &lt;code&gt;command2&lt;/code&gt; but has one year offset, i.e. 2020, 2023, 2026, ...&lt;/p&gt;

&lt;p class="note" &gt;note: don't forget that you have to escape the &lt;percent&gt;-character (%) in your crontab file:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The "sixth" field (the rest of the line) specifies the command to be run. The entire command portion of the line, up to a newline or a "%" character, will be executed by /bin/sh or by the shell specified in the SHELL variable of the cronfile. A "%" character in the command, unless escaped with a backslash (\), will be changed into newline characters, and all data after the first % will be sent to the command as standard input.&lt;/p&gt;
      &lt;footer&gt;— source: man 5 crontab&lt;/footer&gt;
&lt;/blockquote&gt;

&lt;h2&gt;8. Adding Jobs with Crontab:&lt;/h2&gt;
&lt;p&gt;You can add new cron jobs using the &lt;code&gt;crontab&lt;/code&gt; command. Follow these steps:&lt;/p&gt;

&lt;p&gt;1 &amp;#8226; &lt;strong&gt;Open the Crontab Editor:&lt;/strong&gt; To edit your crontab file, enter the following command in your terminal:&lt;br&gt;&lt;code&gt;crontab -e&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;2 &amp;#8226; &lt;strong&gt;Add Your Cron Job:&lt;/strong&gt; In the crontab editor, add a new line for your cron job. Each line represents a separate cron job. &lt;/p&gt;

&lt;p&gt;3 &amp;#8226; &lt;strong&gt;Save and Exit:&lt;/strong&gt; After adding your cron job, save the changes and exit the crontab editor. The specific steps to save and exit depend on the text editor you're using. &lt;/p&gt;

&lt;p&gt;4 &amp;#8226; Once you've added your cron job, it will be saved and scheduled to run according to the specified schedule. You can verify that your cron job has been added by running &lt;code&gt;crontab -l&lt;/code&gt; to list all cron jobs associated with your user account.&lt;/p&gt;

&lt;p&gt;Remember to be cautious when editing the crontab file, as incorrect entries can lead to unexpected behavior or errors.&lt;/p&gt;

&lt;h2&gt;9. Conclusion:&lt;/h2&gt;
&lt;p&gt;In this guide, we've covered the fundamentals of cron jobs, including their purpose, syntax, and common scheduling options. Cron jobs are powerful tools for automating repetitive tasks in Unix-like operating systems, and understanding how to use them effectively can greatly enhance productivity.&lt;/p&gt;
&lt;p&gt;By mastering the syntax and scheduling options of cron jobs, users can streamline their workflow and ensure that routine tasks are executed reliably and efficiently. With the examples provided in this guide, beginners can start leveraging cron jobs to automate tasks and save time.&lt;/p&gt;

&lt;h2&gt;Stay Tuned:&lt;/h2&gt;
&lt;p&gt; Stay tuned for more guides and tutorials.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="cron jobs"></category><category term="beginner's guide"></category><category term="syntax"></category><category term="scheduling options"></category><category term="examples"></category><category term="Linux"></category><category term="automation"></category><category term="Unix"></category><category term="system administration"></category></entry><entry><title>Enhancing Quranic Study with a Command-Line Quran Search and Display Script</title><link href="https://mosaid.xyz/articles/enhancing-quranic-study-with-a-command-line-quran-search-and-display-script-221.html" rel="alternate"></link><published>2024-04-08T23:32:18+00:00</published><updated>2024-04-08T23:32:18+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-04-08:/articles/enhancing-quranic-study-with-a-command-line-quran-search-and-display-script-221.html</id><summary type="html">&lt;p&gt;Enhance your Quranic study with a versatile command-line script for searching and displaying Quranic verses seamlessly. Access specific verses, conduct interactive searches, and integrate color-coded output for improved readability. Explore the significance and usage of this tool, along with access to the GitHub repository.&lt;/p&gt;</summary><content type="html">&lt;div class="embed-responsive embed-responsive-16by9"&gt;
&lt;video class="embed-responsive-item" controls loop&gt;
&lt;source src="/static/videos/quran-search.mp4" type="video/mp4"&gt;
Your browser does not support the video tag.
&lt;/video&gt;
&lt;/div&gt;

&lt;p&gt;In the modern digital age, technology plays a significant role in facilitating various aspects of religious study and practice. Among the numerous religious texts revered by millions worldwide, the Quran holds a central position in Islam. To aid in the exploration and comprehension of this sacred scripture, a novel approach emerges—a command-line Quran search and display script. This article delves into the functionality, usage, and significance of such a tool in the context of Quranic study.&lt;/p&gt;

&lt;h2&gt;Understanding the Script&lt;/h2&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

script_dir=$(dirname &amp;quot;$0&amp;quot;)
file1=&amp;quot;$script_dir/quran-simple-clean.txt&amp;quot;
file2=&amp;quot;$script_dir/quran-uthmani.txt&amp;quot;
file3=&amp;quot;$script_dir/chapters-simple.txt&amp;quot;
quran_text=&amp;quot;$(paste -d'|' &amp;quot;$file1&amp;quot; &amp;quot;$file2&amp;quot; )&amp;quot;

# the command-line arguments
number1=$1
number2=$2
number3=$3

print_lines() {
chapter_name=$(sed -n &amp;quot;$2&amp;quot;p &amp;quot;$file3&amp;quot; )
echo &amp;quot;$1&amp;quot; | awk -F '|' -v num1=&amp;quot;$2&amp;quot; -v num2=&amp;quot;$3&amp;quot; -v num3=&amp;quot;$4&amp;quot; -v chap=&amp;quot;$chapter_name&amp;quot; \
    '{
        if ((num3 != &amp;quot;&amp;quot;) &amp;&amp; ($1 == num1) &amp;&amp; ($2 &amp;gt;= num2) &amp;&amp; ($2 &amp;lt;= num3)) {
       printf(&amp;quot;(\033[1;31m %d %s\033[1;0m) %s\n&amp;quot;,$5,chap,$6);
        } else if ((num2 != &amp;quot;&amp;quot;) &amp;&amp; (num3 == &amp;quot;&amp;quot;) &amp;&amp; ($1 == num1) &amp;&amp; ($2 == num2)) {
       printf(&amp;quot;(\033[1;31m %d %s\033[1;0m) %s\n&amp;quot;,$5,chap,$6);
        } else if ((num2 == &amp;quot;&amp;quot;) &amp;&amp; (num3 == &amp;quot;&amp;quot;) &amp;&amp; ($1 == num1)) {
       printf(&amp;quot;(\033[1;31m %d %s\033[1;0m) %s\n&amp;quot;,$5,chap,$6);
        }
    }'
}

if [[ $1 == h ]] ; then
    echo &amp;quot;Usage:
$(basename &amp;quot;$0&amp;quot;)
$(basename &amp;quot;$0&amp;quot;)  g   open with uthmani Quran in gedit
$(basename &amp;quot;$0&amp;quot;)  [sourah/chapter] [num1] [num2]&amp;quot;
    exit
fi

if [[ $1 == g ]] ; then
    nohup gedit &amp;quot;$file2&amp;quot; &amp;lt;/dev/null &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 &amp;amp;
    exit
fi

number='^[0-9]+$'
if [[ &amp;quot;$1&amp;quot; =~ $number ]] ; then
    if [ -z &amp;quot;$number2&amp;quot; ]; then
        text=$(print_lines &amp;quot;$quran_text&amp;quot; &amp;quot;$number1&amp;quot;)
    elif [[ -z &amp;quot;$number3&amp;quot; ]]; then
        text=$(print_lines &amp;quot;$quran_text&amp;quot; &amp;quot;$number1&amp;quot; &amp;quot;$number2&amp;quot;)
    else
        text=$(print_lines &amp;quot;$quran_text&amp;quot; &amp;quot;$number1&amp;quot; &amp;quot;$number2&amp;quot; &amp;quot;$number3&amp;quot;)
    fi
    if [[ $@ == *g* ]]
    then
        echo &amp;quot;$text&amp;quot; &amp;gt; /tmp/quran_result
        nohup gedit &amp;quot;/tmp/quran_result&amp;quot; &amp;lt;/dev/null &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 &amp;amp;
    else
        echo &amp;quot;$text&amp;quot;
    fi
else
    xkb-switch -s ara
    pkill -RTMIN+12 i3blocks
    pattern=$( zenity --entry --text=&amp;quot;Search Holy Quran:&amp;quot; \
        --title=&amp;quot;search Holy Quran&amp;quot; --width=500 --timeout=30)
    xkb-switch -s fr
    pkill -RTMIN+12 i3blocks

    if [[ -n $pattern ]] ; then
       results=&amp;quot;$(echo &amp;quot;$quran_text&amp;quot; | grep --color=always &amp;quot;$pattern&amp;quot;)&amp;quot;

       if [[ -n $results ]]
           then resuls_count=$(echo &amp;quot;$results&amp;quot; | wc -l)
           else resuls_count=0
       fi
       echo &amp;quot;searching : $pattern&amp;quot;
       echo &amp;quot;================================&amp;quot;
       echo &amp;quot;$resuls_count found&amp;quot;
       echo &amp;quot;================================&amp;quot;
       echo &amp;quot;$results&amp;quot; &amp;gt; /tmp/quran_result
       awk -F'|' '
        NR==FNR {chap[FNR]=$0; next}
        {printf(&amp;quot;(\033[1;31m %d %s\033[1;0m) %s\n&amp;quot;,$5,chap[$1],$6);}
       ' &amp;quot;$file3&amp;quot;  /tmp/quran_result
    fi
fi

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;The command-line Quran search and display script is a versatile tool designed to streamline the process of accessing and studying verses from the Quran. Written in the Bash scripting language, this script leverages a combination of Unix commands such as 'sed', 'awk', 'paste', 'zenity', and 'xkb-switch' to provide users with a seamless experience.&lt;/p&gt;

&lt;h2&gt;Features and Usage&lt;/h2&gt;
&lt;div class="embed-responsive embed-responsive-16by9"&gt;
&lt;video class="embed-responsive-item" controls loop&gt;
&lt;source src="/static/videos/quran-search.mp4" type="video/mp4"&gt;
Your browser does not support the video tag.
&lt;/video&gt;
&lt;/div&gt;

&lt;p&gt;The script offers several features tailored to cater to the diverse needs of users engaging with the Quran:&lt;/p&gt;
&lt;p&gt; &amp;#8226; &lt;strong&gt;Interactive Search:&lt;/strong&gt; Users can initiate an interactive search prompt, enabling them to search for specific keywords or phrases within the Quranic text.&lt;/p&gt;
&lt;p&gt;  &amp;#8226; &lt;strong&gt;Verse Display:&lt;/strong&gt; By providing chapter and verse numbers as command-line arguments, users can display specific verses from the Quran.&lt;/p&gt;
&lt;p&gt;  &amp;#8226; &lt;strong&gt;Visual Enhancement:&lt;/strong&gt; The script incorporates color-coded output for improved readability, enhancing the user experience during verse display.&lt;/p&gt;
&lt;p&gt;  &amp;#8226; &lt;strong&gt;Integration with Text Editor:&lt;/strong&gt; Users can seamlessly open the Uthmani version of the Quran in the 'gedit' text editor directly from the command line.&lt;/p&gt;

&lt;h2&gt;Significance in Quranic Study&lt;/h2&gt;

&lt;p&gt;The command-line Quran search and display script serves as a valuable tool for both scholars and enthusiasts alike:&lt;/p&gt;
&lt;p&gt; &amp;#8226; &lt;strong&gt;Accessibility:&lt;/strong&gt; By offering a command-line interface, the script provides accessibility to users across various platforms without the need for complex software installations.&lt;/p&gt;
&lt;p&gt; &amp;#8226; &lt;strong&gt;Efficiency:&lt;/strong&gt; With its streamlined search and display capabilities, the script enables users to quickly retrieve and study specific verses, enhancing the efficiency of Quranic study sessions.&lt;/p&gt;
&lt;p&gt; &amp;#8226; &lt;strong&gt;Customization:&lt;/strong&gt; The script's modular design allows for easy customization and adaptation to specific study preferences or requirements, catering to the diverse needs of users.&lt;/p&gt;

&lt;h2&gt;GitHub Repository&lt;/h2&gt;

&lt;p&gt;The script along with the Quran text files can be found in the GitHub repository: &lt;a href="https://github.com/neoMOSAID/quran-search" target="_blank" &gt;https://github.com/neoMOSAID/quran-search&lt;/a&gt;. Users can access, contribute, and provide feedback on the script and its associated resources.&lt;/p&gt;

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

&lt;p&gt;In the realm of Quranic study, the command-line Quran search and display script emerges as a versatile and efficient tool, empowering users to delve deeper into the sacred text with ease and convenience. Its integration of modern technology with traditional scholarship exemplifies the harmonious intersection of faith and innovation, facilitating a richer and more immersive Quranic study experience for all.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Quran"></category><category term="study tool"></category><category term="command-line script"></category><category term="verse display"></category><category term="search"></category><category term="Quranic study"></category><category term="interactive search"></category><category term="color-coded output"></category><category term="Quranic text"></category><category term="bash script"></category><category term="GitHub repository"></category></entry><entry><title>How to Use the date Command in Linux: Complete Guide and Examples</title><link href="https://mosaid.xyz/articles/how-to-use-the-date-command-in-linux-complete-guide-and-examples-220.html" rel="alternate"></link><published>2024-04-07T20:03:26+00:00</published><updated>2024-04-07T20:03:26+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-04-07:/articles/how-to-use-the-date-command-in-linux-complete-guide-and-examples-220.html</id><summary type="html">&lt;p&gt;Learn how to effectively use the date command in Linux for displaying, formatting, and manipulating date and time information. This comprehensive guide covers various use cases, including displaying the current date and time, formatting dates, manipulating dates, and localizing date output.&lt;/p&gt;</summary><content type="html">&lt;p&gt;The &lt;code&gt;date&lt;/code&gt; command in Linux is a versatile tool used for displaying and formatting date and time information. Whether you need to display the current date and time, manipulate dates, or format them in a specific way, &lt;code&gt;date&lt;/code&gt; has you covered. In this tutorial, we'll explore various use cases and formats of the &lt;code&gt;date&lt;/code&gt; command to help you become proficient in its usage.&lt;/p&gt;

&lt;h2&gt;Displaying the Current Date and Time&lt;/h2&gt;
&lt;p&gt;To display the current date and time, simply run the &lt;code&gt;date&lt;/code&gt; command without any arguments:&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

date

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Output:&lt;/p&gt;
&lt;pre&gt;Wed Apr  6 22:05:24 UTC 2024&lt;/pre&gt;

&lt;h2&gt;Formatting Date and Time&lt;/h2&gt;
&lt;h3&gt;Basic Formatting&lt;/h3&gt;
&lt;p&gt;You can format the output of &lt;code&gt;date&lt;/code&gt; using format specifiers. For example, to display the date in YYYY-MM-DD format:&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

date '+%Y-%m-%d'

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Output:&lt;/p&gt;
&lt;pre&gt;2024-04-06&lt;/pre&gt;

&lt;h3&gt;Customized Formats&lt;/h3&gt;
&lt;p&gt;You can customize the output further by combining different format specifiers. For instance:&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

date '+%A, %B %d, %Y - %H:%M:%S'

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Output:&lt;/p&gt;
&lt;pre&gt;Wednesday, April 06, 2024 - 22:05:24&lt;/pre&gt;

&lt;h2&gt;Manipulating Dates&lt;/h2&gt;
&lt;h3&gt;Adding or Subtracting Days&lt;/h3&gt;
&lt;p&gt;To manipulate dates by adding or subtracting days, use the &lt;code&gt;--date&lt;/code&gt; option:&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

# Add 1 day to the current date
date --date "+1 days"

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Output:&lt;/p&gt;
&lt;pre&gt;Thu Apr  7 22:05:24 UTC 2024&lt;/pre&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

# Subtract 307 days from the current date
date -d '-307 days'

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Output:&lt;/p&gt;
&lt;pre&gt;Tue May  3 22:05:24 UTC 2023&lt;/pre&gt;

&lt;h2&gt;Displaying Dates Relative to Today&lt;/h2&gt;
&lt;p&gt;You can display dates relative to today using expressions like "today" or "last Monday":&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

# Display the date of the last Monday
date -d 'last Monday'

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Output:&lt;/p&gt;
&lt;pre&gt;Mon Apr  3 00:00:00 UTC 2024&lt;/pre&gt;

&lt;h2&gt;Localization&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;LC_ALL&lt;/code&gt; environment variable can be used to specify the locale for date formatting:&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

# Display date in Arabic locale
LC_ALL=ar_MA.utf8 date '+%A %d %h %Y, %H:%M'

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Output:&lt;/p&gt;
&lt;pre&gt;الأربعاء 07 إبريل 2024, 22:05&lt;/pre&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;date&lt;/code&gt; command in Linux offers a wide range of functionalities for displaying, formatting, and manipulating dates and times. By mastering its various options and format specifiers, you can efficiently handle date-related tasks in your shell scripts and command-line operations. Experiment with different combinations of options and formats to suit your specific requirements.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Linux"></category><category term="date command"></category><category term="date formatting"></category><category term="manipulate dates"></category><category term="date and time"></category><category term="Shell Scripting"></category><category term="Linux commands"></category><category term="tutorial"></category><category term="date output"></category><category term="Linux tips"></category><category term="Linux tricks"></category></entry><entry><title>Mastering grep in Linux: Advanced Tips and Tricks for Text Pattern Searching</title><link href="https://mosaid.xyz/articles/mastering-grep-in-linux-advanced-tips-and-tricks-for-text-pattern-searching-215.html" rel="alternate"></link><published>2024-04-05T15:43:45+00:00</published><updated>2024-04-05T15:43:45+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-04-05:/articles/mastering-grep-in-linux-advanced-tips-and-tricks-for-text-pattern-searching-215.html</id><summary type="html">&lt;p&gt;Unlock the full potential of the grep command in Linux with advanced techniques. Learn how to search multiple files, perform recursive searches, invert matches, display line numbers, and more.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Grep, short for "global regular expression print," is a powerful command-line utility in Linux used for searching text patterns in files. While it's commonly known for its basic usage, such as finding a word or phrase in a file, grep offers a plethora of advanced features and techniques that can significantly enhance its utility. In this article, we'll delve into some advanced uses of the grep command in Linux.&lt;/p&gt;
&lt;h2&gt;1. Searching Multiple Files&lt;/h2&gt;
&lt;p&gt;By default, grep searches only within a single file. However, you can instruct grep to search across multiple files simultaneously by specifying a wildcard or a list of filenames.&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

grep "pattern" file1.txt file2.txt file3.txt

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Or using a wildcard:&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

grep "pattern" *.txt

&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;2. Recursive Searching&lt;/h2&gt;
&lt;p&gt;To search for a pattern in all files within a directory and its subdirectories, you can use the &lt;code&gt;-r&lt;/code&gt; or &lt;code&gt;--recursive&lt;/code&gt; option.&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

grep -r "pattern" /path/to/directory

&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;3. Inverting Match&lt;/h2&gt;
&lt;p&gt;Sometimes you may want to find lines that do not match a particular pattern. You can achieve this by using the &lt;code&gt;-v&lt;/code&gt; or &lt;code&gt;--invert-match&lt;/code&gt; option.&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

grep -v "pattern" file.txt

&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;4. Displaying Line Numbers&lt;/h2&gt;
&lt;p&gt;To display line numbers along with matching lines, use the &lt;code&gt;-n&lt;/code&gt; or &lt;code&gt;--line-number&lt;/code&gt; option.&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

grep -n "pattern" file.txt

&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;5. Case Insensitive Search&lt;/h2&gt;
&lt;p&gt;By default, grep performs case-sensitive searches. To ignore case distinctions in both the pattern and the input files, use the &lt;code&gt;-i&lt;/code&gt; or &lt;code&gt;--ignore-case&lt;/code&gt; option.&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

grep -i "pattern" file.txt

&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;6. Using Regular Expressions&lt;/h2&gt;
&lt;p&gt;Grep supports powerful regular expressions for pattern matching. Regular expressions allow you to define complex search patterns. For example, to match lines containing either "word1" or "word2," you can use the &lt;code&gt;|&lt;/code&gt; (pipe) operator.&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

grep "word1\|word2" file.txt

&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;7. Counting Matches&lt;/h2&gt;
&lt;p&gt;To count the number of lines containing a match rather than displaying the lines themselves, use the &lt;code&gt;-c&lt;/code&gt; or &lt;code&gt;--count&lt;/code&gt; option.&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

grep -c "pattern" file.txt

&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;8. Recursive Inclusion and Exclusion&lt;/h2&gt;
&lt;p&gt;When using recursive searching, you may want to include or exclude certain files or directories. You can achieve this using the &lt;code&gt;--include&lt;/code&gt; and &lt;code&gt;--exclude&lt;/code&gt; options.&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

grep -r --include "*.txt" "pattern" /path/to/directory

&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;9. Displaying Context&lt;/h2&gt;
&lt;p&gt;Sometimes it's useful to display surrounding lines along with the matching lines. You can do this using the &lt;code&gt;-A&lt;/code&gt;, &lt;code&gt;-B&lt;/code&gt;, or &lt;code&gt;-C&lt;/code&gt; options to display lines after, before, or around the matching lines, respectively.&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

grep -A 2 -B 2 "pattern" file.txt

&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;10. Output Formatting&lt;/h2&gt;
&lt;p&gt;You can customize the output format of grep using various options such as &lt;code&gt;-o&lt;/code&gt; to only display the matching part of the line, &lt;code&gt;-l&lt;/code&gt; to list filenames with matches, and &lt;code&gt;-H&lt;/code&gt; to always print filenames with output.&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

grep -o "pattern" file.txt
grep -l "pattern" *.txt
grep -H "pattern" file1.txt file2.txt

&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;The grep command in Linux is a versatile tool for searching and manipulating text data. By mastering its advanced features and techniques, you can efficiently extract information from files, directories, and even entire filesystems. Experiment with these advanced grep commands to streamline your text processing workflows and become more proficient at handling textual data in the Linux environment.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Linux"></category><category term="grep command"></category><category term="advanced"></category><category term="text searching"></category><category term="regular expressions"></category><category term="file searching"></category><category term="recursive search"></category><category term="invert match"></category><category term="line numbers"></category><category term="case insensitive search"></category><category term="output formatting"></category><category term="context display"></category><category term="text processing"></category><category term="pattern matching"></category></entry><entry><title>Mastering Cut Command in Linux: Advanced Tips and Tricks</title><link href="https://mosaid.xyz/articles/mastering-cut-command-in-linux-advanced-tips-and-tricks-212.html" rel="alternate"></link><published>2024-04-04T21:50:02+00:00</published><updated>2024-04-04T21:50:02+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-04-04:/articles/mastering-cut-command-in-linux-advanced-tips-and-tricks-212.html</id><summary type="html">&lt;p&gt;Learn advanced tips and tricks for mastering the Cut command in Linux. Discover how to manipulate text files efficiently, extract specific fields, customize delimiters, and more.&lt;/p&gt;</summary><content type="html">&lt;p&gt;The Cut command in Linux is a powerful tool for slicing and dicing text files and streams with ease. While its basic functionality allows users to extract specific columns or fields from input, mastering its advanced features can significantly enhance your efficiency and productivity. In this article, we'll delve into the advanced uses of the Cut command, showcasing its versatility and potential.&lt;/p&gt;
&lt;h2&gt;Basic Syntax:&lt;/h2&gt;
&lt;p&gt;The basic syntax of the Cut command is as follows:&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

cut OPTION... [FILE]...

&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;Sample Data File:&lt;/h2&gt;
&lt;p&gt;Let's consider a CSV file named &lt;code&gt;data.csv&lt;/code&gt; with the following content:&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

Name, Age, Gender, Occupation
John, 30, Male, Engineer
Alice, 25, Female, Scientist
Bob, 35, Male, Doctor

&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;1. Delimiter Specification:&lt;/h2&gt;
&lt;p&gt;By default, Cut uses the tab character as the field delimiter. However, it can be customized to work with any delimiter using the &lt;code&gt;-d&lt;/code&gt; option. For instance, to specify a comma (&lt;code&gt;,&lt;/code&gt;) as the delimiter, you can use:&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

cut -d',' -f1,2 data.csv

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This command extracts the first and second fields from &lt;code&gt;data.csv&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;2. Selecting Fields:&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;-f&lt;/code&gt; option allows you to specify the fields you want to extract. You can select individual fields or ranges separated by a hyphen. For example:&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

cut -d',' -f1,3-4 data.csv

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This command extracts the first field and fields 3 to 4 from the input.&lt;/p&gt;
&lt;h2&gt;3. Outputting Fields with Delimiters:&lt;/h2&gt;
&lt;p&gt;To retain the delimiters along with the selected fields in the output, you can use the &lt;code&gt;-c&lt;/code&gt; option. For example:&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

cut -d',' -f1,3-4 -c data.csv

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This command retains the delimiters and extracts the specified fields.&lt;/p&gt;
&lt;h2&gt;4. Character Ranges:&lt;/h2&gt;
&lt;p&gt;In addition to specifying fields, Cut can also extract specific character ranges using the &lt;code&gt;-c&lt;/code&gt; option. For example:&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

cut -c1-10 data.csv

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This command extracts the first 10 characters from each line of the input.&lt;/p&gt;
&lt;h2&gt;5. Suppressing Output:&lt;/h2&gt;
&lt;p&gt;You can suppress the output for lines that do not contain any delimiters using the &lt;code&gt;-s&lt;/code&gt; option. For instance:&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

cut -d',' -f2 --complement data.csv

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This command suppresses lines without delimiters and extracts all fields except the second field.&lt;/p&gt;
&lt;h2&gt;6. Outputting Complementary Fields:&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;--complement&lt;/code&gt; option complements the fields selected, i.e., it outputs all fields except those specified. For example:&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

cut -d',' --complement -f3 data.csv

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This command outputs all fields except the third field.&lt;/p&gt;
&lt;h2&gt;7. Multiple Delimiters:&lt;/h2&gt;
&lt;p&gt;Cut also supports multiple delimiters using the &lt;code&gt;-d&lt;/code&gt; option. For instance:&lt;/p&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

cut -d'[:;,]' -f1-3 data.csv

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This command extracts fields using either a colon (&lt;code&gt;:&lt;/code&gt;), semicolon (&lt;code&gt;;&lt;/code&gt;), or comma (&lt;code&gt;,&lt;/code&gt;) as the delimiter.&lt;/p&gt;
&lt;h2&gt;Conclusion:&lt;/h2&gt;
&lt;p&gt;The Cut command in Linux offers a wide range of features for text manipulation, making it an indispensable tool for data processing tasks. By mastering its advanced options, you can efficiently extract, manipulate, and analyze text data according to your specific requirements. Experiment with these advanced features to streamline your workflow and unlock the full potential of the Cut command.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Linux"></category><category term="Cut command"></category><category term="text manipulation"></category><category term="advanced tips"></category><category term="tricks"></category><category term="field extraction"></category><category term="delimiter customization"></category><category term="text processing"></category><category term="Command-line"></category><category term="data manipulation"></category><category term="efficiency"></category><category term="productivity"></category></entry><entry><title>Mounting Android Phones in Linux Made Easy</title><link href="https://mosaid.xyz/articles/mounting-android-phones-in-linux-made-easy-211.html" rel="alternate"></link><published>2024-03-23T17:21:31+00:00</published><updated>2024-03-23T17:21:31+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-03-23:/articles/mounting-android-phones-in-linux-made-easy-211.html</id><summary type="html">&lt;p&gt;Learn how to easily mount your Android phone in Linux using gvfs-mtp. Follow simple steps to connect, mount, access, and unmount your device, enhancing productivity and workflow.&lt;/p&gt;</summary><content type="html">&lt;p&gt;In the realm of technology, interoperability between different platforms has become increasingly important. For Linux users, accessing and managing files on an Android phone was once a cumbersome task, often requiring third-party software or complex configurations. However, with the advancements in the Linux ecosystem, mounting an Android phone has become simpler than ever. In this guide, we'll walk you through the steps to effortlessly mount your Android phone in a Linux environment.&lt;/p&gt;

&lt;p&gt;Modern Android devices typically use the Media Transfer Protocol (MTP) to facilitate file transfers between the device and a computer. MTP is a standardized protocol that allows the transfer of files and metadata between devices. Unlike traditional USB Mass Storage, MTP provides a more flexible and secure method for accessing files on Android devices.&lt;/p&gt;

&lt;p&gt;To interact with Android devices using MTP on a Linux system, we rely on the gvfs-mtp package. gvfs-mtp is part of the GNOME Virtual File System (gvfs) framework, which provides a high-level API for accessing and manipulating files and devices. gvfs-mtp specifically enables MTP support within the GNOME environment, allowing seamless integration of Android devices with Linux desktops.&lt;/p&gt;

&lt;h2&gt;Installing gvfs-mtp&lt;/h2&gt;

&lt;p&gt;To begin, you'll need to ensure that your Linux system has the necessary packages installed to facilitate the mounting process. Depending on your Linux distribution, you can use package managers to install the required components.&lt;/p&gt;

&lt;h3&gt;Arch-based Distributions (e.g., Arch Linux)&lt;/h3&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

pacman -S mtpfs gvfs-mtp

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

&lt;h3&gt;Debian/Ubuntu-based Distributions&lt;/h3&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

apt install gvfs-mtp

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

&lt;h2&gt;Connecting Your Android Phone&lt;/h2&gt;

&lt;p&gt;Once you've installed the necessary packages, connect your Android phone to your Linux machine using a USB cable. After connecting, it's essential to confirm whether the connection was successful and identify the device.&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

lsusb | grep -i smartphone

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

&lt;p&gt;This command will display the USB details of the connected smartphone, confirming the connection. Something like this:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

Bus 001 Device 008: ID 12d1:107e Huawei Technologies Co., Ltd. P10 smartphone

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;Mounting Your Android Phone&lt;/h2&gt;

&lt;p&gt;After confirming the connection, it's time to mount your Android phone. First, you need to find the root path of your device using the following command:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

gio mount -li | grep activation_root

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

&lt;p&gt;This command will display the activation root of your device, providing you with the necessary information to mount it. it will be like this&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

activation_root=mtp://HUAWEI_JNY-LX1_AUDUT20901002554/

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Now, let's mount the device using the obtained root path:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

gio mount "mtp://HUAWEI_JNY-LX1_AUDUT20901002554/"

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

&lt;p&gt;Alternatively, you can also use the Bus and Device Number obtained from the &lt;code&gt;lsusb&lt;/code&gt; output to mount your device:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

gio mount "mtp://[usb:001,008]/"

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

&lt;h2&gt;Accessing Mounted Device&lt;/h2&gt;

&lt;p&gt;Once the device is mounted, you can access it like any other file system. Navigate to the following directory to view the mounted device:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

ls -l /run/user/1000/gvfs

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

&lt;h2&gt;Unmounting Your Android Phone&lt;/h2&gt;

&lt;p&gt;After completing the necessary operations, it's essential to unmount your Android phone properly to ensure data integrity and safe disconnection.&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

gio mount -u "mtp://HUAWEI_JNY-LX1_AUDUT20901002554/"

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

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

&lt;p&gt;Mounting an Android phone in a Linux environment doesn't have to be a daunting task. With the right tools and commands, you can seamlessly access and manage files on your device. By following the steps outlined in this guide, you can effortlessly mount your Android phone in Linux, enhancing your productivity and workflow.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Android"></category><category term="Linux"></category><category term="gvfs-mtp"></category><category term="MTP"></category><category term="mount"></category><category term="file transfer"></category><category term="USB"></category><category term="productivity"></category><category term="Workflow"></category><category term="GNOME"></category><category term="device management"></category></entry><entry><title>How To Install Tor Browser And Open Onion Links</title><link href="https://mosaid.xyz/articles/how-to-install-tor-browser-and-open-onion-links-210.html" rel="alternate"></link><published>2024-03-23T16:38:41+00:00</published><updated>2024-03-23T16:38:41+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-03-23:/articles/how-to-install-tor-browser-and-open-onion-links-210.html</id><summary type="html">&lt;p&gt;Learn how to install Tor Browser for anonymous and secure internet browsing. Follow our step-by-step guide and enhance your online privacy today&lt;/p&gt;</summary><content type="html">&lt;h1&gt;Navigating the Web Anonymously: A Guide to Installing Tor Browser&lt;/h1&gt;

&lt;p&gt;In an age where online privacy is increasingly important, users are turning to tools like the Tor Browser to browse the internet anonymously and securely. Whether you're concerned about protecting your personal information or accessing content blocked in your region, Tor Browser provides a solution. In this guide, we'll walk you through the steps to install Tor Browser on your device.&lt;/p&gt;

&lt;h2&gt;What is Tor Browser?&lt;/h2&gt;

&lt;p&gt;Tor Browser is a web browser that enables users to browse the internet anonymously by routing their connection through a network of volunteer-operated servers. This network, known as the Tor network, encrypts and redirects internet traffic, making it difficult for anyone to track a user's online activity, including their browsing habits and location.&lt;/p&gt;

&lt;h2&gt;Step 1: Downloading Tor Browser&lt;/h2&gt;

&lt;ol&gt;
    &lt;li&gt;&lt;p&gt; Visit the official Tor Project website at &lt;a href="https://www.torproject.org/" target="_blank"&gt;https://www.torproject.org/&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; Navigate to the "Download" section.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; Select your operating system (Windows, macOS, Linux, Android) and click on the corresponding download link.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Step 2: Installing Tor Browser&lt;/h2&gt;

&lt;h3&gt;For Windows:&lt;/h3&gt;
&lt;ol&gt;
    &lt;li&gt;&lt;p&gt; Once the download is complete, locate the downloaded file (usually in your Downloads folder) and double-click on it to run the installer.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; Follow the on-screen instructions to install Tor Browser on your system.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; After the installation is complete, launch Tor Browser by double-clicking its icon.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;For macOS:&lt;/h3&gt;

&lt;ol&gt;
    &lt;li&gt;&lt;p&gt; Locate the downloaded .dmg file and double-click on it to mount the disk image.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; Drag the Tor Browser icon to your Applications folder to install it.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; Once installed, you can launch Tor Browser from your Applications folder or by searching for it in Spotlight.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;For Linux:&lt;/h3&gt;

&lt;ol&gt;
    &lt;li&gt;&lt;p&gt; Open a terminal window.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; Navigate to the directory where the downloaded file is located.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; Extract the downloaded file using the following command: `&lt;code&gt;tar -xvf tor-browser-linux64-*.tar.xz&lt;/code&gt;` (replace `&lt;code&gt;tor-browser-linux64-*.tar.xz&lt;/code&gt;` with the actual filename).&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; Once extracted, navigate to the newly created directory (`&lt;strong style="color: #000000;"&gt;tor-browser_en-US&lt;/strong&gt;`) and run the `&lt;code&gt;start-tor-browser.desktop&lt;/code&gt;` file to launch Tor Browser.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; In Arch linux, I installed it from AUR "Arch User Repository" like this with the command:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

yay -S tor-browser

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

&lt;h3&gt;For Android:&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Download Tor Browser from the Google Play Store or the official Tor Project website.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Follow the on-screen instructions to install the app on your device.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once installed, open the app and start browsing anonymously.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Step 3: Configuring Tor Browser&lt;/h2&gt;

&lt;p&gt;After launching Tor Browser, you'll be presented with the Tor Network Settings window. Here, you can choose whether to connect directly to the Tor network or configure proxy settings if you're using a network that requires one.&lt;/p&gt;

&lt;h2&gt;Step 4: Using Tor Browser&lt;/h2&gt;

&lt;p&gt;Once you've configured the network settings, you can start using Tor Browser like any other web browser. Simply enter a URL into the address bar, and Tor Browser will route your connection through the Tor network, protecting your anonymity and privacy online.&lt;/p&gt;

&lt;h2&gt;Enhancing Tor Browser Functionality with Custom Shell Scripts&lt;/h2&gt;

&lt;p&gt;In addition to the standard installation process, users can further optimize their Tor Browser experience by leveraging custom shell scripts like the &lt;code&gt;ttor&lt;/code&gt; function provided below. This script allows users to open Tor Browser with the impossible to remember onion links directly from the command line.&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;


function ttor {
    [[ "$1" == k ]] &amp;&amp; {
        kill -9 "$(cat /tmp/ttor_pid )"
        return
    }
    if [[ -t 0 ]]
        then aa="$@"
        else aa=$( cat )
    fi
    links="about:newtab  "
    links+="https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/  "  #duckduckgo
    #links+="www.thepiratebay.org  "
    links+="http://piratebayo3klnzokct3wt5yyxb2vpebbuyjl7m623iaxmqhsd52coid.onion/  "   #thepiratebay
    links+="http://jaz45aabn5vkemy4jkg4mi4syheisqn2wn2n4fsuitpccdackjwxplad.onion/  "   #onionlinks
    links+="http://xsglq2kdl72b2wmtn5b2b7lodjmemnmcct37owlz5inrhzvyfdnryqid.onion/  "      #wiki
    links+="http://bj5hp4onm4tvpdb5rzf4zsbwoons67jnastvuxefe4s3v7kupjhgh6qd.onion/  "      #wiki
    [[ -n "$aa" ]] &amp;&amp; links+="$aa"
    tor-browser --detach $( echo "${links[@]}" ) &amp;
    pid=$!
    echo $pid
    echo "$pid"  &amp;gt;| "/tmp/ttor_pid"
}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h3&gt;How to Use the &lt;code&gt;ttor&lt;/code&gt; Function:&lt;/h3&gt;

&lt;p&gt;To use the &lt;code&gt;ttor&lt;/code&gt; function, you can follow these steps:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Adding the Function to Configuration Files:&lt;/strong&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;p&gt;     Add the &lt;code&gt;ttor&lt;/code&gt; function to your &lt;code&gt;.bashrc&lt;/code&gt;, &lt;code&gt;.zshrc&lt;/code&gt;, or any other shell configuration file. You can do this by opening the file in a text editor and pasting the function definition at the end of the file.&lt;/p&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Sourcing the Configuration File:&lt;/strong&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;p&gt;     After adding the function to the configuration file, save the changes and close the editor. Then, reload the configuration file in your terminal session by running the command &lt;code&gt;source ~/.bashrc&lt;/code&gt; (or &lt;code&gt;source ~/.zshrc&lt;/code&gt; for Zsh users).&lt;/p&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Using the &lt;code&gt;ttor&lt;/code&gt; Function:&lt;/strong&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;p&gt;     To open Tor Browser with the default links, simply type &lt;code&gt;ttor&lt;/code&gt; in your terminal.&lt;/p&gt;&lt;/li&gt;
        &lt;li&gt;&lt;p&gt;     To open Tor Browser with additional links, pass them as arguments to the function, like &lt;code&gt;ttor example.com&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
        &lt;li&gt;&lt;p&gt;     To terminate the Tor Browser process, use &lt;code&gt;ttor k&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/210-ttor.png" alt="Tor browser" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Tor brower with onion sites&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Alternatively, you can save the function as a separate shell script file and make it executable. Then, you can run the shell script whenever you need to open Tor Browser with specific links.&lt;/p&gt;

&lt;p&gt;Utilizing such custom scripts not only streamlines the process of accessing Tor Browser but also provides users with added flexibility in managing their browsing sessions. However, users should exercise caution and ensure that they trust the sources of such scripts to maintain the integrity and security of their online activities.&lt;/p&gt;

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

&lt;p&gt;Installing Tor Browser is a straightforward process that allows you to browse the internet anonymously and securely. By following the steps outlined in this guide, you can take control of your online privacy and access the web without fear of surveillance or tracking. So why wait? Install Tor Browser today and start browsing the web with peace of mind.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Tor Browser"></category><category term="anonymous browsing"></category><category term="online privacy"></category><category term="internet security"></category><category term="install Tor Browser"></category><category term="secure browsing"></category><category term="online anonymity"></category><category term="Tor network"></category><category term="internet privacy"></category><category term="web anonymity"></category></entry><entry><title>Linux Basics for Hackers</title><link href="https://mosaid.xyz/articles/linux-basics-for-hackers-209.html" rel="alternate"></link><published>2024-03-15T14:34:00+00:00</published><updated>2024-03-15T14:34:00+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-03-15:/articles/linux-basics-for-hackers-209.html</id><summary type="html">&lt;p&gt;Discover the essential guide to Linux fundamentals for ethical hackers. Learn how «Linux Basics for Hackers» demystifies Linux and cybersecurity, equipping readers with practical skills&lt;/p&gt;</summary><content type="html">&lt;p&gt;In the ever-evolving landscape of cybersecurity, one tool stands out as indispensable: Linux. And for those aspiring to delve into the realms of ethical hacking and penetration testing, mastering Linux is not just advantageous; it's essential. Enter "&lt;a href="/book/programming/bash/1409/linuxbasicsforhackers.pdf/" &gt;Linux Basics for Hackers&lt;/a&gt;" by OccupyTheWeb – a comprehensive guide tailored for beginners, unveiling the fundamental principles of Linux within the context of cybersecurity.&lt;/p&gt;

&lt;p&gt;At the heart of this book lies a simple yet profound premise: understanding Linux is paramount for anyone navigating the intricate pathways of ethical hacking. OccupyTheWeb, a pseudonymous figure deeply entrenched in the cybersecurity community, crafts a meticulous roadmap for enthusiasts, demystifying the complexities of Linux and its applications in security testing.&lt;/p&gt;

&lt;p&gt;The journey begins with a meticulous exploration of the Linux command line – the quintessential tool in any hacker's arsenal. Through concise yet insightful explanations, readers are acquainted with essential commands, file manipulation techniques, and system navigation strategies. This foundational knowledge serves as the cornerstone upon which subsequent chapters build, fostering a solid understanding of Linux's inner workings.&lt;/p&gt;

&lt;p&gt;Networking, a pillar of cybersecurity, receives ample attention as OccupyTheWeb delves into the intricacies of Linux-based network configuration and management. From understanding IP addressing to navigating firewalls, readers are equipped with the expertise needed to navigate the labyrinth of network security measures.&lt;/p&gt;

&lt;p&gt;Scripting, another indispensable skill, is thoroughly elucidated, empowering readers to automate tasks and streamline processes with Bash scripting. Through practical examples and hands-on exercises, the book instills confidence in readers to harness the power of scripting for efficient and effective security operations.&lt;/p&gt;

&lt;p&gt;What sets "&lt;a href="/book/programming/bash/1409/linuxbasicsforhackers.pdf/" &gt;Linux Basics for Hackers&lt;/a&gt;" apart is its unwavering focus on practicality. Each concept is accompanied by real-world examples and scenarios, enabling readers to translate theoretical knowledge into tangible skills. Whether it's conducting vulnerability assessments, performing reconnaissance, or executing penetration tests, the book seamlessly integrates Linux fundamentals into the fabric of ethical hacking practices.&lt;/p&gt;

&lt;p&gt;Moreover, OccupyTheWeb's lucid writing style makes complex concepts accessible to novices without compromising on depth or detail. Concepts are presented in a logical progression, ensuring a smooth learning curve for readers irrespective of their prior experience with Linux or cybersecurity.&lt;/p&gt;

&lt;p&gt;In an era where cybersecurity threats loom large, "&lt;a href="/book/programming/bash/1409/linuxbasicsforhackers.pdf/" &gt;Linux Basics for Hackers&lt;/a&gt;" serves as a beacon of empowerment for aspiring ethical hackers. It transcends the realm of traditional tutorials, offering a holistic understanding of Linux and its indispensable role in safeguarding digital assets. Whether you're a cybersecurity enthusiast, a budding ethical hacker, or an IT professional looking to bolster your skill set, this book is a must-have addition to your library.&lt;/p&gt;

&lt;p&gt;In conclusion, "&lt;a href="/book/programming/bash/1409/linuxbasicsforhackers.pdf/" &gt;Linux Basics for Hackers&lt;/a&gt;" is not just a book; it's a manifesto for the next generation of cybersecurity practitioners. OccupyTheWeb's expertise shines through every page, guiding readers on a transformative journey from novice to proficient Linux users with a keen eye for security. So, if you're ready to embark on a voyage of discovery through the realm of Linux and ethical hacking, this book is your compass – pointing you towards knowledge, proficiency, and ultimately, mastery.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Linux basics"></category><category term="hackers"></category><category term="cybersecurity"></category><category term="ethical hacking"></category><category term="penetration testing"></category><category term="OccupyTheWeb"></category><category term="book review"></category><category term="Linux fundamentals"></category><category term="security testing"></category><category term="practical skills"></category></entry><entry><title>Live Stream Your Linux Screen to YouTube From The Terminal</title><link href="https://mosaid.xyz/articles/live-stream-your-linux-screen-to-youtube-from-the-terminal-208.html" rel="alternate"></link><published>2024-03-12T23:31:11+00:00</published><updated>2024-03-12T23:31:11+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-03-12:/articles/live-stream-your-linux-screen-to-youtube-from-the-terminal-208.html</id><summary type="html">&lt;p&gt;Learn how to live stream your screen to platforms like YouTube using FFmpeg with this comprehensive tutorial. Automate the process with a Bash script and manage recording status effortlessly&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;Before we get started, let's make sure we have everything we need:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;     FFmpeg installed on my system.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;     A YouTube stream key, which  you can find in your YouTube Live Dashboard.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;     (Optional) Conky, a lightweight system monitor for Linux.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Script Overview&lt;/h2&gt;
&lt;p&gt;I've created a Bash script that incorporates several functions to handle different aspects of the streaming process:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;     &lt;code&gt;notif&lt;/code&gt;: Sends desktop notifications using &lt;code&gt;notify-send&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;     &lt;code&gt;ff_recscreen&lt;/code&gt;: Configures FFmpeg for screen recording and streaming.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;     &lt;code&gt;ff_kill&lt;/code&gt;: Terminates the FFmpeg process.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Script Walkthrough&lt;/h2&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

#!/bin/bash
youtube_streaming_key="your youtube streaming key"
function notif(){
    local n_id=12347
    n_msg="$1"
    notify-send -a "ffmpeg rec" -r $n_id -u low "$n_msg" -t 1000 -i notification-message-im
}

function ff_recscreen(){
    ffmpeg -loglevel debug \
           -threads:v 1 -threads:a 4 \
           -filter_threads 2 -thread_queue_size 512 \
           -f x11grab -video_size 1366x768 -framerate 30 -i :0.0+0,0 \
           -f pulse -i alsa_input.pci-0000_00_1f.3.analog-stereo -pix_fmt yuv420p \
           -c:v libx264 -qp:v 19 \
           -profile:v high \
           -af "volume=0.5" \
           -c:a aac -b:a 128k \
           -f flv rtmp://a.rtmp.youtube.com/live2/$youtube_streaming_key
}

function ff_kill(){
    rm /tmp/recording_in_progress 2&amp;gt; /dev/null
    pkill -2 ffmpeg
    kill -9 $(pgrep -f conky_recording)
    notif "streaming finished"
}

if [[ -f "/tmp/recording_in_progress" ]]
    then ff_kill
    else
         notif "Starting streaming"
         conky -c ~/.i3/conky/conky_recording &amp;
         touch /tmp/recording_in_progress
         sleep 1.2
         ff_recscreen &amp;
fi

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;Usage&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;     &lt;strong&gt;Set Permissions:&lt;/strong&gt; First, let's make the script executable by running &lt;code&gt;chmod +x script_name.sh&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;     &lt;strong&gt;Edit the Script:&lt;/strong&gt; Now, replace &lt;code&gt;$youtube_streaming_key&lt;/code&gt; with your actual YouTube stream key in the script.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;     &lt;strong&gt;Run the Script:&lt;/strong&gt; To start streaming, simply execute the script by running &lt;code&gt;./script_name.sh&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Script Overview&lt;/h2&gt;
&lt;p&gt;The Bash script automates the process of screen streaming using FFmpeg. When executed for the first time, it creates a temporary file to track the recording status. It then sends a notification, starts Conky for displaying this small &lt;img src="/theme/images/articles/images/208-play-circle.png" &gt; icon in the top right corner of the screen, and initiates FFmpeg for screen recording and streaming. Subsequent executions of the script check for the existence of the temporary file. If the file exists, indicating an ongoing recording, the script terminates the FFmpeg and Conky processes, effectively stopping the streaming session.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;With this script, you can easily initiate live streaming of your screen to platforms like YouTube using FFmpeg. Feel free to customize it further to suit your specific requirements or integrate additional features. Happy streaming!&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="ffmpeg"></category><category term="screen streaming"></category><category term="live streaming"></category><category term="tutorial"></category><category term="bash script"></category><category term="YouTube"></category><category term="automation"></category><category term="recording"></category><category term="Conky"></category><category term="desktop notifications"></category><category term="video streaming"></category><category term="Linux"></category><category term="software tutorial"></category></entry><entry><title>A Comprehensive Guide to User and Group Administration in Linux</title><link href="https://mosaid.xyz/articles/a-comprehensive-guide-to-user-and-group-administration-in-linux-207.html" rel="alternate"></link><published>2024-03-09T22:48:52+00:00</published><updated>2024-03-09T22:48:52+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-03-09:/articles/a-comprehensive-guide-to-user-and-group-administration-in-linux-207.html</id><summary type="html">&lt;p&gt;Learn the essential Linux commands for user and group administration, from creating and deleting users to modifying group memberships and permissions. Understand the role of the /etc/passwd file in managing user accounts effectively.&lt;/p&gt;</summary><content type="html">&lt;p&gt;User and group administration is a fundamental aspect of managing a Linux system. Whether you're setting up accounts for multiple users on a server or managing permissions for various groups within a team, understanding how to effectively manage users and groups is crucial. In this comprehensive guide, we'll explore the essential Linux commands for user and group administration, covering everything from creating and deleting users to modifying group memberships and permissions.&lt;/p&gt;

&lt;h2&gt;1. Creating Users:&lt;/h2&gt;
&lt;p&gt;The first step in user administration is creating user accounts. The &lt;code&gt;useradd&lt;/code&gt; command is used for this purpose. Here's how you can create a new user:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

useradd username

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

&lt;p&gt;This command will create a new user account with the specified username. By default, the user's home directory will be created under &lt;code&gt;/home/username&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;2. Deleting Users:&lt;/h2&gt;
&lt;p&gt;If you need to remove a user account, you can use the &lt;code&gt;userdel&lt;/code&gt; command:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

userdel username

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

&lt;p&gt;This command will delete the specified user account from the system. Be cautious when using this command, as it will also delete the user's home directory and any associated files.&lt;/p&gt;

&lt;h2&gt;3. Modifying User Accounts:&lt;/h2&gt;
&lt;p&gt;To modify user account properties such as the username, home directory, or default shell, you can use the &lt;code&gt;usermod&lt;/code&gt; command. Here's an example of how to change a username:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

usermod -l newusername oldusername

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

&lt;p&gt;This command will rename the user account from &lt;code&gt;oldusername&lt;/code&gt; to &lt;code&gt;newusername&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;4. Managing Passwords:&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;passwd&lt;/code&gt; command is used to manage user passwords. You can use it to change a user's password:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

passwd username

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

&lt;p&gt;After entering this command, you'll be prompted to enter and confirm the new password for the specified user.&lt;/p&gt;

&lt;h2&gt;5. Creating Groups:&lt;/h2&gt;
&lt;p&gt;Groups allow you to manage permissions and access control for multiple users. You can create a new group using the &lt;code&gt;groupadd&lt;/code&gt; command:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

groupadd groupname

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

&lt;p&gt;This command will create a new group with the specified groupname.&lt;/p&gt;

&lt;h2&gt;6. Deleting Groups:&lt;/h2&gt;
&lt;p&gt;To delete an existing group, you can use the &lt;code&gt;groupdel&lt;/code&gt; command:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

groupdel groupname

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

&lt;p&gt;Be careful when deleting groups, as it will also remove any users that are exclusively members of that group.&lt;/p&gt;

&lt;h2&gt;7. Adding Users to Groups:&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;usermod&lt;/code&gt; command can also be used to add users to groups. Here's how you can add a user to a group:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

usermod -aG groupname username

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

&lt;p&gt;This command will add the specified user to the specified group.&lt;/p&gt;

&lt;h2&gt;8. Displaying Group Memberships:&lt;/h2&gt;
&lt;p&gt;To see which groups a user is a member of, you can use the &lt;code&gt;groups&lt;/code&gt; command:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

groups username

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

&lt;p&gt;This command will display a list of groups that the specified user is a member of.&lt;/p&gt;

&lt;h2&gt;9. Changing Group Ownership:&lt;/h2&gt;
&lt;p&gt;You can change the group ownership of a file or directory using the &lt;code&gt;chgrp&lt;/code&gt; command:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

chgrp groupname filename

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

&lt;p&gt;This command will change the group ownership of the specified file or directory to the specified group.&lt;/p&gt;

&lt;h2&gt;Conclusion:&lt;/h2&gt;
&lt;p&gt;Effective user and group administration is essential for maintaining the security and integrity of a Linux system. By mastering the commands outlined in this guide, you'll have the knowledge and skills necessary to manage users and groups efficiently. Whether you're setting up accounts for a small team or administering a large-scale server environment, these commands will serve as valuable tools in your Linux administration toolkit.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Linux"></category><category term="user administration"></category><category term="group administration"></category><category term="user management"></category><category term="group management"></category><category term="Linux commands"></category><category term="/etc/passwd"></category><category term="user accounts"></category><category term="permissions"></category><category term="Linux tutorial"></category></entry><entry><title>wchanger: A Powerful Wallpaper Changer for i3</title><link href="https://mosaid.xyz/articles/wchanger-a-powerful-wallpaper-changer-for-i3-206.html" rel="alternate"></link><published>2024-03-08T13:57:32+00:00</published><updated>2024-03-08T13:57:32+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-03-08:/articles/wchanger-a-powerful-wallpaper-changer-for-i3-206.html</id><summary type="html">&lt;p&gt;wchanger is a versatile wallpaper changer script designed for i3 users, offering seamless integration into the i3 environment. Although the repository is no longer actively updated, the 5-year-old code still functions well, albeit with room for improvement. Explore the GitHub repository and contribute to its development!&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introducing wchanger: A Powerful Wallpaper Changer for i3&lt;/h2&gt;
&lt;p&gt;Do you find yourself constantly wanting to refresh your desktop background with new and exciting wallpapers? Look no further than wchanger, the ultimate wallpaper changer designed specifically for i3 window manager users. With its plethora of features and customizable options, wchanger takes your desktop customization to the next level.&lt;/p&gt;

&lt;h2&gt;What is wchanger?&lt;/h2&gt;
&lt;p&gt;wchanger is a versatile wallpaper changer script tailored for i3 users. It seamlessly integrates into the i3 environment, allowing users to effortlessly switch between various wallpapers on different workspaces.&lt;/p&gt;

&lt;h2&gt;Key Features&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Multi-Layered Wallpaper Management&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Workspace-Specific Settings&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Extensive Command Line Interface&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Installation Guide&lt;/h2&gt;
&lt;p&gt;Getting started with wchanger is quick and straightforward. Simply follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;        Run the provided &lt;code&gt;install.sh&lt;/code&gt; script:
&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

$ ./install.sh

&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt;        Create a systemd service for wchanger:
    &lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

$ sudo cp wchanger.service /usr/lib/systemd/user/wchanger.service

&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt;        Enable the wchanger service:
    &lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

$ systemctl --user enable wchanger
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt;        Start the wchanger service:
    &lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

$ systemctl --user start wchanger

&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Help and Usage&lt;/h2&gt;
&lt;p&gt;Navigating wchanger is made easy with its intuitive help and usage guide. Here are some essential commands:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;     Adding Favorites: &lt;code&gt;af|addfav&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;     Managing Lists: &lt;code&gt;al|addlist [name] [c]&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;     Changing Wallpaper Mode: &lt;code&gt;cm|setmode [number]&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;     Previewing Montage: &lt;code&gt;l|list [o,l,number]&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;     Updating Database: &lt;code&gt;updatedb [scan]&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;    And so much more, just following its interactive help will get you started right away&lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/206-wchanger-1.png" alt="running wchanger for the first time in a workspace" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;running wchanger for the first time in a workspace&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;When initially utilizing wchanger on any workspace, users are greeted with an intuitive and interactive help system aimed at simplifying the setup process. If a mode is not defined, wchanger automatically defaults to "getwW" mode. With this mode, the script fetches the wallpapers from wallhaven website, with the default search query "nature". To set the mode, users can utilize the simple command "wchanger sm".  This interactive approach guarantees that users can effortlessly configure wchanger to suit their preferences from the very first use.&lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/206-wchanger-2.png" alt="setting wchanger mode for the workspace" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;setting wchanger mode for the workspace&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/206-wchanger-3.png" alt="setting the search id/tag for the workspace" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;setting the search id/tag for the workspace&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/207-wchanger-4.png" alt="A montage of the wallpapers of the current mode" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;A montage of the wallpapers of the current mode&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;For more information, &lt;a href="https://github.com/neoMOSAID/wchanger" target="_blank"&gt;wchanger is available on GitHub.&lt;/a&gt; Unfortunately, I no longer update it. The repository is 5 years old, but it continues to work well for me. However, the code definitely needs improving. Feel free to explore the repository and contribute to its development!&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;With wchanger, i3 users can elevate their desktop experience with dynamic and personalized wallpapers. Whether you're a minimalist or a wallpaper enthusiast, wchanger empowers you to curate your desktop environment to reflect your unique style and preferences. Try wchanger today and revolutionize your desktop customization experience!&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="wallpaper changer"></category><category term="i3"></category><category term="Desktop Customization"></category><category term="wchanger"></category><category term="script"></category><category term="GitHub"></category><category term="development"></category><category term="wallpaper management"></category><category term="desktop experience"></category><category term="dynamic wallpapers"></category><category term="Linux"></category><category term="python"></category><category term="bash"></category></entry><entry><title>Enhance Your i3 Workflow: Keybinding Visualization Made Easy</title><link href="https://mosaid.xyz/articles/enhance-your-i3-workflow-keybinding-visualization-made-easy-205.html" rel="alternate"></link><published>2024-03-07T18:21:28+00:00</published><updated>2024-03-07T18:21:28+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-03-07:/articles/enhance-your-i3-workflow-keybinding-visualization-made-easy-205.html</id><summary type="html">&lt;p&gt;Streamline your i3 window manager keybindings management with this Bash script. Learn how to simplify visualization, customize options, and enhance your workflow efficiency.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;
I've been exploring the depths of the i3 window manager, reveling in its customization options and efficiency. Keybindings, in particular, are crucial for navigating my workflow seamlessly. However, managing, remembering and visualizing these keybindings can sometimes be challenging. That's where a simple Bash script comes to the rescue.
&lt;/p&gt;

&lt;h2&gt;The Script&lt;/h2&gt;
&lt;p&gt;
Let me introduce you to a handy Bash script that simplifies the management and visualization of i3 keybindings. Here's how it works:
&lt;/p&gt;
&lt;p&gt;It checks for the existence of a keybindings file: '&lt;strong style="color: #000000;"&gt;/tmp/i3wm-keys&lt;/strong&gt;'. If the file exists, it removes it and kills any running instances of Conky.&lt;/p&gt;

&lt;p&gt;If the file doesn't exist, the script then filters the lines of &lt;strong style="background: #F5F6CE; color: #000000;"&gt;i3 config file.&lt;/strong&gt; The script extracts only the keybindings  I want to list and show later,this is done by filtering out lines that don't start with a leading space before "&lt;code&gt; bindsym&lt;/code&gt;". I have intentionally put the leading space in the beginning of the lines of some irrelevant keybindings in the i3 configuration file.&lt;/p&gt;
&lt;p&gt;These keybindings are then formatted neatly in the file '&lt;strong style="background: #F5F6CE; color: #000000;"&gt;/tmp/i3wm-keys&lt;/strong&gt;' waiting to be fed to conky.&lt;/p&gt;
&lt;p&gt;Finally, the script starts Conky, a lightweight system monitor, to display the keybindings in a customizable way.&lt;/p&gt;

&lt;h3&gt;the scirpt: &lt;/h3&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

#!/bin/bash
if [[ -f /tmp/i3wm-keys ]]
    then
        rm /tmp/i3wm-keys
        killall conky
        killall conky
    else
    grep '^bindsym' ~/.i3/config |
        sed 's/bindsym//g;s|~/.i3/||g;s|~/bin/||g' |
        sed 's/mod1/alt/g' |
        sed 's/\$mod/win/g' |
    sed 's|~/.config/wchanger/||g' |
        sed 's/exec --no-startup-id/ /g' |
        awk '{
            keys[NR]=$1;
            for (i=2; i&amp;lt;=NF; i++) {
                command[NR]=command[NR] $i " ";
            }
        }
        END {
            for (i=1; i&amp;lt;=NR; i++) {
                key = sprintf("%-25s", keys[i]);
                cmd = sprintf("%-35s", command[i]);
                gsub(/ /,".",key);
                printf "%s %s    ", key, cmd;
                if (i % 2 == 0) printf "\n"; else printf " ";
            }
        }' &amp;gt; /tmp/i3wm-keys
    nohup conky -c "${HOME}/.i3/conky/shortcuts" &amp;lt;/dev/null &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 &amp;amp;
fi

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;The text goes over many filtering and cleanning steps, the last one of them is using &lt;code&gt;awk&lt;/code&gt; that will format the &lt;strong style="color: #000000;"&gt;key/command&lt;/strong&gt; pairs. Finally saving it in the file '&lt;strong style="background: #F5F6CE; color: #000000;"&gt;/tmp/i3wm-keys&lt;/strong&gt;' before feeding it to the following conky script: &lt;/p&gt;

&lt;pre class="language-conky" &gt;
    &lt;code class="language-conky" &gt;

conky.config = {
    use_xft = true,
    font = 'DejaVu Sans Mono:size=13',
    xftalpha = 0.1,
    update_interval = 1,
    total_run_times = 0,

    own_window =true,
    own_window_type ="desktop",
    own_window_type ="override",
    own_window_transparent =true,
    own_window_hints ="undecorated,below,sticky,skip_taskbar,skip_pager",
    own_window_colour ="000000",
    own_window_argb_visual =true,
    own_window_argb_value =255,

    double_buffer = true,
    minimum_width =1150,
    maximum_width =1250,
    draw_shades = false,
    draw_outline = false,
    border_width = 1,
    draw_borders = false,
    draw_graph_borders = false,
    default_color = 'white',
    default_shade_color = 'red',
    default_outline_color = 'green',
    alignment = 'top_middle',
    gap_x = 10,
    gap_y = 10,
    no_buffers = true,
    uppercase = false,
    cpu_avg_samples = 2,
    net_avg_samples = 1,
    override_utf8_locale = true,
    use_spacer = 'none',
}

conky.text = [[
${color green}\
${voffset 15}\
${goto 370}\
${color green}\
_______________\
 .: i3wm shortcuts :. \
_______________\
${color lightblue}
${voffset +10}
${exec cat /tmp/i3wm-keys}
]]

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;
&lt;p&gt;In conclusion, this Bash script offers a simple yet effective solution for managing and visualizing i3 keybindings. Whether you're a seasoned i3 user or just getting started, integrating this script into your workflow can enhance your productivity and overall experience. Give it a try, and take control of your i3 keybindings like never before.&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;
Thank you for reading, and feel free to explore further or reach out with any questions or feedback in the comments section below.
&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="i3"></category><category term="window manager"></category><category term="Keybindings"></category><category term="bash script"></category><category term="workflow efficiency"></category><category term="Customization"></category><category term="visualization"></category><category term="productivity"></category><category term="system monitor"></category><category term="Conky"></category><category term="Linux"></category><category term="scripting"></category></entry><entry><title>Top Ways to Capture Screenshots on Your Linux System</title><link href="https://mosaid.xyz/articles/top-ways-to-capture-screenshots-on-your-linux-system-204.html" rel="alternate"></link><published>2024-03-03T21:23:13+00:00</published><updated>2024-03-03T21:23:13+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-03-03:/articles/top-ways-to-capture-screenshots-on-your-linux-system-204.html</id><summary type="html">&lt;p&gt;Discover various methods for capturing screenshots in Linux, from built-in keyboard shortcuts to specialized tools like GNOME Screenshot and Spectacle. Find the best option for your needs&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Welcome to our guide on capturing screenshots in Linux! As a Linux user, you have several options for taking screenshots, ranging from built-in keyboard shortcuts to specialized tools. In this tutorial, I'll walk you through various methods you can use to capture screenshots on your Linux system.&lt;/p&gt;

&lt;h2&gt;Using Built-in Keyboard Shortcuts&lt;/h2&gt;
&lt;p&gt;Linux offers some handy keyboard shortcuts for taking screenshots:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt; &lt;strong&gt;Print Screen (PrtSc):&lt;/strong&gt; Pressing this key captures the entire screen.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Alt + Print Screen:&lt;/strong&gt; Pressing these keys together captures only the active window.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;GNOME Screenshot Tool&lt;/h2&gt;
&lt;p&gt;If you're using the GNOME desktop environment, you can take advantage of the GNOME Screenshot utility.&lt;/p&gt;
&lt;p&gt;Even if you're not using the GNOME desktop environment, you can still install and use the GNOME Screenshot utility:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;p&gt; Install GNOME Screenshot using your package manager (e.g., &lt;code&gt;sudo apt install gnome-screenshot&lt;/code&gt; for Debian-based systems).&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; Access GNOME Screenshot by searching for it in the application menu or launching it from the terminal with the command &lt;code&gt;gnome-screenshot&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; Features include capturing specific areas, adding delays, and choosing where to save the screenshots.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/204-gnome-screenshot.png" alt="gnome-screenshot" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Screenshot of gnome-screenshot&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2&gt;KDE Spectacle&lt;/h2&gt;
&lt;p&gt;For KDE Plasma users, the default screenshot tool is Spectacle:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;p&gt; Launch Spectacle from the application menu or by pressing Alt + F2 and typing &lt;code&gt;spectacle&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; You can capture the full screen, a specific window, or a custom region with Spectacle.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Command-Line Tools&lt;/h2&gt;
&lt;p&gt;If you prefer using the command line, Linux offers some powerful screenshot utilities:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;p&gt; &lt;code&gt;scrot:&lt;/code&gt; A command-line tool for taking screenshots.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; &lt;code&gt;import:&lt;/code&gt; Part of the ImageMagick suite, allows for capturing screenshots and saving them as images.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can use scrot and import like this:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

#!/bin/bash
#
# script using import to save a screenshot of the desktop
#
filename="screenshot-$(date '+%Y-%m-%d--%H-%M-%S').png"
#scrot "/tmp/$filename"
import -window root "/tmp/$filename"
if [[ "$1" == "1" ]]
    then
          convert "/tmp/$filename" -crop 1366x768+0+0 "/tmp/$filename"
    else
          convert "/tmp/$filename" -crop 1920x1080+1366+0 "/tmp/$filename"
fi
mv "/tmp/$filename" "${HOME}/Pictures/$filename"
mpv --no-config  ${HOME}/.i3/Nikon.ogg

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;Shutter&lt;/h2&gt;
&lt;p&gt;Shutter is a feature-rich screenshot tool available for Linux:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;p&gt; Install Shutter using your package manager or download it from the official website.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; Features include annotations, editing, and sharing options.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Flameshot&lt;/h2&gt;
&lt;p&gt;Flameshot is a lightweight screenshot tool with annotation features:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;p&gt; Install Flameshot from your distribution's software repository.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; It offers simplicity and speed, making it a popular choice among users.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Other Notable Methods&lt;/h2&gt;
&lt;p&gt;In addition to the methods mentioned above, you can also use browser extensions or third-party software for taking screenshots on Linux. However, these may have their own pros and cons, so it's essential to choose the one that best fits your needs.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Capturing screenshots in Linux is easy and versatile, thanks to the various methods available. Whether you prefer built-in keyboard shortcuts, desktop utilities like GNOME Screenshot and Spectacle, or third-party tools like Shutter and Flameshot, there's something for everyone. Experiment with different methods to find the one that works best for you!&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Linux"></category><category term="screenshots"></category><category term="capture"></category><category term="keyboard shortcuts"></category><category term="GNOME Screenshot"></category><category term="spectacle"></category><category term="Shutter"></category><category term="Flameshot"></category><category term="command line tools"></category><category term="tutorial"></category><category term="utilities"></category><category term="desktop environment"></category><category term="tips"></category><category term="methods"></category></entry><entry><title>Take Command of your Cheatsheets with this script</title><link href="https://mosaid.xyz/articles/take-command-of-your-cheatsheets-with-this-script-202.html" rel="alternate"></link><published>2024-02-28T22:17:03+00:00</published><updated>2024-02-28T22:17:03+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-02-28:/articles/take-command-of-your-cheatsheets-with-this-script-202.html</id><summary type="html">&lt;p&gt;Discover the efficiency of a versatile shell script for note-taking and cheatsheet management. Learn how to streamline your command-line workflow with easy editing, listing, and viewing of cheatsheets, all within the familiar environment of the terminal&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction:&lt;/h2&gt;
&lt;p&gt;In the world of shell scripting, simplicity and functionality often go hand in hand. The provided shell script is a testament to this philosophy. It serves as a versatile tool for both note-taking and managing cheatsheets, all within the familiar environment of the command line.&lt;/p&gt;

&lt;h2&gt;The Script:&lt;/h2&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

#!/bin/zsh

if [[ $1 == "-e" ]] ; then
    vim  "${HOME}/.cheat/$2"
    exit
fi
if [[ $1 == "-l" ]] ; then
    ls  "${HOME}/.cheat/"
    exit
fi

less -p '^#.*' -R "${HOME}/.cheat/$1"

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;Usage:&lt;/h2&gt;
&lt;p&gt;The script offers three main functionalities:&lt;/p&gt;

&lt;ol&gt;
    &lt;li&gt;&lt;p&gt;&lt;strong&gt;Editing Notes/Cheatsheets:&lt;/strong&gt;
By providing the option &lt;code&gt;-e&lt;/code&gt; followed by the name of the cheatsheet, the script opens the file in Vim for editing. For instance:
&lt;code&gt;./script.sh -e ffmpeg&lt;/code&gt;&lt;br&gt;
This command opens the &lt;code&gt;ffmpeg&lt;/code&gt; file for editing within the Vim text editor.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Listing Available Cheatsheets:&lt;/strong&gt;
The option &lt;code&gt;-l&lt;/code&gt; lists all available cheatsheets stored in the &lt;code&gt;.cheat&lt;/code&gt; directory. For example:
&lt;code&gt;./script.sh -l&lt;/code&gt;
This command displays a list of all cheatsheets present in the &lt;code&gt;.cheat&lt;/code&gt; folder.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Viewing Cheatsheets:&lt;/strong&gt;
If neither &lt;code&gt;-e&lt;/code&gt; nor &lt;code&gt;-l&lt;/code&gt; options are provided, the script assumes the argument is the name of the cheatsheet to view. It then displays the contents of the cheatsheet using the &lt;code&gt;less&lt;/code&gt; pager, highlighting lines starting with &lt;code&gt;#&lt;/code&gt;, which often denote comments or headings.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/202-example-usage-1.png" alt="Example usage of cheat" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Example usage of cheat script&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;You can press &lt;code&gt;v&lt;/code&gt; while in &lt;code&gt;less&lt;/code&gt; command to enter editing mode with vim &lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/202-example-usage-2.png" alt="Example usage of cheat" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Editing the cheat file in vim&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2&gt;Usage Optimization:&lt;/h2&gt;

&lt;p&gt;To streamline usage even further, creating an alias for this script is a clever move. For instance, you could set up an alias like `&lt;code&gt;cheat&lt;/code&gt;` that points to the script's location. This way, invoking the script becomes as simple as typing `&lt;code&gt;cheat&lt;/code&gt;` followed by the desired command or option.&lt;/p&gt;

&lt;p&gt;Moreover, leveraging the autocomplete feature of &lt;strong style="color: #000000;"&gt;zsh&lt;/strong&gt; can enhance efficiency even more. By configuring Zsh's autocomplete settings, you can enable suggestions for cheatsheet names stored within the `&lt;code&gt;.cheat&lt;/code&gt;` directory. For instance, when typing `&lt;code&gt;cheat&lt;/code&gt;` and pressing the `&lt;strong style="color: #000000;"&gt;TAB&lt;/strong&gt;` key, Zsh can present a dropdown menu of all available cheatsheets, allowing for quick selection without the need to recall filenames manually. This integration seamlessly integrates the script into your workflow, making accessing cheatsheets a breeze.&lt;/p&gt;

&lt;p&gt;In practice, this autocomplete feature looks like this:&lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/202-cheat-autocomplete.png" alt="cheat autocomplete" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;cheat autocomplete&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2&gt;Benefits:&lt;/h2&gt;

&lt;ol&gt;
    &lt;li&gt;&lt;p&gt;&lt;strong&gt;Efficiency:&lt;/strong&gt;
With this script, accessing and managing cheatsheets becomes a seamless process directly from the command line, saving valuable time and effort.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Organization:&lt;/strong&gt;
All cheatsheets are stored within the &lt;code&gt;.cheat&lt;/code&gt; directory, keeping your notes neatly organized and easily accessible.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Customization:&lt;/strong&gt;
The script is easily customizable to suit individual preferences or workflow requirements. Users can modify it to integrate additional features or tailor it to specific use cases.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Conclusion:&lt;/h2&gt;
&lt;p&gt;In the realm of command-line productivity, having quick access to notes and cheatsheets can greatly enhance workflow efficiency. This shell script provides a simple yet effective solution, empowering users to manage their notes effortlessly and focus on the task at hand. With its versatility and ease of use, it stands as a valuable tool in the toolkit of any command-line aficionado.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="shell script"></category><category term="cheatsheet management"></category><category term="command-line efficiency"></category><category term="note-taking"></category><category term="terminal workflow"></category><category term="productivity tool"></category><category term="command-line tool"></category><category term="Shell Scripting"></category><category term="terminal notes"></category><category term="cheatsheet organizer"></category></entry><entry><title>Empowering Your Media Experience: MPV Control with Command Line and socat</title><link href="https://mosaid.xyz/articles/empowering-your-media-experience-mpv-control-with-command-line-and-socat-199.html" rel="alternate"></link><published>2024-02-25T14:50:19+00:00</published><updated>2024-02-25T14:50:19+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-02-25:/articles/empowering-your-media-experience-mpv-control-with-command-line-and-socat-199.html</id><summary type="html">&lt;p&gt;Unlock the power of MPV control with command line efficiency using socat integration. Seamlessly manage media playback and enhance your workflow with optimized command line tactics&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction:&lt;/h2&gt;
&lt;p&gt;In this article, I'm going to show you how to take command of MPV, a powerful media player, directly from the comfort of your command line using socat. Together, we'll unravel the intricacies of socat's capabilities, enabling us to interact with MPV seamlessly and efficiently, all with just a few keystrokes.&lt;/p&gt;

&lt;h2&gt;MPV and socat&lt;/h2&gt;
&lt;p&gt;Let's delve into the fundamentals of MPV and socat to grasp their roles in command line media control.&lt;/p&gt;
&lt;p&gt;MPV stands out as a versatile media player renowned for its wide range of features and robust performance. It supports various audio and video formats, making it a popular choice among media enthusiasts.&lt;/p&gt;
&lt;p&gt;On the other hand, socat serves as a powerful utility for establishing bidirectional data transfer between two independent processes. Its flexibility and efficiency make it an ideal tool for facilitating communication between MPV and the command line interface.&lt;/p&gt;

&lt;h2&gt;Setting up MPV and socat&lt;/h2&gt;
&lt;p&gt;Let's walk through the steps to configure MPV and socat for seamless command line control.&lt;/p&gt;
&lt;p&gt;To begin, ensure that MPV and socat are installed on your system. You can easily install them using your package manager on Linux distributions.&lt;/p&gt;
&lt;p&gt;Once installed, you have two options to configure MPV for remote control:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;p&gt; Pass the &lt;code&gt;--input-ipc-server=/path/to/your/socketfile&lt;/code&gt; option when starting MPV.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt; Alternatively, you can directly modify the MPV configuration file "&lt;code&gt;~/.config/mpv/mpv.conf&lt;/code&gt;" like this:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="language-config" &gt;
    &lt;code class="language-config" &gt;

# add the following line to ~/.config/mpv/mpv.conf
input-ipc-server =/tmp/mpvsocket

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;Bash functions for controlling MPV&lt;/h2&gt;
&lt;p&gt;Let's dive into the bash functions designed to streamline MPV control directly from the command line.&lt;/p&gt;

&lt;h3&gt;Function: mpvVolume()&lt;/h3&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

# $1 +&amp;lt;number&amp;gt; or -&amp;lt;number&amp;gt;
function mpvVolume(){
    echo "add volume $1" | socat - "$mpvsocketfile"
    data=$(
            echo '{ "command": ["get_property", "volume"] }' \
            | socat - "$mpvsocketfile" \
            | jq '.data'
    )
    msg="${data%.*}"
}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;This function adjusts the volume of MPV by a specified increment or decrement.&lt;/p&gt;
&lt;p&gt;Usage:  &lt;code&gt;mpvVolume +&amp;lt;number&amp;gt;&lt;/code&gt; or &lt;code&gt;mpvVolume -&amp;lt;number&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The function sends the volume adjustment command to MPV via socat, followed by querying the current volume level. The jq command is used to filter the retrieved data. If you want to get to know how to use it check this article : &lt;a href="/articles/jq-tutorial-how-to-get-covid-stats-and-data-from-your-terminal-29/"&gt;jq tutorial : How To Get COVID stats and data from your terminal&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;The message retrieved is utilized for notifications at the end of my shell script.&lt;/p&gt;

&lt;h3&gt;Function: mpvPause()&lt;/h3&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

function mpvPause(){
    echo 'cycle pause' | socat - "$mpvsocketfile"
    data=$(
    echo '{ "command": ["get_property", "pause"] }' \
        | socat - "$mpvsocketfile" \
        | jq '.data'
    )
    if [[ "$data" == "true" ]]
        then msg=pause
        else msg=play
    fi
}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;This function toggles the pause state of MPV.&lt;/p&gt;
&lt;p&gt;Usage: &lt;code&gt;mpvPause&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The function sends the 'cycle pause' command to MPV via socat to toggle the pause state. It then retrieves the current pause state using jq to filter the data.&lt;/p&gt;
&lt;p&gt;If the pause state is true, indicating that MPV is paused, the message is set to 'pause'; otherwise, it is set to 'play'.&lt;/p&gt;

&lt;h3&gt;Functions: mpvNext(), mpvPrev()&lt;/h3&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

function mpvNext(){
    echo 'playlist-next' | socat - "$mpvsocketfile"
}

function mpvPrev(){
    echo 'playlist-prev' | socat - "$mpvsocketfile"
}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;mpvNext()&lt;/code&gt; function instructs MPV to play the next item in the playlist.&lt;/p&gt;
&lt;p&gt;This function sends the 'playlist-next' command to MPV via socat, prompting it to play the next item in the playlist.&lt;/p&gt;
&lt;p&gt;The function &lt;code&gt;mpvPrev()&lt;/code&gt; instructs MPV to play the previous item in the playlist.&lt;/p&gt;
&lt;p&gt;This function sends the 'playlist-prev' command to MPV via socat, prompting it to play the previous item in the playlist.&lt;/p&gt;

&lt;h3&gt;Other functions&lt;/h3&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;


# Function to retrieve the total number of items in the MPV playlist
function mpvPlaylistCount(){
    cmd='{ "command": ["get_property", "playlist-count"] }'
    echo "$cmd" \
        | socat - "$mpvsocketfile" 2&amp;gt;/dev/null \
        | jq '.data'
}

# Function to retrieve the current position in the MPV playlist
function mpvPlaylistPos(){
    cmd='{ "command": ["get_property", "playlist-pos"] }'
    echo "$cmd" \
        | socat - "$mpvsocketfile" 2&amp;gt;/dev/null \
        | jq '.data'
}

# Function to set the current position in the MPV playlist to the specified number
function mpvSetPlaylistPos(){
    number=$1
    cmd='{ "command": ["set_property", "playlist-pos", "'
    cmd+="$number"
    cmd+='" ] }'
    echo "$cmd" \
        | socat - "$mpvsocketfile" 2&amp;gt;/dev/null \
        | jq '.data'
}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;These additional functions provide essential functionality for managing MPV playlists with ease. The `&lt;code&gt;mpvPlaylistCount()&lt;/code&gt;` function retrieves the total number of items in the playlist, allowing users to ascertain the size of their playlist dynamically. The `&lt;code&gt;mpvPlaylistPos()&lt;/code&gt;` function retrieves the current position in the playlist, enabling users to track their progress or determine which item is currently playing. Finally, the `&lt;code&gt;mpvSetPlaylistPos()`&lt;/code&gt; function sets the current position in the playlist to the specified number, facilitating seamless navigation within the playlist. Together, these functions enhance the control and management of MPV playlists, providing users with a convenient way to interact with their media collections.&lt;/p&gt;

&lt;h2&gt;Adding notifications&lt;/h2&gt;

&lt;p&gt;Additionally, you can enhance your MPV control setup by incorporating notifications using the media title. By appending the media title to the message, retrieved using the &lt;code&gt;'get_property', 'media-title'&lt;/code&gt; command, you can provide informative notifications while utilizing the MPV control functions. These notifications can be displayed using tools like dunstify, ensuring that you stay informed about the currently playing media and control actions.&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

msg+=" | "
msg+=$(
  echo '{ "command": ["get_property", "media-title"] }' |
  socat - "$mpvsocketfile" |
  jq '.data'
)
dunstify -a "media-controls"  -u low  -r "$msgId" "mpv: $msg"
echo "$msg"


&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;Practical examples&lt;/h2&gt;

&lt;p&gt;Let me show you how I use these functions in my workflow &lt;/p&gt;

&lt;p&gt;For instance, in my i3 window manager configuration file, I've integrated MPV control into various keybindings. This setup allows me to effortlessly control MPV even when its window is in another workspace. For example, Let's say I'm writing something in workspace 3 and mpv is playing in workspace 5, No need to navigate there, just by typing "Alt+Space" to pause MPV and "Alt+V" to increase the volume, I don't have to  disrupt my workflow.&lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/199-mpv-control-notif.png" alt="MPV Control Notification" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;MPV Control Notification&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;As we conclude our exploration, it's evident that controlling MPV from the command line using socat opens up a world of possibilities for seamless media management.&lt;/p&gt;
&lt;p&gt;With the power of bash functions and socat, you can effortlessly interact with MPV, whether it's adjusting volume, toggling playback, or navigating playlists.&lt;/p&gt;
&lt;p&gt;By incorporating these techniques into your workflow, you can streamline your media experience and enhance productivity, all while enjoying the flexibility and customization offered by command line control.&lt;/p&gt;

&lt;h2&gt;References&lt;/h2&gt;
&lt;p&gt;For more information and official documentation on the tools and concepts discussed in this article, refer to the following resources:&lt;/p&gt;

&lt;h3&gt;MPV Documentation&lt;/h3&gt;
&lt;p&gt;Official MPV documentation provides comprehensive guidance on installation, configuration, and usage of the MPV media player.&lt;br&gt;
&lt;a href="https://mpv.io/manual/" target="_blank"&gt;https://mpv.io/manual/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;socat Documentation&lt;/h3&gt;
&lt;p&gt;The official socat documentation offers detailed information on the usage and features of socat, a versatile tool for data transfer between processes.&lt;br&gt;
&lt;a href="http://www.dest-unreach.org/socat/doc/socat.html" target="_blank"&gt;http://www.dest-unreach.org/socat/doc/socat.html&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;dunstify Documentation&lt;/h3&gt;
&lt;p&gt;Explore the official dunstify documentation to learn more about creating desktop notifications from the command line using dunstify.&lt;br&gt;
&lt;a href="https://github.com/dunst-project/dunst" target="_blank"&gt;https://github.com/dunst-project/dunst&lt;/a&gt;&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="MPV"></category><category term="Command-line"></category><category term="socat"></category><category term="media playback"></category><category term="workflow efficiency"></category><category term="Linux"></category><category term="Terminal"></category><category term="bash"></category><category term="sed"></category><category term="regex"></category><category term="scripting"></category><category term="Linux distribution"></category><category term="Desktop Customization"></category><category term="file management"></category><category term="shell commands"></category><category term="Linux tips"></category><category term="media control"></category><category term="productivity"></category></entry><entry><title>Terminal Magic: Simplifying Image Editing for Busy Professionals</title><link href="https://mosaid.xyz/articles/terminal-magic-simplifying-image-editing-for-busy-professionals-197.html" rel="alternate"></link><published>2024-02-24T17:22:41+00:00</published><updated>2024-02-24T17:22:41+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-02-24:/articles/terminal-magic-simplifying-image-editing-for-busy-professionals-197.html</id><summary type="html">&lt;p&gt;Discover how to edit images effortlessly using terminal commands. From flipping and adding color hues to converting Font Awesome icons, unleash your creativity without complex software&lt;/p&gt;</summary><content type="html">&lt;p&gt;Are you like me, you don't like to edit images, or rather you don't have the time to waste learning
how to use sophisticated image editing software like Gimp or Photoshop, but sometimes you want to make
thorough changes to images. This article is just for you.&lt;/p&gt;

&lt;p&gt;In this article, I am going to show you just how easy it is to add a red hue to an image, flip it blur a
part of it or just crop it with single commands in your terminal and much more. Image editing will become a fun activity as you hack your way around it. So let's get started&lt;/p&gt;

&lt;h2&gt;1. Flip and Flop&lt;/h2&gt;

&lt;p&gt;Flipping and flopping images can offer a fresh perspective or correct orientation with just a simple command. Whether it's turning a landscape shot on its head or adjusting the orientation of a portrait, the terminal holds the key to effortless transformations. here is how to do it&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

# I resized a big image for this article:
convert hummingbird.jpg -resize 20% hummingbird-small.jpg
# flop (mirror) it
convert hummingbird-small.jpg -flop hummingbird-flop.jpg
# flip it (vertically)
convert hummingbird-small.jpg -flip hummingbird-flip.jpg

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/197-hummingbird-small.jpg
" alt="hummingbird-small" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Original&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/197-hummingbird-flop.jpg
" alt="hummingbird-small" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;flop: mirrored&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/197-hummingbird-flip.jpg
" alt="hummingbird-small" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;flip: vertically&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;So, for flipping (mirroring) horizontally, you use &lt;code&gt;-flop,&lt;/code&gt; and for flipping vertically, you use &lt;code&gt;-flip.&lt;/code&gt; I hope this clears up any confusion.&lt;/p&gt;

&lt;h2&gt;2. Red or Green Hue&lt;/h2&gt;

&lt;p&gt;Injecting a burst of color into your images is now just a command away. Say goodbye to the complexities of intricate editing software and hello to vibrant imagery with a single terminal command. Whether it's a bold red hue to intensify emotions or a serene green tint to evoke nature's tranquility&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

convert hummingbird-small.jpg -channel G -evaluate set 50% +channel hummingbird-green.jpg
convert hummingbird-small.jpg -channel B -evaluate set 50% +channel hummingbird-blue.jpg
convert hummingbird-small.jpg -channel R -evaluate set 50% +channel hummingbird-red.jpg

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/197-hummingbird-red.jpg
" alt="hummingbird-small" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;red hue&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/197-hummingbird-green.jpg
" alt="hummingbird-small" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;green hue&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/197-hummingbird-blue.jpg
" alt="hummingbird-small" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;blue hue&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2&gt;3. Blur or Erase a Part of the Image&lt;/h2&gt;

&lt;p&gt;Ever wished to blur out sensitive information or seamlessly remove distractions from your images? With terminal magic, achieving a polished and professional look is easier than you think. From blurring out background noise to erasing unwanted elements, I'll demonstrate how to wield the power of image manipulation with precision and finesse.&lt;/p&gt;

&lt;p&gt;Here's the command to do it:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

convert input.jpg -region WxH+X+Y -blur 0x8 output_blurred.jpg

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

&lt;p&gt;Replace `&lt;code&gt;input.jpg&lt;/code&gt;` with the name of your input image file, `&lt;code&gt;W&lt;/code&gt;` and `&lt;code&gt;H&lt;/code&gt;` with the width and height of the rectangle, and `&lt;code&gt;X&lt;/code&gt;` and `&lt;code&gt;Y&lt;/code&gt;` with the coordinates of the top-left corner of the rectangle. Adjust the `&lt;code&gt;0x18&lt;/code&gt;` parameter in the `&lt;code&gt;-blur&lt;/code&gt;` option to control the intensity of the blur effect (larger values mean more blur).&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

convert hummingbird-small.jpg -region 170x750+0+0 -blur 0x18 hummingbird-blurred.jpg

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

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/198-hummingbird-blurred.jpg
" alt="hummingbird-small" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;blur effect&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2&gt;4. Convert Font Awesome Icons Text to Images&lt;/h2&gt;

&lt;p&gt;Rather than loading the Font Awesome CDN on my website just to use a few icons, I create them myself. Whether it's for presentations, graphics, or personal projects, this approach allows for greater flexibility and control over icon usage without the overhead of external dependencies. Transforming text-based icons into versatile images opens up a world of creative possibilities tailored to individual needs and preferences.&lt;/p&gt;

&lt;p&gt;I have a file icon-list.txt  with a huge list of Font Awesome icons in Unicode like this:&lt;/p&gt;

&lt;pre class="language-html" &gt;
    &lt;code class="language-html" &gt;

&amp;lt;span lang='heart' foreground='#78d5e8' face='Font Awesome'&amp;gt;&amp;amp;#xf004;&amp;lt;/span&amp;gt; heart
&amp;lt;span lang='star' foreground='#a9b2fc' face='Font Awesome'&amp;gt;&amp;amp;#xf005;&amp;lt;/span&amp;gt; star
&amp;lt;span lang='star-o' foreground='#f2fc83' face='Font Awesome'&amp;gt;&amp;amp;#xf006;&amp;lt;/span&amp;gt; star-o
&amp;lt;span lang='user' foreground='#a0ff77' face='Font Awesome'&amp;gt;&amp;amp;#xf007;&amp;lt;/span&amp;gt; user
&amp;lt;span lang='film' foreground='#f7b0af' face='Font Awesome'&amp;gt;&amp;amp;#xf008;&amp;lt;/span&amp;gt; film
&amp;lt;span lang='th-large' foreground='#9890f4' face='Font Awesome'&amp;gt;&amp;amp;#xf009;&amp;lt;/span&amp;gt; th-large
&amp;lt;span lang='th' foreground='#fcedc2' face='Font Awesome'&amp;gt;&amp;amp;#xf00a;&amp;lt;/span&amp;gt; th

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/theme/images/articles/images/198-fa-share.png" &gt;And here is the shell script I use to create icons:&lt;img src="/theme/images/articles/images/198-arrow-right.png" &gt;&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

#!/bin/bash

options='-columns 6 -width 100 -lines 20 -bw 2 -yoffset -20 -location 1'

selected=$( cat ~/.i3/icon-list.txt | rofi -dmenu -i -markup-rows -p "Select icon")

# exit if nothing is selected
[[ -z $selected ]] &amp;amp;&amp;amp;  exit

iconcode=$( echo "$selected" | awk -F';' -v RS='&amp;gt;' 'NR==2{sub("&amp;amp;#x","",$1);print "\\u" $1;exit}' )
color=$( echo "$selected" | sed -E "s/^.*='#(.{6}).*$/\1/" )
icon=$(echo -ne $iconcode)
iconname=$( echo "$selected" | cut -d\' -f2 )

r=$(printf "%d" "0x${color:1:2}")
g=$(printf "%d" "0x${color:3:2}")
b=$(printf "%d" "0x${color:5:2}")

file="${HOME}/Pictures/icons/${iconname}.png"
echo "Selected icon name: $iconname"
echo "Selected icon : $icon"

convert -size 50x50 xc:none -background none -font "/home/mosaid/.fonts/fa-solid-900.ttf" -pointsize 48 -fill "rgba($r,$g,$b,1)" -gravity center -draw "text 0,0 '$icon'" "$file"

feh $file

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;The script utilizes `&lt;code&gt;rofi&lt;/code&gt;` to display the icon list interactively, facilitating seamless selection of the desired icon. Once a selection is made, the script employs the powerful `&lt;code&gt;convert&lt;/code&gt;` command from ImageMagick to transform the chosen icon's Unicode representation into a PNG image. This image is then promptly displayed using `&lt;code&gt;feh&lt;/code&gt;`, providing immediate visual feedback and enabling further exploration or utilization.&lt;/p&gt;

&lt;p&gt;And finally, the Awesome banner of this article is created with this script:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

#!/bin/bash
# Create image with simple shapes
convert -size 1600x800 xc:none \
-fill "rgba(0,0,255,0.3)" -draw "rectangle 0,0,1600,800" \
-fill "rgba(255,0,0,0.5)" -draw "circle 300,300 600,600" \
-fill "rgba(55,255,0,0.5)" -draw "rectangle 1300,300 1600,800" \
-fill "rgba(0,255,0,0.7)" -stroke "rgba(255,255,0,0.7)" -strokewidth 10 -draw "line 300,50 1500,250" \
-font "DejaVu-Sans-Mono-Bold" -pointsize 130 -fill "rgba(255,155,55,1)" \
-gravity center -size 800x -fill "rgba(255,155,55,1)" \
-draw "text 20,0 'How to edit images'" \
-draw "text 100,200 'from terminal'" image.png

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="image editing"></category><category term="terminal commands"></category><category term="effortless edits"></category><category term="creative solutions"></category><category term="image manipulation"></category><category term="flipping images"></category><category term="adding color hues"></category><category term="Font Awesome icons"></category><category term="local icon creation"></category><category term="command line tools"></category><category term="quick edits"></category><category term="image transformation"></category><category term="creative possibilities"></category></entry><entry><title>Capture Your Screen Like a Pro in i3wm: Complete Setup and Configuration</title><link href="https://mosaid.xyz/articles/capture-your-screen-like-a-pro-in-i3wm-complete-setup-and-configuration-196.html" rel="alternate"></link><published>2024-02-22T22:08:34+00:00</published><updated>2024-02-22T22:08:34+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-02-22:/articles/capture-your-screen-like-a-pro-in-i3wm-complete-setup-and-configuration-196.html</id><summary type="html">&lt;p&gt;Learn how to set up efficient screen recording in i3wm using ffmpeg. Our step-by-step guide covers configuration, troubleshooting, and integration with i3blocks for seamless status indication&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;

&lt;p&gt;In this tutorial, I'll guide you through setting up efficient screen recording capabilities within the i3 window manager (i3wm) environment using ffmpeg. i3wm is a highly customizable tiling window manager, prized for its minimalism and efficiency. Screen recording is a valuable tool for various purposes, including creating tutorials, delivering presentations, and reporting software bugs. By leveraging the flexibility of i3wm and the power of ffmpeg, you can create a seamless workflow for capturing and sharing your screen content.&lt;/p&gt;

&lt;h2&gt;Setting up i3 Configuration&lt;/h2&gt;

&lt;p&gt;Configuring i3wm to facilitate screen recording is straightforward. Start by editing the i3 configuration file located at &lt;code&gt;~/.config/i3/config&lt;/code&gt;. Within this file, you can define keybindings to execute specific commands. For our purpose, we'll assign a key combination to initiate the screen recording process.&lt;/p&gt;

&lt;p&gt;Here's an example of how to define a keybinding to trigger the screen recording script:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

bindsym mod1+r exec --no-startup-id ~/bin/ff_screen_rec

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

&lt;p&gt;In this snippet, &lt;code&gt;mod1+r&lt;/code&gt; represents the key combination (in this case, Alt + r) that will activate the screen recording. The &lt;code&gt;exec&lt;/code&gt; command is used to execute a shell command, and &lt;code&gt;--no-startup-id&lt;/code&gt; ensures that the command runs asynchronously without waiting for startup notifications. finally the &lt;code&gt;ff_screen_rec&lt;/code&gt; is my bash script&lt;/p&gt;

&lt;h2&gt;Creating the Screen Recording Script&lt;/h2&gt;

&lt;p&gt;To facilitate screen recording within the i3wm environment, we'll create a custom Bash script utilizing ffmpeg. This script automates the process of capturing the screen and optionally recording audio inputs.&lt;/p&gt;

&lt;p&gt;Below is the Bash script:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

#!/bin/bash

function ff_recscreen(){
    # Function to initiate screen recording

    # Define output file path with timestamp
    outputfile="${HOME}/Videos/ff_rec/$(date +%G_%m_%d_at_%H-%M-%S).mkv"

    # Determine audio input and output sources
    audioInputSource=$(pactl list sources short | awk '{print $2}' | grep input | tail -1)
    audioOutputSource=$(pactl list sources short | awk '{print $2}' | grep output | tail -1)

    # Get screen resolution
    SCREEN_res=$(xrandr -q --current | grep '*' | awk '{print $1}' | head -1 )

    # Set screen capture area based on input parameter
    if [[ "$1" == "2" ]]; then
        screen="1920+0"
    else
        screen="0+0"
    fi

    # Print audio and screen information
    printf '\033[1;32m audio1 : \033[1;0m %s\n' "$audioInputSource"
    printf '\033[1;32m audio2 : \033[1;0m %s\n' "$audioOutputSource"
    printf '\033[1;32m screen : \033[1;0m %s\n' "$SCREEN_res +0.0+$screen"

    # Prompt user to continue
    IFS= read -rN 1 -p "continue (Y/n) ? : " answer
    echo
    [[ "$answer" == "n" ]] &amp;amp;&amp;amp;  return

    # Construct ffmpeg command for screen recording
    cmd="ffmpeg"
    if [[ -n $audioInputSource  ]] ; then
        cmd+=" -f pulse -thread_queue_size 1024 -ac 2 -i $audioInputSource"
    fi
    if [[ -n $audioOutputSource ]] ; then
        cmd+=" -f pulse -thread_queue_size 1024 -ac 2 -i $audioOutputSource"
    fi
    cmd+=" -f x11grab -thread_queue_size 1024 -r 30 -s $SCREEN_res -i :0.0+$screen"
    cmd+=" -vf scale=trunc\(iw/2\)*2:trunc\(ih/2\)*2"
    cmd+=' -c:v libx264 -preset ultrafast -crf 18'
    cmd+=' -af highpass=f=200,lowpass=f=3000'
    cmd+=" -acodec pcm_s16le"
    cmd+=" -threads 0"
    cmd+=" $outputfile"

    # Update i3blocks and indicate recording in progress
    pkill -RTMIN+14 i3blocks
    touch /tmp/recording_in_progress
    $cmd &amp;amp;
}

function ff_kill(){
    # Function to stop screen recording and cleanup

    # Remove recording flag file
    rm /tmp/recording_in_progress 2&amp;gt; /dev/null

    # Terminate ffmpeg process
    pkill -2 ffmpeg

    # Update i3blocks
    pkill -RTMIN+14 i3blocks
}

# Check if recording is in progress
if [[ -f "/tmp/recording_in_progress" ]]; then
    ff_kill
else
    ff_recscreen
fi

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

&lt;p&gt;When the recording process starts, the script creates a temporary file to indicate that recording is in progress. It also sends a signal to &lt;strong style="color: #000000;"&gt;i3blocks&lt;/strong&gt; to update its status indicator accordingly. Conversely, when the recording ends, the script runs differently based on the presence of the temporary file. This approach ensures seamless integration with i3wm's status bar and facilitates efficient management of the recording process.&lt;/p&gt;

&lt;h2&gt;Integrating with i3blocks&lt;/h2&gt;

&lt;p&gt;i3blocks serves as a valuable tool for displaying status information in the i3wm status bar. Integrating our screen recording setup with i3blocks allows for seamless monitoring of the recording process.&lt;/p&gt;

&lt;p&gt;To configure i3blocks for this purpose, we define a custom block in the i3blocks configuration file. This block executes a script to provide real-time updates on the recording status.&lt;/p&gt;

&lt;p&gt;Here's an example of how to configure i3blocks:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

[recording_status]
color=#FF0000
command=~/.i3/top-bar/recording_status.sh
interval=once
signal=14

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

&lt;p&gt;The above configuration defines a block named &lt;code&gt;recording_status&lt;/code&gt; with a red color indicator. It executes the script &lt;code&gt;~/.i3/top-bar/recording_status.sh&lt;/code&gt; to fetch the recording status. The &lt;code&gt;interval=once&lt;/code&gt; parameter ensures that the script is executed only once per interval, and the &lt;code&gt;signal=14&lt;/code&gt; specifies the signal to be sent for updates.&lt;/p&gt;

&lt;p&gt;Now, let's take a look at the shell script responsible for providing the recording status:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash" &gt;

#!/bin/bash

if [[ -f /tmp/recording_in_progress ]]; then
    echo " "
else
    echo ""
fi

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

&lt;p&gt;This script checks for the existence of the &lt;code&gt;/tmp/recording_in_progress&lt;/code&gt; file. If the file exists, it echoes a small &lt;img src="/theme/images/articles/images/196-fa-camera-1.png" &gt; in the top right corner of my screen to indicate that a recording is in progress. Otherwise, it echoes nothing, indicating that no recording is currently taking place.&lt;/p&gt;

&lt;p&gt;To initiate screen recording, simply press &lt;code&gt;Alt + r&lt;/code&gt; on your keyboard. To stop the recording, press &lt;code&gt;Alt + r&lt;/code&gt; again. And the recording process will be termianted, then the &lt;img src="/theme/images/articles/images/196-fa-camera-1.png" &gt; icon in i3blocks will disappear, signifying that the recording has ended.&lt;/p&gt;

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

&lt;p&gt;In conclusion, integrating screen recording capabilities into the i3 window manager environment offers a seamless and efficient solution for capturing your screen content. By leveraging the power of ffmpeg for recording and i3blocks for status indication, users can easily initiate, monitor, and manage screen recordings directly within their i3wm setup.&lt;/p&gt;

&lt;p&gt;This setup not only provides convenience but also enhances productivity by streamlining the screen recording process. Whether creating tutorials, presentations, or bug reports, i3wm users can rely on this integrated solution to meet their recording needs effectively.&lt;/p&gt;

&lt;p&gt;With the flexibility to customize and extend the setup further, users can tailor it to their specific requirements and preferences. Overall, incorporating screen recording functionality into i3wm enhances the user experience and adds valuable capabilities to this lightweight and customizable window manager.&lt;/p&gt;

&lt;h2&gt;Appendix: Troubleshooting and FAQs&lt;/h2&gt;

&lt;p&gt;Here are some common troubleshooting tips and frequently asked questions related to setting up screen recording within the i3 window manager:&lt;/p&gt;

&lt;h3&gt;1. Screen Recording Not Starting&lt;/h3&gt;
&lt;p&gt;If the screen recording does not start when pressing &lt;code&gt;Alt + r&lt;/code&gt;, ensure that the keybinding is correctly configured in your i3 configuration file. Double-check the syntax and ensure that the script path is accurate.&lt;/p&gt;

&lt;h3&gt;2. No Audio in Recorded Videos&lt;/h3&gt;
&lt;p&gt;If your recorded videos lack audio, verify that the audio input and output sources are correctly specified in the screen recording script. Additionally, ensure that the selected audio sources are functioning properly and not muted.&lt;/p&gt;

&lt;h3&gt;3. i3blocks Not Displaying Recording Status&lt;/h3&gt;
&lt;p&gt;If i3blocks does not show the recording status indicator, check the configuration of the &lt;code&gt;[recording_status]&lt;/code&gt; block in your i3blocks configuration file. Ensure that the command path and signal number match the setup described in this tutorial.&lt;/p&gt;

&lt;h3&gt;4. Recording Quality or Performance Issues&lt;/h3&gt;
&lt;p&gt;If you encounter issues related to recording quality or performance, consider adjusting the ffmpeg parameters in the screen recording script. Experiment with different settings such as frame rate, resolution, and encoding options to optimize the recording quality and performance for your system.&lt;/p&gt;

&lt;h3&gt;5. Check xsession-errors file for erros&lt;/h3&gt;
&lt;p&gt;you can check &lt;code&gt;tail -f ~/.xsession-errors&lt;/code&gt; for more i3wm troubleshooting.&lt;/p&gt;

&lt;p&gt;If you have further questions or need troubleshooting assistance, feel free to comment below, and I'll be glad to help!&lt;/p&gt;

&lt;h2&gt;References and Resources&lt;/h2&gt;

&lt;p&gt;Here are some valuable references and resources for further learning and exploration:&lt;/p&gt;

&lt;h3&gt;1. &lt;a href="https://i3wm.org/docs/" target="_blank" &gt;i3wm Documentation&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Official documentation for the i3 window manager, providing comprehensive guides and references for configuring and using i3wm effectively.&lt;/p&gt;

&lt;h3&gt;2. &lt;a href="https://ffmpeg.org/documentation.html" target="_blank" &gt;ffmpeg Documentation&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Official documentation for ffmpeg, offering detailed explanations of ffmpeg's features, options, and usage for audio and video processing tasks.&lt;/p&gt;

&lt;h3&gt;3. &lt;a href="https://github.com/vivien/i3blocks" target="_blank" &gt;i3blocks Documentation&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Documentation for i3blocks, containing information on configuring and customizing i3blocks for displaying status information in the i3wm status bar.&lt;/p&gt;

&lt;h3&gt;4. Online Forums and Communities&lt;/h3&gt;
&lt;p&gt;Engage with the i3wm and ffmpeg communities through online forums and discussion platforms such as &lt;a href="https://www.reddit.com/r/i3wm/" target="_blank" &gt;Reddit's i3wm community&lt;/a&gt;. These communities often provide valuable insights, tips, and solutions for troubleshooting and optimization.&lt;/p&gt;

&lt;p&gt;Explore these resources to deepen your understanding of i3wm, ffmpeg, and related tools, and to connect with fellow users for support and collaboration.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="i3wm"></category><category term="ffmpeg"></category><category term="screen recording"></category><category term="tutorial"></category><category term="setup"></category><category term="configuration"></category><category term="Troubleshooting."></category><category term="integration"></category><category term="i3blocks"></category><category term="status indication"></category></entry><entry><title>Comprehensive Guide to the find Command in Linux</title><link href="https://mosaid.xyz/articles/comprehensive-guide-to-the-find-command-in-linux-194.html" rel="alternate"></link><published>2024-02-18T20:47:18+00:00</published><updated>2024-02-18T20:47:18+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-02-18:/articles/comprehensive-guide-to-the-find-command-in-linux-194.html</id><summary type="html">&lt;p&gt;Dive into the world of Linux file management with our comprehensive guide to the find command. Learn how to search, filter, and perform actions on files and directories efficiently. Explore advanced techniques and best practices for maximizing productivity&lt;/p&gt;</summary><content type="html">&lt;p&gt;Welcome to my comprehensive guide on using the &lt;code&gt;find&lt;/code&gt; command in Linux. Whether you're a beginner or an experienced user, mastering the &lt;code&gt;find&lt;/code&gt; command can significantly enhance your ability to navigate and manipulate files and directories in the Linux environment.&lt;/p&gt;

&lt;h2&gt;Basic Syntax and Usage&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;find&lt;/code&gt; command in Linux is incredibly versatile, allowing you to search for files and directories based on various criteria. Here's the basic syntax:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

find [path...] [expression]

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

&lt;p&gt;To find files by case-insensitive extension (e.g., &lt;code&gt;.jpg&lt;/code&gt;, &lt;code&gt;.JPG&lt;/code&gt;, &lt;code&gt;.jpG&lt;/code&gt;), you can use:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

find . -iname "*.jpg"

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

&lt;p&gt;Similarly, to find directories:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

find . -type d

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

&lt;p&gt;And to find files:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

find . -type f

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

&lt;h2&gt;Searching for Files and Directories&lt;/h2&gt;

&lt;p&gt;When searching for files, you can specify additional criteria such as permissions or file type. For example, to find files with octal permission &lt;code&gt;777&lt;/code&gt;:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

find . -type f -perm 777

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

&lt;p&gt;To find files modified more than 7 days ago:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

find . -type f -mtime +7d -ls

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

&lt;p&gt;And to search for symlinks owned by a specific user:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

find . -type l --user=username -ls

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

&lt;h2&gt;Performing Actions on Found Items&lt;/h2&gt;

&lt;p&gt;Once you've found the files or directories you're interested in, you can perform various actions on them. For instance, to delete files with a specific extension, you can use:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

find ./path/ -name '*.txt' -exec rm '{}' \;

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

&lt;p&gt;To modify permissions of found files:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

find . -type f -exec chmod 644 {} \;

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

&lt;h2&gt;Combining Multiple Criteria&lt;/h2&gt;

&lt;p&gt;Combining multiple search criteria can help you narrow down your results effectively. You can use logical operators like &lt;code&gt;-o&lt;/code&gt; and &lt;code&gt;-prune&lt;/code&gt; to exclude certain directories or files from the search. For example, to find all directories except &lt;code&gt;tmp&lt;/code&gt;:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

find /path/to/dest -type d \( ! -name tmp \) -print

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

&lt;h2&gt;Advanced Usage&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;find&lt;/code&gt; command supports advanced usage scenarios, such as searching for files based on size or modification time. For instance, to find files bigger than 2 Megabytes and list them using the &lt;code&gt;ls&lt;/code&gt; command with all their information from permissions to size:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
&lt;code class="language-bash"&gt;

find . -type f -size +200000000c -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
#the same as
find . -type f -size +2M -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'

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

&lt;p&gt;You can play with the fields of &lt;code&gt;awk&lt;/code&gt; command to get your desired output.&lt;/p&gt;

&lt;h2&gt;Best Practices and Tips&lt;/h2&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;Be cautious when using &lt;code&gt;-exec&lt;/code&gt; to perform actions on found items, as it executes the command for each found item.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Combine &lt;code&gt;find&lt;/code&gt; with other commands like &lt;code&gt;grep&lt;/code&gt; or &lt;code&gt;xargs&lt;/code&gt; for more complex operations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Regularly review and test your &lt;code&gt;find&lt;/code&gt; commands before performing actions like deletion to avoid unintended consequences.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;The &lt;code&gt;find&lt;/code&gt; command is an indispensable tool for navigating and managing files and directories in Linux. By mastering its syntax and various options, you can streamline your workflow and perform tasks more efficiently. I encourage you to experiment with the examples provided and explore further possibilities offered by this powerful command.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Linux"></category><category term="find command"></category><category term="file management"></category><category term="directory management"></category><category term="search criteria"></category><category term="file search"></category><category term="directory search"></category><category term="file manipulation"></category><category term="directory manipulation"></category><category term="Linux commands"></category><category term="Linux tips"></category><category term="Linux tricks"></category><category term="shell commands"></category><category term="Shell Scripting"></category><category term="file permissions"></category><category term="search operators"></category><category term="logical operators"></category></entry><entry><title>How I Control My PC from My Phone: A Guide Using Termux, SSH, and SSHpass</title><link href="https://mosaid.xyz/articles/how-i-control-my-pc-from-my-phone-a-guide-using-termux-ssh-and-sshpass-193.html" rel="alternate"></link><published>2024-02-16T22:49:44+00:00</published><updated>2024-02-16T22:49:44+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-02-16:/articles/how-i-control-my-pc-from-my-phone-a-guide-using-termux-ssh-and-sshpass-193.html</id><summary type="html">&lt;p&gt;Discover the ultimate guide to controlling your Arch Linux PC from your Android phone using Termux and SSH. Unlock productivity, efficiency, and convenience with step-by-step instructions and tips&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Hey there, fellow tech enthusiasts! Imagine having the power to control your PC right from the palm of your hand. Well, buckle up because I'm about to show you how I do just that using Termux, SSH, and SSHpass. Get ready to unlock a whole new level of convenience and productivity!&lt;/p&gt;

&lt;h2&gt;Setting Up Termux, SSH, and SSHpass&lt;/h2&gt;
&lt;ol&gt;
    &lt;li&gt;&lt;p&gt;&lt;strong&gt;Install Termux:&lt;/strong&gt; First things first, head over to the Google Play Store or F-Droid and install Termux on your Android device. It's a powerful terminal emulator that's perfect for our needs.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt;&lt;strong&gt;Install SSH:&lt;/strong&gt; Once you've got Termux up and running, install the OpenSSH package using the package manager:
&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;

pkg install openssh

&lt;/code&gt;
&lt;/pre&gt;&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt;&lt;strong&gt;Install SSHpass:&lt;/strong&gt; Additionally, install SSHpass, a handy tool for non-interactive SSH password authentication:
&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;

    pkg install sshpass

&lt;/code&gt;
&lt;/pre&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Setting Up SSH on Your PC&lt;/h2&gt;
&lt;ol&gt;
    &lt;li&gt;&lt;p&gt;&lt;strong&gt;Enable SSH:&lt;/strong&gt; Now, let's head over to our PC running Arch Linux and enable SSH. If you haven't already, install the &lt;code&gt;openssh&lt;/code&gt; package and start the SSH service:
&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;

    sudo pacman -S openssh

&lt;/code&gt;
&lt;/pre&gt;&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt;&lt;strong&gt;Configure SSH:&lt;/strong&gt; To ensure secure connections, let's configure SSH by setting up SSH keys for authentication. This adds an extra layer of security and convenience.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Connecting Your Phone to Your PC&lt;/h2&gt;
&lt;ol&gt;
    &lt;li&gt;&lt;p&gt;&lt;strong&gt;Find PC's IP Address:&lt;/strong&gt; Open up a terminal in Termux and find your PC's local IP address using the &lt;code&gt;ifconfig&lt;/code&gt; or &lt;code&gt;ip addr&lt;/code&gt; command.&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt;&lt;strong&gt;Connect via SSH:&lt;/strong&gt; With the IP address in hand, establish a connection to your PC from Termux using SSHpass. Use the following command, replacing &lt;code&gt;"mylinuxpassword"&lt;/code&gt; with your actual password, &lt;code&gt;myusername&lt;/code&gt; with your username, and &lt;code&gt;192.168.1.12&lt;/code&gt; with your PC's IP address:
&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;

    ssh myusername@192.168.1.12

&lt;/code&gt;
&lt;/pre&gt;
        This command will prompt for your password and establish a secure SSH connection to your PC.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;after the first connection with ssh, you can skip the part of the password prompt everytime using &lt;code&gt; sshpass&lt;/code&gt; like so:&lt;/p&gt;

&lt;pre class="language-bash"&gt;
    &lt;code class="language-bash"&gt;

sshpass -p "mylinuxpassword" ssh myusername@192.168.1.12

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

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/193-screenshot-termux.jpg" alt="Screenshot ranger file manager" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Screenshot: ranger file manager&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2&gt;Executing Commands from Your Phone&lt;/h2&gt;
&lt;ol&gt;
    &lt;li&gt;&lt;p&gt;&lt;strong&gt;Basic Commands:&lt;/strong&gt; Start off by running some basic commands like &lt;code&gt;ls&lt;/code&gt;, &lt;code&gt;pwd&lt;/code&gt;, and &lt;code&gt;date&lt;/code&gt; directly from your phone. It's like having a mini Linux terminal in your pocket!&lt;/p&gt;&lt;/li&gt;
    &lt;li&gt;&lt;p&gt;&lt;strong&gt;Running Custom Shell Scripts:&lt;/strong&gt; Take things up a notch by running your own custom shell scripts stored on your PC. Whether it's controlling music playback with &lt;code&gt;mpc&lt;/code&gt; or snapping photos with &lt;code&gt;ffmpeg&lt;/code&gt;, the possibilities are endless.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As always, I created a simple alias for this whole command, therfore making connecting to my pc as efficient as possible. As an Arch linux user, almost all the daily commands and programs I use are actually my proper shell scripts. So for me, almost all the functionality of my pc can be used with this small command through my phone&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;By harnessing the power of Termux, SSH, and SSHpass, I've transformed my phone into a remote control for my PC. The convenience and productivity gains are undeniable, and I can't imagine going back. Give it a try, and unlock a whole new world of possibilities!&lt;/p&gt;

&lt;h2&gt;Additional Resources&lt;/h2&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a target="_blank" href="https://wiki.termux.com/wiki/Main_Page"&gt;Termux Wiki&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a target="_blank" href="https://www.openssh.com/"&gt;OpenSSH Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Termux"></category><category term="SSH"></category><category term="Arch Linux"></category><category term="Android"></category><category term="remote control"></category><category term="productivity"></category><category term="efficiency"></category><category term="shell scripts"></category><category term="automation"></category><category term="Tasker integration"></category><category term="mobile"></category><category term="remote access"></category><category term="SSHpass"></category><category term="Security"></category></entry><entry><title>How I Capture High-Quality Webcam Photos with a Simple Shell Script</title><link href="https://mosaid.xyz/articles/how-i-capture-high-quality-webcam-photos-with-a-simple-shell-script-192.html" rel="alternate"></link><published>2024-02-16T21:35:58+00:00</published><updated>2024-02-16T21:35:58+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-02-16:/articles/how-i-capture-high-quality-webcam-photos-with-a-simple-shell-script-192.html</id><summary type="html">&lt;p&gt;Capture stunning photos from your webcam effortlessly with this step-by-step shell script tutorial. Learn how to automate the process and unleash your creativity!&lt;/p&gt;</summary><content type="html">&lt;p&gt;Hey there, fellow tech enthusiasts! If you're anything like me, you love finding efficient ways to automate everyday tasks. Today, I'm excited to share with you a nifty shell script I've crafted that allows me to effortlessly capture stunning photos from my webcam.&lt;/p&gt;

&lt;h2&gt;Purpose&lt;/h2&gt;

&lt;p&gt;The purpose of this shell script is straightforward: to streamline the process of capturing photos from a webcam and saving them as high-quality JPEG files, all with just a few lines of code.&lt;/p&gt;

&lt;h2&gt;Prerequisites&lt;/h2&gt;

&lt;p&gt;Before diving into the magic of this script, ensure you have &lt;code&gt;v4l-utils&lt;/code&gt; and &lt;code&gt;ffmpeg&lt;/code&gt; installed on your system. These tools are essential for interacting with the webcam and processing the captured video stream.&lt;/p&gt;

&lt;h2&gt;Script Overview&lt;/h2&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

#!/bin/bash

# Check if v4l2-ctl and ffmpeg are installed
if ! command -v v4l2-ctl &amp;amp;&amp;gt; /dev/null || ! command -v ffmpeg &amp;amp;&amp;gt; /dev/null; then
    echo &amp;quot;Please install v4l-utils and ffmpeg using your package manager.&amp;quot;
    exit 1
fi

# Get the maximum resolution supported by the camera
resolution=$(v4l2-ctl --list-formats-ext | grep -oP '\d+x\d+' | tail -n 1)

# Set the output file name
output_file=&amp;quot;${HOME}/Pictures/photo_$(date +&amp;quot;%Y-%m-%d_%H-%M-%S&amp;quot;).jpg"

# Capture photo with the detected maximum resolution
ffmpeg -f video4linux2 -s &amp;quot;$resolution&amp;quot; -i /dev/video0 -q:v 1 -vframes 1 &amp;quot;$output_file&amp;quot; 2&amp;gt;/dev/null

# Check if the photo was captured successfully
if [ $? -eq 0 ]; then
    echo &amp;quot;Photo captured successfully. Saved as $output_file&amp;quot;
    nohup feh &amp;quot;$output_file&amp;quot; &amp;lt;/dev/null &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 &amp;amp;
else
    echo &amp;quot;Failed to capture photo.&amp;quot;
fi

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Let me walk you through how this script works. We'll cover everything from checking for necessary commands to capturing the perfect shot.&lt;/p&gt;

&lt;h2&gt;Understanding the Script&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;    &lt;strong&gt;Checking for Required Commands:&lt;/strong&gt; We start by verifying the presence of &lt;code&gt;v4l2-ctl&lt;/code&gt; and &lt;code&gt;ffmpeg&lt;/code&gt; on the system.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;    &lt;strong&gt;Getting Maximum Resolution:&lt;/strong&gt; Next, we determine the maximum resolution supported by the webcam.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;    &lt;strong&gt;Setting Output File Name:&lt;/strong&gt; Each photo captured is uniquely named using a timestamp.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;    &lt;strong&gt;Capturing the Photo:&lt;/strong&gt; Using &lt;code&gt;ffmpeg&lt;/code&gt;, we capture a single frame from the webcam at the detected maximum resolution.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;    &lt;strong&gt;Verification:&lt;/strong&gt; Finally, we check if the capture was successful and provide feedback accordingly.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;How to Use the Script&lt;/h2&gt;

&lt;p&gt;Now, let's put this script to work:&lt;/p&gt;

&lt;ol&gt;

&lt;li&gt;&lt;p&gt;    &lt;strong&gt;Copy:&lt;/strong&gt;the script code and save it to a file on your system.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;    &lt;strong&gt;Grant Execution Permissions:&lt;/strong&gt; Make the script executable with &lt;code&gt;chmod +x script.sh&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create an Alias:&lt;/strong&gt; Create an alias for the script using the following command: &lt;pre&gt;$ alias capture_photo='/path/to/script.sh'&lt;/pre&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;    &lt;strong&gt;Verify Alias:&lt;/strong&gt; Check if the alias is created successfully by running:&lt;pre&gt;$ which capture_photo&lt;/pre&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, you can use the &lt;code&gt;capture_photo&lt;/code&gt; alias to execute the script from anywhere in your terminal.&lt;/p&gt;

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

&lt;p&gt;With this simple yet powerful shell script, capturing stunning photos from your webcam has never been easier. Embrace the convenience of automation and let your creativity flow. Give it a try, and don't hesitate to customize it to suit your preferences!&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Shell Scripting"></category><category term="Webcam Photography"></category><category term="automation"></category><category term="tutorial"></category><category term="Capture Photos"></category><category term="v4l-utils"></category><category term="ffmpeg"></category><category term="Scripting Guide"></category><category term="Webcam Capture"></category><category term="Photography Automation"></category></entry><entry><title>5 Best Linux Distributions for Beginners</title><link href="https://mosaid.xyz/articles/5-best-linux-distributions-for-beginners-181.html" rel="alternate"></link><published>2024-01-21T11:41:39+00:00</published><updated>2024-01-21T11:41:39+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-01-21:/articles/5-best-linux-distributions-for-beginners-181.html</id><summary type="html">&lt;p&gt;Explore beginner-friendly Linux distributions such as Ubuntu, Linux Mint, MX Linux, Elementary OS, and Zorin OS. Find the perfect Linux distribution for your needs, with links to official websites. Learn about live USB exploration and enjoy a smooth transition from Windows or macOS to Linux&lt;/p&gt;</summary><content type="html">&lt;p&gt;Hello there! If you're new to Linux and feeling a bit overwhelmed by all the different distributions out there, don't worry - I've got you covered. As someone who's been using Linux for years, I can tell you that there are plenty of beginner-friendly options available that will make your transition from Windows or macOS as smooth as possible.&lt;/p&gt;

&lt;h2&gt;&lt;a href="https://ubuntu.com/" target="_blank"&gt;Ubuntu&lt;/a&gt;&lt;/h2&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/181-screenlets-ubuntu.png" alt="Ubuntu desktop" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Ubuntu&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;If you're looking for a widely-used and well-supported distribution, &lt;strong style="color: #000000;"&gt;&lt;a href="https://ubuntu.com/" target="_blank"&gt;Ubuntu&lt;/a&gt;&lt;/strong&gt; is an excellent choice. It's user-friendly, has a large community, and is based on Debian. Ubuntu provides a reliable and stable environment, making it suitable for both beginners and experienced users. Plus, it has a Software Center for easy application installation and updates.&lt;/p&gt;

&lt;h2&gt;&lt;a href="https://linuxmint.com/" target="_blank"&gt;Mint&lt;/a&gt;&lt;/h2&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/181-linux-mint-19-tara-beta-released-with-cinnamon-mate-and-xfce-editions-521387-3.jpg" alt="Linux Mint desktop" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Linux Mint&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Personally, I recommend starting with &lt;strong style="color: #000000;"&gt;&lt;a href="https://linuxmint.com/" target="_blank"&gt;Linux Mint&lt;/a&gt;&lt;/strong&gt;. It's based on &lt;strong style="color: #000000;"&gt;&lt;a href="https://ubuntu.com/" target="_blank"&gt;Ubuntu&lt;/a&gt;&lt;/strong&gt;, which is one of the most popular distributions out there, but it has a user-friendly interface that's reminiscent of Windows. Plus, it comes with a variety of pre-installed applications, so you won't have to spend too much time searching for software.&lt;/p&gt;

&lt;h2&gt;&lt;a href="https://mxlinux.org/" target="_blank"&gt;MX Linux&lt;/a&gt;&lt;/h2&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/181-mx-linux-desktop.jpeg" alt="MX Linux desktop" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;MX Linux&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;If you're looking for something even more lightweight, I'd suggest giving &lt;strong style="color: #000000;"&gt;&lt;a href="https://mxlinux.org/" target="_blank"&gt;MX Linux&lt;/a&gt;&lt;/strong&gt; a try. It's based on &lt;strong style="color: #000000;"&gt;&lt;a href="https://www.debian.org/" target="_blank"&gt;Debian&lt;/a&gt;&lt;/strong&gt; and uses the Xfce desktop environment, which is fast and efficient. MX Linux also has a software manager that makes it easy to install new applications and updates.&lt;/p&gt;

&lt;h2&gt;&lt;a href="https://elementary.io/" target="_blank"&gt;Elementary OS&lt;/a&gt;&lt;/h2&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/181-desktop.jpg" alt="Elementary OS desktop" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Elementary OS&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;For those who prefer a more modern interface, &lt;strong style="color: #000000;"&gt;&lt;a href="https://elementary.io/" target="_blank"&gt;Elementary OS&lt;/a&gt;&lt;/strong&gt; is a great choice. It's designed to be simple and easy to use, with a beautiful interface that's similar to &lt;strong style="color: #000000;"&gt;&lt;a href="https://www.apple.com/macos/" target="_blank"&gt;macOS&lt;/a&gt;&lt;/strong&gt;. Like Mint and MX Linux, it also comes with a variety of pre-installed applications. Elementary OS is considered to be the most beautiful distribution, it has a great file manager similar to that of macOS.&lt;/p&gt;

&lt;h2&gt;&lt;a href="https://zorinos.com/" target="_blank"&gt;Zorin OS&lt;/a&gt;&lt;/h2&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/181-zorin-16-2.jpg" alt="Zorin OS desktop" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Zorin OS&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;strong style="color: #000000;"&gt;&lt;a href="https://zorinos.com/" target="_blank"&gt;Zorin OS&lt;/a&gt;&lt;/strong&gt; is another great option for those who are new to Linux and are looking for a Windows-like interface. It's designed to be easy to use for Windows users who are new to Linux, and it comes with a variety of pre-installed applications and a software center that makes it easy to install new software.&lt;/p&gt;

&lt;p&gt;Ultimately, the best Linux distribution for you will depend on your personal preferences and needs. My advice would be to try out a few different distributions and see which one you like the best. Linux is all about freedom of choice, so don't be afraid to experiment and find the distribution that works best for you. Good luck and happy exploring!&lt;/p&gt;

&lt;p&gt;If you're curious about Linux but not ready to commit, you can also create a bootable USB drive with your chosen distribution and run it in a live environment. This allows you to explore the system without making any changes to your computer's existing setup. It's a great way to test the waters and see if Linux suits your needs before making a permanent switch.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Linux"></category><category term="Ubuntu"></category><category term="Linux Mint"></category><category term="MX Linux"></category><category term="Elementary OS"></category><category term="Zorin OS"></category><category term="Beginner-friendly Linux"></category><category term="Linux distributions"></category><category term="Windows to Linux"></category><category term="macOS to Linux"></category><category term="Live USB"></category><category term="Linux exploration"></category><category term="Linux transition"></category><category term="Linux for beginners"></category><category term="Linux installation"></category><category term="open-source"></category><category term="operating systems"></category><category term="Software center"></category><category term="Linux community"></category><category term="Debian"></category><category term="User-friendly Linux"></category></entry><entry><title>Quranic Wisdom on Your Desktop: Conky Setup Explained</title><link href="https://mosaid.xyz/articles/quranic-wisdom-on-your-desktop-conky-setup-explained-180.html" rel="alternate"></link><published>2024-01-18T13:48:46+00:00</published><updated>2024-01-18T13:48:46+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-01-18:/articles/quranic-wisdom-on-your-desktop-conky-setup-explained-180.html</id><summary type="html">&lt;p&gt;Discover a unique desktop experience with the Conky Quran Display. Dive into the magic of Python scripting and Conky configuration, bringing Quranic verses to life on your desktop. Elevate your workspace with a seamless blend of technology and spirituality. Explore the step-by-step guide and unleash the beauty of Quranic wisdom on your screen&lt;/p&gt;</summary><content type="html">&lt;p&gt;
    Let me take you through the process of creating a unique Conky setup to display Quran verses on your desktop. This involves a set of Python and shell scripts, along with some Conky configuration magic.
  &lt;/p&gt;

&lt;h3&gt;1. Reshaping Arabic Text&lt;/h3&gt;

&lt;p&gt;
    To begin, I crafted a Python script, &lt;code&gt;reshape_arabic.py&lt;/code&gt;, that handles the reshaping of Arabic text. Leveraging the &lt;code&gt;arabic_reshaper&lt;/code&gt; and &lt;code&gt;bidi&lt;/code&gt; libraries, the script ensures that the Arabic text is correctly displayed and fits neatly within a specified line length.
  &lt;/p&gt;

&lt;pre class="language-python" &gt;
    &lt;code class="language-python" &gt;

# Install the arabic_reshaper package if you haven't already
# You can install it using: pip install arabic-reshaper
# install bidi using      : pip install python-bidi

import arabic_reshaper
from bidi.algorithm import get_display
import sys

def reshape_and_wrap_arabic_text(text, line_length):
    #arabic_reshaper.delete_harakat=False
    reshaped_text = arabic_reshaper.reshape(text)
    bidi_text = get_display(reshaped_text)

    # Split the text into words
    words = bidi_text.split()

    # Initialize variables
    current_line = ""
    wrapped_lines = []

    # Iterate through words and wrap lines
    for word in words:
        if len(current_line) + len(word) + 1 &amp;lt;= line_length:
            current_line += word + " "
        else:
            wrapped_lines.append(current_line)
            current_line = word + " "

    # Add the last line
    wrapped_lines.append(current_line)

    # Reverse the order of lines to read from bottom up
    wrapped_text = "\n".join(reversed(wrapped_lines))

    return wrapped_text


arabic_text =  sys.argv[1]
wrapped_text = reshape_and_wrap_arabic_text(arabic_text, 100)
print(wrapped_text)


&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/180-conky-quran-1.png" alt="screenshot of conky quran" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Screenshot 2&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h3&gt;2. Fortune and Shell Script Magic&lt;/h3&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

#!/bin/bash
#
fortune_data_directory="${HOME}/.i3/conky/conky_quran/quran_fortune/"
python_script="${HOME}/.i3/conky/conky_quran/reshape_arabic.py"

arabic_text="$(fortune "$fortune_data_directory" )"
source "${HOME}/bin/venv/bin/activate"

reshaped_arabic_text=$(python "$python_script" "$arabic_text" )
printf '%s' "$reshaped_arabic_text"

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
    The shell script is the orchestrator of the process. It uses the &lt;code&gt;fortune&lt;/code&gt; command to randomly select a Quranic verse from a designated directory. After obtaining the verse, it activates a virtual environment and hands the text to the Python script for reshaping.
  &lt;/p&gt;
&lt;/p&gt;
&lt;h3&gt;3. Crafting the Conky Environment&lt;/h3&gt;

&lt;p&gt;
    With the reshaped Arabic text in hand, it's time to showcase it on the desktop using Conky. The following Conky configuration script comes into play, defining the fonts, window properties, colors, and other visual elements. This script transforms the desktop into an elegant canvas for displaying Quran verses.
  &lt;/p&gt;

&lt;pre class="language-conky" &gt;
    &lt;code class="language-conky" &gt;

conky.config = {
    use_xft =true,
    font ='Amiri:size=27',
    xftalpha =0.1,
    update_interval =1,
    total_run_times =0,

    own_window =true,
    own_window_type ="conky",
    own_window_type ="override",
    own_window_transparent =true,
    own_window_hints ="undecorated,below,sticky,skip_taskbar,skip_pager",
    own_window_colour ="000000",
    own_window_argb_visual =true,
    own_window_argb_value =255,

    double_buffer =true,
    minimum_width =1265,
    draw_shades =false,
    draw_outline =false,
    border_width = 1,
    draw_borders =false,
    draw_graph_borders =false,
    default_color ="white",
    default_shade_color ="red",
    default_outline_color ="green",
    alignment ="top_middle",
    gap_x =-10,
    gap_y =160,
    no_buffers =true,
    cpu_avg_samples =2,
    net_avg_samples =1,
    override_utf8_locale =true,
    use_spacer ="none",

}

conky.text = [[
    ${execi 20 /home/mosaid/.i3/conky/conky_quran/reshape_arabic.sh }
]]

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/180-conky-quran-2.png" alt="screenshot of conky quran" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Screenshot 2&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2&gt;How to Use&lt;/h2&gt;

&lt;p&gt;
    To integrate this setup, ensure that the required Python libraries are installed. The Conky configuration is set up to point to the shell script, creating a seamless pipeline that fetches, reshapes, and displays a random Quran verse on your desktop at regular intervals.
  &lt;/p&gt;

&lt;p&gt;You can get all the files from this github repo : &lt;a href="https://github.com/neoMOSAID/conqy-quran-with-fortune.git" target="_blank"&gt;Conky Quran with fortune&lt;/a&gt; &lt;/p&gt;

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

&lt;p&gt;
    This personalized Conky Quran display is not just a functional addition but also a visually pleasing one. By combining the flexibility of Conky with the scripting capabilities of Python, you can bring a touch of elegance and inspiration to your desktop with ever-changing Quranic verses.
  &lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Conky"></category><category term="Quran"></category><category term="Python Scripting"></category><category term="Desktop Customization"></category><category term="Quranic Verses"></category><category term="Arabic Text"></category><category term="Conky Configuration"></category><category term="Spirituality"></category><category term="Visual Experience"></category><category term="Quran Display"></category><category term="shell script"></category><category term="virtual environment"></category><category term="Desktop Enhancement"></category><category term="Python Magic"></category><category term="Islamic Desktop"></category><category term="Coding Project"></category><category term="open-source"></category><category term="Creative Commons"></category><category term="Tanzil Project"></category><category term="Fortune Files"></category></entry><entry><title>Deep Dive: System Architecture Differences - Linux vs. Windows</title><link href="https://mosaid.xyz/articles/deep-dive-system-architecture-differences-linux-vs-windows-179.html" rel="alternate"></link><published>2024-01-16T20:54:59+00:00</published><updated>2024-01-16T20:54:59+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2024-01-16:/articles/deep-dive-system-architecture-differences-linux-vs-windows-179.html</id><summary type="html">&lt;p&gt;Exploring the intricate system architectures of Linux and Windows, uncovering the transparency of Linux system calls and the layered approach in Windows.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;The Inner Workings of Linux System Calls&lt;/h2&gt;
&lt;p&gt;
    For the technically inclined, delving into the core of Linux reveals a design philosophy centered around openness and transparency.
    At the heart of this lies the system call interface, a set of open and documented entry points that enable user applications to communicate directly with the kernel.
    In the following example, the C program uses the "write" system call to print "Hello, Linux!" to the standard output:
&lt;/p&gt;

&lt;pre class="language-c" &gt;
   &lt;code class="language-c" &gt;

// Linux System Call Example
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;unistd.h&amp;gt;

int main() {
    write(1, "Hello, Linux!\n", 13);
    return 0;
}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/179-linux-syscall.png" alt="Linux System calls" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Linux System calls Overview&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2&gt;Windows: Navigating Through Layers&lt;/h2&gt;
&lt;p&gt;
Windows, on the other hand, employs a more intricate and layered architecture. As user applications interact with the operating system, they traverse through several intermediary layers.
At the forefront is the Windows API (WinAPI), a comprehensive set of functions and procedures. However, beneath this facade, developers encounter layers such as winntdll, which acts as a bridge between user space and the kernel.
Consider the following example showcasing the use of WinAPI in a Windows C program:
&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

// Windows WinAPI Example
#include &amp;lt;windows.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;

int main() {
    MessageBox(NULL, "Hello, Windows!", "Message", MB_OK);
    return 0;
}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;
Here, the C program utilizes the "&lt;code&gt;MessageBox&lt;/code&gt;" function provided by the WinAPI. However, this function is just the tip of the iceberg. Under the hood, it calls a series of other functions and passes through layers such as winntdll.
For instance, "&lt;code&gt;MessageBox&lt;/code&gt;" may internally call functions like "&lt;code&gt;CreateWindow&lt;/code&gt;," which in turn involves more intricate processes. The detailed execution path is encapsulated within the closed layers of the Windows architecture.
&lt;/p&gt;

&lt;figure&gt;
&lt;img src="/theme/images/articles/images/179-windows-system-calls.jpg" alt="Windows System calls" style="max-width:100%;height:auto;" &gt;
&lt;figcaption&gt;Windows Operating System Software Architecture Overview&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2&gt;Linux's System Call Interface: A Programmer's Perspective&lt;/h2&gt;
&lt;p&gt;
From a programming standpoint, the direct communication facilitated by Linux's system call interface offers a programmer unparalleled control and visibility.
The absence of excessive intermediary layers streamlines the development process, making it easier to understand and optimize system interactions.
&lt;/p&gt;

&lt;h2&gt;Peering Into the Kernel: A Windows Perspective&lt;/h2&gt;
&lt;p&gt;
In contrast, navigating through Windows' layered architecture requires a keen understanding of the interactions between user space and the Windows Executive.
The transition from user space to kernel mode involves traversing through proprietary layers, adding intricacy to the debugging and optimization processes.
&lt;/p&gt;

&lt;h2&gt;Conclusion: Unraveling the Architectural Nuances&lt;/h2&gt;
&lt;p&gt;
In conclusion, the architectural disparities between Linux and Windows reveal themselves in the transparency of Linux's system calls and the layered complexity of Windows.
For developers and system architects, choosing between the two involves weighing the advantages of a straightforward, open system against the added complexities of a layered architecture.
&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Linux"></category><category term="Windows"></category><category term="system architecture"></category><category term="system calls"></category><category term="WinAPI"></category><category term="kernel space"></category><category term="user space"></category><category term="operating systems"></category></entry><entry><title>Customize Ranger File Manager: Tips and Tricks for Personalizing Your Experience</title><link href="https://mosaid.xyz/articles/customize-ranger-file-manager-tips-and-tricks-for-personalizing-your-experience-136.html" rel="alternate"></link><published>2023-03-24T17:17:01+00:00</published><updated>2023-03-24T17:17:01+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-03-24:/articles/customize-ranger-file-manager-tips-and-tricks-for-personalizing-your-experience-136.html</id><summary type="html">&lt;p&gt;Discover the power and versatility of Ranger File Manager - a customizable and extensible command-line file manager. Learn how Ranger can streamline your workflow and make managing files and directories a breeze. Get advice from a seasoned developer and find out why Ranger is one of the best file managers out there!&lt;/p&gt;</summary><content type="html">&lt;p&gt;Today, I want to talk about one of my favorite tools for managing files and directories on the command line: Ranger File Manager. As a developer, I spend a lot of time working in the terminal, and I find that using a good file manager can make my life a lot easier. And Ranger is one of the best file managers out there!&lt;/p&gt;

&lt;p&gt;One of the things I love about Ranger is how customizable it is. You can tweak pretty much everything about it, from the color scheme and key bindings to the plugins and file preview settings. And this is great, because it means you can tailor Ranger to your exact needs and preferences. For example, I like to use a dark color scheme and map some of the most common commands to single keys, so that I can navigate files quickly and efficiently.&lt;/p&gt;

&lt;p&gt;Another thing that makes Ranger so powerful is its support for plugins. There are dozens of plugins available for Ranger, which can add all sorts of functionality to the file manager. Some of my favorite plugins include the one for integrating with Git, which shows me the status of my repositories right in Ranger, and the one for previewing images and videos, which lets me quickly preview media files without having to open them in an external program.&lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/screenshot-2023-03-24-16-50-12.jpg" alt="Ranger File Manager: file preview" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Ranger File Manager: image preview&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/screenshot-2023-03-24-16-49-59.jpg" alt="Ranger File Manager: file preview" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Ranger File Manager: file preview&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;To add your custom commands to ranger, all you have to do is add it to &lt;strong style="color: #000000;"&gt;"commands.py"&lt;/strong&gt; file in &lt;strong style="color: #000000;"&gt;~/.config/ranger&lt;/strong&gt; directory. here is my own commands.py file, to use it you must have the programs it uses installed like fzf&lt;/p&gt;

&lt;pre class="language-python" &gt;
   &lt;code class="language-python" &gt;

# This is a sample commands.py.  You can add your own commands here.
#
# Please refer to commands_full.py for all the default commands and a complete
# documentation.  Do NOT add them all here, or you may end up with defunct
# commands when upgrading ranger.

# A simple command for demonstration purposes follows.
# -----------------------------------------------------------------------------

from __future__ import absolute_import, division, print_function

# You can import any python module as needed.
import os

# You always need to import ranger.api.commands here to get the Command class:
from ranger.api.commands import Command


# Any class that is a subclass of "Command" will be integrated into ranger as a
# command.  Try typing ":my_edit&amp;lt;ENTER&amp;gt;" in ranger!
class my_edit(Command):
    # The so-called doc-string of the class will be visible in the built-in
    # help that is accessible by typing "?c" inside ranger.
    """:my_edit &amp;lt;filename&amp;gt;

    A sample command for demonstration purposes that opens a file in an editor.
    """

    # The execute method is called when you run this command in ranger.
    def execute(self):
        # self.arg(1) is the first (space-separated) argument to the function.
        # This way you can write ":my_edit somefilename&amp;lt;ENTER&amp;gt;".
        if self.arg(1):
            # self.rest(1) contains self.arg(1) and everything that follows
            target_filename = self.rest(1)
        else:
            # self.fm is a ranger.core.filemanager.FileManager object and gives
            # you access to internals of ranger.
            # self.fm.thisfile is a ranger.container.file.File object and is a
            # reference to the currently selected file.
            target_filename = self.fm.thisfile.path

        # This is a generic function to print text in ranger.
        self.fm.notify("Let's edit the file " + target_filename + "!")

        # Using bad=True in fm.notify allows you to print error messages:
        if not os.path.exists(target_filename):
            self.fm.notify("The given file does not exist!", bad=True)
            return

        # This executes a function from ranger.core.acitons, a module with a
        # variety of subroutines that can help you construct commands.
        # Check out the source, or run "pydoc ranger.core.actions" for a list.
        self.fm.edit_file(target_filename)

    # The tab method is called when you press tab, and should return a list of
    # suggestions that the user will tab through.
    # tabnum is 1 for &amp;lt;TAB&amp;gt; and -1 for &amp;lt;S-TAB&amp;gt; by default
    def tab(self, tabnum):
        # This is a generic tab-completion function that iterates through the
        # content of the current directory.
        return self._tab_directory_content()


class terminal(Command):
    """
    :terminal

    Open new terminal split in the current directory.
    """

    def execute(self):
        import os
        from ranger.ext.get_executables import get_executables

        command = "lxterminal"
        self.fm.run(command, flags="f")


# https://github.com/ranger/ranger/wiki/Integrating-File-Search-with-fzf
# Now, simply bind this function to a key, by adding this to your ~/.config/ranger/rc.conf:
# map &amp;lt;C-f&amp;gt; fzf_select
class fzf_select(Command):
    """
    :fzf_select

    Find a file using fzf.

    With a prefix argument select only directories.

    See: https://github.com/junegunn/fzf
    """

    def execute(self):
        import subprocess

        if self.quantifier:
            # match only directories
            command = "find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
            -o -type d -print 2&amp;gt; /dev/null | sed 1d | cut -b3- | fzf +m"
        else:
            # match files and directories
            command = "find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
            -o -print 2&amp;gt; /dev/null | sed 1d | cut -b3- | fzf +m"
        fzf = self.fm.execute_command(command, stdout=subprocess.PIPE)
        stdout, stderr = fzf.communicate()
        if fzf.returncode == 0:
            fzf_file = os.path.abspath(stdout.decode("utf-8").rstrip("\n"))
            if os.path.isdir(fzf_file):
                self.fm.cd(fzf_file)
            else:
                self.fm.select_file(fzf_file)


# fzf_locate
class fzf_locate(Command):
    """
    :fzf_locate

    Find a file using fzf.

    With a prefix argument select only directories.

    See: https://github.com/junegunn/fzf
    """

    def execute(self):
        import subprocess

        if self.quantifier:
            command = "locate home media | fzf -e -i"
        else:
            command = "locate home media | fzf -e -i"
        fzf = self.fm.execute_command(command, stdout=subprocess.PIPE)
        stdout, stderr = fzf.communicate()
        if fzf.returncode == 0:
            fzf_file = os.path.abspath(stdout.decode("utf-8").rstrip("\n"))
            if os.path.isdir(fzf_file):
                self.fm.cd(fzf_file)
            else:
                self.fm.select_file(fzf_file)


# fzf_fasd - Fasd + Fzf + Ranger (Interactive Style)
class fzf_fasd(Command):
    """
    :fzf_fasd

    Jump to a file or folder using Fasd and fzf

    URL: https://github.com/clvv/fasd
    URL: https://github.com/junegunn/fzf
    """

    def execute(self):
        import subprocess

        if self.quantifier:
            command = "fasd | fzf -e -i --tac --no-sort | awk '{print $2}'"
        else:
            command = "fasd | fzf -e -i --tac --no-sort | awk '{print $2}'"
        fzf = self.fm.execute_command(command, stdout=subprocess.PIPE)
        stdout, stderr = fzf.communicate()
        if fzf.returncode == 0:
            fzf_file = os.path.abspath(stdout.decode("utf-8").rstrip("\n"))
            if os.path.isdir(fzf_file):
                self.fm.cd(fzf_file)
            else:
                self.fm.select_file(fzf_file)


# Fasd with ranger (Command Line Style)
# https://github.com/ranger/ranger/wiki/Commands


class fasd(Command):
    """
    :fasd

    Jump to directory using fasd
    URL: https://github.com/clvv/fasd
    """

    def execute(self):
        import subprocess

        arg = self.rest(1)
        if arg:
            directory = subprocess.check_output(
                ["fasd", "-d"] + arg.split(), universal_newlines=True
            ).strip()
            self.fm.cd(directory)


from collections import deque

fd_deq = deque()


class fd_search(Command):
    """
    :fd_search [-d&amp;lt;depth&amp;gt;] &amp;lt;query&amp;gt;

    Executes "fd -d&amp;lt;depth&amp;gt; &amp;lt;query&amp;gt;" in the current directory and focuses the
    first match. &amp;lt;depth&amp;gt; defaults to 1, i.e. only the contents of the current
    directory.
    """

    def execute(self):
        import subprocess
        from ranger.ext.get_executables import get_executables

        if not "fd" in get_executables():
            self.fm.notify("Couldn't find fd on the PATH.", bad=True)
            return
        if self.arg(1):
            if self.arg(1)[:2] == "-d":
                depth = self.arg(1)
                target = self.rest(2)
            else:
                depth = "-d1"
                target = self.rest(1)
        else:
            self.fm.notify(":fd_search needs a query.", bad=True)
            return

        # For convenience, change which dict is used as result_sep to change
        # fd's behavior from splitting results by \0, which allows for newlines
        # in your filenames to splitting results by \n, which allows for \0 in
        # filenames.
        null_sep = {"arg": "-0", "split": "\0"}
        nl_sep = {"arg": "", "split": "\n"}
        result_sep = null_sep

        process = subprocess.Popen(
            ["fd", result_sep["arg"], depth, target],
            universal_newlines=True,
            stdout=subprocess.PIPE,
        )
        (search_results, _err) = process.communicate()
        global fd_deq
        fd_deq = deque(
            (
                self.fm.thisdir.path + os.sep + rel
                for rel in sorted(
                    search_results.split(result_sep["split"]), key=str.lower
                )
                if rel != ""
            )
        )
        if len(fd_deq) &amp;gt; 0:
            self.fm.select_file(fd_deq[0])


class fd_next(Command):
    """
    :fd_next

    Selects the next match from the last :fd_search.
    """

    def execute(self):
        if len(fd_deq) &amp;gt; 1:
            fd_deq.rotate(-1)  # rotate left
            self.fm.select_file(fd_deq[0])
        elif len(fd_deq) == 1:
            self.fm.select_file(fd_deq[0])


class fd_prev(Command):
    """
    :fd_prev

    Selects the next match from the last :fd_search.
    """

    def execute(self):
        if len(fd_deq) &amp;gt; 1:
            fd_deq.rotate(1)  # rotate right
            self.fm.select_file(fd_deq[0])
        elif len(fd_deq) == 1:
            self.fm.select_file(fd_deq[0])



&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;But perhaps the best thing about Ranger is how much it can streamline your workflow. With Ranger, you can move, copy, delete, rename, and preview files and directories all from the command line. This can save you a lot of time and effort, especially if you're working with a lot of files. And because Ranger is so customizable, you can set it up in a way that feels natural and intuitive to you, which can help you work more efficiently and with less frustration.&lt;/p&gt;

&lt;p&gt;Here is the shell script "scope.sh" file that is used by ranger fo previewing files and directories&lt;/p&gt;
&lt;pre class="language-bash" &gt;
   &lt;code class="language-bash" &gt;

#!/usr/bin/env bash

set -o noclobber -o noglob -o nounset -o pipefail
IFS=$'\n'

# If the option `use_preview_script` is set to `true`,
# then this script will be called and its output will be displayed in ranger.
# ANSI color codes are supported.
# STDIN is disabled, so interactive scripts won't work properly

# This script is considered a configuration file and must be updated manually.
# It will be left untouched if you upgrade ranger.

# Meanings of exit codes:
# code | meaning    | action of ranger
# -----+------------+-------------------------------------------
# 0    | success    | Display stdout as preview
# 1    | no preview | Display no preview at all
# 2    | plain text | Display the plain content of the file
# 3    | fix width  | Don't reload when width changes
# 4    | fix height | Don't reload when height changes
# 5    | fix both   | Don't ever reload
# 6    | image      | Display the image `$IMAGE_CACHE_PATH` points to as an image preview
# 7    | image      | Display the file directly as an image

# Script arguments
FILE_PATH="${1}"         # Full path of the highlighted file
PV_WIDTH="${2}"          # Width of the preview pane (number of fitting characters)
PV_HEIGHT="${3}"         # Height of the preview pane (number of fitting characters)
IMAGE_CACHE_PATH="${4}"  # Full path that should be used to cache image preview
PV_IMAGE_ENABLED="${5}"  # 'True' if image previews are enabled, 'False' otherwise.

FILE_EXTENSION="${FILE_PATH##*.}"
FILE_EXTENSION_LOWER=$(echo ${FILE_EXTENSION} | tr '[:upper:]' '[:lower:]')

# Settings
HIGHLIGHT_SIZE_MAX=262143  # 256KiB
HIGHLIGHT_TABWIDTH=8
HIGHLIGHT_STYLE='pablo'
PYGMENTIZE_STYLE='autumn'


handle_extension() {
    case "${FILE_EXTENSION_LOWER}" in
        # Archive
        a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\
        rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)
            atool --list -- "${FILE_PATH}" &amp;&amp; exit 5
            bsdtar --list --file "${FILE_PATH}" &amp;&amp; exit 5
            exit 1;;
        rar)
            # Avoid password prompt by providing empty password
            unrar lt -p- -- "${FILE_PATH}" &amp;&amp; exit 5
            exit 1;;
        djvu)
            exit 1 ;;
        7z)
            # Avoid password prompt by providing empty password
            7z l -p -- "${FILE_PATH}" &amp;&amp; exit 5
            exit 1;;

        # PDF
        #pdf)
            # Preview as text conversion
            #pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - &amp;&amp; exit 5
        #evince-thumbnailer -s 400 "${FILE_PATH}" &amp;&amp; exit 5
        #try pdftoppm -jpeg -singlefile "$path" "${cached//.jpg}" &amp;&amp; exit 5
        #exiftool "${FILE_PATH}" &amp;&amp; exit 5
            #exit 1;;

        # BitTorrent
        torrent)
            transmission-show -- "${FILE_PATH}" &amp;&amp; exit 5
            exit 1;;

        # OpenDocument
        odt|ods|odp|sxw)
            # Preview as text conversion
            odt2txt "${FILE_PATH}" &amp;&amp; exit 5
            exit 1;;

        mkv)
             # Thumbnail
             ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 &amp;&amp; exit 6
             exit 1;;
        # HTML
        htm|html|xhtml)
            # Preview as text conversion
            w3m -dump "${FILE_PATH}" &amp;&amp; exit 5
            lynx -dump -- "${FILE_PATH}" &amp;&amp; exit 5
            elinks -dump "${FILE_PATH}" &amp;&amp; exit 5
            ;; # Continue with next handler on failure
    esac
}

handle_image() {
    local mimetype="${1}"
    case "${mimetype}" in
        # SVG
        # image/svg+xml)
        #     convert "${FILE_PATH}" "${IMAGE_CACHE_PATH}" &amp;&amp; exit 6
        #     exit 1;;

        # Image
        image/vnd.djvu)
            exit 1;;
        image/*)
            local orientation
            orientation="$( identify -format '%[EXIF:Orientation]\n' -- "${FILE_PATH}" )"
            # If orientation data is present and the image actually
            # needs rotating ("1" means no rotation)...
            if [[ -n "$orientation" &amp;&amp; "$orientation" != 1 ]]; then
                # ...auto-rotate the image according to the EXIF data.
                convert -- "${FILE_PATH}" -auto-orient "${IMAGE_CACHE_PATH}" &amp;&amp; exit 6
            fi

            # `w3mimgdisplay` will be called for all images (unless overriden as above),
            # but might fail for unsupported types.
            exit 7;;

        # Video
          video/*)
             # Thumbnail
             ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 &amp;&amp; exit 6
             exit 1;;
        # PDF
         application/pdf)
             pdftoppm -f 1 -l 1 \
                      -scale-to-x 1920 \
                      -scale-to-y -1 \
                      -singlefile \
                      -jpeg -tiffcompression jpeg \
                      -- "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" \
                 &amp;&amp; exit 6 || exit 1;;
    esac
}

handle_mime() {
    local mimetype="${1}"
    case "${mimetype}" in
        # Text
        text/* | */xml)
            # Syntax highlight
            if [[ "$( stat --printf='%s' -- "${FILE_PATH}" )" -gt "${HIGHLIGHT_SIZE_MAX}" ]]; then
                exit 2
            fi
            if [[ "$( tput colors )" -ge 256 ]]; then
                local pygmentize_format='terminal256'
                local highlight_format='xterm256'
            else
                local pygmentize_format='terminal'
                local highlight_format='ansi'
            fi
            highlight --replace-tabs="${HIGHLIGHT_TABWIDTH}" --out-format="${highlight_format}" \
                --style="${HIGHLIGHT_STYLE}" --force -- "${FILE_PATH}" &amp;&amp; exit 5
            # pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}" -- "${FILE_PATH}" &amp;&amp; exit 5
            exit 2;;

        # Image
        image/vnd.djvu)
                exit 1;;
        image/*)
            # Preview as text conversion
            # img2txt --gamma=0.6 --width="${PV_WIDTH}" -- "${FILE_PATH}" &amp;&amp; exit 4
            exiftool "${FILE_PATH}" &amp;&amp; exit 5
            exit 1;;

        # Video and audio
        video/* | audio/*)
            mediainfo "${FILE_PATH}" &amp;&amp; exit 5
            exiftool "${FILE_PATH}" &amp;&amp; exit 5
            exit 1;;
    esac
}

handle_fallback() {
    echo '----- File Type Classification -----' &amp;&amp; file --dereference --brief -- "${FILE_PATH}" &amp;&amp; exit 5
    exit 1
}


MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )"
if [[ "${PV_IMAGE_ENABLED}" == 'True' ]]; then
    handle_image "${MIMETYPE}"
fi
handle_extension
handle_mime "${MIMETYPE}"
handle_fallback

exit 1



&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;So if you're a command-line user looking for a powerful and flexible file manager, I definitely recommend checking out Ranger. It may take a bit of time to set up and configure to your liking, but once you do, it can really make your life a lot easier. Trust me, I've been using it for years, and I can't imagine working without it!&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="ranger"></category><category term="File Manager"></category><category term="Command-line"></category><category term="Workflow"></category><category term="Customization"></category><category term="Plugins"></category><category term="Preview"></category><category term="Keybindings"></category><category term="Organization"></category><category term="Troubleshooting."></category></entry><entry><title>How to edit images in the terminal</title><link href="https://mosaid.xyz/articles/how-to-edit-images-in-the-terminal-130.html" rel="alternate"></link><published>2023-03-15T20:28:56+00:00</published><updated>2023-03-15T20:28:56+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-03-15:/articles/how-to-edit-images-in-the-terminal-130.html</id><summary type="html">&lt;p&gt;Learn how to edit images in the terminal using the powerful convert command from the ImageMagick library. This tutorial covers common use cases such as resizing, cropping, rotating, converting formats, adding borders and watermarks, and applying filters&lt;/p&gt;</summary><content type="html">&lt;p&gt;Simple answer: the convert command from imagemagick package&lt;/p&gt;
&lt;p&gt;The convert command is a powerful tool that comes with the ImageMagick library, which can be used to manipulate images from the command line. This tutorial will cover some of the most common use cases of the convert command.&lt;/p&gt;
&lt;h2&gt;Installing convert&lt;/h2&gt;

&lt;pre class="language-bash" &gt;
   &lt;code class="language-bash" &gt;

# Arch based disro
sudo pacman -S imagemagick
# Debian Based distros
sudo apt install imagemagick
# to check if the install was successfull
convert -version

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;Resizing an image:&lt;/h2&gt;
&lt;p&gt;To resize an image, you can use the following syntax:&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;pre class="language-bash" &gt;
   &lt;code class="language-bash" &gt;

convert input_image.jpg -resize 50% output_image.jpg
convert input_image.jpg -resize 500x500 output_image.jpg

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;This will resize the input image to 50% of its original size and save the resized image as "output_image.jpg". The second command will resize it to 500x500, this is my daily command as it helps me create small thumbnails. keep in mind that you should be mindful of the aspect ration of the image I use 500x500 because the input image is square&lt;/p&gt;

&lt;h2&gt;Cropping an image:&lt;/h2&gt;
&lt;p&gt;To crop an image, you can use the following syntax:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
   &lt;code class="language-bash" &gt;

convert input_image.jpg -gravity South -chop x200 output_image.jpg
convert input_image.jpg -crop 500x500+100+100 output_image.jpg

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;The first command will remove 200px from the bottom of the input image.&lt;br&gt;
The second command will crop a 500x500 pixel square from the input image, starting at coordinates (100, 100) and save the cropped image as "output_image.jpg".&lt;/p&gt;

&lt;h2&gt;Rotating an image:&lt;/h2&gt;
&lt;p&gt;To rotate an image, you can use the following syntax:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
   &lt;code class="language-bash" &gt;

convert input_image.jpg -rotate 90 output_image.jpg

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;This will rotate the input image by 90 degrees clockwise and save the rotated image as "output_image.jpg".&lt;/p&gt;

&lt;h2&gt;Converting image format:&lt;/h2&gt;
&lt;p&gt;To convert an image from one format to another, you can use the following syntax:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
   &lt;code class="language-bash" &gt;

convert input_image.png output_image.jpg

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;This will convert the input image from PNG format to JPEG format and save the converted image as "output_image.jpg".&lt;/p&gt;

&lt;h2&gt;Adding a border to an image:&lt;/h2&gt;
&lt;p&gt;To add a border to an image, you can use the following syntax:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
   &lt;code class="language-bash" &gt;

convert input_image.jpg -bordercolor black -border 20 output_image.jpg

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;This will add a black border with a width of 20 pixels to the input image and save the bordered image as "output_image.jpg".&lt;/p&gt;

&lt;h2&gt;Adding a watermark to an image:&lt;/h2&gt;
&lt;p&gt;To add a watermark to an image, you can use the following syntax:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
   &lt;code class="language-bash" &gt;

convert input_image.jpg -gravity center -pointsize 30 -fill white -annotate +0+0 "watermark" output_image.jpg

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;This will add a white watermark with the text "watermark" to the center of the input image and save the watermarked image as "output_image.jpg".&lt;/p&gt;

&lt;h2&gt;Applying a filter to an image:&lt;/h2&gt;
&lt;p&gt;To apply a filter to an image, you can use the following syntax:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
   &lt;code class="language-bash" &gt;

convert input_image.jpg -colorspace Gray output_image.jpg

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;This will apply a grayscale filter to the input image and save the filtered image as "output_image.jpg".&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;These are just some of the most common use cases of the convert command. The convert command has many other options and features, which can be explored by referring to the ImageMagick documentation.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="convert command"></category><category term="ImageMagick library"></category><category term="Terminal"></category><category term="image editing"></category><category term="resizing images"></category><category term="cropping images"></category><category term="rotating images"></category><category term="converting image formats"></category><category term="adding borders"></category><category term="adding watermarks"></category><category term="applying filters"></category><category term="ImageMagick"></category></entry><entry><title>Have you Heard Of Gecholinux ?</title><link href="https://mosaid.xyz/articles/have-you-heard-of-gecholinux--116.html" rel="alternate"></link><published>2023-02-25T20:26:29+00:00</published><updated>2023-02-25T20:26:29+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-02-25:/articles/have-you-heard-of-gecholinux--116.html</id><summary type="html">&lt;p&gt;Gecholinux is a Linux distribution that is based on the popular Debian operating system. It is designed to be easy to use and lightweight, making it a good option for older or less powerful computers. As someone who has used various Linux distributions over the years, I found Gecholinux to be a solid choice for those looking for a simple and efficient operating system.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Gecholinux is a Linux distribution that is based on openSUSE operating system. It is designed to be easy to use and lightweight, making it a good option for older or less powerful computers. As someone who has used various Linux distributions over the years, I found Gecholinux to be a solid choice for those looking for a simple and efficient operating system.&lt;/p&gt;

&lt;p&gt;One of the things I appreciate about Gecholinux is its minimalistic approach. The distribution comes with only the essential software pre-installed, which helps keep the system fast and responsive. This is a refreshing change from other Linux distributions that come with a plethora of programs that most users will never use.&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;Gecholinux also has a user-friendly interface, making it easy to navigate for those who may be new to Linux. The desktop environment is clean and simple, with a taskbar and menu that are easy to access. The default applications that come with the distribution, such as the file manager and web browser, are intuitive and easy to use.&lt;/p&gt;

&lt;p&gt;Another feature of Gecholinux that sets it apart is its focus on privacy and security. The distribution includes several privacy-focused applications, such as the Tor Browser and the I2P network, that allow users to browse the internet anonymously. Additionally, Gecholinux comes with built-in encryption tools that help protect sensitive data.&lt;/p&gt;

&lt;p&gt;Here is a technical sheet of Gecholinux:&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;table class="table table-striped"&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;th&gt;Desktop Environment:&lt;/th&gt;
      &lt;td&gt;Xfce&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;th&gt;File Manager:&lt;/th&gt;
      &lt;td&gt;Thunar&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;th&gt;Other Default Packages in Gecholinux:&lt;/th&gt;
      &lt;td&gt;Firefox, LibreOffice, GIMP, VLC, Tor Browser, I2P, VeraCrypt&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;figure&gt;
  &lt;img src="/theme/images/articles/images/116-img-2.png" alt="Gecholinux File Manager And Desktop Environment:" style="max-width:100%;height:auto;" &gt;
  &lt;figcaption&gt;Gecholinux File Manager And Desktop Environment&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;figure&gt;
  &lt;img src="/theme/images/articles/images/116-img-1.png" alt="Gecholinux File Manager And Desktop Environment:" style="max-width:100%;height:auto;" &gt;
  &lt;figcaption&gt;Gecholinux File Manager And Desktop Environment&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;for more infomation, check &lt;a href="https://geckolinux.github.io/" target="_blank"&gt;Gecholinux Home page&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One downside of Gecholinux is that it may not be the best choice for power users or those who require a lot of customization options. The distribution is designed to be lightweight and simple, so it may not have all the bells and whistles that some users may be looking for.&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Gecholinux"></category><category term="Lightweight"></category><category term="Security"></category><category term="User-friendly"></category><category term="Customizable"></category><category term="Xfce"></category><category term="Default packages"></category><category term="distribution"></category></entry><entry><title>How to Check Your Linux Distribution and Version</title><link href="https://mosaid.xyz/articles/how-to-check-your-linux-distribution-and-version-108.html" rel="alternate"></link><published>2023-02-21T13:59:52+00:00</published><updated>2023-02-21T13:59:52+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-02-21:/articles/how-to-check-your-linux-distribution-and-version-108.html</id><summary type="html">&lt;p&gt;If you're a Linux user, it's important to know which distribution and version of Linux you're running. This information can be useful when troubleshooting issues or installing software that requires a specific version of Linux.&lt;/p&gt;</summary><content type="html">&lt;p&gt;If you're a Linux user, it's important to know which distribution and version of Linux you're running. This information can be useful when troubleshooting issues or installing software that requires a specific version of Linux.&lt;/p&gt;

&lt;p&gt;When people refer to Linux, they are usually referring to a Linux distribution. Strictly speaking, Linux is a kernel, the core component of the operating system that, simply put, acts just like a bridge between the software applications and the hardware. A Linux distribution is an operating system made from a Linux kernel, GNU tools and libraries, and software collections. Usually, Linux distributions include desktop environments, package management system, and a set of preinstalled applications.&lt;/p&gt;
&lt;p&gt;Some of the most popular Linux distributions are:&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;ul&gt;
  &lt;li&gt;Debian&lt;/li&gt;
  &lt;li&gt;Red Hat&lt;/li&gt;
  &lt;li&gt;Ubuntu&lt;/li&gt;
  &lt;li&gt;Arch Linux&lt;/li&gt;
  &lt;li&gt;Fedora&lt;/li&gt;
  &lt;li&gt;CentOS&lt;/li&gt;
  &lt;li&gt;Kali Linux&lt;/li&gt;
  &lt;li&gt;OpenSUSE&lt;/li&gt;
  &lt;li&gt;Linux Mint&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When you log in to a Linux system for the first time, before doing any work, it is always a good idea to check what version of Linux is running on the machine. For example, determining the Linux distribution can help you figure out what package manager you should use to install new packages.&lt;/p&gt;
&lt;p&gt;Here are a few ways to check which distribution and version of Linux you're running:&lt;/p&gt;

&lt;h2&gt;1. Use the lsb_release Command&lt;/h2&gt;
&lt;p&gt;The lsb_release command is a simple and easy way to check your Linux distribution and version. To use it, open a terminal window and type the following command:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
lsb_release -a
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will display information about your Linux distribution, including the distribution ID, release number, and codename. Here's an example output:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
&lt;/code&gt;&lt;/pre&gt;

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;h2&gt;2. check /etc/os-release file&lt;/h2&gt;
&lt;p&gt;The /etc/os-release file contains operating system identification data, including information about the distribution. This file is part of the systemd package and should be present on all system running systemd.&lt;/p&gt;
&lt;p&gt;To view the contents of the os-release file, use either cat or less :&lt;/p&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
cat /etc/os-release
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or you can check for anyfile that has "ease" at the end of its name:&lt;/p&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
cat /etc/*ease
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The output should look something like below:&lt;/p&gt;
&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;3. Check the /etc/issue File&lt;/h2&gt;
&lt;p&gt;Another way to check your Linux distribution and version is to look at the contents of the /etc/issue file. This file contains information about your Linux distribution and version, as well as the kernel version.&lt;/p&gt;
&lt;p&gt;To view the contents of the /etc/issue file, open a terminal window and type the following command:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
cat /etc/issue
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here's an example output:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
Ubuntu 20.04.3 LTS \n \l
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;4. Use the hostnamectl Command&lt;/h2&gt;
&lt;p&gt;The hostnamectl command can also be used to check your Linux distribution and version. This command displays information about your system, including the operating system and kernel version.&lt;/p&gt;
&lt;p&gt;To use the hostnamectl command, open a terminal window and type the following command:&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
hostnamectl
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here's an example output:&lt;/p&gt;

&lt;pre class="language-bash"&gt;&lt;code class="language-bash"&gt;
 Static hostname: ubuntu
Icon name: computer-laptop
Chassis: laptop
Machine ID: 1234567890abcdef
Boot ID: 1234567890abcdef
Operating System: Ubuntu 20.04.3 LTS
Kernel: Linux 5.11.0-38-generic
Architecture: x86-64
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;5. Using the Graphical Interface&lt;/h3&gt;
&lt;p&gt;If you are using a Linux distribution with a graphical interface, you can usually check your distribution and version from the settings or system information panel. The exact location of this information may vary depending on your distribution.&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Knowing which Linux distribution and version you're running is an important piece of information for Linux users. With the above methods, you can easily check your Linux distribution and version in just a few steps.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Linux"></category><category term="distribution"></category><category term="version"></category><category term="check"></category><category term="verify"></category><category term="command line"></category><category term="graphical tools"></category><category term="update"></category><category term="operating system"></category></entry><entry><title>Rofi - A Window Switcher, Application Launcher, SSH Dialog, dmenu Replacement and More</title><link href="https://mosaid.xyz/articles/rofi-a-window-switcher-application-launcher-ssh-dialog-dmenu-replacement-and-more-106.html" rel="alternate"></link><published>2023-02-20T17:31:59+00:00</published><updated>2023-02-20T17:31:59+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-02-20:/articles/rofi-a-window-switcher-application-launcher-ssh-dialog-dmenu-replacement-and-more-106.html</id><summary type="html">&lt;p&gt;Rofi is a versatile and lightweight application launcher, window switcher, SSH dialog, and dmenu replacement for Linux systems. It provides a fast and efficient way to launch applications, switch between windows, and perform a variety of other tasks.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Rofi is a versatile and lightweight application launcher, window switcher, SSH dialog, and dmenu replacement for Linux systems. It provides a fast and efficient way to launch applications, switch between windows, and perform a variety of other tasks.&lt;/p&gt;
&lt;h2&gt;Installation&lt;/h2&gt;
&lt;p&gt;Rofi is available in most Linux distributions' official repositories. To install it, open your terminal and type the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo apt-get install rofi&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you are using a different package manager, replace &lt;code&gt;apt-get&lt;/code&gt; with the appropriate command for your system.&lt;/p&gt;
&lt;p&gt;Alternatively, you can download the source code from the official Rofi website and build it manually.&lt;/p&gt;
&lt;h2&gt;Basic Usage&lt;/h2&gt;
&lt;h3&gt;Application Launcher&lt;/h3&gt;
&lt;p&gt;One of the most common uses of Rofi is as an application launcher. To launch Rofi, open your terminal and type the following command:&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;pre&gt;&lt;code&gt;rofi -show run&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will open the Rofi launcher with a list of installed applications. You can use the arrow keys to navigate the list and press Enter to launch the selected application.&lt;/p&gt;
&lt;p&gt;You can also search for an application by typing its name in the search bar at the top of the Rofi window. Rofi will filter the list of applications based on your search query.&lt;/p&gt;
&lt;h3&gt;Window Switcher&lt;/h3&gt;
&lt;p&gt;Rofi can also be used as a window switcher. To launch Rofi in window switcher mode, type the following command in your terminal:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;rofi -show window&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will open the Rofi window switcher, which will display a list of currently open windows. You can use the arrow keys to navigate the list and press Enter to switch to the selected window.&lt;/p&gt;
&lt;h3&gt;SSH Dialog&lt;/h3&gt;
&lt;p&gt;Rofi also provides an SSH dialog, which allows you to quickly connect to remote servers using SSH. To launch the SSH dialog, type the following command in your terminal:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;rofi -show ssh&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will open the Rofi SSH dialog, which will prompt you to enter the hostname or IP address of the server you want to connect to. Once you enter the server information, press Enter to initiate the SSH connection.&lt;/p&gt;
&lt;h3&gt;dmenu Replacement&lt;/h3&gt;
&lt;p&gt;Rofi can also be used as a replacement for the dmenu utility, which is used in many Linux window managers to launch applications and perform other tasks. To launch Rofi as a dmenu replacement, type the following command in your terminal:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;rofi -dmenu&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will open the Rofi dmenu, which will display a list of items based on the input you provide. You can use the arrow keys to navigate the list and press Enter to select the item.&lt;/p&gt;
&lt;h2&gt;Customization&lt;/h2&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;Rofi provides many customization options that allow you to tailor its behavior and appearance to your needs. You can customize Rofi by editing its configuration file, which is located at &lt;code&gt;~/.config/rofi/config.rasi&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Some of the things you can customize in the Rofi configuration file include:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;The color scheme&lt;/li&gt;
  &lt;li&gt;The font&lt;/li&gt;
  &lt;li&gt;The keybindings&lt;/li&gt;
  &lt;li&gt;The behavior of each mode (application launcher, window switcher, SSH dialog, dmenu replacement)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For example, to change the color scheme of Rofi, you can add the following lines to the configuration file:&lt;/p&gt;
&lt;pre class="language-config" &gt;
    &lt;code class="language-config" &gt;

configuration {
  /* ... */
  theme: "my-theme";
  /* ... */
}

# Colors for my-theme
* {
  background-color: #282828;
  text-color: #ebdbb2;
  selected-background-color: #458588;
  selected-text-color: #ebdbb2;
}

&lt;/code&gt;
&lt;/pre&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;This will set the theme to "my-theme" and define the colors for the background, text, selected background, and selected text.&lt;/p&gt;
&lt;p&gt;You can also create custom keybindings for Rofi by adding the following lines to the configuration file:&lt;/p&gt;
&lt;pre class="language-config" &gt;
    &lt;code class="language-config" &gt;

configuration {
  /* ... */
  key-ctrl-t: "spawn urxvt";
  key-super-d: "spawn rofi -show run";
  /* ... */
}

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This will create two custom keybindings: &lt;code&gt;Ctrl + T&lt;/code&gt; will launch the &lt;code&gt;urxvt&lt;/code&gt; terminal emulator, and &lt;code&gt;Super + D&lt;/code&gt; will launch the Rofi application launcher.&lt;/p&gt;

&lt;h2&gt;My Personal config&lt;/h2&gt;

&lt;p&gt;In my home config directory: &lt;code&gt;~/.config/rofi&lt;/code&gt; I have two files; the config file &lt;code&gt;config.rasi&lt;/code&gt; and the theme file &lt;code&gt;Monokai.rasi&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;config.rasi&lt;/p&gt;
&lt;pre class="language-config" &gt;
    &lt;code class="language-config" &gt;

configuration {
    modi: "window,run,drun,combi";
    font: "Awesome 11";
    location: 0;
    yoffset: 20;
    xoffset: 0;
    fixed-num-lines: false;
    show-icons: true;
    terminal: "lxterminal";
    ssh-client: "ssh";
    ssh-command: "{terminal} -e {ssh-client} {host}";
    run-command: "{cmd}";
    run-list-command: "";
    run-shell-command: "{terminal} -e {cmd}";
    window-command: "xkill -id {window}";
    disable-history: false;
    case-sensitive: false;
    cycle: true;
    sidebar-mode: false;
    eh: 1;
    auto-select: false;
    parse-hosts: false;
    parse-known-hosts: true;
    combi-modi: "window,drun";
    tokenize: true;
    m: "-1";
    filter: "";
    dpi: -1;
    threads: 1;
    scroll-method: 0;
}
@theme "Monokai"


&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Monokai.rasi, the theme file which I don't remember where I got it from&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;pre class="language-config" &gt;
    &lt;code class="language-config" &gt;

/**
 * ROFI Color theme
 * User: milouse
 * Copyright: Étienne Deparis
 */

* {
    selected-normal-foreground:  rgba ( 0, 0, 0, 100 % );
    foreground:                  rgba ( 248, 248, 242, 100 % );
    normal-foreground:           @foreground;
    alternate-normal-background: rgba ( 39, 40, 34, 0 % );
    red:                         rgba ( 220, 50, 47, 100 % );
    selected-urgent-foreground:  rgba ( 248, 248, 242, 100 % );
    blue:                        rgba ( 38, 139, 210, 100 % );
    urgent-foreground:           rgba ( 249, 38, 114, 100 % );
    alternate-urgent-background: rgba ( 39, 40, 34, 0 % );
    active-foreground:           rgba ( 166, 226, 42, 100 % );
    lightbg:                     rgba ( 238, 232, 213, 100 % );
    selected-active-foreground:  rgba ( 166, 226, 42, 100 % );
    alternate-active-background: rgba ( 39, 40, 34, 0 % );
    background:                  rgba ( 39, 40, 34, 93 % );
    bordercolor:                 rgba ( 0, 43, 54, 100 % );
    alternate-normal-foreground: @foreground;
    normal-background:           rgba ( 39, 40, 34, 0 % );
    lightfg:                     rgba ( 88, 104, 117, 100 % );
    selected-normal-background:  rgba ( 248, 248, 248, 100 % );
    border-color:                @foreground;
    spacing:                     2;
    separatorcolor:              rgba ( 230, 219, 116, 100 % );
    urgent-background:           rgba ( 39, 40, 34, 0 % );
    selected-urgent-background:  rgba ( 249, 38, 114, 100 % );
    alternate-urgent-foreground: @urgent-foreground;
    background-color:            rgba ( 0, 0, 0, 0 % );
    alternate-active-foreground: @active-foreground;
    active-background:           rgba ( 39, 40, 34, 0 % );
    selected-active-background:  rgba ( 20, 20, 17, 100 % );
}
window {
    background-color: @background;
    border:           1;
    padding:          5;
}
mainbox {
    border:  0;
    padding: 0;
}
message {
    border:       2px 0px 0px ;
    border-color: @separatorcolor;
    padding:      1px ;
}
textbox {
    text-color: @foreground;
}
listview {
    fixed-height: 0;
    border:       2px 0px 0px ;
    border-color: @separatorcolor;
    spacing:      2px ;
    scrollbar:    true;
    padding:      2px 0px 0px ;
}
element {
    border:  0;
    padding: 1px ;
}
element-text {
    background-color: inherit;
    text-color:       inherit;
}
element.normal.normal {
    background-color: @normal-background;
    text-color:       @normal-foreground;
}
element.normal.urgent {
    background-color: @urgent-background;
    text-color:       @urgent-foreground;
}
element.normal.active {
    background-color: @active-background;
    text-color:       @active-foreground;
}
element.selected.normal {
    background-color: @selected-normal-background;
    text-color:       @selected-normal-foreground;
}
element.selected.urgent {
    background-color: @selected-urgent-background;
    text-color:       @selected-urgent-foreground;
}
element.selected.active {
    background-color: @selected-active-background;
    text-color:       @selected-active-foreground;
}
element.alternate.normal {
    background-color: @alternate-normal-background;
    text-color:       @alternate-normal-foreground;
}
element.alternate.urgent {
    background-color: @alternate-urgent-background;
    text-color:       @alternate-urgent-foreground;
}
element.alternate.active {
    background-color: @alternate-active-background;
    text-color:       @alternate-active-foreground;
}
scrollbar {
    width:        4px ;
    border:       0;
    handle-width: 8px ;
    padding:      0;
}
mode-switcher {
    border:       2px 0px 0px ;
    border-color: @separatorcolor;
}
button.selected {
    background-color: @selected-normal-background;
    text-color:       @selected-normal-foreground;
}
inputbar {
    spacing:    0;
    text-color: @normal-foreground;
    padding:    1px ;
}
case-indicator {
    spacing:    0;
    text-color: @normal-foreground;
}
entry {
    spacing:    0;
    text-color: @normal-foreground;
}
prompt {
    spacing:    0;
    text-color: @normal-foreground;
}
inputbar {
    children:   [ prompt,textbox-prompt-colon,entry,case-indicator ];
}
textbox-prompt-colon {
    expand:     false;
    str:        ":";
    margin:     0px 0.3em 0em 0em ;
    text-color: @normal-foreground;
}


&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Rofi is a versatile and lightweight application launcher, window switcher, SSH dialog, and dmenu replacement for Linux systems. It provides a fast and efficient way to launch applications, switch between windows, and perform a variety of other tasks. With its extensive customization options, you can tailor Rofi to your needs and preferences. Try it out and see how it can improve your workflow!&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Rofi"></category><category term="window switcher"></category><category term="application launcher"></category><category term="SSH dialog"></category><category term="dmenu replacement"></category><category term="productivity tool"></category><category term="workflow enhancement"></category><category term="Linux utility"></category></entry><entry><title>Linux 6.3 update will bring hardware Noise «hwnoise» Tool</title><link href="https://mosaid.xyz/articles/linux-63-update-will-bring-hardware-noise-hwnoise-tool-105.html" rel="alternate"></link><published>2023-02-20T15:40:18+00:00</published><updated>2023-02-20T15:40:18+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-02-20:/articles/linux-63-update-will-bring-hardware-noise-hwnoise-tool-105.html</id><summary type="html">&lt;p&gt;The Linux 6.3 update includes various enhancements and improvements, including updates to the tracing subsystem. One of the significant additions to the kernel source tree is the «hwnoise» tool, which was developed by Daniel Bristot de Oliveira over the past few months.&lt;/p&gt;</summary><content type="html">&lt;p&gt;The Linux 6.3 update includes various enhancements and improvements, including updates to the tracing subsystem. One of the significant additions to the kernel source tree is the "hwnoise" tool, which was developed by Daniel Bristot de Oliveira over the past few months.&lt;/p&gt;

&lt;p&gt;The hwnoise tool provides a way to monitor and quantify hardware noise in the system. It relies on the operating system noise tracer (osnoise) and displays a summary of the noise attributed to hardware. The tool works by running with interrupts disabled, which allows it to focus on non-maskable interrupts (NMIs) and hardware-related noise.&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;The hwnoise tool offers features similar to the osnoise tracer, which is used to monitor system noise. However, hwnoise is designed to focus only on hardware noise and provides a more detailed view of the noise generated by hardware components in the system.&lt;/p&gt;

&lt;figure&gt;
  &lt;img src="/theme/images/articles/images/105-img-1.jpg" alt="hardware-related noise" style="max-width:100%;height:auto;" &gt;
  &lt;figcaption&gt;An output example of hwnoise&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Overall, the hwnoise tool provides a valuable addition to the Linux kernel source tree for those interested in monitoring and analyzing hardware noise. Its development underscores the ongoing efforts to enhance the performance and functionality of the Linux operating system.&lt;/p&gt;
&lt;p&gt;More details on the hwnoise tool can be found here: &lt;a href="https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git/tree/Documentation/tools/rtla/rtla-hwnoise.rst?h=for-next&amp;id=5dc3750e747f93f9bb7987da3d47a8ab4a5a181e" target="_blank" &gt;Official tracing, probes and ftrace repo&lt;/a&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Linux 6.3"></category><category term="update"></category><category term="hwnoise"></category><category term="hardware noise tool"></category><category term="performance enhancement"></category><category term="Linux environment"></category><category term="User Experience"></category><category term="hardware management"></category></entry><entry><title>fstab: Automounting NTFS partitions</title><link href="https://mosaid.xyz/articles/fstab-automounting-ntfs-partitions-103.html" rel="alternate"></link><published>2023-02-19T19:55:21+00:00</published><updated>2023-02-19T19:55:21+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-02-19:/articles/fstab-automounting-ntfs-partitions-103.html</id><summary type="html">&lt;p&gt;NTFS is a proprietary file system used by Microsoft Windows operating systems. Linux can read and write NTFS partitions using the ntfs-3g driver. This article explains how to automount NTFS partitions in Linux using fstab.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Automounting NTFS partitions in Linux using fstab&lt;/h2&gt;

&lt;p&gt;NTFS is a proprietary file system used by Microsoft Windows operating systems. Linux can read and write NTFS partitions using the ntfs-3g driver. This article explains how to automount NTFS partitions in Linux using fstab.&lt;/p&gt;

&lt;h2&gt;What is fstab?&lt;/h2&gt;

&lt;p&gt;The /etc/fstab file is a configuration file that contains information about file systems that are mounted during the boot process. Each line in the file represents a file system that needs to be mounted. fstab is used to configure the automounting of file systems in Linux.&lt;/p&gt;

&lt;h2&gt;Automounting NTFS partitions using fstab&lt;/h2&gt;

&lt;p style="color:blue;"&gt;Step 1: Find the device name and UUID of the NTFS partition&lt;/p&gt;

&lt;p&gt;To automount an NTFS partition, you need to know the device name and UUID of the partition. You can use the following command to find the device name and UUID:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

sudo blkid

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;This command will display a list of all the available partitions on your system, along with their device names and UUIDs. Find the device name and UUID of the NTFS partition that you want to automount.&lt;/p&gt;

&lt;p style="color:blue;"&gt;Step 2: Create a mount point&lt;/p&gt;

&lt;p&gt;You need to create a mount point for the NTFS partition. A mount point is a directory where the partition will be mounted. You can create a mount point in the /mnt directory using the following command:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

sudo mkdir /mnt/ntfs

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p style="color:blue;"&gt;Step 3: Edit the fstab file&lt;/p&gt;

&lt;p&gt;Open the /etc/fstab file in a text editor using the following command:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

sudo vim /etc/fstab

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;Add the following line to the end of the file:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

UUID=&amp;lt;UUID&amp;gt; /mnt/ntfs ntfs-3g defaults 0 0

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Replace &amp;lt;UUID&amp;gt; with the UUID of the NTFS partition that you found in step 1. The ntfs-3g option specifies that the ntfs-3g driver should be used to mount the partition. The defaults option specifies the default mount options for the file system.&lt;/p&gt;

&lt;p&gt;Save and close the file.&lt;/p&gt;

&lt;p style="color:blue;"&gt;Step 4: Test the configuration&lt;/p&gt;

&lt;p&gt;To test the fstab configuration, you can either reboot your system or manually mount the partition using the following command:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

sudo mount -a

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;This command will mount all file systems specified in the /etc/fstab file.&lt;/p&gt;

&lt;p&gt;You can verify that the partition is mounted by running the mount command:&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

mount | grep /mnt/ntfs

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;This command should display the mount point and the file system type.&lt;/p&gt;

&lt;h2&gt;Permission and ownership problems&lt;/h2&gt;

&lt;p&gt;Sometimes automounting an NTFS partition in Linux using fstab can result in permission and ownership problems. This is because NTFS partitions are typically formatted and used with Windows operating systems, which have different permissions and ownership models than Linux.&lt;/p&gt;

&lt;p&gt;To avoid these issues, you can use the uid and gid options in the fstab configuration to specify the user and group ownership of the mounted partition. You can also use the umask option to set the default permissions for the files and directories on the partition.&lt;/p&gt;

&lt;p&gt;For example, you can add the following line to the /etc/fstab file to automount an NTFS partition with read and write access for the current user, while setting the default permissions to 644 for files and 755 for directories:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

UUID=&amp;lt;UUID&amp;gt; /mnt/ntfs ntfs-3g defaults,uid=&amp;lt;user_id&amp;gt;,gid=&amp;lt;group_id&amp;gt;,umask=022 0 0

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;Replace &amp;lt;UUID&amp;gt; with the UUID of the NTFS partition, &amp;lt;user_id&amp;gt; with the user ID of the current user, and &amp;lt;group_id&amp;gt; with the group ID of the group that should own the files on the partition.&lt;/p&gt;

&lt;p&gt;The umask=022 option sets the default permissions for files to 644 (read and write for the owner, read-only for others) and for directories to 755 (read, write, and execute for the owner, and read and execute for others).&lt;/p&gt;

&lt;p&gt;Note that the actual values of uid and gid depend on your system configuration. You can find the user and group IDs by running the id command in the terminal.&lt;/p&gt;

&lt;p&gt;By using these options, you can avoid permission and ownership problems when automounting NTFS partitions in Linux using fstab.&lt;/p&gt;

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

&lt;p&gt;Automounting NTFS partitions in Linux using fstab is a simple and straightforward process. By following the steps outlined in this article, you can easily configure your system to automount NTFS partitions during the boot process.&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="fstab"></category><category term="NTFS partitions"></category><category term="automount"></category><category term="Linux"></category><category term="Windows partitions"></category><category term="configuration"></category><category term="integration"></category><category term="convenience"></category><category term="file system management"></category></entry><entry><title>Wine 8.2 Released With More Improvements For Running Windows Apps/Games On Linux</title><link href="https://mosaid.xyz/articles/wine-82-released-with-more-improvements-for-running-windows-appsgames-on-linux-97.html" rel="alternate"></link><published>2023-02-18T18:38:09+00:00</published><updated>2023-02-18T18:38:09+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-02-18:/articles/wine-82-released-with-more-improvements-for-running-windows-appsgames-on-linux-97.html</id><summary type="html">&lt;p&gt;Wine 8.2 is the second bi-weekly development release of the new series, following the stable release of Wine 8.0 in late January and the release of Wine 8.1, which began the new development series.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Wine 8.2 is the second bi-weekly development release of the new series, following the stable release of Wine 8.0 in late January and the release of Wine 8.1, which began the new development series.&lt;/p&gt;
&lt;p&gt;The release of Wine 8.2 continues work on the WoW64 support, which allows 32-bit Portable Executable (PE) modules to call 64-bit Unix libraries, ultimately letting 32-bit Windows applications run without requiring 32-bit Unix libraries. The debug information has been enhanced when operating in WoW64 mode, further improving the support.&lt;/p&gt;
&lt;p&gt;Another change in Wine 8.2 is the use of monitor EDID information for querying display names. There are also other changes in the release.&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;h2&gt;New features and improvements:&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Better debug information in Wow64 mode.&lt;/li&gt;
  &lt;li&gt;Wow64 thunks in the WPCAP library.&lt;/li&gt;
  &lt;li&gt;Indeo IV50 codec support.&lt;/li&gt;
  &lt;li&gt;Monitor names set from EDID data.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are 22 known bug fixes in Wine 8.2, including fixes for software like VBScript and games like GOG Heroes of Might and Magic IV, The Void, and other Windows games. more at : &lt;a href="https://www.winehq.org/" target="_blank"&gt;WineHQ&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you're running a Debian or Debian-based distribution, such as Ubuntu or Mint, you can install Wine 8.2 by adding the official WineHQ repository and installing it through the package manager. Arch Linux users can also install Wine 8.2 from the official Arch User Repository (AUR) using their preferred AUR helper, such as yay or pacaur. Keep in mind that while Wine has made significant progress in recent years, it may not be able to run all Windows applications flawlessly. However, for those looking to run specific Windows programs or games on Linux, Wine remains an invaluable tool.&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Wine 8.2"></category><category term="release"></category><category term="Linux"></category><category term="Windows applications"></category><category term="games"></category><category term="compatibility"></category><category term="gaming experience"></category><category term="enhancements"></category></entry><entry><title>My Personalized Dmenu Launcher</title><link href="https://mosaid.xyz/articles/my-personalized-dmenu-launcher-87.html" rel="alternate"></link><published>2023-02-16T15:26:00+00:00</published><updated>2023-02-16T15:26:00+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-02-16:/articles/my-personalized-dmenu-launcher-87.html</id><summary type="html">&lt;p&gt;Discover a personalized dmenu launcher for Linux, designed to streamline program launching by prioritizing frequently used applications. Explore usage instructions, including updating the launcher database and listing available programs, and learn how to integrate it with the i3 window manager for enhanced efficiency.&lt;/p&gt;</summary><content type="html">&lt;p&gt;My personalized dmenu launcher is a convenient tool that allows me to quickly launch frequently used programs. The launcher gives priority to programs that are frequently used, making them appear first in the dmenu list. Each time a program is executed, its usage is incremented in a SQLite database, ensuring that it will appear at the top of the list in the future.&lt;/p&gt;
&lt;h2&gt;Usage&lt;/h2&gt;
&lt;p&gt;There are three ways to use the launcher:&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;code&gt;launcher.sh update&lt;/code&gt;: Updates the launcher database with the latest program information. This command should be run whenever new programs are installed or removed.&lt;/li&gt;
    &lt;li&gt;&lt;code&gt;launcher.sh list&lt;/code&gt;: Displays a list of all programs in the launcher database.&lt;/li&gt;
    &lt;li&gt;&lt;code&gt;launcher.sh&lt;/code&gt;: Launches the dmenu and allows the user to select a program to run.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The launcher is designed to be used with the i3 window manager. To bind the launcher to a keyboard shortcut in i3, add the following line to the i3 config file:&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

bindsym $mod+x exec --no-startup-id /path/to/launcher.sh

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;The Bash Script&lt;/h2&gt;
&lt;p&gt;Below is the Bash script that powers the launcher. It uses a Python script to interact with the SQLite database. Enjoy&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

#!/bin/sh

WORKINGDIR="$( cd -- "$(dirname "$0")" &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 ; pwd -P )"
pythonScript="${WORKINGDIR}/database.py"

clean_up(){
    while read -r file ; do
        if ! [ -f "$file" ] ; then
            echo "removed: $file"
            python "$pythonScript" del "$file"
        fi
    done &amp;lt;&amp;lt;&amp;lt; "$( python "$pythonScript" get | jq -r '.[]|.location' )"
}

update(){
    tmpfile="/tmp/mydmenu_update_file.csv"
    rm "$tmpfile" 2&amp;gt;/dev/null
    while IFS= read -r -u 3 -d ':'  dir ; do
        #echo "===================================== $dir"
        find "$dir" -type f -iname "*.desktop" -exec grep -L 'NoDisplay=true' {} \; 2&amp;gt;/dev/null |
        while read -r file ; do
            location="$file"
            tname="$(sed -n '/^[nN]ame=/p' "$file" | sed 's/^[nN]ame=//' | tr '\n' ' ' | sed 's/[ \t]*$//' )"
            name=$(echo "$tname" | cut -d' ' -f1,2)
            #echo $file === $name
            exec="$(sed -n '/^[eE]xec=/{s/^[eE]xec=//;s/ %.*//;p;q}' "$file" | tr '\n' ' '  | sed 's/[ \t]*$//' )"
            [[ -z "$exec" ]] &amp;amp;&amp;amp; continue
            description="$(sed -n '/^[cC]ategories=/p' "$file" | sed 's/^[cC]ategories=//'  | tr '\n' ' '  | sed 's/[ \t]*$//' )"
            echo "$name,$exec,$location,$description $tname" &amp;gt;&amp;gt; "$tmpfile"
        done
    done 3&amp;lt;&amp;lt;&amp;lt; "$HOME/.local/share/applications:/usr/share/applications:/usr/local/share/applications:"
    python "$pythonScript" update
}

if [ "$1" = "update" ] ; then
    update
    clean_up
    exit
fi

if [ "$1" = "list" ] ; then
    python $WORKINGDIR/database.py get | jq -r '.[]|select(.name)' | less
    exit
fi


data=$(python "$pythonScript" get)
selected=$( echo "$data" | jq -r '.[]|.name' | dmenu -i -fn monospace:20 -p run )
[[ -n "$selected" ]] || exit
program=$(echo "$data" | jq -r ".[]|select(.name|match(\"$selected\"))|.exec" )
python "$pythonScript" increment "$selected"
#echo "$selected"
#echo "$program"
echo "$program" | ${SHELL:-"/bin/sh"} &amp;amp;


&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;h2&gt;Python Script&lt;/h2&gt;
&lt;pre class="language-python" &gt;
    &lt;code class="language-python" &gt;

import sqlite3
import json
import csv
import sys
import os
import inspect

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

def connectDB():
    try:
        path = os.path.dirname(os.path.realpath(__file__)) + "/database.db"
        con = sqlite3.connect(path)
        return con
    except sqlite3.Error as error:
        eprint("@%s: %s" % (inspect.stack()[0][3], error))


def createDB():
    con = connectDB()
    cursor = con.cursor()
    cursor.execute( """
        CREATE TABLE IF NOT EXISTS "programs" (
                "name"  TEXT NOT NULL,
                "exec"  TEXT UNIQUE,
                "location"  TEXT,
                "description"   TEXT,
                "uses"  INTEGER DEFAULT 0
        ); """
    )
    con.commit()
    cursor.close()
    con.close()

def update():
    try:
        con = connectDB()
        cursor = con.cursor()
        with open("/tmp/mydmenu_update_file.csv") as ifile:
            reader = csv.reader(ifile,delimiter = ',')
            for f in reader:
                cursor.execute( """ INSERT INTO programs
                 (name,exec,location,description) VALUES (?, ?, ?, ? )
                 ON CONFLICT(location) DO UPDATE SET
                 name= ? , exec= ? , location= ? , description= ?
                 """ , (f[0],f[1],f[2],f[3],f[0],f[1],f[2],f[3]) )
        con.commit()
        cursor.close()
    except sqlite3.Error as error:
        eprint("@%s: %s" % (inspect.stack()[0][3], error))
        print(error)
    finally:
        if con:
            con.close()


def clean_up(p):
    try:
        con = connectDB()
        cursor = con.cursor()
        str_query = """ DELETE FROM programs WHERE location = ? """
        cursor.execute(str_query, (p,) )
        con.commit()
        cursor.close()
    except sqlite3.Error as error:
        eprint("@%s: %s" % (inspect.stack()[0][3], error))
    finally:
        if con:
            con.close()


def increment(p):
    try:
        con = connectDB()
        cursor = con.cursor()
        str_query = """ UPDATE programs SET uses = uses + 1 WHERE name = ? """
        cursor.execute(str_query, (p,) )
        con.commit()
        cursor.close()
    except sqlite3.Error as error:
        eprint("@%s: %s" % (inspect.stack()[0][3], error))
    finally:
        if con:
            con.close()


def get():
    try:
        con = connectDB()
        con.row_factory = sqlite3.Row
        cursor = con.cursor()
        str_query = """ SELECT * from programs ORDER BY uses DESC """
        cursor.execute(str_query)
        rows = cursor.fetchall()
        cursor.close()
        print(json.dumps( [ dict(x) for x in rows] ))
    except sqlite3.Error as error:
        eprint("@%s: %s" % (inspect.stack()[0][3], error))
    finally:
        if con:
            con.close()


def myfuncSwitch(arg):
    cmd = arg[1]
    switcher = {
        "update": update,
        "get": get,
        "del": clean_up,
        "increment": increment,
    }
    func = switcher.get(cmd)
    func(*arg[2:])


if __name__ == "__main__":
    createDB()
    myfuncSwitch(sys.argv)


&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;If you would like to contribute to this personalized dmenu launcher, you can find the Github repository at &lt;a href="https://github.com/neoMOSAID/mylauncher" target="_blank" &gt;my github repository&lt;/a&gt;. The repository contains the source code for this launcher, and you can use it to make any changes or improvements that you see fit. Additionally, you can submit bug reports or feature requests in the Github issues section. Contributions are always welcome and appreciated, and they can help make this launcher even better. Thank you for your interest in this project, and I look forward to seeing your contributions.&lt;/p&gt;

&lt;p&gt;I hope you found this article on my personalized dmenu launcher informative and useful. If you have any ideas or insights that you would like to share, or if you would like to share your experience with this launcher, please feel free to leave a comment below. Your feedback is valuable, and it can help improve this launcher and make it more useful for everyone. Additionally, if you have any questions or concerns, please do not hesitate to ask in the comments section.&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="dmenu launcher"></category><category term="Linux"></category><category term="productivity"></category><category term="i3 Window Manager"></category><category term="program launching"></category><category term="Customization"></category><category term="efficiency"></category><category term="workflow optimization"></category><category term="shell script"></category></entry><entry><title>ffmpeg command: basic and advanced usage and script examples</title><link href="https://mosaid.xyz/articles/ffmpeg-command-basic-and-advanced-usage-and-script-examples-86.html" rel="alternate"></link><published>2023-02-15T21:04:15+00:00</published><updated>2023-02-15T21:04:15+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-02-15:/articles/ffmpeg-command-basic-and-advanced-usage-and-script-examples-86.html</id><summary type="html">&lt;p&gt;Master the ffmpeg command with this comprehensive guide, covering basic and advanced usage as well as script examples. Learn how to manipulate audio and video files, perform conversions, apply filters, and automate tasks using ffmpeg commands, scripts, and practical examples.&lt;/p&gt;</summary><content type="html">&lt;h1&gt;Introduction to ffmpeg&lt;/h1&gt;
&lt;p&gt;ffmpeg is a powerful command-line tool for converting, editing, and processing audio and video files. It is available for Linux, as well as other operating systems, and supports a wide range of formats and codecs. As always in this article I will share with you a personal script of mine using ffmpeg&lt;/p&gt;

&lt;h2&gt;Installing ffmpeg on Linux&lt;/h2&gt;
&lt;p&gt;Installing ffmpeg on Linux is straightforward. On Debian based distros, you can use the following command:&lt;/p&gt;
&lt;pre class="language-terminal"&gt;
    &lt;code class="language-terminal"&gt;

sudo apt install ffmpeg

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;On Arch linux: &lt;/p&gt;
&lt;pre class="language-terminal"&gt;
    &lt;code class="language-terminal"&gt;

sudo pacman -S ffmpeg

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Other Linux distributions may have different installation methods. You can check the documentation for your distribution to find the appropriate commands.&lt;/p&gt;

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;h2&gt;Basic Usage of ffmpeg&lt;/h2&gt;
&lt;p&gt;The basic syntax for using ffmpeg is as follows:&lt;/p&gt;
&lt;pre class="language-terminal"&gt;
    &lt;code class="language-terminal"&gt;

ffmpeg [input options] -i input_file [output options] output_file

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;For example, to convert a video file from one format to another, you can use the following command:&lt;/p&gt;
&lt;pre class="language-terminal"&gt;
    &lt;code class="language-terminal"&gt;

ffmpeg -i input.mp4 output.avi

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This will convert the input file, `input.mp4`, to the output file, `output.avi`, using the default settings for the output format. You can also specify options such as the bitrate, resolution, and quality of the output file.&lt;/p&gt;

&lt;h2&gt;Advanced Usage of ffmpeg&lt;/h2&gt;
&lt;p&gt;ffmpeg can be used for more complex tasks, such as video and audio filtering, cropping and scaling, and adding subtitles or watermarks to a video. You can find more information and examples in the ffmpeg documentation and online tutorials.&lt;/p&gt;

&lt;h2&gt;Using ffmpeg for Live Streaming and Recording&lt;/h2&gt;
&lt;p&gt;ffmpeg can also be used for live streaming and recording. It supports a variety of streaming protocols, such as RTMP and HLS, and can encode and stream video and audio in real time.&lt;/p&gt;
&lt;p&gt;To start a live stream, you can use a command like the following:&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;pre class="language-terminal"&gt;
    &lt;code class="language-terminal"&gt;

ffmpeg -f v4l2 -i /dev/video0 -f alsa -i hw:0 -vcodec libx264 -preset ultrafast -acodec aac -f flv rtmp://streaming_server/live/stream_key

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This command uses the video and audio input devices, encodes the video using the `libx264` codec and the audio using the `aac` codec, and streams the output to an RTMP server.&lt;/p&gt;

&lt;h2&gt;My personal ffmpeg scripts&lt;/h2&gt;

&lt;p&gt;ffmpeg is really versatile, one cannot really say they know all about it. the following bash script is my go to whenever I need some quick conversion, screen recording or other things. it offers the following functions&lt;/p&gt;
&lt;pre class="language-terminal" &gt;
    &lt;code class="language-terminal" &gt;

    $ ff_functions
      0  ff_recscreen
      1  ff_mergeVideoAudio
      2  ff_convertToYoutube
      3  ff_muteVideo
      4  ff_convertToWhatsApp
      5  ff_concatSubscribe

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt; to use it just run it like this, to mute a video for example &lt;/p&gt;
&lt;pre class="language-terminal" &gt;
    &lt;code class="language-terminal" &gt;

    $ ff_functions 3 video_file.mp4

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

#!/bin/bash

#screen recording
# $1 can be 2, indication recording the second monitor as per my settings
function ff_recscreen(){
    outputfile="${HOME}/Videos/$(date +%G_%m_%d_at_%H-%M-%S).mkv"
    audioInputSource=$(
    pactl list sources short \
        | awk '{print $2}'\
        | grep input \
        | tail -1
    )
    audioOutputSource=$(
    pactl list sources short \
        | awk '{print $2}' \
        | grep output \
        | tail -1
    )
    SCREEN_res=$(xrandr -q --current | grep '*' | awk '{print $1}' | head -1 )

    if [[ "$1" == "2" ]]
        then  screen="1920+0"
        else  screen="0+0"
    fi
    printf '\033[1;32m audio1 : \033[1;0m %s\n' "$audioInputSource"
    printf '\033[1;32m audio2 : \033[1;0m %s\n' "$audioOutputSource"
    printf '\033[1;32m screen : \033[1;0m %s\n' "$SCREEN_res +0.0+$screen"

    IFS= read -rN 1 -p "continue (Y/n) ? : " answer
    echo
    [[ "$answer" == "n" ]] &amp;amp;&amp;amp; return

    ffmpeg \
        -f pulse  -ac 2 -i $audioInputSource \
        -f pulse  -ac 2 -i $audioOutputSource \
        -f x11grab -r 30 -s $SCREEN_res -i :0.0+$screen \
        -af "highpass=f=200, lowpass=f=3000" \
        -acodec pcm_s16le \
        -vcodec libx264 \
        -crf 0 \
        -threads 0 \
        $outputfile
}

# merge video and audio
# $1 : video file
# $2 : audio file
function ff_mergeVideoAudio(){
    video="$1"
    audio="$2"
    ffmpeg \
        -i "$video" \
        -i "$audio" \
        -filter_complex \
        "[0:a]apad[main];[1:a]volume=1.2,apad[A];[main][A]amerge[out]" \
        -c:v copy -c:a aac -map 0:v -map "[out]" \
        -preset ultrafast -threads 0 \
        -ac 2 -pix_fmt yuv420p  \
        -shortest \
        "${video%.*}-${audio%.*}_mixed.mp4"
}

# convert large video file to a reasonable size, no loss of quality
# $1 : video file
function ff_convertToYoutube(){
    video="$1"
    ffmpeg \
        -i "$video" \
        -c:v libx264 \
        -crf 24 \
        -b:v 1M \
        "${video%.*}_converted.mp4"
}

# remove audio from video file
# $1 : video file
function ff_muteVideo(){
    video="$1"
    ffmpeg \
        -i "$video" \
        -c:v copy \
        -an \
        "${video%.*}_muted.mp4"
}

# reduce video size to make it uploadable to whatsapp
# $1 : video file
function ff_convertToWhatsApp(){
    video="$1"
    ffmpeg \
        -i "$video" \
        -c:v libx264 \
        -profile:v baseline \
        -level 3.0 \
        -pix_fmt yuv420p \
        "${video%.*}_whatsapp.mp4"
}

# add add an image to the end of a video
function ff_concatSubscribe(){
    video="$1"
    image="$2"

    #get the video duration:

    dd=$(ffmpeg -i "$1" 2&amp;gt; &amp;amp;1 | grep Duration | awk '{print $2}' | tr -d , )
    m=$(echo "$dd" | cut -d: -f2 )
    s=$(echo "$dd" | cut -d: -f3 | cut -d. -f1)
    duration=$((m*60+s+2))

    #create a slightly longer video from the image:

    ffmpeg \
        -loop 1 \
        -i "$image" \
        -f lavfi -i anullsrc \
        -c:v libx264 \
        -c:a aac \
        -t $duration \
        -pix_fmt yuv420p \
        -vf scale=1902:1080 \
        -b:v 1M \
        -y "${image%.*}.mp4"

    #concat video and image:

    ffmpeg \
        -i "$video" \
        -i "${image%.*}.mp4" \
        -filter_complex "[0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1[v][a]" \
        -map "[v]" -map "[a]" \
        -shortest \
        -y output.mkv
    exit
}

readarray -t y &amp;lt;&amp;lt;&amp;lt; "$( cat "$0"  |grep ^function |sed 's/function//g;s/[(){]//g' )"

if [[ -z "$1" ]]
    then
        for (( k=0;k&amp;lt;${#y[$@]}; k++ )) ; do
            ! [[ -z "${y[$k]}" ]] &amp;amp;&amp;amp; printf "$k\t${y[$k]}\n"
        done
    else
        ${y[$1]} "$2" "$3" "$4"
fi

&lt;/code&gt;
&lt;/pre&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;h2&gt;Conclusion and Further Resources&lt;/h2&gt;
&lt;p&gt;ffmpeg is a versatile and powerful tool for audio and video processing in Linux. With the right options and techniques, you can use it to perform a wide range of tasks, from simple conversions to complex video processing and live streaming. For more information, you can consult the ffmpeg documentation and online forums and communities.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="ffmpeg"></category><category term="command"></category><category term="audio"></category><category term="video"></category><category term="manipulation"></category><category term="conversion"></category><category term="filters"></category><category term="scripting"></category><category term="examples"></category><category term="tutorial"></category><category term="automation"></category></entry><entry><title>i3 Window Manager: supporting scripts part 1</title><link href="https://mosaid.xyz/articles/i3-window-manager-supporting-scripts-part-1-84.html" rel="alternate"></link><published>2023-02-15T16:21:08+00:00</published><updated>2023-02-15T16:21:08+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-02-15:/articles/i3-window-manager-supporting-scripts-part-1-84.html</id><summary type="html">&lt;p&gt;Dive deeper into i3 Window Manager with supporting scripts in this continuation article. Explore essential bash scripts for workspace management, window movement, and keyboard shortcut listing. Learn how these scripts enhance the functionality and customization of i3, empowering users to optimize their workflow efficiently&lt;/p&gt;</summary><content type="html">&lt;p&gt;This article is a continuation to the previous article about &lt;a href="/articles/i3-window-manager-introduction-and-my-personal-config-83/"&gt;i3 window manager&lt;/a&gt; where I shared my &lt;b&gt;config&lt;/b&gt; file. which contained many of my bash scripts. in this first article I will share 3 scripts. one checks weither a workspace is empty. the second one helps me in moving windows to other workspaces and the last one is for listing the available keyboard combinations&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;h2&gt;workspace is empty &lt;/h2&gt;
&lt;p&gt;this script uses two commands/tools &lt;code&gt;xprop&lt;/code&gt; and &lt;code&gt;xdotool&lt;/code&gt; to check weither the workspace/desktop is empty or not. I used it with some of my conky scripts to only show conky window if there is no other window in the workspace. it should return 1 if no windows are visible, and 0 otherwise&lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

#!/bin/bash

# get the zero based index of current workspace
DESKTOP=$(xprop -notype -root _NET_CURRENT_DESKTOP | cut -c 24-)

# get the list of ID's of the windows in the current workspace/desktop
WINDOWS=$(xdotool search --all --onlyvisible --desktop $DESKTOP "" 2&amp;gt;/dev/null)

# count them
number_windows=$(echo "$WINDOWS" | wc -c)

if (( $number_windows &amp;gt; 1 ))
    then echo 0
    else echo 1
fi

&lt;/code&gt;
&lt;/pre&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;h2&gt;Go to workspace, move window to workspace &lt;/h2&gt;
&lt;p&gt;In this script I use a small Dialog window generated by the program &lt;code&gt;zenity&lt;/code&gt; that takes a number and go to that workspace&lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

#!/bin/bash

# we set the dialog title

title="Go to"
[[ "$1" == "move" ]] &amp;amp;&amp;amp; title="Move window To"

#we get the number from the dialog window

ws=$(
    zenity --entry --text="workspace:" --title="$title"
)

# we only accept numbers as input

number='^[0-9]+$'
if ! [[ "$ws" =~ $number ]]
    then exit
fi

# the script takes an argument "move". if so then we move the highlighted
# window to workspace $ws. otherwise we go to workspace $ws
# using the i3 built-in command i3-msg

if [[ "$1" == "move" ]]
    then
        i3-msg "move container to workspace $ws"
    else
        i3-msg "workspace $ws"
fi

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

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;h2&gt;Free keys&lt;/h2&gt;
&lt;p&gt;In this script I loop through the alphabet from {a..z} and each time check for the existence of keyboard combinations such as "ALT+a" "WIN+a" "CONTROL+ALT+a"  if &lt;code&gt;grep&lt;/code&gt; does not find it then it is free &lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

#!/bin/bash
echo "========================"
for a in `echo {a..z}` ; do
    if ! grep -w " mod1+$a" ~/.i3/config &amp;gt;/dev/null ; then
        echo "ALT+$a is free"
    fi
done
echo "========================"
for a in `echo {a..z}` ; do
    if ! grep -w "\$mod+$a" ~/.i3/config &amp;gt;/dev/null ; then
        echo "WIN+$a is free"
    fi
done
echo "========================"
for a in `echo {a..z}` ; do
    if ! grep -w "\$mod+mod1+$a" ~/.i3/config &amp;gt;/dev/null ; then
        if ! grep -w "mod1+\$mod+$a" ~/.i3/config &amp;gt;/dev/null ; then
            echo "WIN+ALT+$a is free"
        fi
    fi
done

&lt;/code&gt;
&lt;/pre&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="i3 Window Manager"></category><category term="supporting scripts"></category><category term="Bash scripts"></category><category term="workspace management"></category><category term="window movement"></category><category term="keyboard shortcuts"></category><category term="Customization"></category><category term="workflow optimization"></category><category term="productivity"></category><category term="Linux"></category><category term="Shell Scripting"></category><category term="i3"></category></entry><entry><title>i3 Window Manager: Introduction and My Personal config</title><link href="https://mosaid.xyz/articles/i3-window-manager-introduction-and-my-personal-config-83.html" rel="alternate"></link><published>2023-02-14T22:43:58+00:00</published><updated>2023-02-14T22:43:58+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-02-14:/articles/i3-window-manager-introduction-and-my-personal-config-83.html</id><summary type="html">&lt;p&gt;Discover i3, a powerful tiling window manager for Unix-like operating systems, renowned for its speed, efficiency, and configurability. Learn how i3 revolutionizes window management, maximizing productivity for power users and developers. Explore the fundamentals of i3 and gain insights into personal configurations for an optimized workflow&lt;/p&gt;</summary><content type="html">&lt;p&gt;i3 is a tiling window manager designed for Unix-like operating systems. It is lightweight, fast, and highly configurable, making it a popular choice among power users and developers.&lt;/p&gt;
&lt;p&gt;Unlike traditional window managers that use a desktop metaphor, i3 divides your screen into a grid of tiles and arranges your windows in a non-overlapping way. This allows you to maximize your screen real estate and be more productive.&lt;/p&gt;
&lt;p&gt;Some of the key features of i3 include:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Tiling layout&lt;/li&gt;
    &lt;li&gt;Keyboard-driven&lt;/li&gt;
    &lt;li&gt;Multiple workspaces&lt;/li&gt;
    &lt;li&gt;Customizable keybindings&lt;/li&gt;
    &lt;li&gt;Support for floating windows&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-9705701149690337"
data-ad-slot="7092311090"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;If you're new to i3, here are some basic commands to get you started:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;mod+enter&lt;/code&gt;: open a new terminal window&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mod+d&lt;/code&gt;: open the dmenu (a launcher for applications)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mod+shift+q&lt;/code&gt;: close the current window&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mod+1-9&lt;/code&gt;: switch to workspace 1-9&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mod+shift+1-9&lt;/code&gt;: move the current window to workspace 1-9&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To customize i3, you'll need to edit the configuration file located at &lt;code&gt;~/.config/i3/config&lt;/code&gt;. This file is written in a simple syntax and allows you to change keybindings, set up custom commands, and configure your i3 setup to your liking.&lt;/p&gt;
&lt;p&gt;Overall, i3 is a powerful and highly customizable window manager that can help you be more productive and efficient in your daily work. If you're looking for a lightweight and fast alternative to traditional desktop environments, give i3 a try!&lt;/p&gt;

&lt;h2&gt;My i3 config file updated over the years&lt;/h2&gt;

&lt;p&gt;Ever since I installed Arch Linux with i3 window manager. I instantly fallen in love with it and I've never gone back to other systems. it is great. and once you get into the art of creating your own scripts for your needs you will never part ways with i3wm.&lt;/p&gt;

&lt;p&gt;Dear visitor Please bear in mind that there are a lot of script files there that are for my personal system, once you copy the config file you have to change some things accordingly. feel free to ask about those files in the comments section bellow and I'll make sure to post them and notify you via Email &lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;


set $mod Mod4
set $altgr mod5

#i3-gaps
#gaps inner 12

font pango:monospace 12

# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

# start a terminal
#bindsym    $mod+Return         exec --no-startup-id i3-sensible-terminal
bindsym     $mod+t          exec --no-startup-id lxterminal
bindsym     $mod+Return         exec --no-startup-id lxterminal
bindsym     $mod+KP_Enter       exec --no-startup-id terminator
bindsym     mod1+s              exec --no-startup-id terminator




# kill focused window
 bindsym     mod1+x             kill
 bindsym     button3            floating toggle

# start program launchers
bindsym     $mod+shift+x    exec --no-startup-id "rofi -show combi "
bindsym     $mod+c      exec --no-startup-id ~/.i3/dm-mylocate.sh
bindsym     $mod+s      exec --no-startup-id ~/.i3/s-surf.sh
bindsym     $mod+g      exec --no-startup-id ~/.i3/dm-menu.sh '2 - search'
bindsym     mod1+a      exec --no-startup-id ~/.i3/apropos-man.sh aaa
bindsym     $mod+x      exec --no-startup-id ~/bin/mylauncher/launcher.sh
#bindsym     $mod+x     exec --no-startup-id "i3-dmenu-desktop --dmenu='dmenu -i -fn monospace:20 -p run'"

# change focus
#bindsym $mod+j focus left
#bindsym $mod+k focus down
#bindsym $mod+l focus up
#bindsym $mod+m focus right

# alternatively, you can use the cursor keys:
 bindsym $mod+Left          focus left
 bindsym $mod+Down          focus down
 bindsym $mod+Up            focus up
 bindsym $mod+Right         focus right

# # move focused window
# bindsym $mod+Shift+j       move left
# bindsym $mod+Shift+k       move down
# bindsym $mod+Shift+l       move up
# bindsym $mod+Shift+M       move right

 # alternatively, you can use the cursor keys:
 bindsym $mod+Shift+Left    move left
 bindsym $mod+Shift+Down    move down
 bindsym $mod+Shift+Up      move up
 bindsym $mod+Shift+Right   move right

 # split in horizontal orientation
 bindsym $mod+h split h

 # split in vertical orientation
 bindsym $mod+v split v

 # enter fullscreen mode for the focused container
 bindsym $mod+f fullscreen toggle

 # Make the currently focused window a scratchpad
 bindsym $mod+q move scratchpad
 # Show the first scratchpad window
 bindsym $mod+Shift+s scratchpad show
 # change container layout (stacked, tabbed, toggle split)
 bindsym $mod+a layout stacking
 bindsym $mod+z layout tabbed
 bindsym $mod+e layout toggle split

 # toggle tiling / floating
 bindsym $mod+Shift+space floating toggle

 # change focus between tiling / floating windows
 bindsym $mod+space focus mode_toggle

 # focus the parent container
 #bindsym $mod+q focus parent

 # focus the child container
 #bindsym $mod+d focus child

 # Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1           "1: root"
set $ws2           "2: net"
set $ws3           "3: Media"
set $ws4           "4: Files"
set $ws5           "5: Work"
set $ws6           "6: Docs"
set $ws7           "7"
set $ws8           "8"
set $ws9           "9"
set $ws10          "10"
set $ws11          "11"
set $ws12          "12"
set $ws13          "13"

# switch to workspace
 bindsym $mod+ampersand              workspace $ws1
 bindsym $mod+eacute                 workspace $ws2
 bindsym $mod+quotedbl               workspace $ws3
 bindsym $mod+apostrophe             workspace $ws4
 bindsym $mod+parenleft          workspace $ws5
 bindsym $mod+minus                  workspace $ws6
 bindsym $mod+egrave                 workspace $ws7
 bindsym $mod+underscore             workspace $ws8
 bindsym $mod+ccedilla               workspace $ws9
 bindsym $mod+agrave                 workspace $ws10
 bindsym $mod+parenright             workspace $ws11
 bindsym $mod+equal              workspace $ws12
 bindsym $mod+control+twosuperior    workspace $ws13

# switch to workspace
 bindsym $mod+control+ampersand              workspace "14"
 bindsym $mod+control+eacute                 workspace "15"
 bindsym $mod+control+quotedbl               workspace "16"
 bindsym $mod+control+apostrophe             workspace "17"
 bindsym $mod+control+parenleft          workspace "18"
 bindsym $mod+control+minus                  workspace "19"
 bindsym $mod+control+egrave                 workspace "20"
 bindsym $mod+control+underscore             workspace "21"
 bindsym $mod+control+ccedilla               workspace "22"
 bindsym $mod+control+agrave                 workspace "23"
 bindsym $mod+control+parenright             workspace "24"
 bindsym $mod+control+equal                  workspace "25"

 # move focused container to workspace
 bindsym $mod+Shift+ampersand       move container to workspace $ws1
 bindsym $mod+Shift+eacute          move container to workspace $ws2
 bindsym $mod+Shift+quotedbl        move container to workspace $ws3
 bindsym $mod+Shift+apostrophe      move container to workspace $ws4
 bindsym $mod+Shift+parenleft       move container to workspace $ws5
 bindsym $mod+Shift+minus       move container to workspace $ws6
 bindsym $mod+Shift+egrave          move container to workspace $ws7
 bindsym $mod+Shift+underscore      move container to workspace $ws8
 bindsym $mod+Shift+ccedilla        move container to workspace $ws9
 bindsym $mod+Shift+agrave          move container to workspace $ws10
 bindsym $mod+Shift+parenright      move container to workspace $ws11
 bindsym $mod+Shift+equal           move container to workspace $ws12
 bindsym $mod+Shift+twosuperior     move container to workspace $ws13

 # move focused container to workspace
 bindsym $mod+control+Shift+ampersand       move container to workspace  "14"
 bindsym $mod+control+Shift+eacute          move container to workspace  "15"
 bindsym $mod+control+Shift+quotedbl        move container to workspace  "16"
 bindsym $mod+control+Shift+apostrophe      move container to workspace  "17"
 bindsym $mod+control+Shift+parenleft       move container to workspace  "18"
 bindsym $mod+control+Shift+minus       move container to workspace  "19"
 bindsym $mod+control+Shift+egrave          move container to workspace  "20"
 bindsym $mod+control+Shift+underscore      move container to workspace  "21"
 bindsym $mod+control+Shift+ccedilla        move container to workspace  "22"
 bindsym $mod+control+Shift+agrave          move container to workspace  "23"
 bindsym $mod+control+Shift+parenright      move container to workspace  "24"
 bindsym $mod+control+Shift+equal           move container to workspace  "25"

bindsym $mod+w      exec --no-startup-id   ~/.i3/move_to_ws.sh
bindsym $mod+shift+w    exec --no-startup-id   ~/.i3/move_to_ws.sh move

 # dual monitor settings
 #exec_always --no-startup-id xrandr --output HDMI-1 --right-of eDP-1
 set $firstmonitor eDP1
 set $secondmonitor HDMI1

 workspace $ws1 output  $firstmonitor
 workspace $ws2 output  $firstmonitor
 workspace $ws4 output  $firstmonitor
 workspace $ws8 output  $firstmonitor
 workspace $ws9 output  $secondmonitor
 workspace $ws3 output  $secondmonitor
 workspace $ws5 output  $secondmonitor
 workspace $ws7 output  $secondmonitor

assign [class="Transmission-gtk"] $ws3
assign [class="Navigator|firefox"] $ws2
assign [class="libreoffice-calc|libreoffice-writer"] $ws5
assign [class="Chromium|Google-chrome"] $ws11
assign [class="Tor Browser"] $ws7
assign [class="VirtualBox Manager"] $ws7
assign [class="sqlitebrowser|DB Browser for SQLite"] $ws6
assign [class="Evince|Org.gnome.gedit|MuPDF"] $ws6
assign [class="VirtualBox Machine"] $ws6
assign [class="obs|explorer.exe|Wine|huniepop.exe|joey_pc.exe"] $ws12
assign [class="openshot|QtCreator|TeXstudio|code-oss|Atom"] $ws11
#
#
#some window parameters
for_window [class="mpv|Tor Browser|Transmission-gtk|vlc|Pavucontrol"] floating enable border normal
for_window [class="Gnome-system-monitor|smplayer|Gnome-calculator"] floating enable border normal
for_window [class="Pidgin|Woeusbgui|Wicd-client.py"] floating enable border normal
for_window [class="VirtualBox Manager|florence|Florence"] floating enable border normal
for_window [class="TelegramDesktop|Qalculate-gtk"] floating enable border normal
for_window [class="feh|fim"] floating enable move absolute position 0px 0px
#for_window [class="Lxterminal|lxterminal"] resize set 1200 700
for_window [class="Xfce4-terminal|Surf"] floating enable border normal
for_window [class="Xfce4-terminal"] resize set 1600 700
for_window [class="Surf"] resize set 1200 650
for_window [class="Xfce4-terminal|Surf"] move absolute position 70 70
for_window [class="Google-chrome|firefox|Chromium"] resize set width 33 ppt
#for_window [class="VirtualBox Machine"] floating enable, resize set 1601 900, move position 0 0
#

#new_window normal
#set $background  #e0eaf9
#
## class                 border  backgr. text    indicator child_border
#client.focused          #271f17 #271f17 #AAAAAA #AAAAAA   #C93F2C
#client.focused_inactive #21211d #1d2121 #a1a1a1 #484e50   #1d2121
#client.unfocused        #333333 #222222 #888888 #292d2e   #222222
#client.urgent           #4a4b4c #4a4b4c #AAAAAA #AAAAAA   #4a4c4b
#client.placeholder      #000000 #0c0c0c #AAAAAA #000000   #0c0c0c
#
#client.background       #111111

# reload the configuration file
# bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
 bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
 bindsym $mod+Shift+e   exec --no-startup-id "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
 bindsym $mod+control+Escape exec --no-startup-id 'i3-msg exit'

# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode

# Pressing left will shrink the window’s width.
# Pressing right will grow the window’s width.
# Pressing up will shrink the window’s height.
# Pressing down will grow the window’s height.
        bindsym j resize shrink width 10 px or 10 ppt
        bindsym k resize grow height 10 px or 10 ppt
        bindsym l resize shrink height 10 px or 10 ppt
        bindsym m resize grow width 10 px or 10 ppt

# same bindings, but for the arrow keys
        bindsym Left  resize shrink width   10 px or 10 ppt
        bindsym Down  resize shrink height  10 px or 10 ppt
        bindsym Up    resize grow   height  10 px or 10 ppt
        bindsym Right resize grow   width   10 px or 10 ppt

# back to normal: Enter or Escape or $mod+r
        bindsym Return mode "default"
        bindsym Escape mode "default"
        bindsym $mod+r mode "default"
}

 bindsym $mod+r mode "resize"


# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)

#Polybar to replace the default i3statusbar:
#exec_always --no-startup-id $HOME/.config/polybar/launch.sh boot

bar {
    colors {
        background #000000
        # statusline #00A5FF #that neon blue
        separator #000000
        focused_workspace  #4c7899 #285577 #ffffff
        active_workspace   #333333 #5f676a #ffffff
        inactive_workspace #333333 #222222 #888888
        urgent_workspace   #2f343a #900000 #ffffff
    }
    font pango:FontAwesome Bold 9
#tray_output none
    status_command i3blocks -c ~/.i3/top-bar/i3blocks.conf
    position    top
#bindsym --release button3  exec --no-startup-id scrot '%Y-%m-%d-%s_$wx$h.png' -e 'mv $f ~/Pictures/' &amp;&amp; mplayer ~/.i3/Nikon.ogg
}

#bar {
#    font pango:FontAwesome Bold 20
#    status_command i3blocks -c ~/.i3/bottom-bar/i3blocks.conf
#    position   bottom
#    modifier    Mod4
#    mode        hide
#    hidden_state hide
#    workspace_buttons no
#}

# Pulse Audio controls
 bindsym XF86AudioRaiseVolume       exec --no-startup-id /home/mosaid/bin/vv + 2
 bindsym XF86AudioLowerVolume       exec --no-startup-id /home/mosaid/bin/vv - 2
 bindsym XF86AudioMute          exec --no-startup-id /home/mosaid/bin/vv mute

 # Screen brightness controls
 #bindsym XF86MonBrightnessUp       exec --no-startup-id xbacklight -inc 20 # increase screen brightness
 #bindsym XF86MonBrightnessDown     exec --no-startup-id xbacklight -dec 20 # decrease screen brightness
 bindsym XF86MonBrightnessUp        exec --no-startup-id light -A 10 # increase screen brightness
 bindsym XF86MonBrightnessDown      exec --no-startup-id light -U 10 # decrease screen brightness

# Touchpad controls
#bindsym XF86TouchpadToggle     exec --no-startup-id /some/path/toggletouchpad.sh # toggle touchpad
#bindsym XF86TouchpadToggle     exec --no-startup-id vlc

# Media player controls
 bindsym XF86AudioPlay              exec --no-startup-id /home/mosaid/bin/mympc.sh pp
 bindsym XF86AudioPause         exec --no-startup-id /home/mosaid/bin/mympc.sh pp
 bindsym XF86AudioNext              exec --no-startup-id /home/mosaid/bin/mympc.sh
 bindsym XF86AudioPrev              exec --no-startup-id /home/mosaid/bin/mympc.sh p

 #screenshots
bindsym Print                   exec --no-startup-id  ~/.i3/screenshot.sh 1
bindsym mod1+control+p              exec --no-startup-id  ~/.i3/screenshot.sh 1
bindsym mod1+control+o              exec --no-startup-id  ~/.i3/screenshot.sh 2

#other keyboard shortcuts
bindsym $mod+l                      exec --no-startup-id  betterlockscreen --lock
bindsym $mod+n                      exec --no-startup-id  ~/bin/playFromClipboard.sh npr
bindsym $mod+m                  exec --no-startup-id  ~/.i3/top-bar/user.sh menu
bindsym mod1+space              exec --no-startup-id  ~/bin/mpd-controls.sh pp
bindsym control+mod1+space          exec --no-startup-id  ~/bin/mpd-controls.sh m
bindsym mod1+n                      exec --no-startup-id  ~/bin/mpd-controls.sh n
bindsym mod1+b                      exec --no-startup-id  ~/bin/mpd-controls.sh p
bindsym mod1+v                      exec --no-startup-id  ~/bin/mpd-controls.sh v
bindsym mod1+c                      exec --no-startup-id  ~/bin/mpd-controls.sh vv
bindsym mod1+r                      exec --no-startup-id  ~/bin/mpd-controls.sh r
bindsym mod1+w                      exec --no-startup-id  ~/.i3/pplay/play.sh
#bindsym mod1+f                     exec --no-startup-id  ~/bin/conkyfont.sh
bindsym $mod+mod1+g             exec --no-startup-id  ~/.i3/shortcuts-conky.sh
bindsym mod1+d                      exec --no-startup-id  ~/bin/myBash_functions.sh eglllr
bindsym mod1+t                      exec --no-startup-id  ~/bin/myBash_functions.sh ttor
bindsym control+less                exec --no-startup-id  ~/bin/ws.sh ++
bindsym control+shift+less          exec --no-startup-id  ~/bin/ws.sh --

#startup
#exec           --no-startup-id wicd-gtk -t
#exec           --no-startup-id firefox
#exec           --no-startup-id pidgin
#exec            --no-startup-id transmission-gtk -m
#exec           --no-startup-id udiskie
#exec           --no-startup-id ~/.i3/start-conky.sh
#exec           --no-startup-id ~/.i3/prayerTime.sh
#exec           --no-startup-id ~/.i3/pplay/pplayEngine.sh
exec            --no-startup-id ~/.i3/onedriveMonitor.sh
#exec           --no-startup-id ~/.i3/touchpadSettings.sh
exec            --no-startup-id redshift
exec_always     --no-startup-id numlockx on
exec_always     --no-startup-id picom --config ~/.i3/picom.conf
exec_always     --no-startup-id xkb-switch --i3

set $mode_display Mirrored (c) , Ext Screen (v) , HDMI ON (b) , HDMI OFF (n)
mode "$mode_display" {
    bindsym c   exec  --no-startup-id ~/.i3/display.sh mirrored , mode "default"
    bindsym v   exec  --no-startup-id ~/.i3/display.sh extended , mode "default"
    bindsym b   exec  --no-startup-id ~/.i3/display.sh mirrored , mode "default"
    bindsym n   exec  --no-startup-id ~/.i3/display.sh default  , mode "default"

    bindsym Return mode "default"
    bindsym Escape mode "default"
}
#
 bindsym $mod+d mode "$mode_display"
#bindsym $mod+d             exec --no-startup-id ~/.i3/display.sh
#bindsym XF86Display    exec --no-startup-id ~/.i3/display.sh

# multitouch gestures
 bindsym --whole-window $mod+button10 workspace prev_on_output
 bindsym --whole-window $mod+button11 workspace next_on_output

#keyboard layout
exec_always --no-startup-id "setxkbmap -model pc104 -layout fr,ar -variant ,, -option grp:alt_shift_toggle"
#bindsym --release Caps_Lock exec --no-startup-id pkill -SIGRTMIN+11 i3blocks
#bindsym --release Num_Lock  exec --no-startup-id pkill -SIGRTMIN+11 i3blocks

#switch to greeter and login
#bindsym $mod+twosuperior exec dm-tool switch-to-greeter


set $playFromClipboard play From ClipBoard (c), play next youtube video (v)
mode "$playFromClipboard" {

    bindsym c  exec --no-startup-id ~/bin/playFromClipboard.sh
    bindsym v  exec --no-startup-id ~/bin/playFromClipboard.sh n

    bindsym Escape mode "default"
}

 bindsym mod1+p mode "$playFromClipboard"

set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown
mode "$mode_system" {
    bindsym l exec --no-startup-id i3exit.sh lock, mode "default"
    bindsym e exec --no-startup-id i3exit.sh logout, mode "default"
    bindsym s exec --no-startup-id i3exit.sh suspend, mode "default"
    bindsym h exec --no-startup-id i3exit.sh hibernate, mode "default"
    bindsym r exec --no-startup-id i3exit.sh reboot, mode "default"
    bindsym Shift+s exec --no-startup-id i3exit.sh shutdown, mode "default"

    # back to normal: Enter or Escape
    bindsym Return mode "default"
    bindsym Escape mode "default"
}
 bindsym $mod+Shift+q mode "$mode_system"



&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="i3"></category><category term="window manager"></category><category term="tiling"></category><category term="Unix-like operating systems"></category><category term="productivity"></category><category term="configuration"></category><category term="efficiency"></category><category term="power users"></category><category term="developers"></category><category term="workspace optimization"></category><category term="personal configurations"></category><category term="Linux"></category></entry><entry><title>ed text editor: An advanced tutorial with scripts</title><link href="https://mosaid.xyz/articles/ed-text-editor-an-advanced-tutorial-with-scripts-82.html" rel="alternate"></link><published>2023-02-13T14:05:12+00:00</published><updated>2023-02-13T14:05:12+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-02-13:/articles/ed-text-editor-an-advanced-tutorial-with-scripts-82.html</id><summary type="html">&lt;p&gt;ed is a line-oriented text editor that was popular in the early days of Unix. Although it's not as widely used today as more modern text editors like vi or emacs, it's still available on many systems and is sometimes used for scripting purposes.&lt;/p&gt;</summary><content type="html">&lt;p&gt;
  ed is a line-oriented text editor that was popular in the early days of Unix.
  Although it's not as widely used today as more modern text editors like vi or emacs,
  it's still available on many systems and is sometimes used for scripting purposes.
&lt;/p&gt;
&lt;h2&gt;Starting ed&lt;/h2&gt;
&lt;p&gt;
  To start the ed editor, simply type "ed" at the command prompt and press Enter.
  You will be taken to the ed prompt, which looks like this:
&lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

  $ ed

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;
  To open an existing file in ed, you can use the following syntax:
&lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

  $ ed &amp;lt;file name&amp;gt;

&lt;/code&gt;
&lt;/pre&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;h2&gt;Basic commands&lt;/h2&gt;
&lt;p&gt;
  The ed editor is controlled by typing commands at the prompt. Some basic commands include:
&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;a: append text to the end of the file&lt;/li&gt;
  &lt;li&gt;i: insert text before the current line&lt;/li&gt;
  &lt;li&gt;p: print the current line&lt;/li&gt;
  &lt;li&gt;d: delete the current line&lt;/li&gt;
  &lt;li&gt;q: quit the editor&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Advanced commands&lt;/h2&gt;
&lt;p&gt;
  In addition to the basic commands, ed also supports a number of more advanced commands for editing text:
&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;c: change the current line&lt;/li&gt;
  &lt;li&gt;n: print the current line number&lt;/li&gt;
  &lt;li&gt;/text/: search for the specified text&lt;/li&gt;
  &lt;li&gt;s/old/new/: replace the first occurrence of "old" with "new" in the current line&lt;/li&gt;
  &lt;li&gt;s/old/new/g: replace all occurrences of "old" with "new" in the current line&lt;/li&gt;
  &lt;li&gt;u: undo the last change&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Adding text&lt;/h2&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;
  To add text to the file, use the 'a' command. After you type 'a', you can enter the text you want to add.
  To end the text input and return to the ed prompt, press the escape key (ESC).
&lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

  $ ed
  a
  &amp;lt;text to be added&amp;gt;
  ESC

&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;Saving and quitting&lt;/h2&gt;
&lt;p&gt;
  To save your changes and quit the editor, type 'w' followed by 'q'. To quit without saving changes, simply type 'q'.
&lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

  wq

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;
In addition to using ed interactively, it's also possible to use ed to perform one-line commands from the terminal. These commands are useful for quickly editing a file without having to start the interactive editor. For example, to replace text between two patterns in a file, you can use the following syntax:
&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

$ echo 'text to be edited' | ed -s file.txt &amp;lt;&amp;lt;&amp;lt; $'/pattern1/,/pattern2/s/old/new/g\nw\nq'

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;
This will replace all occurrences of "old" with "new" in the file "file.txt" between the first line containing "pattern1" and the first line containing "pattern2". The changes will be saved to the file and the ed editor will quit.
&lt;/p&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

$ printf '%s\n' "/$pattern1/+1,/$pattern2/-1d" "/$pattern1/a" "$TEXT" . wq | ed -s "$texFile"

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;
This command uses the `printf` command to generate the ed commands, which are passed to the `ed` editor using a pipe. The first line of the generated commands, `"/$pattern1/+1,/$pattern2/-1d"`, deletes all lines from the line after the first occurrence of `$pattern1` to the line before the first occurrence of `$pattern2`. The second line of the commands, `"/$pattern1/a"`, appends the text `$TEXT` to the line containing `$pattern1`. The `.` on the last line of the commands saves the changes and the `wq` quits the editor.
&lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

# Append text to the end of a file
$ echo "$TEXT" | ed -s "$file" &amp;lt;&amp;lt;&amp;lt; $'$a\n'"$TEXT"'\n.\nw\nq'

# Insert text at the beginning of a file
$ echo "$TEXT" | ed -s "$file" &amp;lt;&amp;lt;&amp;lt; $'0a\n'"$TEXT"'\n.\nw\nq'

# Replace a line in a file
$ echo "$TEXT" | ed -s "$file" &amp;lt;&amp;lt;&amp;lt; $'$LINE_NUMBER c\n'"$TEXT"'\n.\nw\nq'

# Delete a line from a file
$ ed -s "$file" &amp;lt;&amp;lt;&amp;lt; $"$LINE_NUMBER d\n.\nw\nq"

# Search and replace text in a file
$ ed -s "$file" &amp;lt;&amp;lt;&amp;lt; $'1,$s/old/new/g\n.\nw\nq'

# Search for a pattern and print matching lines
$ ed -n "$file" &amp;lt;&amp;lt;&amp;lt; $'/PATTERN/p\nq'

&lt;/code&gt;
&lt;/pre&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;
In these examples, `$TEXT` is the text you want to insert, `$LINE_NUMBER` is the line number in the file where you want to perform an operation, `$file` is the name of the file you want to edit, `old` is the text you want to replace, `new` is the replacement text, and `PATTERN` is the pattern you want to search for.
&lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

#!/bin/sh

# Define the file to edit
file="file.txt"

# Define the text to insert
text="This is some text"

# Define the line number to insert the text at
line_number=3

# Use ed to insert the text at the specified line number
ed -s "$file" &amp;lt;&amp;lt;-EOF
$line_number
a
$text
.
w
q
EOF


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

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;
This script uses ed to insert the text `$text` at line number `$line_number` in the file `$file`. The script starts by defining the file to edit, the text to insert, and the line number to insert the text at. The script then uses ed in a here document to insert the text. The here document contains ed commands to go to the specified line number, append the text, save the changes, and quit the editor.
&lt;/p&gt;
&lt;p&gt;
    let's say we have a log file that contains entries. and it is organized this way:
&lt;/p&gt;

&lt;pre&gt;
.....
%%12:01-02-2022:start
    ....
%%12:01-02-2022:end
%%13:17-07-2022:start
    ....
%%13:17-07-2022:end
%%14:21-10-2022:start
    ....
%%14:21-10-2022:end
....
&lt;/pre&gt;
&lt;p&gt;Each entry starts with pattern %%entry_number:entry_date:start and ends with %%entry_number:entry_date:end. suppose we want to edit an entry but we only know its date and number but we don't want to browse the millions of lines manually to find it. with "ed" and other commands like "grep" we can do that. &lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

#!/bin/sh

# Define the log file
log_file="log.txt"

# Define the start pattern
start_pattern="%%entry_number:entry_date:start"

# Define the end pattern
end_pattern="%%entry_number:entry_date:end"

# Get the start line number of the entry
start_line_number=$(grep -n "$start_pattern" "$log_file" | awk -F: '{print $1}')

# Get the end line number of the entry
end_line_number=$(grep -n "$end_pattern" "$log_file" | awk -F: '{print $1}')

# Use ed to extract the entry into a temporary file
ed -n "$log_file" &amp;lt;&amp;lt;-EOF
$start_line_number,$end_line_number w entry.tmp
q
EOF

# Edit the temporary file as needed
# ...

# Use ed to reinsert the edited entry into the log file
ed -s "$log_file" &amp;lt;&amp;lt;-EOF
$start_line_number,$end_line_number d
$start_line_number
r entry.tmp
.
w
q
EOF

&lt;/code&gt;
&lt;/pre&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;
In this example, the script uses `grep` to search for the start and end patterns in the log file and retrieve the line numbers where they occur. The script then uses the line numbers in the `ed` commands to extract and reinsert the entry in the same way as in the previous example.
&lt;/p&gt;
&lt;p&gt;ed text editor and many other similar tools take advantage of the organized and repetitive patterns found in many configuration files, making it easier to automate and manipulate these files in various ways. This is because ed and other tools are designed to work with text files, and these repetitive patterns allow these tools to locate specific information and make changes to it with just a few simple commands. Additionally, these tools can be combined with other utilities, such as grep, to further increase their functionality and allow for even more advanced text manipulation. This is why the well-organized structure of configuration files is so important in the world of computing, as it allows for a wide range of powerful and efficient tools to be used to manage and manipulate these files.&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;h1&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;In conclusion, ED is a powerful and versatile text editor that offers many features and functionalities for advanced text manipulation. From basic editing tasks to complex text operations, ED provides a simple and efficient way to work with text files in a Unix environment. Whether you are a seasoned developer or just getting started, ED is definitely worth exploring and learning.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Ed"></category><category term="Ed editor"></category><category term="Text Editor"></category><category term="command line"></category></entry><entry><title>An Introduction to Kali Linux</title><link href="https://mosaid.xyz/articles/an-introduction-to-kali-linux-72.html" rel="alternate"></link><published>2023-02-05T21:09:30+00:00</published><updated>2023-02-05T21:09:30+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-02-05:/articles/an-introduction-to-kali-linux-72.html</id><summary type="html">&lt;p&gt;Discover the power of Kali Linux, a Debian-based distribution tailored for digital forensics and penetration testing. Explore its features, extensive collection of security tools, and custom desktop environment designed for efficiency. Learn about example commands for various security categories and understand the importance of responsible usage in the security industry.&lt;/p&gt;</summary><content type="html">&lt;h1&gt;An Introduction to Kali Linux&lt;/h1&gt;
&lt;p&gt;
  Kali Linux is a Debian-based Linux distribution designed for digital forensics and penetration testing. It is a popular tool for security professionals, ethical hackers, and enthusiasts, who use it to test the security of their own systems and networks, as well as those of their clients. In this article, we'll explore what Kali Linux is, its features, and why it is an essential tool for those in the security industry.
&lt;/p&gt;
&lt;h2&gt;What is Kali Linux?&lt;/h2&gt;
&lt;p&gt;
  Kali Linux is a Debian-based Linux distribution that is widely used for penetration testing, digital forensics, and security research. It was created and developed by Offensive Security, a leading provider of security training and services. Kali Linux is built on a strong foundation of open-source software and is continuously updated to include the latest security tools and features.
&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;h2&gt;Features of Kali Linux&lt;/h2&gt;
&lt;p&gt;
  One of the key features of Kali Linux is its extensive collection of security tools, which are organized into categories such as information gathering, vulnerability analysis, exploitation tools, password attacks, wireless attacks, and web applications. This makes it easy for users to find the tools they need for their specific task or project.
&lt;/p&gt;
&lt;p&gt;
  Kali Linux also includes a custom desktop environment, which provides a user-friendly interface for accessing and using the tools. Additionally, Kali Linux is designed to be lightweight and fast, making it ideal for use on low-end hardware and older computers.
&lt;/p&gt;
&lt;h2&gt;Example Commands for Different Categories&lt;/h2&gt;
&lt;h3&gt;Information Gathering&lt;/h3&gt;
&lt;p&gt;
  One of the most popular tools for information gathering in Kali Linux is Nmap, which is used to scan networks and identify open ports and running services. An example command for using Nmap to scan a network is:
&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;
  &lt;code&gt;nmap 192.168.1.0/24&lt;/code&gt;
&lt;/p&gt;
&lt;h3&gt;Vulnerability Analysis&lt;/h3&gt;
&lt;p&gt;
  A popular tool for vulnerability analysis in Kali Linux is OpenVAS, which is used to identify vulnerabilities in systems and networks. An example command for using OpenVAS is:
&lt;/p&gt;
&lt;p&gt;
  &lt;code&gt;openvas-launch&lt;/code&gt;
&lt;/p&gt;
&lt;h3&gt;Exploitation Tools&lt;/h3&gt;
&lt;p&gt;
  A widely used exploitation tool in Kali Linux is Metasploit, which is used to exploit vulnerabilities in systems and networks. An example command for using Metasploit is:
&lt;/p&gt;
&lt;p&gt;
  &lt;code&gt;msfconsole&lt;/code&gt;
&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;h3&gt;Password Attacks&lt;/h3&gt;
&lt;p&gt;
  One of the most popular tools for password attacks in Kali Linux is John the Ripper, which is used to crack passwords. An example command for using John the Ripper is:
&lt;/p&gt;
&lt;p&gt;
  &lt;code&gt;john --wordlist=/usr/share/wordlists/rockyou.txt hashfile.txt&lt;/code&gt;
&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;
  Kali Linux is a powerful and versatile Linux distribution that is widely used in the security industry. Its extensive collection of security tools, user-friendly interface, and lightweight design make it a popular choice for those who need to test the security of their systems and networks. Whether you are a security professional, ethical hacker, or enthusiast, Kali Linux is a valuable tool to have in your arsenal.
&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;
  However, it is important to note that Kali Linux should only be used for lawful purposes and with the proper knowledge and training. Using Kali Linux for malicious purposes or without proper understanding of its tools can have serious consequences, both legally and ethically.
&lt;/p&gt;
&lt;p&gt;
  In conclusion, Kali Linux is a useful tool for those in the security industry, but it should be used responsibly and with the proper understanding of its capabilities and limitations.
&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Kali Linux"></category><category term="penetration testing"></category><category term="digital forensics"></category><category term="security tools"></category><category term="Debian-based distribution"></category><category term="ethical hacking"></category><category term="vulnerability analysis"></category><category term="exploitation"></category><category term="password attacks"></category><category term="Metasploit"></category><category term="Nmap"></category><category term="John the Ripper"></category><category term="OpenVAS"></category><category term="security professionals"></category></entry><entry><title>Linux vs Windows: Understanding the Differences</title><link href="https://mosaid.xyz/articles/linux-vs-windows-understanding-the-differences-66.html" rel="alternate"></link><published>2023-02-05T17:10:27+00:00</published><updated>2023-02-05T17:10:27+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-02-05:/articles/linux-vs-windows-understanding-the-differences-66.html</id><summary type="html">&lt;p&gt;Explore the differences between Linux and Windows operating systems in this insightful article. Understand key terms such as kernel, file manager, and desktop environment, and delve into the accessibility and control levels offered by each system. Whether you're a beginner or an experienced user, uncover the distinctions to make an informed decision for your computing needs.&lt;/p&gt;</summary><content type="html">&lt;p&gt;
When it comes to operating systems, Linux and Windows are two of the most popular choices. While both systems have their own unique features, there are some key differences that set them apart.
&lt;/p&gt;
&lt;h2&gt;Definition of Key Terms&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Kernel:&lt;/b&gt; The kernel is the central component of an operating system. It acts as the intermediary between software applications and the computer hardware. The kernel controls the allocation of resources, such as CPU time, memory, and disk space, among other things. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;File Manager:&lt;/b&gt; A file manager is a software application used for organizing and manipulating files on a computer. It provides a graphical user interface for accessing and manipulating files, folders, and disks.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Desktop Environment (DE):&lt;/b&gt; A desktop environment is a graphical user interface that runs on top of a computer's operating system. It provides the user with a graphical interface for accessing and managing files, applications, and other resources.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-9705701149690337"
data-ad-slot="7092311090"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;h2&gt;Access to Directories and Processes&lt;/h2&gt;
&lt;p&gt;
In Windows, users have limited control over many directories and processes, as they are protected by the operating system. This means that users do not have the ability to access or modify certain parts of the system.
&lt;/p&gt;
&lt;p&gt;
In Windows, even a software developer has no direct access to the Windows kernel. Access to the kernel is through multiple layers, such as the WinAPI and the WinNTDLL. This means that developers have to work with APIs (Application Programming Interfaces) to communicate with the kernel.
&lt;/p&gt;

&lt;p&gt;
Windows users are not able to change the Windows file manager "Explorer.exe". This is because Explorer.exe is a core component of the Windows operating system and cannot be replaced or altered by users.
&lt;/p&gt;
&lt;p&gt;
The same goes for the Desktop Environment (DE) in Windows. Windows users are not able to change the DE that is built into the operating system.
&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-9705701149690337"
data-ad-slot="7092311090"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;figure&gt;
&lt;img src="/theme/images/articles/images/66-img-1.png" alt="altaltalt" style="max-width:100%;height:auto;" &gt;
&lt;figcaption&gt; windows OS architecture: user -&amp;gt; winAPI  -&amp;gt; ntDLL  -&amp;gt; kernel &lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;
On the other hand, in Linux, users have complete control over the system, including all directories and processes. The superuser account, also known as "root", has complete control over the system, including the ability to modify or delete any part of the system.
&lt;/p&gt;
&lt;figure&gt;
&lt;img src="/theme/images/articles/images/66-img-2.png" alt="altaltalt" style="max-width:100%;height:auto;" &gt;
&lt;figcaption&gt; linux architecture: completely documented, open source and available &lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-9705701149690337"
data-ad-slot="7092311090"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;
In Linux, system calls go directly to the kernel. This gives Linux developers more control over the system and the ability to directly communicate with the kernel. Linux users have the ability to change both their file manager and DE if they so choose.
&lt;/p&gt;
&lt;p&gt;
This level of customization is one of the key differences between Linux and Windows. Linux offers users more flexibility and control over their computing environment, while Windows provides a more standardized and controlled environment.
&lt;/p&gt;
&lt;p&gt;
This level of control can be both an advantage and a disadvantage. On one hand, it allows users to have complete control over their system and the ability to customize it to their needs. On the other hand, it also means that users have the ability to completely wipe out their system if they are not careful.
&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;
These are just some of the differences between Linux and Windows. Both systems have their own advantages and disadvantages, and the best choice for you will depend on your needs and preferences.
&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-9705701149690337"
data-ad-slot="7092311090"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Linux"></category><category term="Windows"></category><category term="operating system"></category><category term="differences"></category><category term="comparison"></category><category term="kernel"></category><category term="File Manager"></category><category term="desktop environment"></category><category term="control"></category><category term="accessibility"></category><category term="Customization"></category><category term="superuser"></category><category term="root"></category><category term="system calls"></category><category term="APIs"></category><category term="computing environment"></category></entry><entry><title>A Guide to the Linux Operating System</title><link href="https://mosaid.xyz/articles/a-guide-to-the-linux-operating-system-63.html" rel="alternate"></link><published>2023-02-04T21:01:25+00:00</published><updated>2023-02-04T21:01:25+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2023-02-04:/articles/a-guide-to-the-linux-operating-system-63.html</id><summary type="html">&lt;p&gt;Linux is a free, open-source operating system that has become increasingly popular in recent years, both for personal and professional use. It is known for its stability, security, and versatility, and is used by millions of people around the world. This article will provide an overview of the Linux operating system, including the different distributions, desktop environments, package managers, and file managers that are available.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Linux is a free, open-source operating system that has become increasingly popular in recent years, both for personal and professional use. It is known for its stability, security, and versatility, and is used by millions of people around the world. This article will provide an overview of the Linux operating system, including the different distributions, desktop environments, package managers, and file managers that are available.&lt;/p&gt;
&lt;h2&gt;Distributions&lt;/h2&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;One of the most notable features of Linux is the availability of different distributions, or "distros". These are essentially different versions of the operating system that are tailored to meet the specific needs and preferences of users. There are two main types of distros: Debian-based and Arch-based. Debian-based distros, such as Ubuntu, are known for their user-friendly interface and ease of use, making them a popular choice for beginners. Arch-based distros, such as Arch Linux, are more focused on customization and advanced users. They offer a rolling release model and a more hands-on approach to configuration, making them ideal for those who want to get the most out of their operating system.&lt;/p&gt;
&lt;h2&gt;Desktop Environments&lt;/h2&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/63-cinnamon-desktop.jpg" alt="altaltalt" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt; Cinnamon Desktop Environment (Linux Mint)&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/63-kde.jpg" alt="altaltalt" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt; KDE Desktop Environment&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/63-unity.png" alt="altaltalt" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt; Unity Desktop Environment (Ubuntu) &lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/63-gnome.jpg" alt="altaltalt" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt; Gnome Desktop Environment&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/63-xfce.jpg" alt="altaltalt" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt; xfce Desktop Environment, the most lightweight DE&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;In addition to the different distros, Linux also offers a variety of desktop environments, which are essentially the graphical user interface (GUI) that the user interacts with. Some of the most popular desktop environments include Gnome, KDE, Xfce, and LXDE. Each of these desktop environments provides a different look and feel, and offers different features and customization options. For example, Gnome is known for its sleek and modern interface, while KDE is known for its customization options and extensive features.&lt;/p&gt;
&lt;h2&gt;Package Managers&lt;/h2&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;Another key aspect of the Linux operating system is the package manager. A package manager is essentially a tool that helps users install, update, and manage software packages on their system. Linux has several popular package managers, including APT (Debian-based), Pacman (Arch-based), and YUM (Red Hat-based). These package managers make it easy to find, install, and manage software packages, ensuring that users always have the latest version of the software they need.&lt;/p&gt;
&lt;h2&gt;File Managers&lt;/h2&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;Finally, Linux also offers a variety of file managers, which are essentially tools that help users manage and organize their files and directories. Some of the most popular file managers for Linux include Nautilus (Gnome-based), Dolphin (KDE-based), and Thunar (Xfce-based). These file managers provide a user-friendly interface for managing files and directories, making it easy to find, move, and organize files as needed.&lt;/p&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/dolphin-file-manager.jpg" alt="altaltalt" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Dolphin File Manager &lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/nautilus-file-manager.jpg" alt="altaltalt" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Nautilus File Manager (Ubuntu) &lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/Nemo-File-Manager.jpeg" alt="altaltalt" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Nemo File Manager (Linux Mint) &lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/pantheon-files-4.jpg" alt="altaltalt" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Pantheon File Manager (Elementary OS) &lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;figure&gt;
    &lt;img src="/theme/images/articles/images/ranger.png" alt="altaltalt" style="max-width:100%;height:auto;" &gt;
    &lt;figcaption&gt;Ranger File Manager, A console FM, Highly customizable. &lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;figure&gt;
&lt;img src="/theme/images/articles/images/vifm.png" alt="altaltalt" style="max-width:100%;height:auto;" &gt;
&lt;figcaption&gt;vifm File Manager another console FM &lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
    &lt;div&gt;&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;p&gt;&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;&lt;/p&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/div&gt;
&lt;p&gt;In conclusion, Linux is a versatile and powerful operating system that is suitable for a wide range of users, from beginners to advanced users. Whether you are looking for an easy-to-use operating system, or you want to take full control of your system, Linux has something to offer. With its variety of distributions, desktop environments, package managers, and file managers, Linux is a flexible and customizable operating system that can be tailored to meet your specific needs and preferences&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Linux"></category><category term="operating system"></category><category term="distributions"></category><category term="desktop environments"></category><category term="file managers"></category><category term="package managers"></category><category term="DE"></category><category term="FM"></category><category term="package management"></category><category term="Linux distributions"></category><category term="Linux desktop environments"></category><category term="Linux file managers"></category><category term="Linux package managers"></category></entry><entry><title>My Archive extractor</title><link href="https://mosaid.xyz/articles/my-archive-extractor-51.html" rel="alternate"></link><published>2022-12-15T17:54:56+00:00</published><updated>2022-12-15T17:54:56+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2022-12-15:/articles/my-archive-extractor-51.html</id><summary type="html">&lt;p&gt;an all in one archive extractor for most archive filetypes&lt;/p&gt;</summary><content type="html">&lt;p&gt;My personal archive extractor. it's a bash script that simply creates a directory and extract the archive file in int and it supports most of the archive filetypes: &lt;/p&gt;

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

#!/bin/bash
file="$1"

SCRIPTNAME="${0##*/}"

err() {
    printf &amp;gt;&amp;2 "$SCRIPTNAME: $*\n"
    exit 1
}

file="$(readlink -f "$file")"
mkdir "$file-extDir" 2&amp;gt;/dev/null
dir="$file-extDir"
case "$file" in
    *.tar.bz2)   tar -xjf        "$file"  -C "$dir"    ;;
    *.tar.gz)    tar -xzf        "$file"  -C "$dir"    ;;
    *.tar.lz)    tar --lzip -xvf "$file"  -C "$dir"    ;;
    *.bz2)       bunzip2         "$file"               ;;
    *.rar)       unrar x         "$file"               ;;
    *.gz)        gunzip          "$file"               ;;
    *.tar)       tar xf          "$file"  -C "$dir"    ;;
    *.tbz2)      tar xjf         "$file"  -C "$dir"    ;;
    *.tgz)       tar xzf         "$file"  -C "$dir"    ;;
    *.zip)       unzip           "$file"  -d "$dir"    ;;
    *.Z)         uncompress      "$file"               ;;
    *.7z)        7z x            "$file"  -o"$dir"    ;;
    *.iso)       7z x            "$file"  -o"$dir"    ;;
    *)           echo "'$file' cannot be extracted by $SCRIPTNAME" ;;
esac

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;you can make an alias for it in your .bashrc or .zshrc files like so&lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

alias x='/home/mosaid/path/to/extract.sh'

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;it works great with ranger file manager. all you have to do is add the following line to ~/.config/ranger/rc.conf&lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

map xx  shell ${HOME}/path/to/extract.sh %s

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="ranger"></category><category term="archive"></category><category term="winrar"></category><category term="zip"></category><category term="7zip"></category><category term="bash"></category><category term="script"></category><category term="Linux"></category><category term="unrar"></category><category term="unzip"></category><category term="extract"></category><category term="tar"></category><category term="xvf"></category></entry><entry><title>sed command: A comprehensive guide</title><link href="https://mosaid.xyz/articles/sed-command-a-comprehensive-guide-46.html" rel="alternate"></link><published>2021-11-08T21:29:57+00:00</published><updated>2021-11-08T21:29:57+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2021-11-08:/articles/sed-command-a-comprehensive-guide-46.html</id><summary type="html">&lt;p&gt;sed (short for stream editor) is a great tool to quickly and efficently edit text files, this article is a full tutorial of how to use sed from a beginner level to an advanced one, I believe that this article will show you some of the magic of sed command&lt;/p&gt;</summary><content type="html">&lt;p&gt;sed  is  a  stream editor.  A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline).  While in some ways similar to an editor which permits scripted edits (such as ed),  sed  works  by  making only  one  pass  over the input(s), and is consequently more efficient.  But it is sed's ability to filter text in a pipeline which particularly distinguishes it from other types of editors.&lt;/p&gt;
&lt;p&gt;in this article I will show you the power of sed and how easy and convinient it is to edit text files. so lets get to it&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;h2&gt;Search and replace&lt;/h2&gt;
&lt;p&gt;this is one of the basic uses of sed . you will find yourself using this a lot &lt;/p&gt;
&lt;p&gt;the way we use this command is: sed 's&lt;span style="color:red;font-weight:bold"&gt;/&lt;/span&gt;&lt;span style="color:blue;font-weight:bold"&gt;pattern&lt;/span&gt;&lt;span style="color:red;font-weight:bold"&gt;/&lt;/span&gt;&lt;span style="color:green;font-weight:bold"&gt;replacement&lt;/span&gt;&lt;span style="color:red;font-weight:bold"&gt;/&lt;/span&gt;'.  the character &lt;span style="color:red;font-weight:bold"&gt;/&lt;/span&gt; can be any character you want but it will result in an error if your text contains the said character so if you're dealing with a text file containing paths, ie a lot of / character , it is advised to use another character like so: sed 's&lt;span style="color:red;font-weight:bold"&gt;|&lt;/span&gt;day&lt;span style="color:red;font-weight:bold"&gt;|&lt;/span&gt;night&lt;span style="color:red;font-weight:bold"&gt;|&lt;/span&gt;' another thing is that you can add a "g" at the end of the command to make it global or greedy, meaning change all occurences of the pattern not just the first one, like so&lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

echo "good day to you Ser, and good day to you Madame" | sed 's/day/night/'
# the result will be:
 good night to you Ser, and good day to you Madame
echo "good day to you Ser, and good day to you Madame" | sed 's/day/night/g'
# the result will be:
 good night to you Ser, and good night to you Madame

&lt;/code&gt;
&lt;/pre&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;h2&gt;Search and replace: regular expressions&lt;/h2&gt;
&lt;p&gt;you can search using literal words or regular expressions, here are a few symbols if you are not familiar with reg ex: ^ means the beginning of the line, $ the end of the line, . "dot" means every character&lt;/p&gt;
&lt;p&gt;The following will make all lines of the file between double quotes, by inserting " at the beginning of the line and at the end&lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

# insert double quote " at the beginning of the line
# the -i means change the actual file: performe the changes in place instead of printing the result to stdout
sed -i 's/^/"/'  myfile
# insert double quote " at the end of the line, this can be used to append to a line
sed -i 's/$/"/'  myfile
echo {a..z} | sed -E 's/^.{20}//'
# remove the first 20 characters: k l m n o p q r s t u v w x y z

&lt;/code&gt;
&lt;/pre&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;h2&gt;Search and replace: keep and reuse a pattern&lt;/h2&gt;
&lt;p&gt;you can search for a pattern and reuse it as much as you like, but to do so you need to use sed with the argument &lt;span style="color:red;font-weight:bold"&gt;-E&lt;/span&gt; which tells it that we want to use extended regular expressions. we do this by surrending the patterns with &lt;span style="color:red;font-weight:bold"&gt;()&lt;/span&gt; like so.&lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

echo "day and night" | sed -E 's/(and)/\1 \1 \1/'
# day and and and night

&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;&lt;/h2&gt;
&lt;p&gt;consider a line containing the following : &lt;/p&gt;
&lt;pre&gt;
hello 1234 ladies and gentlmen, welcome
&lt;/pre&gt;
&lt;p&gt;we will apply the follwoing sed command to it : &lt;/p&gt;
&lt;pre&gt;
sed -E 's/(&lt;span style="color:green;font-weight:bold"&gt;^[^ ]*&lt;/span&gt;) (&lt;span style="color:red;font-weight:bold"&gt;[0-9]*&lt;/span&gt;) (&lt;span style="color:magenta;font-weight:bold"&gt;.*&lt;/span&gt;)and (&lt;span style="color:blue;font-weight:bold"&gt;.*&lt;/span&gt;)$/&lt;span style="color:red;font-weight:bold"&gt;\2&lt;/span&gt; &lt;span style="color:green;font-weight:bold"&gt;\1&lt;/span&gt; \3 AND :&lt;span style="color:red;font-weight:bold"&gt;\2&lt;/span&gt;: &lt;span style="color:blue;font-weight:bold"&gt;\4&lt;/span&gt; &lt;span style="color:green;font-weight:bold"&gt;\1&lt;/span&gt; + &lt;span style="color:magenta;font-weight:bold"&gt;\3&lt;/span&gt;/'
&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;Explanation:&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt; &lt;span style="color:green;font-weight:bold"&gt;^[^ ]*&lt;/span&gt;  : means from the beginning of the line ^, any non ^ space characters ie [^ ] or more *  . this will match "hello" at the beginning of the line&lt;/li&gt;
  &lt;li&gt; then space and then &lt;/li&gt;
  &lt;li&gt;&lt;span style="color:red;font-weight:bold"&gt;[0-9]*&lt;/span&gt; : means any numeric character [0-9] or more * . this will match 1234&lt;/li&gt;
  &lt;li&gt; then space and then &lt;/li&gt;
  &lt;li&gt;&lt;span style="color:magenta;font-weight:bold"&gt;(.*)&lt;/span&gt; : means every character "." or more "*", this will match "ladies ", notice the space after ladies &lt;/li&gt;
  &lt;li&gt;then "and" then space&lt;/li&gt;
  &lt;li&gt;&lt;span style="color:blue;font-weight:bold"&gt;(.*)$&lt;/span&gt; : finally every character untill the end of the line "$", this will match "gentlmen, welcome"&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;the parentheses () are not included in the patterns unless we escape them with \( and \). each opening and closing parenthesis make a pattern that will be assigned an index starting from \1 . in the example above we have 4 of them and we can use them however we want in the replacement. this will produce &lt;/p&gt;
&lt;pre&gt;
1234 hello ladies  AND :1234: gentlmen, welcome hello + ladies
&lt;/pre&gt;
&lt;h2&gt;Operating on lines : by line numbers&lt;/h2&gt;
&lt;p&gt;The sed commands affect all the lines of the file unless told otherwise. the "s" command for search and replace for instance can be told to operate on a single line or a range of lines like so:&lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

# replace day by night only on the first line
sed '1s/day/night/' file
# do the same but on the last line
sed '$s/day/night/' file
# replace day by night in the lines from line 3 to line 7
sed '3,7s/day/night/' file

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Let's say we want to print only specific lines of a file. we need to tell sed to suppress printing the output by the argument &lt;span style="color:red;font-weight:bold"&gt;-n&lt;/span&gt; and then use the command &lt;span style="color:red;font-weight:bold"&gt;"p"&lt;/span&gt; to print the output we want: &lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

# only print the 2nd line:
sed -n '2p' file
# only print lines 3 to 7
sed -n '3,7p' file
# print from the line 10 to the last line
sed '10,$p' file

&lt;/code&gt;
&lt;/pre&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;there is also the &lt;span style="color:red;font-weight:bold"&gt;"d"&lt;/span&gt; command to delete lines by their numbers, it behaves just like the &lt;span style="color:red;font-weight:bold"&gt;"p"&lt;/span&gt; command above. PS no need to suppress the output by &lt;span style="color:red;font-weight:bold"&gt;-n&lt;/span&gt; when you are deleting lines, unless you want to, of course.&lt;/p&gt;
&lt;h2&gt;Operating on lines : by patterns&lt;/h2&gt;
&lt;p&gt;What if you want to operate on specific lines but you don't know their line numbers for whatever reason. sed of course gives you the choice to operate on lines using patterns. consider a file containing the following lines &lt;/p&gt;
&lt;pre&gt;
dear diary.
day 1 : we went camping outside to spend 7 days in the forest

and then we needed to go fishing in the forest

day 2 : it was raining all day
day 3 : trip canceled
&lt;/pre&gt;
&lt;p&gt;operating on lines by patterns:&lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

# print lines containing "forest"
sed -n '/forest/p' file
# delete everything between "day 1" and "day 2"
sed '/day 1/,/day 2/d' file
# delete empty lines, ie lines that has nothing between the start ^ and the end $
sed '/^$/d' file
# or lines containing only spaces
sed '/^[ ]*$/d' file

&lt;/code&gt;
&lt;/pre&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;When we are dealing with lines with patterns or a range of lines, the delimiter character is &lt;span style="color:red;font-weight:bold"&gt;"/"&lt;/span&gt; if we need to change it. we have to escape it with &lt;span style="color:red;font-weight:bold"&gt;"\"&lt;/span&gt; like so: sed -n '\&lt;span style="color:blue;font-weight:bold"&gt;X&lt;/span&gt;hello&lt;span style="color:blue;font-weight:bold"&gt;X&lt;/span&gt;p' file. the sed character is &lt;span style="color:blue;font-weight:bold"&gt;"X"&lt;/span&gt; . this will only print lines containing the word &lt;span style="color:green;font-weight:bold"&gt;"hello"&lt;/span&gt;   &lt;/p&gt;
&lt;p&gt;The following example will replace "fishing" by "hunting" in lines between "day 1" and "day 3"  &lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

sed '/day 1/,/day 3/s/fishing/hunting/' file
# combining the above with p to only print these lines after the change
sed -n '/day 1/,/day 3/{s/fishing/hunting/;p}' file

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;in the second example above, we can combine as many commands as we want inside the &lt;span style="color:red;font-weight:bold"&gt;{}&lt;/span&gt; and separate them by a semicolon &lt;span style="color:red;font-weight:bold"&gt;";"&lt;/span&gt;. these commands can be multiple search and replace or &lt;span style="color:red;font-weight:bold"&gt;"p"&lt;/span&gt; for printing or &lt;span style="color:red;font-weight:bold"&gt;"d"&lt;/span&gt; for deleting, or any other commands that we'll show later&lt;/p&gt;
&lt;h2&gt;Inserting text before or after a line:  by line number&lt;/h2&gt;
&lt;p&gt;sed of course can insert text in a specific line of our file, and here is how we can do it &lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

# insert before line 1, ie at the beginning of the file
sed '1ithis text will be inserted at the beginning\nand this is a new line' file
# insert after the 3rd line
sed '3athis will be added after the 3rd line' file

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Notice that there is no need for spaces or anything. sed will read the number, then the &lt;span style="color:red;font-weight:bold"&gt;"i"&lt;/span&gt; for insertion before or &lt;span style="color:red;font-weight:bold"&gt;"a"&lt;/span&gt; for after. and then you can add your text. in a shell script with a string variable containing text and some special characters, it was not consistent and sometimes it throws some errors, so for complicated and multiline text that needs to be inserted. I use &lt;span style="color:blue;font-weight:bold"&gt;"ed the standard editor"&lt;/span&gt; which is an awesome tool and an ancestor of all the text editors out there (sed, grep, awk, vim ...). the ed command needs its own article, maybe it will be next&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;h2&gt;Inserting text before or after a line:  by pattern&lt;/h2&gt;
&lt;p&gt;Inserting before or after a line can also be done by finding the line by a specific pattern or regular expression. &lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

# insert before the line containing "day 2"
sed -i '/day 2/i these lines describe actions done before day 2' file
# how about the crazy idea of inserting after every line containing the word "forest"
sed -i '/forest/a hello nature\nhello world' file

&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;Advanced stuff:&lt;/h2&gt;
&lt;p&gt;at this point we need an in depth understanding of the inner workings of sed command. sed iterates over the file line by line. when a line is read. it goes into a space called &lt;span style="color:blue;font-weight:bold"&gt;"pattern space"&lt;/span&gt;. it is in this pattern space that sed applies the instructions and commands we provide. be it s, p ,d or any other command. after applying the commands on the lines in the pattern space the result is then printed to the output. then the pattern space is emptied for the next line/lines of the file. and the cycle continues until the end of the file.&lt;br&gt; there is another space in sed. it is called &lt;span style="color:blue;font-weight:bold"&gt;"hold space"&lt;/span&gt;. any line that is stored in the hold space is not operated upon by our commands. as the name suggests, the lines in the hold space are on hold  and the stay as they are untill we get them back to the pattern space &lt;/p&gt;
&lt;p&gt;&lt;img src="/theme/images/articles/images/46-img-1.png" alt="altaltalt" style="max-width:100%;height:auto;" &gt;&lt;/p&gt;
&lt;p&gt;the following commands are for the pattern and hold space. and are illustrated in the picutre above &lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;n N    Read/append the next line of input into the pattern space&lt;/li&gt;
  &lt;li&gt;h H    Copy/append pattern space to hold space&lt;/li&gt;
  &lt;li&gt;g G    Copy/append hold space to pattern space&lt;/li&gt;
  &lt;li&gt;x      Exchange the contents of the hold and pattern spaces.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;in order to clearly show you examples of using the hold/pattern space. I will introduce the concept of sed scripts. up until now we used sed one liners. ie a block of sed commands inside single ' ' or double quotes " ". but it is possible to write a separate sed script and provide it to sed via the argument &lt;span style="color:red;font-weight:bold"&gt;"-f"&lt;/span&gt; &lt;br&gt; the following script will not do anything fancy. it will just move the first line of our file to the end making it the last line. also it will change the first occurence of "day" in each line to "night", it will also replace "and" by "AND". it will be done by the command: &lt;br&gt; &lt;span style="color:blue;font-weight:bold"&gt;sed -f scriptfilename ourfilename&lt;/span&gt; &lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

# this is a comment in the sed script
# this is a block of commands
1{
    # this block will operate on the first line
    # copy the line from pattern space to hold space
    h
    # then Delete pattern space.  Start next cycle.
    d
}
{
    # do the following for all lines
    s/day/night/
    s/and/AND/
}
${
    # this block will operate on the last line $
    # we get back the first line we stored in the hold space
    G
    # magiscule G will append to pattern space
    # miniscule g will erase the pattern space and replace it
    # with what is stored in hold space
}

&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;Labels and branching&lt;/h2&gt;
&lt;p&gt;if we are in a situation where we need to repeat a set of commands or instructions, we can make them in a label, and then instruct sed to &lt;span style="color:blue;font-weight:bold"&gt;"branch to this label"&lt;/span&gt;, ie go to this label. and repeat it again. this script shows us  how to read all the lines in a file and after that we replace all the new line characters with spaces, thus making it a single line file. if you are familiar with windows batch scripting, this is the same concept&lt;/p&gt;
&lt;pre class="language-bash" &gt;
    &lt;code class="language-bash" &gt;

# we make a new label using the colon ":" then a character as the name
# of the label
:a
# append the next line of the file into the pattern space
N
# unless this is the last line "$!" means not last line
# branch to label a "ba" go to label a and repeat the comands after the label
# in this example a single instruction: N
$!ba
# when we exit the loop, ie we reach the last line and the end of the file
# we substitute the new line character "\n" by space
s/\n/ /g

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt; the above script can be compressed into a one liner: &lt;span style="color:red;font-weight:bold"&gt;sed ':a;N;$!ba;s/\n//g' &lt;/span&gt; file &lt;/p&gt;
&lt;h2&gt;A few useful sed examples&lt;/h2&gt;
&lt;p&gt;remove leading spaces: sed -E 's/^\s+//g' file&lt;/p&gt;
&lt;p&gt;remove leading spaces: sed 's/^[ \t]*//g' file&lt;/p&gt;
&lt;p&gt;remove html tags: sed 's/&amp;lt;[^&amp;gt;]*&amp;gt;//g' file.html&lt;/p&gt;
&lt;p&gt;change in place and keep backup: sed -i.bak '' file&lt;/p&gt;
&lt;p&gt;And there you have it. I believe I covered everything there is to know about sed command. if I overlooked or forgot something. please tell me in the comments &lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="space"></category><category term="Linux"></category><category term="command"></category><category term="sed"></category><category term="Text Editor"></category><category term="pattern"></category><category term="hold"></category><category term="pattern space"></category><category term="hold space"></category><category term="reg ex"></category><category term="regular expressions"></category><category term="search and replace"></category><category term="scripts"></category><category term="sed regex"></category></entry><entry><title>Linux Directory Tree Structure</title><link href="https://mosaid.xyz/articles/linux-directory-tree-structure-45.html" rel="alternate"></link><published>2021-11-04T19:05:21+00:00</published><updated>2021-11-04T19:05:21+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2021-11-04:/articles/linux-directory-tree-structure-45.html</id><summary type="html">&lt;p&gt;The Directory Tree Structure of Linux might seem a bit overwhelming at first but once you get used to it you will discover that it is precise and  well organized. And it all starts from the root directory&lt;/p&gt;</summary><content type="html">&lt;p&gt;First is the root directory, which is often noted by a &lt;span style="color:blue;font-weight:bold"&gt;forward slash (/)&lt;/span&gt;. This houses everything on your Linux system, and since Linux gives total control to its user. you can issue the following command: &lt;span style="background-color:red; color:black; font-weight:bold;padding:3px;"&gt;sudo rm -rf /&lt;/span&gt; to completely remove everything (AND I MEAN EVERYTHING) in your computer . WARNING: do not try this command in your computer!.&lt;/p&gt;

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;Next up is &lt;span style="color:blue;font-weight:bold"&gt;/bin&lt;/span&gt;, which contains all essential executable binaries that are required for a system to function in single-user mode. These executables aren't user applications, but essential commands that are used by the system (but can also be used by users), such as less and ip.&lt;/p&gt;
&lt;p&gt;Next is &lt;span style="color:blue;font-weight:bold"&gt;/boot&lt;/span&gt;, which contains all the files required for the system to boot. You'll then find /dev, which contains several special device files, such as /dev/sda, which represent hardware and virtual devices.&lt;/p&gt;
&lt;p&gt;The &lt;span style="color:blue;font-weight:bold"&gt;/etc&lt;/span&gt; directory is where all of the system-wide configuration files for applications and services are.&lt;/p&gt;
&lt;p&gt;The &lt;span style="color:blue;font-weight:bold"&gt;/dev&lt;/span&gt;  directory consists of files that represent devices that are attached to the local system. However, these are not regular files that a user can read and write to; these files are called devices files or special files.  Device files are abstractions of standard devices that applications interact with via I/O system calls. They are representations of hardware devices.&lt;/p&gt;

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;The home directory, which is &lt;span style="color:blue;font-weight:bold"&gt;/home&lt;/span&gt;, houses all personal files and directories for the users. such as Music, Documents and Download directories, in my system for example I have this "/home/mosaid/Documents" directory which contains my documents&lt;/p&gt;
&lt;p&gt;The &lt;span style="color:blue;font-weight:bold"&gt;/lib&lt;/span&gt; directory contains the library files (which are used by essential binaries).&lt;/p&gt;
&lt;p&gt;There's also the &lt;span style="color:blue;font-weight:bold"&gt;/lost+found&lt;/span&gt; directory, which stores recovered files that are used in case of a system crash.&lt;/p&gt;

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;The &lt;span style="color:blue;font-weight:bold"&gt;/media&lt;/span&gt; directory contains all subdirectories for removable devices (such as external drives).&lt;/p&gt;
&lt;p&gt;The &lt;span style="color:blue;font-weight:bold"&gt;/opt&lt;/span&gt; directory is for optional packages and serves as a common location for proprietary software that doesn't tend to follow the standard file system hierarchy.&lt;/p&gt;
&lt;p&gt;System and process information files are stored in &lt;span style="color:blue;font-weight:bold"&gt;/proc&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;The Root user home directory is isolated from home and is found in &lt;span style="color:blue;font-weight:bold"&gt;/root&lt;/span&gt;. the root user is called the super user, it has the highest prevelege in the linux system, when we want to install a program for instance we precede our command by the word &lt;span style="color:red;font-weight:bold"&gt;"sudo"&lt;/span&gt;  which means do this command as a super user&lt;/p&gt;
&lt;p&gt;Applications can store transient files for sockets and process IDs in the &lt;span style="color:blue;font-weight:bold"&gt;/run&lt;/span&gt; directory.&lt;/p&gt;

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;The &lt;span style="color:blue;font-weight:bold"&gt;/sbin&lt;/span&gt; directory houses more executable binary files, but these are those that are used primarily for system administration.&lt;/p&gt;
&lt;p&gt;The Service Data folder (&lt;span style="color:blue;font-weight:bold"&gt;/srv&lt;/span&gt;) is a location that houses data for services that are provided by the system (such as for the Apache webserver).&lt;/p&gt;
&lt;p&gt;All temporary files are stored in &lt;span style="color:blue;font-weight:bold"&gt;/tmp&lt;/span&gt; and are deleted when the system is restarted.&lt;/p&gt;
&lt;p&gt;User binaries (applications used only by the user and not by the system) are stored in &lt;span style="color:blue;font-weight:bold"&gt;/usr&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;And finally, the &lt;span style="color:blue;font-weight:bold"&gt;/var&lt;/span&gt; directory houses all variable data files, such as log files (in /var/log) as well as the Apache document root (in /var/www/html/).&lt;/p&gt;
&lt;p&gt;And here you have it, that was the linux filesystem and directory heirarchy. everytime you want to know your position in this directory tree you can use the command &lt;span style="color:red;font-weight:bold"&gt;pwd&lt;/span&gt; which will print current directory and will let you know where you are. &lt;/p&gt;

&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Linux"></category><category term="Linux Directory Tree Structure"></category><category term="Filesystem"></category><category term="root"></category><category term="etc"></category><category term="home"></category><category term="proc"></category><category term="var"></category><category term="dev"></category><category term="sudo"></category><category term="srv"></category><category term="usr"></category><category term="sbin"></category></entry><entry><title>The best configuration for mpd music player with ncmpcpp and mpc (2020)</title><link href="https://mosaid.xyz/articles/the-best-configuration-for-mpd-music-player-with-ncmpcpp-and-mpc-2020-26.html" rel="alternate"></link><published>2020-09-06T18:40:05+00:00</published><updated>2020-09-06T18:40:05+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2020-09-06:/articles/the-best-configuration-for-mpd-music-player-with-ncmpcpp-and-mpc-2020-26.html</id><summary type="html">&lt;p&gt;Learn how to configure mpd, mpc, and ncmpcpp for seamless music playback on your system. Enhance your experience with a custom bash script for simplified control of your music player daemon through mpc commands&lt;/p&gt;</summary><content type="html">&lt;p&gt;mpd stands for music player daemon, it is a music player and as its name
suggests it is a daemon, ie a process that runs in the background and you cannot
interact with it directly.&lt;br&gt;
the music player daemon needs a way to control it. comes ncmpcpp is a command
line graphical interface built for mpd and highly configurable. with beautiful
colors and features. you can control mpd with mpc - music player control. is a
command line tool to control the music player from the command line via
sockets.&lt;/p&gt;
&lt;p&gt;In this article I give you the enitre configuration for mpd, mpc and ncmpcpp
and &lt;strong&gt;my personal bash script&lt;/strong&gt; to add more simplicity to using mpc
to control the music player daemon via simple and short commands.&lt;/p&gt;
&lt;h2&gt;Installing mpd, mpc and ncmpcpp&lt;/h2&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;it is extremely easy to install these 3 packages :&lt;/p&gt;
&lt;pre class="language-terminal"&gt;
&lt;code class="language-terminal"&gt;

# debian based distributions:
$ sudo apt install mpd mpc ncmpcpp

# Arch based distributions:
$ sudo pacman -S mpd mpc ncmpcpp

&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;Configuring mpd:&lt;/h2&gt;
&lt;p&gt;we create a ".mpd" directory anywhere we want, preferably in our home
directly. then we create &lt;strong style="color:blue;"&gt; mpd.conf &lt;/strong&gt; file
and we put the following lines in it :&lt;/p&gt;
&lt;pre class="language-conf"&gt;
&lt;code class="language-conf"&gt;

music_directory         "/home/myusername/path/to/My Music"
playlist_directory      "/home/myusername/.mpd/playlists"
db_file                 "/home/myusername/.mpd/mpd.db"
log_file                "/tmp/mpd.log"
pid_file                "/home/myusername/.mpd/mpd.pid"
state_file              "/home/myusername/.mpd/mpdstate"
restore_paused          "yes"
auto_update             "yes"
audio_output {
    type "pulse"
    name "pulse audio"
}
audio_output {
    type                 "fifo"
    name                 "my_fifo"
    path                 "/tmp/mpd.fifo"
    format               "44100:16:2"
}

bind_to_address          "127.0.0.1"
port                     "6601"

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;the above config file will set the path to our music directory, and an
optional yet very important path to our custom playlists directory. the other
files will be created dynamically as the mpd runs.&lt;br&gt;
While running in the background, mpd acts like a server running in our localhost
and can be controlled  from port "6601", we can choose any port we want as long as it
is not used by some other application.&lt;br&gt;
we execute mpd only once, onboot or when we want to play some music or in anyway
we want. by issuing this command: &lt;/p&gt;
&lt;pre class="language-terminal"&gt;
&lt;code class="language-terminal"&gt;

$ mpd /home/myusername/.mpd/mpd.conf

&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;Configuring ncmpcpp:&lt;/h2&gt;
&lt;p&gt;Configuring ncmpcpp is just as easy as Configuring mpd, however it would take
a lot of trial and error to get the perfect colors and layout of the user
interface.&lt;br&gt;
We begin by creating a ".ncmpcpp" directory anywhere we want, we may even name
it something else entirely. the name is only to remind us that it is the
directory for ncmpcpp . then we create a &lt;strong
style="color:blue;"&gt;config&lt;/strong&gt; file in it and put the following in it:&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre class="language-conf"&gt;
&lt;code class="language-conf"&gt;

##### connection settings #####
mpd_host = "localhost"
mpd_port = "6601"
mpd_music_dir = "/home/myusername/Music/My Music"
lyrics_directory = "/home/myusername/Music/My Music/nmcpplyrics"
mpd_connection_timeout = "5"
mpd_crossfade_time = "1"

ncmpcpp_directory = "/home/myusername/.ncmpcpp"

##### delays #####
playlist_disable_highlight_delay = "1"
message_delay_time = "4"

##### window interface #####
user_interface = classic
header_visibility = yes
titles_visibility = no
cyclic_scrolling = yes
header_text_scrolling = yes
playlist_display_mode = "columns"
browser_playlist_prefix = "$2playlist$9 "
alternative_header_first_line_format = "{%t}"
alternative_header_second_line_format = "$7{%a} - $5{%b} $8{(%y)}"
song_window_title_format = "{%a - }{%t}|{%f}"
##### song list format #####
song_list_format = "{%a - %t}|{$8%f$9}{$3(%l)$9}"
song_library_format = "{%n - }{%t}|{%f}"
selected_item_prefix = "$6"
selected_item_suffix = "$9"
now_playing_prefix = "$b$r"
now_playing_suffix = "$/b$/r"
song_status_format = "{(%l) }{%a - }{%t}|{%f}"
playlist_shorten_total_times = yes
song_columns_list_format = "(30)[52]{a} (30)[4]{t} (7f)[88]{l}"

###### various settings #####
#incremental_seeking = yes
#seek_time = "1"
#autocenter_mode = yes
#centered_cursor = yes
#default_place_to_search_in = "database"
#default_find_mode = "wrapped"
#default_tag_editor_pattern = "%n - %t"
#header_visibility = yes
#header_text_scrolling = yes
#cyclic_scrolling = no
#statusbar_visibility = yes
#follow_now_playing_lyrics = yes
#clock_display_seconds = yes
#enable_window_title = yes
#user_interface = "alternative"
#progressbar_look = "=&gt;"
progressbar_look = "─╼-"
seek_time = 10
#external_editor = "vim"
#use_console_editor = yes
#locked_screen_width_part = "60"


##### colors definitions #####
colors_enabled = yes
empty_tag_color = "52"
header_window_color = "52"
volume_color = "11"
state_line_color = "yellow"
state_flags_color = "11"
main_window_color = "52"
color1 = "white"
color2 = "green"
progressbar_color = "11"
progressbar_elapsed_color = "yellow"
statusbar_color = "52"
visualizer_color = "11"
window_border_color = "green"
active_window_border = "11"
alternative_ui_separator_color = "black"


#### visualizer ##############
visualizer_in_stereo = yes
visualizer_fifo_path = "/tmp/mpd.fifo"
visualizer_output_name = "my_fifo"
visualizer_sync_interval = "30"
visualizer_type = "spectrum"
visualizer_look = "◆▋"


######## more ######
external_editor = vim
use_console_editor = yes

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;The important part of that config file is the connection settings. Obviously
they need to match mpd's config file: the host, the port and the music directory
... need to be the same. all the remaining configs are just to tweak the
interface. the above config will produce the following interface:&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;&lt;br&gt;
&lt;img src="/theme/images/articles/images/26-img-1.png" style="max-width:100%;height:auto;" alt="altaltalt" &gt;
&lt;br&gt;&lt;/p&gt;
&lt;p&gt;mpc does not require any configuration. all we need is to provide the host
and port in which mpd is running when we try to control it, the following
command will toggle  the music player play/pause from the terminal :&lt;/p&gt;
&lt;pre class="language-terminal"&gt;
&lt;code class="language-terminal"&gt;

$ mpc --host=127.0.0.1 --port=6601  toggle

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;one can simply alias the above command to a more convenient one, or make a
shell script to control mpd using mpc, and that's what I did in the following
script:&lt;/p&gt;
&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

#!/bin/bash
function printhelp () {
  printf '\033[1;33m  %-15s\t\033[1;37m%s\n' "$1" "$2"
}
mympc=' mpc --host=127.0.0.1 --port=6601 '
case "$1" in
    "" )  $mympc -q  next  ;;
    "c")  ;;
    "s") if [ -z "$2" ]
        then $mympc -q  stop
        else
             ii=0
             for i do
            if (($ii!=0)) ; then query+="$i|" ; fi
            ii=$((ii+1))
             done
             query=${query::-1}
             "$0" ll |grep --color=always -i -E "$query"| sort -n | uniq
         fi
         exit ;;
       "pp"|"m") if ! `$mympc |grep -F "playing"&amp;gt;/dev/null`
        then $mympc -q play
        else $mympc -q pause
         fi
    ;;
    "p") $mympc -q  prev ;;
    "n") $mympc -q  next ;;
    "v") $mympc   volume +2|awk 'NR==3{print $2}' ;;
    "vv") $mympc   volume -2|awk 'NR==3{print $2}' ;;
    "h"|"H"|"help")
        printf "\t \033[1;32m my script to control mpd \033[1m\n"
        printhelp  "h,H,help" "print this help"
        printhelp  "c" "currently playing song"
        printhelp  "" "play next"
        printhelp  "pp,m" "play/pause"
        printhelp  "p" "previous"
        printhelp  "n" "next"
        printhelp  "v" "volume +2"
        printhelp  "vv" "volume -2"
        printhelp  "s" "stop"
        printhelp  "s   [pattern]" "search index of song(s) with pattern(s)"
        printhelp  "[number]" "play nth song"
        printhelp  "a   [patterns]" "add songs w/ patter(n) to curr playlist"
        printhelp  "ll" "print current playlists"
        printhelp  "d" "remove current song from playlist"
        printhelp  "ss  [patterns]" "print result of search pattern(s)"
        printhelp  "sl  [patterns]" "play songs with pattern(s)"
        printhelp  "ssl [patterns]" "print then play songs with pattern(s)"
        printhelp  "save [name]" "save current playlist"
        printhelp  "l   [playlist]" "load playlist"
        printhelp  "*" "other commands accepted by mpc"
    exit
    ;;
    "a") $mympc search any "$2" | $mympc add  ;;
       "ll") index=$($mympc status -f "%position%" |head -1)
         $mympc playlist|awk '{$0=substr($0,0,60) ; print $0 }'\
           |nl| less +"$index"
    exit
    ;;
       "sl"|"ss"|"ssl")
         ii=0
         ss=$( $mympc search  any "")
         ss+="\n"
         for i do
        if (($ii!=0)) ; then
        ss+=$( $mympc search  any "$i")
        ss+="\n"
        query+="$i|"
        fi
        ii=$((ii+1))
         done
         query=${query::-1}
         if [[ "$1" == "ss" || "$1" == "ssl" ]] ; then
             printf "$ss" |grep --color=always -i -E "$query"| sort -n | uniq
         fi
         if [[ "$1" == "sl" || "$1" == "ssl" ]] ; then
             printf "$ss" |grep -i -E "$query" | sort -n | uniq &amp;gt;| "$HOME/.mpd/playlist/tmp.m3u"
             "$0" l tmp|grep -v ^loading
             rm "$HOME/.mpd/playlist/tmp.m3u"
         fi
    exit
    ;;
    "save") $mympc rm "$2" 2&amp;gt;/dev/null; $mympc save "$2" ;;
    "l") $mympc -q clear
         $mympc -q load $2
         $mympc -q play ;;
    "d")
    index=$($mympc status -f "%position%" |head -1)
    CURRENT="$( $mympc -f "%file%" playlist | sha512sum )"
    while read -r line
    do
        i="$( $mympc -f "%file%" playlist $line | sha512sum )"
        if [ "$i" = "$CURRENT" ]; then
        break
        fi
    done &amp;lt;&amp;lt;&amp;lt; "$( $mympc lsplaylist )"
     $mympc del 0
     $mympc rm "$line"
     $mympc save "$line"
     $mympc -q clear
     echo "removed from $line"
     $mympc -q load "$line"
     $mympc -q play $index
     exit
     ;;
     *)
     number='^[0-9]+$'
     if [[ $1 =~ $number ]]
     then $mympc -q play "$1"
     else $mympc  "$@"
     fi
     exit
     ;;
     esac
     title=$($mympc status -f "%title%" |head -1)
     artist=$($mympc status -f "%artist%" |head -1)
     file=$($mympc status -f "%file%" |head -1)
     index=$($mympc status -f "%position%" |head -1)
     size=$($mympc status |awk 'NR==2{print $2}'|cut -d'/' -f2)
     stats=$( $mympc status |awk 'NR==2{printf("%s - %s",$2,$3) }' )
     stats=${stats:1}
     if ! [[ -z "$artist" &amp;&amp; -z "$title" ]]
     then str="$artist - ${title##*/}"
      else str="${file##*/}"
    fi
    echo "$stats # $str"

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;the above script looks like : &lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;&lt;br&gt;
&lt;img src="/theme/images/articles/images/26-img-2.png" style="max-width:100%;height:auto;"  alt="altaltalt"  &gt;
&lt;br&gt;&lt;/p&gt;
&lt;p&gt;We can search single or multiple words queries:&lt;/p&gt;
&lt;p&gt;&lt;br&gt;
&lt;img src="/theme/images/articles/images/26-img-3.png" style="max-width:100%;height:auto;"  alt="altaltalt"  &gt;
&lt;br&gt;&lt;/p&gt;
&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="mpd"></category><category term="mpc"></category><category term="ncmpcpp"></category><category term="music player daemon"></category><category term="command line music player"></category><category term="music player control"></category><category term="bash script"></category><category term="mpd configuration"></category><category term="mpc configuration"></category><category term="ncmpcpp configuration"></category></entry><entry><title>Everything you need to know about strings manipulation in Bash</title><link href="https://mosaid.xyz/articles/everything-you-need-to-know-about-strings-manipulation-in-bash-21.html" rel="alternate"></link><published>2020-08-28T12:51:57+00:00</published><updated>2020-08-28T12:51:57+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2020-08-28:/articles/everything-you-need-to-know-about-strings-manipulation-in-bash-21.html</id><summary type="html">&lt;p&gt;One of the best things in Bash is the extensive tools we can use to  manipulate strings. you can extract substrings , replace or delete them,  and do much more&lt;/p&gt;</summary><content type="html">&lt;p&gt;One of the best things in Bash is the extensive tools we can use to
manipulate strings. you can extract substrings , replace or delete them,
and do much more.&lt;br&gt;This will be our string to manipulate  for this tutorial:&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

#!/bin/sh
str=/home/mosaid/Documents/Bash/Bashstrings.sh
#   0123456789.....
#   0-based indexing.

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h4 style="color:#4ac5db" &gt;Get Length of string&lt;/h4&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

echo ${#str}        #42

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h4 style="color:#4ac5db" &gt;Get 5 chars starting from 0 &lt;/h4&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

echo ${str:0:5}      # /home

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h4 style="color:#4ac5db" &gt;Get everything after the 5th char &lt;/h4&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

echo ${str:5}      # /mosaid/Documents/Bash/Bashstrings.sh

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h4 style="color:#4ac5db" &gt;backward positioning: get the last 14 chars &lt;/h4&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;we use parentheses  or a space to delimit the negative sign for the position
parameter when we are backward positioning:&lt;br&gt; &lt;/p&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

echo ${str:(-14)}      # Bashstrings.sh
echo ${str: -14}       # Bashstrings.sh

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h4 style="color:#4ac5db" &gt;substrings: forward search  &lt;/h4&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;remove everything before ( including ) the first occurrence of "Bash" :&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

echo ${str#*Bash}      # /Bashstrings.sh

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;remove everything untill (and including) the last occurrence of "Bash" :&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

echo ${str##*Bash}      # strings.sh

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

&lt;p&gt; we can use the same to extract the extension: remove everything until the
last dot "."&lt;br&gt;
or to extract the file name from the path by removing everything untill the last
"/":
&lt;/p&gt;
&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

echo ${str##*.}      # sh
echo ${str##*/}      # Bashstring.sh

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h4 style="color:#4ac5db" &gt;substrings: backward search  &lt;/h4&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;starting from the end remove everything after (including) the word
"Bash":&lt;/p&gt;
&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

echo ${str%Bash*}      # /home/mosaid/Documents/Bash/

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt; we can use it to extract the directory path :&lt;br&gt;
starting from the end, removing everything after the first occurrence of "/"&lt;/p&gt;
&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

echo ${str%%/*}      # /home/mosaid/Documents/Bash/

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h4 style="color:#4ac5db" &gt;substrings: replace &lt;/h4&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt; first example : replace the first occurrence of "Bash" with "Shell
Scripting"&lt;br&gt;
second example: replace all occurrences of "Bash" with "Shell"&lt;br&gt;&lt;/p&gt;

&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

echo ${str/Bash/Shell Scripting}    # /home/mosaid/Documents/Shell Scripting/Bashstrings.sh
echo ${str//Bash/Shell}             # /home/mosaid/Documents/Shell/Shellstrings.sh

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt; if we want to use the backward slash "/" as a pattern we need to escape it
with a forward slash "\":&lt;br&gt;
replace all "/" with "@"&lt;/p&gt;
&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

echo ${str//\//@}       # @home@mosaid@Documents@Bash@Bashstrings.sh

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

&lt;p&gt;we can make some/all chars uppercase or lowercase:&lt;/p&gt;
&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

str="Hello, Welcome to LINUX, Bash strings"

#convert the first char to uppercase
echo ${str^}

#convert all chars to uppercase
echo ${str^^}

#convert the characters c,s and m to uppercase
echo ${str^^[csm]}

#convert the first char to lowercase
echo ${str,}

#convert all chars to lowercase
echo ${str,,}

#convert the characters N,U and S to lowercase
echo ${str,,[NUS]}


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

&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h4 style="color:#4ac5db" &gt;delimit string and divide it into variables &lt;/h4&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Here, the delimitter (separator) is the comma , &lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

str="Hello, Welcome to LINUX, Bash strings"

IFS=, read -r x y z &amp;lt;&amp;lt;&amp;lt; "$str"

echo x = $x         # Hello
echo y = $y         # Welcome to LINUX
echo z = $z         # Bash strings

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

&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h4 style="color:#4ac5db" &gt;delimit string and divide it into an array &lt;/h4&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre class="language-bash"&gt;
&lt;code class="language-bash"&gt;

str="Hello, Welcome to LINUX, Bash strings"

IFS=, read -ra arr &amp;lt;&amp;lt;&amp;lt; "$str"

echo ${arr[0]}         # Hello
echo ${arr[1]}         # Welcome to LINUX
echo ${arr[2]}         # Bash strings

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;With these tools we can manipulate our strings in any way we want, however
we might face a situation much complicated where these native Bash strings
manipulation tools will not be sufficient, at this point we can use some much
more powerful commands like sed or awk.&lt;/p&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="bash"></category><category term="string manipulation"></category><category term="Bash scripts"></category><category term="text processing"></category><category term="command line"></category><category term="programming"></category><category term="Linux"></category><category term="Shell Scripting"></category><category term="string operations"></category><category term="substring"></category><category term="concatenation"></category><category term="search and replace"></category><category term="regular expressions"></category><category term="scripting techniques"></category></entry><entry><title>Bash scripting tutorials: for loop</title><link href="https://mosaid.xyz/articles/bash-scripting-tutorials-for-loop-19.html" rel="alternate"></link><published>2020-08-22T18:14:50+00:00</published><updated>2020-08-22T18:14:50+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2020-08-22:/articles/bash-scripting-tutorials-for-loop-19.html</id><summary type="html">&lt;p&gt;Loops are an important part of any programming language, they offer a way to repeat commands or instruction without repeating lines of code, the for loop comes in different styles in bash scripting&lt;/p&gt;</summary><content type="html">&lt;p&gt;Loops are an important part of any pragramming language, they offer a way to repeat commands or
instruction witout repeating lines of code, the for loop comes in diffrent styles in bash scripting
&lt;/p&gt;
&lt;p&gt;Generally the for loop has the following syntax:&lt;/p&gt;
&lt;pre&gt;
    for var in list
        do
            commands
    done
&lt;/pre&gt;
&lt;h1&gt;C style for loop:&lt;/h1&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre class=" language-bash"&gt;
&lt;code class=" language-bash"&gt;

for (( i= 0 ; i&amp;lt;=10; i++ )) ; do
    echo $i
done

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h1&gt;for loop with basic range:&lt;/h1&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;the following for loop will print numbers from 0 to 10:&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre class=" language-bash"&gt;
&lt;code class=" language-bash"&gt;

for i in {0..10} ; do
    echo $i
done

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h1&gt;for loop with range and step:&lt;/h1&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;the following for loop will print the  numbers : 0 5 10 15 20,  since the step is 5&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre class=" language-bash"&gt;
&lt;code class=" language-bash"&gt;

for i in {0..20..5} ; do
    echo $i
done

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;We can iterate through the results of a command &lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre class=" language-bash"&gt;
&lt;code class=" language-bash"&gt;

for w in $(echo "John Smith Sarah Ashly" ) ; do
    echo "my name is $w"
done

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;div&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;the next for loop will go through html files in a directory and change their extension to php &lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre class=" language-bash"&gt;
&lt;code class=" language-bash"&gt;

for f in $(ls dir/*.html) ; do
    mv "$f" "$( basename -s .html $f ).php"
done

&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Linux"></category><category term="Terminal"></category><category term="tutorial"></category><category term="bash"></category></entry><entry><title>Bash scripting tutorials: part 1 - hello world and variables</title><link href="https://mosaid.xyz/articles/bash-scripting-tutorials-part-1-hello-world-and-variables-11.html" rel="alternate"></link><published>2020-07-05T18:22:55+00:00</published><updated>2020-07-05T18:22:55+00:00</updated><author><name>mosaid</name></author><id>tag:mosaid.xyz,2020-07-05:/articles/bash-scripting-tutorials-part-1-hello-world-and-variables-11.html</id><summary type="html">&lt;p&gt;Shell scripting is the language of Linux Command Line, it is the most used language under linux because you can assimilate and use all other languages in your scripts. you can use Python scripts, All the operating system programs and commands, you can even run php scripts right from your terminal or shell scripts.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Shell scripting is the language of Linux Command Line, it is the most used language under linux
because you can assimilate and use all other langages in your scripts. you can use Python scripts,
All the operating system programs and commands, you can even run php scripts right from your
terminal or shell scripts.&lt;/p&gt;

&lt;p&gt;it is preferable to write shell scripts in a text file with the extension ".sh" for a better text
highlighting in the text editors like vim.&lt;br&gt;
shell scripts are just sequences of commands that are executed by the shell interpreter, in our case
the shell interpreter is Bash.&lt;/p&gt;

&lt;p&gt;Note: Shell can be Bash, zsh, sh or fish... in these tutorials I will be talking about scripts
intended for Bash, but there is not much difference between the shells except for sh. which is the
legacy shell in all unix systems and it does not support much of the advanced scripting supported
bty the other shells.&lt;/p&gt;

&lt;h2&gt;First Bash script&lt;/h2&gt;

&lt;div&gt; 
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;As the Tradition dictates in all programming langues. Our first program will be a hello world
program.&lt;br&gt;
Lets fire up a terminal and create a file and call it &lt;strong&gt;first.sh&lt;/strong&gt; like so :&lt;/p&gt;

&lt;pre class=" language-bash" style="background-color:black;"&gt;
    &lt;code class=" language-bash" style="background-color:black;" &gt;
 touch first.sh
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;Lets write the next two lines in our file:&lt;/p&gt;

&lt;pre class=" language-bash" style="background-color:black;"&gt;
    &lt;code class=" language-bash" style="background-color:black;" &gt;
#!/bin/bash
echo "hello world"
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;Lets write the next two lines in our file:&lt;/p&gt;

&lt;p&gt;The first line is called a &lt;strong&gt;shabang&lt;/strong&gt;. it is an instruction to the current shell
interpreter that is about to execute our file to use "Bash" as the program to interpret and execute
our script. the 2nd line is our message to the world using the command "echo" and we will be using
this command a lot.&lt;br&gt;
then we make the file executable. we have the choice to not make it executabe. but then we must pass
it as an argument to Bash every time we want to execute it by typing : "bash first.sh".&lt;/p&gt;

&lt;pre class=" language-bash" style="background-color:black;"&gt;
    &lt;code class=" language-bash" style="background-color:black;" &gt;
  chmod +x first.sh
  ./first.sh
&lt;/code&gt;
&lt;/pre&gt;

&lt;h2&gt;Variables&lt;/h2&gt;
&lt;div&gt; 
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;p&gt;All programming languages use variables, and Bash scripting is no exception. for it is the
variables that makes the scriptes dynamic and adaptive to their envirement.in Shell scripting there
are only two types of variables : integers and strings (of characters) . and Bash scripting has many
built in features for maniputating string. we will make a full tutorial about them in future
articles&lt;/p&gt;

&lt;h3&gt;using variables&lt;/h3&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt; we can make variables just by giving them a name the starts with with alpha-characters or the
underscore character "_" and then asigning a value to the variable with the "=" symbol. like so:&lt;/p&gt;

&lt;pre class=" language-bash" style="background-color:black;"&gt;
    &lt;code class=" language-bash" style="background-color:black;" &gt;
var1=123
mytext1="hello world"
echo "$var1 is a number"
echo  $mytext1 is a string echoed without double quotes
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt; we then use them  by the dollar "$" sign followed by the variable name , we can use them in
other commands like "echo" or any other command.:&lt;/p&gt;

&lt;pre class=" language-text" style="background-color:black;"&gt;
    &lt;code class=" language-text" style="background-color:black;" &gt;
123 is a number
hello world is a string echoed without double quotes
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;As you have seen we created our first program and we said hello to the entire world , then we
created some variables. the good stuff are yet to come in future articles and then you will witness
the full power of Bash scripting.&lt;/p&gt;

&lt;div class="w-100" &gt; 
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- viewarticle --&gt;
&lt;ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-9705701149690337"
    data-ad-slot="7092311090"
    data-ad-format="auto"
    data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt; &lt;/div&gt;

&lt;!-- This markdown file was generated automatically from the DB --&gt;</content><category term="Linux"></category><category term="Linux"></category><category term="Terminal"></category><category term="bash"></category><category term="programming"></category></entry></feed>