Posts

zimbra notify password expired by bash script

Image
Introduction Zimbra Collaboration Suite (ZCS) is a popular open-source email platform that provides enterprise-level features for communication and collaboration. As an administrator, managing user accounts effectively is crucial, and one common challenge is handling expired passwords. Automating the notification process with a Bash script can save time, enhance user experience, and improve security. This article explores how to use a Bash script for notifying Zimbra users about password expiration In this tutorial, we’ll cover how to remind users about password expiration on Zimbra. The Bash script adheres to a policy of 120 days for password expiration and notifies users in advance. We will create a script named zimbra_notify_change_pass.sh to automate this process. Understanding Zimbra and Bash Scripts What is Zimbra? Zimbra is a powerful platform combining email, calendar, and collaboration tools into one suite. It’s known for its reliability and versatility, making it a go-to sol...

Recover Data from Crashed Disks with ddrescue command: A Comprehensive Guide

Introduction Learn how to recover data from crashed disks using the ddrescue command in Linux . This step-by-step guide will help you rescue valuable data, solve mounting errors, and ensure your filesystem's integrity on CentOS 7. Data loss can be a nightmare, especially when it involves critical files and documents. In the world of Linux, there are powerful tools designed to mitigate such risks. One such tool is `ddrescue`, a command-line utility that specializes in rescuing data from damaged disks. Whether you're dealing with I/O errors or corrupted filesystems, `ddrescue` offers a reliable solution to recover data from crashed disks. In this guide, we will explore how to use the `ddrescue` command to recover data from a failed disk on a CentOS 7 server. We will also address common mounting errors, such as the "wrong fs type, bad option, bad superblock" error, and provide solutions to resolve these issues. What is ddrescue and Why Use It? `ddrescue` is a GNU utility...

Zimbra Enable PTR/Reverse DNS lookup Incomming Email

Image
Introduction PTR/Reverse DNS lookup is an essential configuration for mail servers to authenticate and validate incoming emails, ensuring smooth communication and reducing spam risks. For Zimbra administrators, enabling this feature can enhance the server’s credibility and align with email best practices. This guide walks you through enabling PTR/Reverse DNS lookup for incoming emails in Zimbra, using examples and best practices to ensure a seamless setup. Why PTR/Reverse DNS Lookup is Crucial Understanding PTR/Reverse DNS Lookup PTR (Pointer Record) or Reverse DNS (rDNS) lookup is the process of mapping an IP address to a domain name, opposite to the conventional DNS resolution. This lookup is crucial for email servers to: Verify sender authenticity: Ensures that the sending server’s IP matches its domain. Prevent spam: Many spam filters rely on reverse DNS to block suspicious emails. Improve deliverability: Trusted email providers prefer servers with correctly configured PTR recor...

How to using NGINX Multiple ssl certificates on one ip

