# sh <(curl https://autoinstall.plesk.com/one-click-installer || wget -O - https://autoinstall.plesk.com/one-click-installer)
Monday, September 30, 2024
Tuesday, April 2, 2024
Saturday, June 3, 2023
How To Install PHP (8.2, 8.1, 7.4,7.3) on Ubuntu 22.04
Sunday, October 23, 2022
How to move all files and folders via mv command
To move all files & folders from one destination to another:
mv /path/sourcefolder/* /path/destinationfolder/
To move All files & Folder of current:
mv * /path/destinationfolder/
To move single File:
mv filename.zip /path/destinationfolder/
Friday, October 21, 2022
How to install MySQL on Ubuntu 22.04
Installing MySQL:
sudo apt update
sudo apt install mysql-server
sudo systemctl start mysql.service
Configuring MySQL:
sudo mysql_secure_installation
Creating a Dedicated MySQL User and Granting Privileges:
sudo mysql
mysql -u root -p
CREATE USER 'mailapp'@'localhost' IDENTIFIED WITH authentication_plugin BY 'password';
CREATE USER 'mailapp'@'localhost' IDENTIFIED BY 'password';
CREATE USER 'mailapp'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
ALTER USER 'mailapp'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT on *.* TO 'mailapp'@'localhost' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'mailapp'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit
mysql -u mailapp -p
Thursday, September 15, 2022
How to remove directory in Linux
To permanently remove a directory in Linux, use either rmdir or rm command:
- For empty directories, use
rmdir [dirname]
orrm -d [dirname]
- For non-empty directories, use
rm -r [dirname]
Before you remove a directory, you need to know the name of it. To discover files and directories, use the ls command, and to know the current directory you are in, use the pwd command.
The options you use together with these commands are also important to determine how they work. Here’s a quick recap of rm command options:
Command and Option | Description |
rm -d | Remove an empty directory using the rm command. |
rm -r | Remove a non-empty directory and its content. |
rm -f | Ignore any prompt when deleting a write-protected file. |
rm -rf | Ignore any prompt when deleting a write-protected non-empty folder. |
rm -i | Output a prompt before deleting every file. |
rm -I | Output a prompt only once before deleting more than three files. |
rm * | Wildcard that represents multiple characters. |
rm ? | Wildcard that represents a single character. |
rmdir -p | Remove an empty subdirectory and its parent directory. |
rmdir -v | Print the information that the specified directory was deleted. |
Sunday, September 4, 2022
How to access EC2 instance if lost key Pair and root credentials
Step-1:
Create a new instance with same OS as previous one or create it from AIM made from old instance
Step-2:
Shutdown the old instance and detach the volume
Step-3:
Shutdown new instance Attached the detached volume to new instance and start the instance
Step-4:
Login new instance using ssh console
Run the following commands:
lsblk
df -h
cd mnt
mkdir oldvolume
sudo mount /dev/sda1 mnt/oldvolume
cd mnt/oldvolume/root/.ssh
sudo vi authorized_keys
Now add your public key and save
umount /dev/sda1
sudo shutdown now
Step-5:
Now detach the dev/sda1 volume from new instance and attach to old instance as dev/sda
Step-6:
Reboot old instance from AWS dashboard and login your old instance using ssh console
Note: Your old instance IP will be changed after doing this if no elastic IP
Tuesday, August 30, 2022
How to install composer and use it on Ubuntu
Install multiple PHP version on Ubuntu for Virtualmin
Enable ondrej/php repository
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && apt-get update
Install additional PHP packagesapt-get install php*-{cgi,cli,fpm,pdo,gd,mbstring,mysqlnd,opcache,xml,zip}
Note: php* should be replaced with a specific PHP version, i.e. php7.4, unless you really need to install all available additional PHP versions.
Configuring the second PHP Version in Virtualmin
The following PHP execution modes are available : fpm The following PHP-FPM versions are available : 8.0.13 (php-fpm) 7.4.30 (php74-php-fpm) 8.2.0 (php82-php-fpm)
You can configure which one is the default PHP version used on new Virtual Servers. The default is to use the newest available. You can change that default in System Settings → Server Templates → Default → PHP Options page.
Configuring Individual Virtual Servers
You can configure the PHP version being used for a specific Virtual Server by selecting Server Configuration → PHP Options.
Monday, August 29, 2022
How to install NGINX and configure on Ubuntu 20.04
sudo apt-get update
sudo apt upgrade
sudo apt install nginx
sudo systemctl status nginx
sudo ufw allow http
sudo ufw reload
sudo systemctl status nginx
sudo systemctl stop nginx
sudo systemctl start nginx
sudo systemctl disable nginx
sudo systemctl enable nginx
sudo systemctl restart nginx
sudo systemctl reload nginx
sudo unlink /etc/nginx/sites-enabled/default
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
sudo mkdir /var/www/example.com
How to unzip tar.gz file in linux
sudo apt-get install zip
unzip file.zip -d destination_folder
unzip file.zip
tar -xf archive.tar.gz
Thursday, August 25, 2022
How to add public key to authorized_keys ec2 instance Ubunutu Linux
Step 1: Login into you AWS account and go to EC2 instances
Step 2: Select your instance and click connect
Step 2: Then click connect button at the bottom right corner
Step 3: Now a new tab will be opened with console as follows
Step 4: Copy your SSH public key then add the key to the following key file
Use this command in Mac/Windows powershell to copy your public key: pbcopy ~/.ssh/id_rsa.pub
nano ~/.ssh/authorized_keys
Step 5: Save and reboot then try to connect again with device from which public key generated.
Friday, February 25, 2022
How to change root pasword using ssh command
The procedure to change the root user password on Ubuntu Linux:
Type the following command to become root user and issue passwd:
sudo -i
passwd
OR set a password for root user in a single command:
sudo passwd root
Test it your root password by typing the following command:
su -
Thursday, August 12, 2021
Remove the Apache Web Server Ubuntu
sudo service apache2 stop
sudo systemctl disable apache2
sudo apt remove apache2
sudo apt autoremove
Sunday, August 8, 2021
Change Ubuntu server Hoatname permanently
Type the hostnamectl command :
sudo hostnamectl set-hostname newNameHere
Delete the old name and setup new name.
Next Edit the /etc/hosts file:
sudo nano /etc/hosts
Replace any occurrence of the existing computer name with your new one.
Reboot the system to changes take effect:
sudo reboot
Saturday, April 17, 2021
Install Webmin on Ubuntu 20.04
sudo apt update
Thursday, April 15, 2021
Install geoip-database in Ubuntu 20
- Update the package index:
# sudo apt-get update
- Install geoip-database deb package:
# sudo apt-get install geoip-database
Install extensions for PHP 7.4 on Ubuntu 20
sudo apt-get install php7.4-cli php7.4-fpm php7.4-bcmath php7.4-curl php7.4-gd php7.4-intl php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-sqlite3 php7.4-xml php7.4-zip
Thursday, February 25, 2021
How to install Fully Featured Mail Server using Postal on Ubuntu 16.04
sudo apt-get update sudo apt-get install erlang
sudo apt-get update sudo apt-get install esl-erlang
sudo apt-get purge elixir
sudo apt-get purge erlang
sudo apt-get install esl-erlang
Tuesday, February 23, 2021
Install and enable CURL extention for PHP 7.4 on Ubuntu 20.04
/etc/init.d/apache2 restart
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...
-
Put the following code in a TXT file and save as "file.cmd" then run the cmd file as administrator. @echo off title Activate Micr...
-
We can install PowerMTA on the server. rpm -ivh /home/PowerMTA-4.0r6.x86_64.rpm You will see the output like this Preparing... #############...
-
# $Id: config 2015-03-24 16:00:00 Jack $ # Sample PowerMTA configuration file # PowerMTA Multiple Virtual PMTA config file sample # # E-mai...