Author: rpaco

  • Samba Installation in Ubuntu 22

    apt-get install sambaadduser usernamesmbpasswd -a usernamecd /home/username/mkdir share_folderchown username share_folder/chgrp username share_folder/ [share_folder$]comment = share_folder Folderpath = /home/username/share_folderread only = noinherit permission = yes systemctl stop smbdsystemctl start smbd

  • 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

  • What to do when all docker commands hang or unresponsive

    Step 1 : Uninstall docker “sudo yum remove docker”Step 2 : remove all docker folder“sudo rm -rf /var/lib/docker”“sudo rm -rf /var/run/docker”“sudo rm /var/run/docker.*” (remove docker.sock, docker.pid files) Step 3 : Reinstall docker “sudo yum install docker”Step 4 : Start docker “sudo service docker start”

  • 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

  • NTP offset monitoring bash script

  • 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…

  • Git Useful Commands

    git branch git checkout development git add . git commit -m “Initial changes” git push -u origin development

  • 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