Convert .p12 bundle to server certificate and key files

Seperate Private Key and Certificate file

#Generate certificates bundle file

openssl pkcs12 -nokeys -in server-cert-key-bundle.p12 -out server-ca-cert-bundle.pem

#Generate server key file.

openssl pkcs12 -nocerts -nodes -in server-cert-key-bundle.p12 -out server.key

Convert a PKCS#12 file (.pfx .p12) containing a private key and certificates to PEM

openssl pkcs12 -in keyStore.pfx -out keyStore.pem -nodes

Create a .pfx/.p12 certificate file using OpenSSL

openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt

Src: https://www.sslshopper.com/article-most-common-openssl-commands.html

Share

Convert VirtualBox VM to ProxMox VE

  1. On the VirtualBox host, launch VirtualBox
  2. Right click the VM to convert > Settings
  3. Select Storage from the left navigation
  4. Click the virtual hard disk and copy the Location value for the full path of the disk to the clipboard
  5. Right click on the Start menu > Run > type cmd.exe > Press Enter
  6. Enter the following commands in the command prompt
    # change directory to VirtualBox installation
    cd %programfiles%\Oracle\VirtualBox
    # convert the .vdi to raw .img
    VBoxManage clonehd --format RAW "pasted\full\path\to.vdi" "pasted\full\path\to.raw"
  7. Once the .vdi to .raw conversion completes, open a web browser and navigate to the ProxMox web UI https://ProxMoxDNSorIP:8006/
  8. Click the Create VM button at the top right
  9. On the General tab, enter a VM Name and note the VM ID generated > click Next
  10. On the OS tab select Do not use any media and set the Guest OS > click Next
  11. On the System tab click Next
  12. On the Hard Disk tab set the Disk size to 0.001 > click Next
  13. On the CPU tab set the number of CPUs > click Next
  14. On the Memory tab set the amount of memory to allocate in MiB > click Next
  15. On the Network tab click Next
  16. On the Confirm tab review the settings and click Finish
  17. Select the newly created VM from the left navigation panel > Hardware
  18. Click the Hard Disk to select it
  19. Click the Detach button to detach the hard disk from the VM
  20. Click the Unused disk
  21. Click the Remove button to permanently delete it
  22. Download WinSCP Download
  23. Extract WinSCP and run the executable
  24. Connect to the ProxMox IP server via WinSCP
  25. Copy the VirtualBox created .raw file to a location on the ProxMox server that has enough free disk space, /root for example
  26. Back in the browser, open the ProxMox host Shell
  27. Run the following command to import the raw disk, modify the .raw file name and VM ID noted earlier
    # import the raw disk
    # usage:
    # qm importdisk <VM ID> /root/<source disk file>.raw <destination storage pool name>
    qm importdisk 100 vbox.raw HDD_500GB --format qcow2
  28. Once the disk import completes, select the target VM from the left navigation menu > Hardware
  29. Double click the Unused Disk > Click the Add button
  30. Select Options from the left navigation sub-menu
  31. Double click Boot Order
  32. Check the Enabled box next to the hard disk
  33. Drag the Hard disk up in the boot order as needed, typically below the CD-ROM device
  34. Click OK
  35. Click the Start button in the top right of the screen
  36. Click the Console link to watch the boot process

Src:

https://i12bretro.github.io/tutorials/0295.html

Share

Clean RDP Sessions

Just found it useful with the garbage of RDP session to clean-

Paste the below lines on a notepad and rename it- rdp_clean.bat. Execute the batch file through cmd line as admin user.

@echo off
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Default" /va /f
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Servers" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Servers"
cd %userprofile%\documents\
attrib Default.rdp -s -h
del Default.rdp

Voila!

Share

Install MariaDB 10 on Centos or Springdale Linux

Step 1: Add MariaDB Yum Repository

Start by adding the MariaDB YUM repository file MariaDB.repo for RHEL/CentOS and Fedora systems.

# nano /etc/yum.repos.d/MariaDB.repo

Now add the following lines to your respective Linux distribution version as shown.

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Continue reading “Install MariaDB 10 on Centos or Springdale Linux” »

Share

Disable ipv6 on Linux Machine

Disable on Centos/RHEL system:

1. Append below lines in /etc/sysctl.conf:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

NOTE : To disable IPv6 on a single interface add below lines to /etc/sysctl.conf :

