Dimas Maulana

Dimas Maulana

Developer

Welcome to my website! I am a developer with a current focus on React and Go. My experience encompasses both front-end and back-end development, enabling me to design and develop seamless and efficient applications.

Compress Each Folder With One Archive if Archive Is Not Exist

The provided command is a shell script written in Bash that iterates through directories in the current directory, checks if an archive file (.tar.gz) already exists for each directory, and if not, it creates a compressed archive of the directory using the tar command.

Here’s an explanation of what the script does:

1
2
3
4
5
for dir in `find . -maxdepth 1 -type d  | grep -v "^\.$" `; do
    if ! [ -e ${dir}.tar.gz ] ; then
        tar -cvzf ${dir}.tar.gz ${dir}
    fi
done
  1. for dir in find . -maxdepth 1 -type d | grep -v “^.$” ; do: This line starts a loop that iterates through all subdirectories (excluding the current directory) in the current directory.

Delete Except Newest Files Bash

The provided Bash commands are useful for listing and deleting files, including dotfiles, except for the newest ones. Here’s a breakdown of what each command does:

List all files except the newest three:

1
ls -t | tail -n +4
  • ls -t: Lists all files in the current directory sorted by modification time in descending order (newest first).
  • tail -n +4: Displays all lines starting from the fourth line. In this context, it shows all files except the newest three.

Delete those files:

1
ls -t | tail -n +4 | xargs rm --
  • xargs: Takes the output from the previous command (the list of files to delete) and passes them as arguments to the rm (remove) command.
  • rm --: Deletes the specified files.

List all dotfiles except the newest three:

1
ls -At | tail -n +4
  • ls -At: Lists all files, including dotfiles, sorted by modification time in descending order.
  • tail -n +4: Displays all lines starting from the fourth line. It shows all dotfiles except the newest three.

Delete dotfiles:

1
ls -At | tail -n +4 | xargs rm --
  • xargs: Takes the output from the previous command (the list of dotfiles to delete) and passes them as arguments to the rm (remove) command.
  • rm --: Deletes the specified dotfiles.

It’s important to use these commands with caution, especially the ones that involve deletion (xargs rm --). Deleting files is irreversible, and there’s no easy way to recover them if you make a mistake. Make sure you’re in the correct directory and that you are certain about the files you want to delete before running these commands.

Removing Local Time Machine Snapshots

If you are unable to find the “sudo tmutil disablelocal” command to remove all local copies of Time Machine snapshots, you can manually delete them using the following steps.

Step 1: List Local Snapshot Dates

To begin, open the Terminal application on your Mac and enter the following command:

Setting Up Avahi-Daemon on Ubuntu for Hostname Resolution

Avahi is an open-source implementation of zero-configuration networking, also known as Bonjour or mDNS, which allows devices to automatically discover and communicate with each other on a local network without requiring any manual configuration. This guide will walk you through the process of setting up avahi-daemon on Ubuntu, enabling you to reach the hostname ubuntu.local from the host OS, Samba, and through network discovery.

Step 1: Install Avahi Packages

Open a terminal and execute the following command to install the required Avahi packages:

Troubleshooting Common Issues With the ATIV Smart PC Pro

The ATIV Smart PC Pro is a versatile device that combines the functionality of a tablet and a laptop. However, like any electronic device, it can experience issues from time to time. In this article, we will discuss three common problems that users may encounter with the ATIV Smart PC Pro and provide step-by-step instructions to resolve them. We will cover the following issues: mouse double tap not working, brightness control not functioning properly, and difficulties in uninstalling the Samsung Update software.

How to Write Awesome User Stories

In Software engineering, requirements gathering has multiple techniques. User stories are one of the most popular techniques in agile development. It’s a way to document stakeholders’ requirements in an informal manner. The primary focus of a user story is talking about requirements value rather than writing a detailed specification of each functionality. Basically, a user story is a short statement mentioning the potential value that a specific stakeholder believes he/she would achieve from the solution/system. In addition, user stories are always complemented with Acceptance Criteria. Those criteria verify that the proposed designed solution is meeting the stakeholders’ objectives.

0%