Image
I experienced setup and configure nginx multiple domain on one VPS. In this tutorial, How to using NGINX Multiple ssl certificates on one ip. Multiple SSL Certificates use letsencrypt Web server: Nginx Two domain: domain1.com domain2.cm IP VPS: 111.111.111.222 You buy VPS linux and configure multiple domain on one ip VPS server. I use VPS linode.com cheap 5 USD/month. I love it! Nginx Redirect all HTTP requests to HTTPS server {         listen 80;         listen [::]:80 ipv6only=on;         if ($host = www.domain1.com) {         return 301 https://$host$request_uri;         }         if ($host = www.domain2.com) {         return 301 https://$host$request_uri;         }  ...

Run bash script on boot time on centos

Image
Introduction Automating tasks at startup is essential for server administration, ensuring services and scripts execute without manual intervention. CentOS , a popular Linux distribution, provides multiple ways to run bash scripts on boot time. This guide covers various approaches, their use cases, and step-by-step implementations. Methods to Run a Bash Script on Boot Time on CentOS 1. Using crontab with @reboot Cron jobs are a powerful way to schedule tasks. The @reboot directive in crontab allows executing scripts upon system startup. Steps: Open the crontab editor: crontab -e Add the following line: @reboot /path/to/your/script.sh Save and exit. Ensure the script has executable permissions: chmod +x /path/to/your/script.sh Pros: Simple and effective. Cons: Requires crontab configuration and user-specific settings. 2. Using systemd service (Recommended for CentOS 7+) Systemd is a modern service manager that provides better control over startup scripts. Steps: Create a new system...

Linux create user Using `useradd`

Image
Introduction Learn how to create and configure a user in Linux using the `useradd` command. This comprehensive guide covers creating a user, assigning groups, and configuring sudo privileges without a password. Managing user accounts is a fundamental task for any Linux system administrator. Whether you are setting up a new server or adding users to an existing system, understanding how to create and configure users efficiently is crucial. In this tutorial, we will explore how to use the `useradd` command to create a new user in Linux, assign them to specific groups, and enable them to execute sudo commands without requiring a password. Why Use `useradd` for User Creation? The `useradd` command is a powerful tool that allows system administrators to create user accounts with specific options such as User ID (UID), Group ID (GID), home directory, shell, and more. Unlike graphical user interfaces, `useradd` provides a streamlined way to automate user creation through scripts, making it i...

Shell script parse xml in linux

Image
How to use shell script parse xml file . In this tutorial, I will use grep command, awk command and sed command Reading xml file extracting value in linux . For example xml person file as below <person>   <sex>Male</sex>   < firstname >Huu</ firstname >   <lastname>Phan</lastname>   <sex>female</sex>   < firstname >Miranda</ firstname >   <lastname>Kerr</lastname> </person> How to extracting value Huu and Miranda  of < firstname > < /firstname > Use grep command [huupv@huupv huuphan.com]$ grep -oP '(?<=<firstname>).*(?=</firstname)' person.xml Use awk command [huupv@huupv huuphan.com]$ awk -F "[><]" '/firstname/{print $3}' person.xml Use sed command [huupv@huupv huuphan.com]$ sed -n '/firstname/{s/.*<firstname>//;s/<\/firstname.*//;p;}' person.xml  The result, Shell script parse xml in linux

rename command in linux

Image
rename command similar with mv command. This command is slightly more advanced than mv  command. How to rename multiple files in linux. The syntax rename command rename [options] expression replacement-file For example, basic use rename command [huupv@huupv huuphan.com]$  rename file huu file1.txt The same output How to rename all file extension .txt to .atxt file [huupv@huupv huuphan.com]$ rename .txt .atxt *.txt The same output Use option --verbose in rename command [huupv@huupv huuphan.com]$ rename -v foo huu foo?.atxt The same ouput `foo2.atxt' -> `huu2.atxt' `foo3.atxt' -> `huu3.atxt' Details more information rename command man rename

How to setup OpenVPN Server on Centos 7

Introduction Learn how to set up an OpenVPN server on CentOS 7 with this comprehensive step-by-step guide. Ensure your network's security and privacy with one of the most reliable VPN solutions available. Perfect for both beginners and advanced users. Setting up a secure and reliable VPN is essential for ensuring privacy and data protection, especially in today's increasingly interconnected world. OpenVPN is one of the most trusted and robust VPN solutions available, providing a high level of security and flexibility for both businesses and individual users. This guide will walk you through the process of setting up an OpenVPN server on CentOS 7, offering step-by-step instructions to help you establish a secure connection that meets your specific needs. Step 1: Prepare install OpenVPN server sudo yum update -y sudo yum install epel-release -y sudo yum update -y sudo yum install -y openvpn easy-rsa Configure Ip forwarding for OpenVPN Server vim /etc/sysctl.conf The c...

Failed to create the VirtualBox COM object solve problem

Image
Someday, your Virtualbox not start and the display error "Failed to create the VirtualBox COM object". it got somewhat corrupted. The error of Virtualbox "Failed to create the VirtualBox COM object" as below: Location: '/home/huupv/.config/VirtualBox/VirtualBox.xml' , line 1 (0), column 1. /home/vbox/vbox-5.2.14/src/VBox/Main/src-server/VirtualBoxImpl.cpp[554] (nsresult VirtualBox::init()). How to solve problem! Step 1: make sure process VBoxSVC not running Step 2: make a copy file VirtualBox.xml then delete original file. Step 3: Rename VirtualBox.xml-prev file to VirtualBox.xml file. Step 4: try again start VirtualBox. To check not running process VBoxSVC not running use ps command as below: $ ps -ef | grep VBoxSVC huupv 10122 2421 0 22:19 pts/1 00:00:00 grep --color=auto VBoxSVC To check VirtualBox.xml file and Delete VirtualBox.xml file $ ll /home/huupv/.config/VirtualBox/ | grep VirtualBox.xml -rw-----...