Tuesday, October 29, 2024

How to ping multiple hosts.

[root@sukhoi tmp]# cat pingall.sh #!/bin/bash # Script to check the ping to multiple nodes # Version 1.1 # date 29-10-2024 date cat /tmp/nodes.txt | while read output do ping -c 1 "$output" > /dev/null if [ $? -eq 0 ]; then echo "node $output is up" else echo "node $output is down" fi done

How to set the boot manager in exadata Linux

[root@sukhoi~]# efibootmgr -v BootCurrent: 0009 Timeout: 1 seconds BootOrder: 0000,0001,0002,0003,0006,0007 Boot0000* ExadataLinux_1 HD(2,GPT,147745f1-4f73-42b2-bc34-f64dfc876d29,0x100040,0x80000)/File(\EFI\redhat\shimx64.efi) Boot0001* NET0:PXE IP4 Intel(R) I210 Gigabit Network Connection PciRoot(0x0)/Pci(0x1c,0x4)/Pci(0x0,0x0)/MAC-ADDRESS,1)/IPv4(0.0.0.00.0.0.0,0,0)..BO Boot0002* NET1:PXE IP4 Oracle Dual Port 10Gb/25Gb SFP28 Ethernet Controller PciRoot(0x1)/Pci(0x0,0x0)/Pci(0x0,0x0)/MAC(MAC-ADDRESS,1)/IPv4(0.0.0.00.0.0.0,0,0)..BO Boot0003* NET2:PXE IP4 Oracle Dual Port 10Gb/25Gb SFP28 Ethernet Controller PciRoot(0x1)/Pci(0x0,0x0)/Pci(0x0,0x1)/MAC( MAC-ADDRESS,1)/IPv4(0.0.0.00.0.0.0,0,0)..BO Boot0006* PCIE1:PXE IP4 Nvidia Network Adapter - B8:CE:F6:23:15:9A PciRoot(0x8)/Pci(0x0,0x0)/Pci(0x0,0x0)/MAC(MAC-ADDRESS,1)/IPv4(0.0.0.00.0.0.0,0,0)..BO Boot0007* PCIE1:PXE IP4 Nvidia Network Adapter - B8:CE:F6:23:15:9B PciRoot(0x8)/Pci(0x0,0x0)/Pci(0x0,0x1)/MAC(MAC-ADDRESS,1)/IPv4(0.0.0.00.0.0.0,0,0)..BO MirroredPercentageAbove4G: 0.00 MirrorMemoryBelow4GB: false [root@sukhoi~]# efibootmgr -n 0000 BootNext: 0000 BootCurrent: 0009 Timeout: 1 seconds BootOrder: 0000,0001,0002,0003,0006,0007 Boot0000* ExadataLinux_1 Boot0001* NET0:PXE IP4 Intel(R) I210 Gigabit Network Connection Boot0002* NET1:PXE IP4 Oracle Dual Port 10Gb/25Gb SFP28 Ethernet Controller Boot0003* NET2:PXE IP4 Oracle Dual Port 10Gb/25Gb SFP28 Ethernet Controller Boot0006* PCIE1:PXE IP4 Nvidia Network Adapter - MAC-ADDRESS Boot0007* PCIE1:PXE IP4 Nvidia Network Adapter - MAC-ADDRESS MirroredPercentageAbove4G: 0.00 MirrorMemoryBelow4GB: false

Wednesday, October 2, 2024

How to update the firmware in Exadata

/opt/oracle.cellos/CheckHWnFWProfile -U /opt/oracle.cellos/iso/cellbits cellcli -e alter cell shutdown services all on the cell service /opt/oracle.cellos/CheckHWnFWProfile -action updatefw -component HardDisk -powercycle no (To update the disk firmware) /opt/oracle.cellos/CheckHWnFWProfile -action updatefw -component InfinibandHCA (To update the InfinibandHCA Firmware) /opt/oracle.cellos/CheckHWnFWProfile -action updatefw -component all (To update all the component)

