Category: Uncategorized

  • Delete git commit history

    Checkout git checkout –orphan latest_branch Add all the files git add -A Commit the changes git commit -am “commit message” Delete the branch git branch -D main Rename the current branch to main git branch -m main Finally, force update your repository git push -f origin main

  • How to create a local repository in RHEL 8 from DVD ISO

    mkdir /media/rhel8/ mount -o loop rhel-8.2-x86_64-dvd.iso /media/rhel8/ cp /media/rhel8/media.repo /etc/yum.repos.d/ chmod 644 /etc/yum.repos.d/media.repo vi /etc/yum.repos.d/media.repo [InstallMedia]name=Red Hat Enterprise Linux 8.2.0mediaid=Nonemetadata_expire=-1gpgcheck=0cost=500baseurl=file:///media/rhel8/BaseOS/gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release [InstallMedia-AppStream]name=Red Hat Enterprise Linux 8 – AppStreammetadata_expire=-1gpgcheck=1enabled=1baseurl=file:///media/rhel8/BaseOS/gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

  • Extend LVM partition with same device

    Existing Partition Table [root@server ~]# fdisk -lDevice Boot Start End Blocks Id System/dev/sda1 * 2048 1026047 512000 83 Linux/dev/sda2 1026048 41861119 20417536 8e Linux LVM Example: I want to add /dev/sda3 #fdisk /dev/sdaCommand (m for help): mCommand (m for help): nCommand (m for help): tCommand (m for help): 8eCommand (m for help): w #reboot Create…

  • Setup BIND9 DNS server RHEL7/CENTOS 7

    Setup BIND9 DNS server RHEL7/CENTOS 7 SERVER IP ADDRESS: 10.68.33.61 1) Assign a hostname of your server hostnamectl set-hostname dnsserver 2) Install bind and bind-utils yum -y install bind bind-utils 3) Configure the DNS(BIND) Disable IPv6 by commeting the line in name.conf. In this tutorial I will be using IPv4. vi /etc/named.conf // listen-on-v6 port…

  • Use Pam_Tally2 to Lock and Unlock SSH Failed Login Attempts

    To check the user fail login count: # pam_tally2 –user=<user name> To reset or unlock the user acount to enable access again: # pam_tally2 –user=<user name> –reset

  • /dev/mapper/system-root does not exist

    mount –bind /proc /mnt/sysimage/proc mount –bind /dev /mnt/sysimage/dev mount –bind /sys /mnt/sysimage/sys chroot /mnt/sysimage dracut –regenerate-all -f && grub2-mkconfig -o /boot/grub2/grub.cfg

  • Running Java without installing in Linux

    Copy jre-8u211-linux-x64.tar.gz to /usr/java tar -zxvf jre-8u211-linux-x64.tar.gz export JAVA_HOME=/usr/java/jre1.8.0_211/binexport PATH=$JAVA_HOME:$PATH

  • Finding Lost Windows Product Key Using Command Prompt or PowerShell

    Command Prompt wmic path softwarelicensingservice get OA3xOriginalProductKey Powershell powershell “(Get-WmiObject -query ‘select * from SoftwareLicensingService’).OA3xOriginalProductKey”

  • How to troubleshoot spamming activities on postfix mail server.

    1. To see the mail queue: mailq 2. To flush the mail queue: postfix flush or postfix -f 3. To remove all mails from the queue: postsuper -d ALL 4. To remove all mails in the deferred queue: postsuper -d ALL deferred 5. To delete all queued messages from or to the domain called webserverpage.com:…

  • How to monitor MySQL process.

    rpaco@choi:~$ mytop -uroot -p<mypassword> Output should be like this. MySQL on localhost (5.0.45) up 0+05:34:18 [15:50:11] Queries: 16.6M qps: 869 Slow: 0.0 Se/In/Up/De(%): 20/00/00/00 qps now: 682 Slow qps: 0.0 Threads: 9 ( 1/ 1) 22/00/00/00 Key Efficiency: 99.9% Bps in/out: 0.0/ 1.8 Now in/out: 8.4/ 1.4k Id User Host/IP DB Time Cmd Query or…