How to disable swap partition

To see your swap usage run the following:

free -m

To disable swap without reboot and just temporary run the following:

sudo swapoff -a

This will wipe out used swap space and disable it

To get this enabled again run next:

sudo swapon -a

To disable swap permanently you need to edit /etc/fstab as root and comment out a line related to swap

For example:

cat /etc/fstab |grep swap

# swap was on /dev/nvme0n1p6 during installation
#UUID=d10c1d70-bb88-43fc-bbe2-e17592b660ba none swap sw 0 0

Then reboot your machine to apply the change or try to run next:

mount -a

To reboot run:

reboot

Enjoy!… Read the rest

How to calculate innodb_buffer_pool_size value

Run to the following command to start calculation:

SELECT CEILING(Total_InnoDB_Bytes*1.6/POWER(1024,3)) RIBPS FROM
(SELECT SUM(data_length+index_length) Total_InnoDB_Bytes
FROM information_schema.tables WHERE engine='InnoDB') A;

Example:

mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 60295069
Server version: 10.3.34-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Read the rest

How to update reseller’s subaccounts disk quota and bandwidth on cPanel server

Useful if you have plan limited by:

– limitation by amount of cPanel accounts
– bandwidth limitation
– disk space limitation
– overselling disabled

Update reseller’s packages with new limits via command line

sed -i -e "s/QUOTA=.*/QUOTA=2000/g" /var/cpanel/packages/resellerusername_*
sed -i -e "s/BWLIMIT=.*/BWLIMIT=20000/g"
Read the rest

How to specify which IP address to use for curl or wget commands

Useful when you try to send a request from cPanel shell from your Dedicated IP address

For curl you need to use –interface to specify IP address

Example:

curl --interface 11.22.33.44 http://alltime.pp.ua/

For wget you need to use –bind-address to set IP from which you need to send a request

wget --bind-address=192.0.2.116 http://alltime.pp.ua/
Read the rest

How to fix Roundcube Server Error: STATUS: Mailbox doesn’t exist error

This may occur because of UTF8 formatting was not enabled

– Navigate to cPanel –> Email –> Email Accounts.
– Select Manage next to the “Default” account.
– Enable the toggle under “UTF-8 Mailbox Names”.

You may also inspect Roundcube interface setting for UTF8 formatting enabling… Read the rest

How to remove Mailman list from command line

Find rmlist binary file under  /usr/local/cpanel/3rdparty/mailman/bin folder

For more info run:

[email protected] [/usr/local/cpanel/3rdparty/mailman/bin]# ./rmlist --help

Usage:
rmlist [-a] [-h] listname

Where:
–archives
-a
Remove the list’s archives too, or if the list has already been
deleted, remove any residual archives.

–help
-h
Print this help message and exit.

Read the rest

How to install busybox

BusyBox combines tiny versions of many common UNIX utilities into a single small executable.

This may help you when you got your shell broken since busybox in independent binary which includes a lot of commands inside.

In simple words this tool can save your life 🙂

Find the latest version of busybox at https://busybox.net/downloads/binariesRead the rest

How to fix WordPress Media error Unable to create directory uploads..

You may face something like the following upon uploading an image using your WordPress –> Media section

Error:

“foto-0012.jpg” has failed to upload.
Unable to create directory uploads/2022/02. Is its parent directory writable by the server?

Fix 1:

Double check you have files/folders permissions 644/755 accordingly

find .
Read the rest