-
- CWPpro Database connection
vi /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php
- MySQL root password
vi /root/.my.cnf
- Reset the MySQL root password fast with this command
/scripts/mysql_pwd_reset -q
- CWPpro Database connection
by dev
vi /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php
vi /root/.my.cnf
/scripts/mysql_pwd_reset -q
by dev
rpm -qa|grep -i maria
vi /etc/yum.repos.d/mariadb.repo
[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.2/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 enabled=1
[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.5/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 enabled=1
service mysql stop service mariadb stop systemctl disable mariadb rpm --nodeps -ev MariaDB-server
yum clean all yum -y update "MariaDB-*" yum -y install MariaDB-server systemctl enable mariadb service mariadb start mysql_upgrade
diff -Bw /etc/my.cnf.d/server.cnf.rpmsave /etc/my.cnf.d/server.cnf
rpm -qa|grep -i maria
Yum repository list of the available versions
http://yum.mariadb.org/
by dev
How to Install Zip/Unzip in Debian/Ubuntu/Mint
apt install zip apt install unzip
How to Install Zip/Unzip in RedHa/CentOS/Fedora
dnf install zip dnf install unzip
How to Install Zip/Unzip in Arch/Manjaro Linux
pacman -S zip pacman -S unzip
How to Install Zip/Unzip in OpenSUSE
zypper install zip zypper install unzip
by dev
We can do the change timezone in two ways,
1. Using /etc/localtime File
Check current timezone
date
The /etc/localtime is a link to the original timezone file. Check the symbolic link using the following command.
ls -al /etc/localtime
Output
lrwxrwxrwx 1 root root 32 Oct 8 13:58 /etc/localtime -> ../usr/share/zoneinfo/Asia/Dhaka
The /usr/share/zoneinfo/ directory contains all the timezones.
You can check your zone info. For example, America, Chicago, Los_Angeles, Dhaka etc
ls /usr/share/zoneinfo/America/
Now, create a link with the desired timezone file. America/Chicago
ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime
Verify the timezone using the date command.
date
That’s All.
2. Using timedatectl command
Check current timezone
date
Use the following command to list all time zones.
timedatectl list-timezones
You can filter the output with the city nearer to you.
timedatectl list-timezones | grep -i Los_Angeles
Set the timezone using the following command.
timedatectl set-timezone America/Los_Angeles
Verify the timezone using the date command.
date
That’s All.
by dev
Check whether installed.
systemctl status fail2ban
Installed, but fail2ban not active or running
systemctl start fail2ban systemctl enable fail2ban
To fail2ban error fix
fail2ban-client start
Installing Fail2ban, if not installed
sudo apt update sudo apt install fail2ban
Check installation status
systemctl status fail2ban.service
Configuration files of fail2ban service is in the /etc/fail2ban directory. There is a file with defaults called jail.conf. In this tutorial, you’ll create jail.local by copying jail.conf
cd /etc/fail2ban sudo cp jail.conf jail.local
Now you can configure as per requirements
sudo vi jail.local
You can set bantime, findtime, maxretry and you can set destemail to receive email alert.
vi /etc/fail2ban/jail.local
By default, the SSH service is enabled and all others are disabled.
enabled = true
After configuring all restart
sudo systemctl restart fail2ban
# # The fail2ban local definition file for the default settings. # [DEFAULT] # Destination email for action that send you an email destemail = hostbriz@gmail.com # Sender email. Warning: not all actions take this into account. Make sure to test if you rely on this sender = fail2ban@imail.hostbriz.com # Default action. Will block user and send you an email with whois content and log lines. action = %(action_mwl)s # ignoreip can be a list of IP addresses, CIDR masks, or DNs hosts. Fail2ban # # will not ban a host which matches an address in this list. ignoreip = 127.0.0.1/8 ::1/128 27.147.130.62 123.200.16.218 203.4.187.252 157.119.236.11 # configure nftables banaction = nftables-multiport chain = input # regular banning bantime = 24h findtime = 600 maxretry = 5 # "bantime.increment" allows to use database for searching of previously banned ip's to increase a # default ban time using special formula, default it is banTime * 1, 2, 4, 8, 16, 32... bantime.increment = true # "bantime.rndtime" is the max number of seconds using for mixing with random time # to prevent "clever" botnets calculate exact time IP can be unbanned again: bantime.rndtime = 30m # "bantime.maxtime" is the max number of seconds using the ban time can reach (don't grows further) bantime.maxtime = 60d # "bantime.factor" is a coefficient to calculate exponent growing of the formula or common multiplier, # default value of factor is 1 and with default value of formula, the ban time # grows by 1, 2, 4, 8, 16 ... bantime.factor = 2 # purge database entries after dbpurgeage = 30d [sshd] enabled = true port = ssh filter = sshd logpath = /var/log/auth.log maxretry = 6 mode = aggressive [postfix] enabled = true port = smtp,ssmtp filter = postfix logpath = /var/log/mail.log ignoreip = 127.0.0.1/8 ::1/128 91.229.0.0/24 27.147.130.62 123.200.16.218 203.4.187.252 157.119.236.11