Increasing mysql or mariadb max connections

Find out whether MySQL, or MariaDB service is used: # systemctl list-unit-files | grep -E ‘mysql|mariadb’ mariadb.service enabled Create an override for the service file from the previous step: # systemctl edit mariadb.service Note: In case mysql.service, or mysqld.service was displayed on the previous step, replace “mariadb.service” with it. Add the following content to the opened text editor and save the file: … Read more

Rsync example

Basic syntax of rsync command # rsync options source destination Some common options used with rsync commands -v : verbose -r : copies data recursively (but don’t preserve timestamps and permission while transferring data -a : archive mode, archive mode allows copying files recursively and it also preserves symbolic links, file permissions, user & group ownerships and timestamps … Read more

Installing Samba on CentOS

Installing Samba on CentOS Samba is available from the standard CentOS repositories. To install it on your CentOS system run the following command: sudo yum install samba samba-client Once the installation is completed, start the Samba services and enable them to start automatically on system boot: sudo systemctl start smb.servicesudo systemctl start nmb.service sudo systemctl … Read more

How to change timezone in Linux

To set the timezone in Linux, update /etc/localtime with the appropriate timezone file from /usr/share/zoneinfo. rm -f /etc/localtime ln -sf /usr/share/zoneinfo/Europe/Rome /etc/localtime This would set your time zone to Europe/Rome.

SSH – login without password

  If you are in the mood of login to Linux without prodividing the user password, as for automating linux script, well you’re in the right page. In this following we will set up a sketch using user alice on host Earth who wants to log in on host Mars without providing any password. Let’s … Read more

MySQL Backup Script

#!/bin/bash export PATH=/bin:/usr/bin:/usr/local/bin TIMESTAMP=`date +”%Y%d%m-%H%M”` DB_BACKUP_PATH=’/backup/dbbackup’ MYSQL_HOST=’localhost’ MYSQL_PORT=’3306′ MYSQL_USER=’root’ MYSQL_PASSWORD=’mysecret’ DATABASE_NAME=’mydb’ echo “Backup started for database – ${DATABASE_NAME}” mysqldump -h ${MYSQL_HOST} \ -P ${MYSQL_PORT} \ -u ${MYSQL_USER} \ -p${MYSQL_PASSWORD} \ ${DATABASE_NAME} | gzip –best > ${DB_BACKUP_PATH}/${DATABASE_NAME}-${TIMESTAMP}.sql.gz if [ $? -eq 0 ]; then echo “Database backup successfully completed” else echo “Error found during backup” exit … Read more

Configuring HTTPS on CentOS

1. Getting the required software   For an SSL encrypted web server you will need a few things. Depending on your install you may or may not have OpenSSL and mod_ssl, Apache’s interface to OpenSSL. Use yum to get them if you need them. yum install mod_ssl openssl   2. Generate a self-signed certificate   Using … Read more

recovering root password for debian 9

If you happen to forget the root password and you don’t have sudo configured, then don’t give up just yet and think about reinstalling the operating system again. There is a way to reset the root password. First reboot your computer. You should see the GRUB menu when your computer boots as shown in the screenshot below. Select Debian GNU/Linux and press e. You should see … Read more