<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Bash - Tag - Dimas Maulana</title>
    <link>https://dimasmaulana.pages.dev/tags/bash/</link>
    <description>Dimas Maulana Website</description>
    <generator>Hugo 0.150.0 &amp; FixIt v0.4.3-20260130042349-e23a50d7</generator>
    <language>en</language>
    <lastBuildDate>Wed, 06 Nov 2024 16:40:20 +0700</lastBuildDate>
    <atom:link href="https://dimasmaulana.pages.dev/tags/bash/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Rsync to Windows Open SSH</title>
      <link>https://dimasmaulana.pages.dev/posts/devops/rsync-to-windows-open-ssh/</link>
      <pubDate>Wed, 06 Nov 2024 16:40:20 +0700</pubDate>
      <guid>https://dimasmaulana.pages.dev/posts/devops/rsync-to-windows-open-ssh/</guid>
      <category domain="https://dimasmaulana.pages.dev/categories/devops/">DevOps</category>
      <description>&lt;p&gt;Attempting to perform an rsync operation from a Linux or macOS system to a Windows machine directly using the &lt;code&gt;rsync&lt;/code&gt; command will fail. This is because Windows does not have a built-in &lt;code&gt;rsync&lt;/code&gt; utility.&lt;/p&gt;&#xA;&lt;p&gt;A typical command like &lt;code&gt;rsync /source/ target-hostname:/mnt/e/target/&lt;/code&gt; will result in an error.&lt;/p&gt;&#xA;&lt;h2 class=&#34;heading-element&#34; id=&#34;solution&#34;&gt;&lt;span&gt;Solution&lt;/span&gt;&#xA;  &lt;a href=&#34;#solution&#34; class=&#34;heading-mark&#34;&gt;&#xA;    &lt;svg class=&#34;octicon octicon-link&#34; viewBox=&#34;0 0 16 16&#34; version=&#34;1.1&#34; width=&#34;16&#34; height=&#34;16&#34; aria-hidden=&#34;true&#34;&gt;&lt;path d=&#34;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&#34;&gt;&lt;/path&gt;&lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&lt;p&gt;Leverage the power of the Windows Subsystem for Linux (WSL) to enable rsync functionality on your Windows system.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Step-by-Step Guide to Installing SadTalker on Mac</title>
      <link>https://dimasmaulana.pages.dev/posts/software/a-step-by-step-guide-to-installing-sadtalker-on-mac/</link>
      <pubDate>Wed, 05 Jun 2024 09:29:43 +0700</pubDate>
      <guid>https://dimasmaulana.pages.dev/posts/software/a-step-by-step-guide-to-installing-sadtalker-on-mac/</guid>
      <category domain="https://dimasmaulana.pages.dev/categories/software/">Software</category>
      <description>&lt;p&gt;For those new to the world of AI-powered chatbots, SadTalker is a popular open-source project that enables users to generate synthetic talking faces. While the official guide might not work for everyone, this detailed tutorial should help install SadTalker successfully on Mac.&lt;/p&gt;&#xA;&lt;h2 class=&#34;heading-element&#34; id=&#34;step-1-install-conda-with-miniforge&#34;&gt;&lt;span&gt;Step 1: Install Conda with Miniforge&lt;/span&gt;&#xA;  &lt;a href=&#34;#step-1-install-conda-with-miniforge&#34; class=&#34;heading-mark&#34;&gt;&#xA;    &lt;svg class=&#34;octicon octicon-link&#34; viewBox=&#34;0 0 16 16&#34; version=&#34;1.1&#34; width=&#34;16&#34; height=&#34;16&#34; aria-hidden=&#34;true&#34;&gt;&lt;path d=&#34;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&#34;&gt;&lt;/path&gt;&lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&lt;pre&gt;&lt;code&gt;brew install miniforge&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is the first hurdle to overcome. Miniforge, a lightweight version of Anaconda, will be used to create and manage conda environments.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Lock Your Mac via Terminal</title>
      <link>https://dimasmaulana.pages.dev/posts/software/how-to-lock-your-mac-via-terminal/</link>
      <pubDate>Fri, 01 Dec 2023 18:08:27 +0700</pubDate>
      <guid>https://dimasmaulana.pages.dev/posts/software/how-to-lock-your-mac-via-terminal/</guid>
      <category domain="https://dimasmaulana.pages.dev/categories/software/">Software</category>
      <description>&lt;p&gt;Securing your Mac quickly can be achieved through Terminal commands. Please note that this method only turns off the display, and the actual lock screen with password protection is activated based on your system settings.&lt;/p&gt;&#xA;&lt;h2 class=&#34;heading-element&#34; id=&#34;opening-terminal&#34;&gt;&lt;span&gt;Opening Terminal&lt;/span&gt;&#xA;  &lt;a href=&#34;#opening-terminal&#34; class=&#34;heading-mark&#34;&gt;&#xA;    &lt;svg class=&#34;octicon octicon-link&#34; viewBox=&#34;0 0 16 16&#34; version=&#34;1.1&#34; width=&#34;16&#34; height=&#34;16&#34; aria-hidden=&#34;true&#34;&gt;&lt;path d=&#34;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&#34;&gt;&lt;/path&gt;&lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&lt;p&gt;To initiate the process, open the Terminal application. You can find it by searching in Spotlight or navigating to Applications &amp;gt; Utilities &amp;gt; Terminal.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Renaming Markdown Files Based on Front Matter Date Using Bash Script</title>
      <link>https://dimasmaulana.pages.dev/posts/development/renaming-markdown-files-based-on-front-matter-date-using-bash-script/</link>
      <pubDate>Fri, 01 Sep 2023 05:21:49 +0700</pubDate>
      <guid>https://dimasmaulana.pages.dev/posts/development/renaming-markdown-files-based-on-front-matter-date-using-bash-script/</guid>
      <category domain="https://dimasmaulana.pages.dev/categories/development/">Development</category>
      <description>&lt;p&gt;Managing files with meaningful and structured names can greatly enhance organization and accessibility. Suppose you have a collection of Markdown files containing Front Matter sections, each with a &amp;ldquo;date&amp;rdquo; field. You want to rename these files using the date from their Front Matter section to create a consistent and informative naming scheme. This article will guide you through achieving this task using a bash script on macOS.&lt;/p&gt;&#xA;&lt;h2 class=&#34;heading-element&#34; id=&#34;prerequisites&#34;&gt;&lt;span&gt;Prerequisites&lt;/span&gt;&#xA;  &lt;a href=&#34;#prerequisites&#34; class=&#34;heading-mark&#34;&gt;&#xA;    &lt;svg class=&#34;octicon octicon-link&#34; viewBox=&#34;0 0 16 16&#34; version=&#34;1.1&#34; width=&#34;16&#34; height=&#34;16&#34; aria-hidden=&#34;true&#34;&gt;&lt;path d=&#34;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&#34;&gt;&lt;/path&gt;&lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&lt;ul&gt;&#xA;&lt;li&gt;Basic familiarity with the command line interface (CLI).&lt;/li&gt;&#xA;&lt;li&gt;A macOS environment with bash, grep, awk, and date utilities.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 class=&#34;heading-element&#34; id=&#34;scenario&#34;&gt;&lt;span&gt;Scenario&lt;/span&gt;&#xA;  &lt;a href=&#34;#scenario&#34; class=&#34;heading-mark&#34;&gt;&#xA;    &lt;svg class=&#34;octicon octicon-link&#34; viewBox=&#34;0 0 16 16&#34; version=&#34;1.1&#34; width=&#34;16&#34; height=&#34;16&#34; aria-hidden=&#34;true&#34;&gt;&lt;path d=&#34;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&#34;&gt;&lt;/path&gt;&lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&lt;p&gt;Let&amp;rsquo;s say you have a set of Markdown files in a folder. You want to rename these files based on the date mentioned in their Front Matter sections. Additionally, you want to exclude renaming any files named &amp;ldquo;README.md&amp;rdquo; or &amp;ldquo;template.md.&amp;rdquo;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Executing an Embedded Bash Script in Go with Interactive Input</title>
      <link>https://dimasmaulana.pages.dev/posts/development/executing-an-embedded-bash-script-in-go-with-interactive-input/</link>
      <pubDate>Fri, 26 May 2023 07:52:00 +0700</pubDate>
      <guid>https://dimasmaulana.pages.dev/posts/development/executing-an-embedded-bash-script-in-go-with-interactive-input/</guid>
      <category domain="https://dimasmaulana.pages.dev/categories/development/">Development</category>
      <description>&lt;p&gt;This article will delve further into the code and explain how to enable interactive input when executing the embedded Bash script. We&amp;rsquo;ll walk through the code and understand how to connect the Go program&amp;rsquo;s standard input to the command&amp;rsquo;s standard input, allowing interaction with the Bash script.&lt;/p&gt;&#xA;&lt;h2 class=&#34;heading-element&#34; id=&#34;1-overview-of-the-code&#34;&gt;&lt;span&gt;1. Overview of the Code&lt;/span&gt;&#xA;  &lt;a href=&#34;#1-overview-of-the-code&#34; class=&#34;heading-mark&#34;&gt;&#xA;    &lt;svg class=&#34;octicon octicon-link&#34; viewBox=&#34;0 0 16 16&#34; version=&#34;1.1&#34; width=&#34;16&#34; height=&#34;16&#34; aria-hidden=&#34;true&#34;&gt;&lt;path d=&#34;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&#34;&gt;&lt;/path&gt;&lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&lt;p&gt;The provided code is a Go program that executes an embedded Bash script. It imports necessary packages such as &lt;code&gt;fmt&lt;/code&gt;, &lt;code&gt;log&lt;/code&gt;, &lt;code&gt;os&lt;/code&gt;, and &lt;code&gt;os/exec&lt;/code&gt; to handle command execution, input/output, and error handling.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Running an Embedded Bash Script with Command-Line Arguments in Go</title>
      <link>https://dimasmaulana.pages.dev/posts/development/running-an-embedded-bash-script-with-command-line-arguments-in-go/</link>
      <pubDate>Thu, 25 May 2023 22:07:00 +0700</pubDate>
      <guid>https://dimasmaulana.pages.dev/posts/development/running-an-embedded-bash-script-with-command-line-arguments-in-go/</guid>
      <category domain="https://dimasmaulana.pages.dev/categories/development/">Development</category>
      <description>&lt;p&gt;In this article, we will explore how to embed a Bash script within a Go program and execute it while passing command-line arguments to the embedded script. This approach allows us to package the script directly within the Go binary, eliminating the need for an external script file. We will leverage the os/exec package and the Go embed feature to achieve this.&lt;/p&gt;&#xA;&lt;h2 class=&#34;heading-element&#34; id=&#34;prerequisites&#34;&gt;&lt;span&gt;Prerequisites&lt;/span&gt;&#xA;  &lt;a href=&#34;#prerequisites&#34; class=&#34;heading-mark&#34;&gt;&#xA;    &lt;svg class=&#34;octicon octicon-link&#34; viewBox=&#34;0 0 16 16&#34; version=&#34;1.1&#34; width=&#34;16&#34; height=&#34;16&#34; aria-hidden=&#34;true&#34;&gt;&lt;path d=&#34;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&#34;&gt;&lt;/path&gt;&lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&lt;ul&gt;&#xA;&lt;li&gt;Basic understanding of Go programming language&lt;/li&gt;&#xA;&lt;li&gt;Familiarity with executing shell scripts&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 class=&#34;heading-element&#34; id=&#34;step-1-embedding-the-bash-script&#34;&gt;&lt;span&gt;Step 1: Embedding the Bash Script&lt;/span&gt;&#xA;  &lt;a href=&#34;#step-1-embedding-the-bash-script&#34; class=&#34;heading-mark&#34;&gt;&#xA;    &lt;svg class=&#34;octicon octicon-link&#34; viewBox=&#34;0 0 16 16&#34; version=&#34;1.1&#34; width=&#34;16&#34; height=&#34;16&#34; aria-hidden=&#34;true&#34;&gt;&lt;path d=&#34;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&#34;&gt;&lt;/path&gt;&lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&lt;p&gt;To embed the Bash script in the Go program, we can use the Go embed feature. Place the Bash script file, named &lt;code&gt;bash.sh&lt;/code&gt; in this example, alongside the Go source file. Annotate the script content using the &lt;code&gt;//go:embed&lt;/code&gt; directive to indicate that it should be embedded in the binary:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Bash Scroll Won&#39;t Work</title>
      <link>https://dimasmaulana.pages.dev/posts/software/bash-scroll-wont-work/</link>
      <pubDate>Thu, 27 Aug 2020 07:36:37 +0700</pubDate>
      <guid>https://dimasmaulana.pages.dev/posts/software/bash-scroll-wont-work/</guid>
      <category domain="https://dimasmaulana.pages.dev/categories/software/">Software</category>
      <description>&lt;p&gt;If you&amp;rsquo;re encountering difficulties scrolling through content in your Bash terminal while using the &lt;code&gt;more&lt;/code&gt; or &lt;code&gt;less&lt;/code&gt; commands, there are several troubleshooting steps you can take to address the issue. These commands are designed to display the contents of files or command outputs one screen at a time. If scrolling isn&amp;rsquo;t functioning as expected, consider the following solutions:&lt;/p&gt;&#xA;&lt;h2 class=&#34;heading-element&#34; id=&#34;1-utilize-keyboard-shortcuts&#34;&gt;&lt;span&gt;1. Utilize Keyboard Shortcuts&lt;/span&gt;&#xA;  &lt;a href=&#34;#1-utilize-keyboard-shortcuts&#34; class=&#34;heading-mark&#34;&gt;&#xA;    &lt;svg class=&#34;octicon octicon-link&#34; viewBox=&#34;0 0 16 16&#34; version=&#34;1.1&#34; width=&#34;16&#34; height=&#34;16&#34; aria-hidden=&#34;true&#34;&gt;&lt;path d=&#34;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&#34;&gt;&lt;/path&gt;&lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&lt;p&gt;When using the &lt;code&gt;more&lt;/code&gt; or &lt;code&gt;less&lt;/code&gt; commands, you can employ the following keyboard shortcuts to navigate through the displayed content:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
