Mel Editor โ mini editor for Linux.
MEL Editor User Guide โ mini editor for Linux.
A more or less complete list of commands and configuration files for Ubuntu Linux.
Main macOS Sonoma 14.5 commands.
Main Windows PowerShell Commands.
Main Windows cmd prompt commands.
Docker Best practices.

Docker has revolutionized the world of containerization, enabling scalable and efficient application deployment.
To make the most of this powerful tool, here are 10 essential Docker best practices:
๐ฆ๐๐ฎ๐ฟ๐ ๐๐ถ๐๐ต ๐ฎ ๐๐ถ๐ด๐ต๐๐๐ฒ๐ถ๐ด๐ต๐ ๐๐ฎ๐๐ฒ ๐๐บ๐ฎ๐ด๐ฒ: Use minimalist base images to reduce container size and vulnerabilities.
๐ฆ๐ถ๐ป๐ด๐น๐ฒ ๐ฃ๐ฟ๐ผ๐ฐ๐ฒ๐๐ ๐ฝ๐ฒ๐ฟ ๐๐ผ๐ป๐๐ฎ๐ถ๐ป๐ฒ๐ฟ: Keep it simple – one process per container for better isolation and maintainability.
๐จ๐๐ฒ ๐๐ผ๐ฐ๐ธ๐ฒ๐ฟ ๐๐ผ๐บ๐ฝ๐ผ๐๐ฒ: Define multi-container applications in a YAML file for easy management.
๐ฉ๐ผ๐น๐๐บ๐ฒ ๐ ๐ผ๐๐ป๐๐ถ๐ป๐ด: Store data outside the container to preserve it, even if the container is removed.
๐๐ผ๐ป๐๐ฎ๐ถ๐ป๐ฒ๐ฟ ๐ข๐ฟ๐ฐ๐ต๐ฒ๐๐๐ฟ๐ฎ๐๐ถ๐ผ๐ป: Consider Kubernetes or Docker Swarm for managing containers at scale.
๐ฉ๐ฒ๐ฟ๐๐ถ๐ผ๐ป๐ถ๐ป๐ด ๐ฎ๐ป๐ฑ ๐ง๐ฎ๐ด๐ด๐ถ๐ป๐ด: Always tag images with version numbers to ensure reproducibility.
๐๐ฒ๐ฎ๐น๐๐ต ๐๐ต๐ฒ๐ฐ๐ธ๐: Implement health checks to monitor container status and reliability.
๐ฅ๐ฒ๐๐ผ๐๐ฟ๐ฐ๐ฒ ๐๐ถ๐บ๐ถ๐๐: Set resource constraints to prevent one container from hogging resources.
๐๐ผ๐ฐ๐ธ๐ฒ๐ฟ๐ณ๐ถ๐น๐ฒ ๐๐ฒ๐๐ ๐ฃ๐ฟ๐ฎ๐ฐ๐๐ถ๐ฐ๐ฒ๐: Optimize Dockerfiles by minimizing layers and using caching effectively.
๐ฆ๐ฒ๐ฐ๐๐ฟ๐ถ๐๐: Regularly update images, scan for vulnerabilities, and follow security best practices.
Install Docker on Linux with a single command.
Run this to install Docker:
$ curl -fsSLย get.docker.comย | sh
To preview the installation steps first:
$ curl -fsSLย get.docker.comย -oย get-docker.sh
$ sudo sh ./get-docker.shย –dry-run
How to Send Email using Shell Script (gmail).
In this article, we will learn how to send email using shell scripting. Sending emails programmatically can be very useful for automated notifications, error alerts, or any other form of communication that needs to be sent without manual intervention. Shell scripting offers a powerful way to achieve this through various utilities and tools available in Unix-like operating systems.
Prerequisites
- AWS Account with Ubuntu 24.04 LTS EC2 Instance.
- Basic knowledge of Shell scripting.
Step #1:Generate the App Password
First go to your account:

Search forย App Passwordย in the search bar.

Enter your google account password to verify itโs you:

Now Enter the app name for which you wanted to get the app password like Shell Script.
And click on Create to create it:

the password will be generated. Note it down cause will be using it.

Step #2:Create a file in Ubuntu
Open the terminal and use theย nanoย command to create a new file:
nano email.sh
Step #3:Write a Script to Send Emails
Below is a basic script to send an email.
-----------------------------------------
#!/bin/bash
# Prompt the user for input
read -p "Enter your email: " sender
read -p "Enter recipient email: " receiver
read -s -p "Enter your Google App password: " gapp
echo
read -p "Enter the subject of mail: " sub
# Read the body of the email
echo "Enter the body of mail (Ctrl+D to end):"
body=$(</dev/stdin)
# Sending email using curl
response=$(curl -s --url 'smtps://smtp.gmail.com:465' --ssl-reqd \
--mail-from "$sender" \
--mail-rcpt "$receiver" \
--user "$sender:$gapp" \
-T <(echo -e "From: $sender\nTo: $receiver\nSubject: $sub\n\n$body"))
if [ $? -eq 0 ]; then
echo "Email sent successfully."
else
echo "Failed to send email."
echo "Response: $response"
fi
------------------------------------------

Save the file and exit the editor.
Explanation of the Script:
This script is designed to send an email using Gmailโs SMTP server through the command line. Hereโs a step-by-step explanation of each part of the script:
- Shebang: Theย
#!/bin/bashย line at the beginning of the script indicates that the script should be run using the Bash shell. - User Input Prompts: These lines prompt the user to enter
- The senderโs email address.
- The recipientโs email address.
- The senderโs Google App password (entered silently usingย
-sย to hide the input). - The subject of the email.
- Reading the Email Body: This section prompts the user to enter the body of the email. The user can type the email content and end input by pressingย
Ctrl+D. The body of the email is then captured into the variableยbody. - Sending the Email: This part of the script usesย
curlย to send the email-sย makesยcurlย run silently.--url 'smtps://smtp.gmail.com:465'ย specifies the Gmail SMTP server with SSL on port 465.--ssl-reqdย ensures SSL is required.--mail-from "$sender"ย specifies the senderโs email address.--mail-rcpt "$receiver"ย specifies the recipientโs email address.--user "$sender:$gapp"ย provides the senderโs email and Google App password for authentication.-T <(echo -e "From: $sender\nTo: $receiver\nSubject: $sub\n\n$body")ย sends the email content including headers and body.
- Handling the Response: This final part checks the exit status of theย
curlย command ($?):- If the exit status isย
0, it prints โEmail sent successfully.โ - If the exit status is notย
0, it prints โFailed to send email.โ and outputs the response fromยcurl.
- If the exit status isย
Step #4:Make file executable
Change the file permissions to make it executable using theย chmodย command:
chmod +x email.sh
Step #5:Run the script
Run the script by executing the following command:
./email.sh
You will be prompted to enter the senderโs email, recipientโs email, Google App password, subject, and body of the email:

You will get the message Email sent successfully.
Now check the mail box to see if you receive the mail or not.

Conclusion:
In conclusion, sending emails using shell scripting can greatly enhance your automation tasks, enabling seamless communication and notifications. This approach is especially useful for automated notifications, error alerts, and other routine communications. With the power of shell scripting, you can integrate emails functionality into your workflows, ensuring timely and efficient information exchange.




