Saturday, April 29, 2023

Fix: Wget HTTP request sent, awaiting response... 403 Forbidden

 wget --user-agent="Mozilla" https://www.domain.com/file.extension

or

 wget --user-agent="Mozilla" https://domain.com/file.extension

or

 wget --user-agent="Mozilla" www.domain.com/file.extension

Wednesday, April 19, 2023

How to add an additional IP address in Centos 7

Method -1:

Create file /etc/sysconfig/network-scripts/ifcfg-eth0:0 with the following content:

DEVICE=eth0:0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.0.11
NETMASK=255.255.255.255

service network restart

Method-2:

Run the following command
ipadd your_ip

Example: ipadd 192.168.0.1

Thursday, April 6, 2023

Sovled ! Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

 # sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*

# sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*


or


# sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*

# sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.epel.cloud|g' /etc/yum.repos.d/CentOS-Linux-*

Thursday, March 30, 2023

How to set up VSFTPD Server and FTP Account in AlmaLinux

sudo dnf install vsftpd

sudo mv /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf_original

sudo vi /etc/vsftpd/vsftpd.conf

Add the following code to vsftpd.conf:

-------------------------------

anonymous_enable=NO

connect_from_port_20=YES

dirmessage_enable=YES

local_enable=YES

local_umask=022

listen=NO

listen_ipv6=YES

pam_service_name=vsftpd

userlist_enable=YES

write_enable=YES

xferlog_enable=YES

xferlog_std_format=YES

-------------------------------

cat /etc/vsftpd/vsftpd.conf 

sudo firewall-cmd --zone=public --add-service=ftp --permanent

sudo firewall-cmd --reload

sudo systemctl restart vsftpd

sudo useradd -m testftpuser

sudo passwd testftpuser

sudo bash -c "echo TO CHECK WORKING OF FTP > /home/baycombd/FTP_CHECK"

chown -R testftpuser /home/testftpuser

Note: Up to this user can access FTP files via ftp client application like FileZilla

Sunday, March 5, 2023

Remove header and footer text when click print button in Codeigniter

Add the following CSS for print area html tag:

@media print { @page { margin-top: 0; margin-bottom: 0; } body { padding-top: 5px; padding-bottom: 5px ; } }

Wednesday, March 1, 2023

Generate specific range of numbers having specific digit in excel

 The following function is for generating 8 digit unique number in excel and masked with 123:

=RANDBETWEEN(12300000,12399999)

Wednesday, February 22, 2023

Solved : Unable to guess the MIME type as no guessers are available (have you enabled the php_fileinfo extension?).

Issues: 
1. Image doesn't load correctly or shows broken
2. File (i.e: csv, xlsx etc.) will not be downloaded or cannot be exported

Solution:
in WHM:
  1. Navigate to Software -> EasyApache4
  2. Click the button that says Customize next to Currently Installed Packages
  3. Click PHP Extensions
  4. Search for Fileinfo in the search bar and select the extensions you would like to install
  5. Click Review
  6. After looking over the proposed changes, scroll to the bottom of the screen and click provision.




In cPanel using PHP Selector (if not works even installed in WHM):




In cPanel using ini file (if not works even installed in WHM):




Other:
  1. Install PHP FIleInfo Extension (if not installed)
  2. Enable php_fileinfo in php.ini 
extension=php_fileinfo.dll (Windows)
extension=php_fileinfo.so (Linux)

How to get Ranking of the Students in Excel using RANK Function

=RANK(number,ref,[order]) To rank in descending order, we will use the formula =RANK(B2,($C$5:$C$10),0) If we want unique ranks, we can use...