net.ipv6.conf.[interface].disable_ipv6 = 1 ### put interface name here [interface]
net.ipv6.conf.default.disable_ipv6 = 1

2. To make the settings affective, execute :

# sysctl -p

Disable on Debian/Ubuntu system:

One method to make this option persist is modifying /etc/sysctl.conf.  Add the following lines to the file:

net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1

For the settings to take effect use:

sudo sysctl -p
Share

Install Development Tool on CentOS and Debian

Well, in my working domain I face these tools to be installed, so that most of the dependent tools or programs that need to be deployed later don’t face much of dependency issue. So here goes the installation process for both the OS.

On CentOS/RHEL system use the follwoing command (either one of it would work)-

Type the following yum command as root user:

# yum group install "Development Tools"

Continue reading “Install Development Tool on CentOS and Debian” »

Share

Install Proxmox VE 7 on Debian 11 (Bullseye)

Step 1: Update Debian OS

Ensure your Debian 11 (Bullseye) operating system is upgraded.

sudo apt -y update && sudo apt -y upgrade

Once the upgrade process is complete, reboot the server

sudo systemctl reboot

Step 2: Set Proxmox Server hostname

Let’s set a hostname on the server

sudo hostnamectl set-hostname proxmox7node01.example.com --static

Replaceproxmox7node01.example.com with correct hostname you’re setting on your system. Get the IP address of the primary interface: Continue reading “Install Proxmox VE 7 on Debian 11 (Bullseye)” »

Share

Delete Old Unused Kernels in Debian

To find out the current version of Linux kernel running on your system, use the following command.

$ uname -sr
Linux 4.12.0-041200-generic

To list all installed kernels on your system, issue this command.

$ dpkg -l | grep linux-image | awk '{print$2}'

linux-image-4.12.0-041200-generic
linux-image-4.8.0-22-generic
linux-image-extra-4.8.0-22-generic
linux-image-generic

Remove Old Unused Kernels on Debian and Ubuntu

Run the commands below to remove a particular linux-image along with its configuration files, then update grub2 configuration, and lastly reboot the system.

$ sudo apt remove --purge linux-image-4.4.0-21-generic
$ sudo update-grub2
$ sudo reboot
Share

Install Cacti 1.2 on Debian 11

First, update the repository index.

sudo apt update

Install MariaDB Database

Install MariaDB from Official MariaDB Mirror

Update the repository index and install the required packages.

sudo apt update
sudo apt install -y software-properties-common dirmngr apt-transport-https wget curl

Add signing key to your system.

curl -fsSL https://mariadb.org/mariadb_release_signing_key.asc | sudo gpg --dearmor -o /usr/share/keyrings/mariadb-keyring.gpg

MariaDB foundation offers a repository for Debian to install MariaDB easily. You can choose any one of the download mirrors from the MariaDB download page to set up the repository on your system.

Add MariaDB repository using the below command.

echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/mariadb-keyring.gpg] http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.6/debian bullseye main' | sudo tee /etc/apt/sources.list.d/mariadb.list

Install MariaDB server and client using the following command.

sudo apt update
sudo apt install -y mariadb-server mariadb-client

Continue reading “Install Cacti 1.2 on Debian 11” »

Share

Install VirtualBox legacy version 5.x on CentOS 7

Install Dependencies

Install Extra Packages for Enterprise Linux (EPEL)

# sudo yum install epel-release wget -y

Install Dynamic Kernel Module Support (DKMS)

# sudo yum --enablerepo=epel install dkms -y

This will install quite a few packages:

Install Development Tools

# sudo yum groupinstall "Development Tools" -y

Continue reading “Install VirtualBox legacy version 5.x on CentOS 7” »

Share

How to Disable Network Manager on CentOS 7

1. To disable the Network Manager service, perform the following steps:

Disable Network Manager with the following commands:

CentOS 6, CloudLinux 6, Red Hat Enterprise Linux 6 (RHEL), or Amazon Linux:

service NetworkManager stop
chkconfig NetworkManager off

CentOS 7, CloudLinux 7, or RHEL 7:

systemctl stop NetworkManager
systemctl disable NetworkManager

2. Change to the /etc/sysconfig/network-scripts directory.

3. Open the ifcfg-eth0 and ifcfg-lo files with your preferred text editor and, if they exist, set the following keys’ Continue reading “How to Disable Network Manager on CentOS 7” »

Share