Change Windwos RDP default port 3389

Reference is on Windows 10 (should work on other editions too)

Step 1: Open the Registry Editor

Run the regedit command. You may do this by opening the Start Menu and typing “regedit” into the search bar. Select the option labeled “regedit” with the words “Run command” below it.

(Note: The search bar in Windows 10 is not visible when the menu is first opened. To access the search bar, just start typing with the Start Menu open.)

Alternatively, press the Windows Key + R. This will open the Run dialog box. Type “regedit” into the input bar labeled “Open:” and press “OK”.

Read more

Share

Installing Laravel 9 with php 8.1 and Apache2 using Ubuntu 22

Connect to your ubuntu instance.

1. Install Apache

sudo apt update
sudo apt install apache2
sudo systemctl status apache2

2. Install PHP 8.1

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt install php8.1 libapache2-mod-php8.1
sudo systemctl restart apache2

3. Install required PHP extensions for Laravel 9

sudo apt install php8.1-common php8.1-bcmath php8.1-curl php8.1-dom php8.1-mbstring php8.1-intl php8.1-zip

4. Test Apache installation

Create a new file index.php in /var/www/html

rename index.html -> index.html_old

Edit the index.php with the following.

Read more

Share

Start Docker container after linux boot

Docker provides restart policies to control whether your containers start automatically when they exit, or when Docker restarts. Restart policies start linked containers in the correct order. Docker recommends that you use restart policies, and avoid using process managers to start containers.

Restart policies are different from the –live-restore flag of the dockerd command. Using –live-restore lets you to keep your containers running during a Docker upgrade, though networking and user input are interrupted.

The following command starts a Redis container and configures it to always restart, unless the container is explicitly stopped, or the daemon restarts.

Read more

Share

How To Install and Use Docker Compose on Rocky Linux 8

Step 1 — Installing Docker

The Docker installation package available in the official Rocky Linux 8 repository may not be the latest version. To get the latest and greatest version, install Docker from the official Docker repository. This section shows you how to do just that.

But first, let’s update the package database:

sudo dnf check-update

Next, add the official Docker repository:

sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

While there is no Rocky Linux specific repository from Docker, Rocky Linux is based upon CentOS and can use the same repository. With the repository added, install Docker, which is composed of three packages:

sudo dnf install docker-ce docker-ce-cli containerd.io

After installation has completed, start the Docker daemon:

sudo systemctl start docker

Verify that it’s running:

sudo systemctl status docker

The output should be similar to the following, showing that the service is active and running:

Read more

Share

How to change shared public IP of Virtualmin for all domain hosts

Steps are pretty straight forward.

Step-1:

Under > Webmin > Networking > Network Configuration > Network Interfaces

You need your VM or server console access. Update the new IP with the old one from the correct interface. You will lose the connection. Reboot the server and re-login to webmin/virtualmin interface.

Step-2

Virtualmin > Addresses and Networking > Change IP Addresses > Change Real Address and simply inserting the new primary IP there.

It’ll take a while to update records of the old IP to the new one.

You’re done.

Share

PHPSysinfo CentOS 7 Installer Script

Intended to to deploy on a barebone fresh CentOS installation with Apache and PHP-

!#/bin/sh

#################################################
# Server Configuration for Centos 6.8 Final #
# Don't use port 7071 
# Updated by Rumi- hasan@servermart.net # 
#################################################

## updating packages
sudo yum update -y

## installing dependencies
sudo yum install unzip -y
sudo yum install nano -y
sudo yum install sed -y
sudo yum install screen -y

## installing HTTP Server (Powered By Apache)
sudo yum install httpd mod_ssl -y

## starting HTTP Services
sudo /usr/sbin/apachectl start

## fix for hostname resolving
echo "ServerName localhost" >> /etc/httpd/conf/httpd.conf

## make automatic start after reboot
sudo /sbin/chkconfig httpd on

## make sure automatic start is running
sudo /sbin/chkconfig --list httpd | grep httpd

## install PHP
sudo yum install php php-mysql php-devel php-gd php-pecl-memcache php-pspell php-snmp php-xmlrpc php-xml -y

## change to port 7071
#sed -i -e 's/Listen 80/Listen 7071/g' /etc/httpd/conf/httpd.conf

##restarting HTTP Services
sudo systemctl restart httpd &&

## downloading phpsysinfo
cd /var/www/html
rm -R *
wget https://github.com/phpsysinfo/phpsysinfo/archive/master.zip
unzip master.zip
cp -r phpsysinfo-main/* /var/www/html
mv phpsysinfo.ini.new phpsysinfo.ini

## finishing installation
sudo systemctl restart httpd
Share

Destroy Linux operating system with fork bomb

If you don’t want to completely destroy your Linux system but just neutralize it, you can go with a fork bomb using the following command:

:(){ :|: & };:

This will create a process which will duplicate it self infinitely until the system crash.

If you are in a situation where you receive unwanted guest (like Kim Dotcom), you might want to quickly delete all your hard drive content in a safe way (Use a hammer and crash it) or a programmatic way.

If you have too many hard-drive, the programmatic way will do it. This command will write random data on your hard drive without worriying for a sec for files or partitions.

sudo dd if=/dev/random of=/dev/sda

Replace /dev/sda with the hard drive you wish to delete.

Ref:
https://blog.kop.ax/destroy-your-linux/

Share

Use sudo su to login without any password prompt

Step 1

Edit sudoers file with command visudo:

$ visudo

You should get something similar to this content:

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"

# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

Step 2

Read more

Share

Proxmox create VXLAN using its native SDN

Prerequisite:

You need to have an Installed Proxmox and Configure a Clustered setup.

The first step in any installation is to make sure your hosts are updated. By default, Proxmox hosts will reach out to the enterprise repository, so I need to configure the pve-no-subscription repository. To enable that, I added it to /etc/apt/sources.list like the image below.

Add the pve-no-subscription repository

After adding the repository, I run an apt update and upgrade to install the latest patches and make sure the new repository works.

# apt update && apt upgrade -y

Now I can install the needed dependencies on each host. Important note here, the next few steps are run on EVERY node in the cluster.

Read more

Share