Posts

How to create a local yum repository for Centos/Redhat/Fedora

Image
In this tutorial, How to create a local yum repository for Centos / Redhat / Fedora . Step 1: mount your ISO file Create folder path /mnt/dvd [huupv@huupv huuphan.com]$ sudo mkdir -p /mnt/dvd If you used a physical DVD [huupv@huupv huuphan.com]$ sudo umount /dev/sr0 [huupv@huupv huuphan.com]$ sudo mount -t iso9660 -o ro /dev/sr0 /mnt/dvd If you used an IOS file [huupv@huupv huuphan.com]$ sudo mount -t iso9660 -o loop,ro /opt/CentOS-7-x86_64-Minimal-1511.iso /mnt/dvd Step 2: Create the repository I'll use vi editor. [huupv@huupv huuphan.com]$  vi /etc/yum.repos.d/local.repo Add the following lines: [local] name=Local DVD or ISO repository baseurl= file:///mnt/dvd gpgcheck=0 enabled=1 Step 3: Test your local repository I installing nginx package using local repository. [huupv@huupv huuphan.com]$  yum install --disablerepo="*" --enablerepo="local" nginx

Mastering the Linux find command: A Comprehensive Guide

Image
Introduction Learn how to effectively use the Linux find command to search for files and directories. This detailed guide covers syntax, examples, and advanced usage, ensuring you're equipped to handle any file search task on your Linux system. The Linux find command is a powerful and flexible tool for searching files and directories in a Linux system. Whether you are a seasoned sysadmin or a new Linux user, understanding how to use find can save you countless hours and make file management tasks significantly easier. This guide provides a comprehensive look at the find command, from basic usage to more advanced options, helping you master this essential Linux command. What is the Linux find Command? The find command in Linux is used to search for files and directories in a directory hierarchy based on criteria specified by the user. The command traverses the file tree from the specified directory, matching files and directories that meet the search conditions. You can use f...

Linux alias tips

Image
In this tutorial, How do I  use alias command to stop and start service with human language. Linux alias tips For example, you execute command " vagrant halt app1 " to stop server app1  or " vagrant halt db " to stop server db in Vagrant . you can use alias command the define command  "stop_app1" or "stop_db" Step 1: Add command end of line in .bashrc file  [huupv@huupv ~]$ vim .bashrc The terminal output as below Step 2: Apply the change [huupv@huupv ~]$ source .bashrc The screen output terminal: [huupv@huupv ~]$ cd my_ansible/example01/ [huupv@huupv example01]$ stop_app1 DEPRECATION: The 'sudo' option for the Ansible provisioner is deprecated. Please use the 'become' option instead. The 'sudo' option will be removed in a future release of Vagrant. ==> app1: Attempting graceful shutdown of VM... [huupv@huupv example01]$ stop_db DEPRECATION: The 'sudo' option for the Ansible provi...

How to Install sublime text editor on Fedora with DNF

Image
In this tutorial, How to Install sublime text editor on Fedora with DNF. Sublime Text is a powerful tool for web developer. I love it Install sublime Text editor Use sublime official yum repository for fedora system. Open terminal and import gpg $ sudo rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg $ sudo dnf config-manager --add-repo https://download.sublimetext.com/rpm/stable/x86_64/sublime-text.repo Install sublime text latest version your system. $ sudo dnf install sublime-text Access sublime text Yeah coding :)

netstat command not found in CentOS 7 / RHEL 7

Netstat command is tool to check the network configure and activity. The default centos 7 and RHEL 7 not found netstat command. How to use netstat command on Centos 7 and RHEL 7 To find out which package provides "netstat" command. yum provides */netstat Or yum whatprovides */netstat The output screen as below net-tools-2.0-0.22.20131004git.el7.x86_64 : Basic networking tools Repo        : @base Matched from: Filename    : /bin/netstat Install netstat command # yum install net-tools The output screen as below: Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile  * base: ftp.jaist.ac.jp  * epel: mirror.ehost.vn  * extras: ftp.jaist.ac.jp  * updates: ftp.jaist.ac.jp Resolving Dependencies --> Running transaction check ---> Package net-tools.x86_64 0:2.0-0.22.20131004git.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ======================...

Linux commands cheat sheet

System Commands Command Description Examples shutdown bring your system down shutdown -h now --> Halt or poweroff after shutdown shutdown -r now --> Reboot after shutdown halt stop your system. halt reboot reboot your system. reboot uptime Tell how long the system has been running. uptime runlevel find the previous and current system runlevel. runlevel printenv print all or part of environment printenv env run a program in a modified environment env hostname show or set the system's your host name hostname --> show the system's host name hostname newhostname -->- set the system's uname print system information uname -a --> print all information locale Displays information about the current locale, or ...

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;         }  ...