Wednesday, September 4, 2024

How to check the Apache is Working through ansible

--- - name: Check if Apache is Working hosts: webservers vars: webserver_message: "I am running to the finish line." tasks: - name: Start httpd service: name: httpd state: started - name: Create index.html using Jinja2 template: src: index.j2 dest: /var/www/html/index.html

Create node-reboot.yml

--- - hosts: become: yes tasks: - name: Check the uptime shell: uptime register: UPTIME_PRE_REBOOT - debug: msg={{UPTIME_PRE_REBOOT.stdout}} - name: Check the kernel info before the reboot shell: uname -a register: Kernel_PRE_REBOOT - debug: msg={{Kernel_PRE_REBOOT.stdout}} - name: Unconditionally reboot the machine with all defaults reboot: reboot_timeout: 600 - name: Check the uptime after reboot shell: uptime register: UPTIME_POST_REBOOT - debug: msg={{UPTIME_POST_REBOOT.stdout}} - name: Check the kernel info after the reboot shell: uptrack-uname -a register: Kernel_POST_REBOOT - debug: msg={{Kernel_POST_REBOOT.stdout}}

Sunday, August 25, 2024

How to check the disk info speed and unreadable blocks

# Show info about disk sda hdparm -i /dev/sda # Perform a read speed test on disk sda hdparm -tT /dev/sda # Test for unreadable blocks on disk sda badblocks -s /dev/sda

Wednesday, August 14, 2024

Monday, May 27, 2024

How to unzip multiple files in Linux

for I in `ls p24436624_121020_Linux-x86-64*f10.zip` do unzip $I done

How to set the time in the aruba switch and sync with the ntp.

login to the Switch configure terminal clock set 05/27/2024 03:04:30 timesync ntp ntp enable show ntp status write memory.

Saturday, May 18, 2024

Tuesday, April 9, 2024

How to see specific information about disk

hdparm -i /dev/sda smartctl -A /dev/sda hdparm -tT /dev/sda used to Do a read speed test on disk sda badblocks -s /dev/sda used to Test for unreadable blocks on disk sda

How to check the tcp udp and network sockts in linux

netstat -ntlp to view the open TCP sockets netstat -nulp to view the open UDP sockets netstat -nxlp to view the open Unix sockets

How to find the hidden files in Linux

du -sh .[!.]* *

How to check which shells are already installed and configured on our machine ?

by using the chsh -l [user@localhost ~]$ chsh -l /bin/sh /bin/bash /sbin/nologin /usr/bin/sh /usr/bin/bash /usr/sbin/nologin /usr/bin/fish Or by using cat /etc/shells we can change the following default shell using chsh -s /usr/bin/bash Now all that is left to do is preform a logoff-logon cycle, and enjoy our new default shell.

How to Shows all bad login attempts into the system

Try with the following command lastb

Sunday, April 7, 2024

How to mount the nfs share in all the hosts.

--- - name: Mount the NFS share hosts: all become: true vars: mynfs: "172.2.0.200:/nfs/data" mountpoint: "/share" permission: '0777' myopts: 'rw,sync' tasks: - name: utility present redhat-like ansible.builtin.yum: name: - nfs-utils - nfs4-acl-tools state: present when: ansible_os_family == 'RedHat' - name: utility present debian-like ansible.builtin.apt: name: - nfs-common - nfs4-acl-tools state: present when: ansible_os_family == 'Debian' - name: check mountpoint exist ansible.builtin.file: path: "{{ mountpoint }}" state: directory mode: "{{ permission }}" owner: root group: root - name: mount network share ansible.posix.mount: src: "{{ mynfs }}" path: "{{ mountpoint }}" fstype: nfs opts: "{{ myopts }}" state: mounted

How to restart the ssh service in all the hosts.

--- - name: restart ssh service in all the hosts. hosts: all become: true tasks: - name: sshd restart ansible.builtin.service: name: sshd state: restarted enabled: true