Friday, November 27, 2020

jq installation on Red Hat 7.8

 [root@resilient domain1]# rpm -ivh https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/j/jq-1.6-2.el7.x86_64.rpm https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-6.8.2-1.el7.x86_64.rpm

Wednesday, November 4, 2020

Create custom rhcos installation iso image

 
yum install -y genisoimage-1.1.11-39.el8.x86_64
wget https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.5/4.5.2/rhcos-4.5.2-x86_64-installer.x86_64.iso
mkdir /mnt/1; mount -t iso9660 -o loop rhcos-4.5.2-x86_64-installer.x86_64.iso /mnt/1
mkdir /mnt/2
cd /mnt/1/

tar cf - . | (cd /mnt/2/; tar xfp -)
cd /mnt/2/
cd isolinux/
vim isolinux.cfg

--

label linux
  menu label ^Install Bootstrap
  kernel /images/vmlinuz
  append initrd=/images/initramfs.img nomodeset rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=sda coreos.inst.image_url=http://10.1.1.2/ocp45/rhcos-4.5.2-x86_64-metal.x86_64.raw.gz coreos.inst.ignition_url=http://10.1.1.2/ocp45/bootstrap.ign ip=10.1.1.59::10.1.1.254:255.255.255.0:bootstrap.data.tr.ibm.com:ens192:none nameserver=10.1.1.2

label linux
  menu label ^Install Master0
  kernel /images/vmlinuz
  append initrd=/images/initramfs.img nomodeset rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=sda coreos.inst.image_url=http://10.1.1.2/ocp45/rhcos-4.5.2-x86_64-metal.x86_64.raw.gz coreos.inst.ignition_url=http://10.1.1.2/ocp45/master.ign ip=10.1.1.61::10.1.1.254:255.255.255.0:control-plane-0.data.tr.ibm.com:ens192:none nameserver=10.1.1.2

label linux
  menu label ^Install Master1
  kernel /images/vmlinuz
  append initrd=/images/initramfs.img nomodeset rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=sda coreos.inst.image_url=http://10.1.1.2/ocp45/rhcos-4.5.2-x86_64-metal.x86_64.raw.gz coreos.inst.ignition_url=http://10.1.1.2/ocp45/master.ign ip=10.1.1.62::10.1.1.254:255.255.255.0:control-plane-1.data.tr.ibm.com:ens192:none nameserver=10.1.1.2

label linux
  menu label ^Install Master2
  kernel /images/vmlinuz
  append initrd=/images/initramfs.img nomodeset rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=sda coreos.inst.image_url=http://10.1.1.2/ocp45/rhcos-4.5.2-x86_64-metal.x86_64.raw.gz coreos.inst.ignition_url=http://10.1.1.2/ocp45/master.ign ip=10.1.1.63::10.1.1.254:255.255.255.0:control-plane-2.data.tr.ibm.com:ens192:none nameserver=10.1.1.2

label linux
  menu label ^Install Worker0
  kernel /images/vmlinuz
  append initrd=/images/initramfs.img nomodeset rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=sda coreos.inst.image_url=http://10.1.1.2/ocp45/rhcos-4.5.2-x86_64-metal.x86_64.raw.gz coreos.inst.ignition_url=http://10.1.1.2/ocp45/worker.ign ip=10.1.1.64::10.1.1.254:255.255.255.0:compute-0.data.tr.ibm.com:ens192:none nameserver=10.1.1.2

label linux
  menu label ^Install Worker1
  kernel /images/vmlinuz
  append initrd=/images/initramfs.img nomodeset rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=sda coreos.inst.image_url=http://10.1.1.2/ocp45/rhcos-4.5.2-x86_64-metal.x86_64.raw.gz coreos.inst.ignition_url=http://10.1.1.2/ocp45/worker.ign ip=10.1.1.65::10.1.1.254:255.255.255.0:compute-1.data.tr.ibm.com:ens192:none nameserver=10.1.1.2

label linux
  menu label ^Install Worker2
  kernel /images/vmlinuz
  append initrd=/images/initramfs.img nomodeset rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=sda coreos.inst.image_url=http://10.1.1.2/ocp45/rhcos-4.5.2-x86_64-metal.x86_64.raw.gz coreos.inst.ignition_url=http://10.1.1.2/ocp45/worker.ign ip=10.1.1.65::10.1.1.254:255.255.255.0:compute-2.data.tr.ibm.com:ens192:none nameserver=10.1.1.2


--

cp isolinux.cfg /opt/oc45setup/config/


mkisofs -U -A  rhcos-4.5.2-modified -V  rhcos-4.5.2-modified -volset  rhcos-4.5.2-modified -J -joliet-long -r -v -T -x ./lost-found -o ~/rhcos-4.5.2-modified.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot .

Saturday, October 31, 2020

haproxy siem load balancing config example

 

defaults
    mode tcp
    timeout connect 5000ms
    timeout client 50000ms

listen graylog
    bind *:514
    mode tcp
    balance roundrobin
    server graylog1 10.0.0.1:514
    server graylog2 10.0.0.1:514
    timeout connect 20s
    timeout server 30s

Thursday, October 29, 2020

Sniffing pod's traffic on openshift

# get worker node name

oc get pod -o wide

# get container id
oc get pod <podname> |grep -i containerid

# login to worker node

# get pid by using container-id
docker inspect <container-id> |grep -i pid

# use namespace enter -t <pid> and run tcpdump command.


nsenter -t 1234 -n tcpdump -nnvv -i eth0 port 3128

vim Tips for Editing YAML Files

 vim Tips for Editing YAML Files# 

:set cursorcolumn 

:set nocursorcolumn 

:set ai ts=2 sw=2 et 

:set colorcolumn=3,5,7

 

press lower case v: VISUAL mode 

press capital v: VISUAL LINE mode 

press ctrl + v: VISUAL BLOCK mode

Red Hat Ansible installation

You can find source code and rpm files on this link:

https://access.redhat.com/articles/3174981

Wednesday, October 21, 2020

Enable API interface on Checkpoint r80.20

1. Login to web portal by using admin user:

2. Open terminal

3. Login as admin

4. type "api start"

 

 

5. Open SmartConsole (Desktop app)


6. Login as admin rights

7. Manage Settings -> Blades -> Management API

 

7. Select "All ip addresses"

 

8. Click Publish