daily work

compile kernel

CONFIG_DEBUG_INFO_BTF=n
CONFIG_SYSTEM_TRUSTED_KEYS=""
dnf install -y ncurses-devel openssl openssl-devel elfutils-libelf-devel flex bison bc dwarves tar
make menuconfig
make -j8 all
make modules_install
make install

mount

mount -t nfs fs-qe.usersys.redhat.com:/srv/nfs/vmcore <mount point>
mount netqe-bj.usersys.redhat.com:/home/share /mnt/
mount netqe-bj.usersys.redhat.com:/home/kdump/vmcore /mnt/
mount netqe-infra01.knqe.eng.rdu2.dc.redhat.com:/home/www/html/share /mnt/test

errata

errata:
bkr workflow-tomorrow --errata=102647 --tps-rpmtest --tps-srpmtest
tps-results --errata=102647 --job=7631186  --rpmtest --srpmtest
bkr workflow-tomorrow --errata=<errata_id> --tps-rpmtest --tps-srpmtest --tps-rhnqa
bkr workflow-tomorrow --errata=<errata_id> --tps-rpmtest --tps-srpmtest
bkr workflow-tomorrow --errata=<errata_id> --tps-rhnqa

other

bundle exec jekyll serve 

# sos
ssh supportshell.cee.redhat.com
yank

# dig
dig @ns1.eng.pek2.redhat.com -x 10.73.88.28 +noall +answ
dd if=/dev/zero of=bigfile2 bs=1MB count=1000
iostat -d -x -k 1 1
sar -n DEV 5 5
sar -d 5 5

# find
sudo find ./ -cnewer teamd-1.30-2.fc32-ccpp-2020-04-04-19-59-54.414169-327830.tar.gz | grep -v "^./$" | grep -v "teamd-1.3" | grep -v "^?" | (while read f;do rm -rf $f;done)
# delete directory old then 20days
find . -maxdepth 1 -type d -mtime +20 | xargs -I ^ sh -c "mv ^ /tmp/backup"

# clear vmcore
find . -maxdepth 1 -type d -regex "^./[0-9].*" -mtime +10 -exec rm -rf {} \;

# delete log file
tmpwatch 20d /var/tmp
ll /var/tmp/dnf-liliang-7k3r5p7a/dnf.librepo.log

# kdump
yum install kexec-tools
grubby --update-kernel=ALL --args="crashkernel=256M"
vim /etc/kdump.conf
  nfs netqe-bj.usersys.redhat.com:/home/kdump/vmcore
  path /liali
systemctl enable kdump
systemctl start kdump
echo c > /proc/sysrq-trigger

# early kdump
# Rebuild the initramfs of the booting kernel with early kdump support.
dracut -f --add earlykdump 
# Append rd.earlykdump kernel boot parameter to 'kernelopts' line in /boot/grub2/grubenv file.
grubby --update-kernel=ALL --args="rd.earlykdump"
reboot
# Check the status of the early kdump support on the command prompt.
journalctl -x | grep early-kdump 

# sysrq
Enable SysRq then trigger a panic through /proc interface
    echo 1 > /proc/sys/kernel/sysrq
    echo c > /proc/sysrq-trigger

# tshark
tshark -a duration:10 -nVpq -i ens8 host 225.1.2.3 -c1 -T fields -e ip.dst 2>/dev/null

# substitute                                                     
for f in $(grep -l -i version -R ../*);do
        sed -i 's:RhelVersion=.*redhat-release.*):RhelVersion=$\(get_RhelVersion\):g' $f
        sed -i 's:MajorVersion=.*redhat-release.*):MajorVersion=$\(get_rhel_MajorVersion\):g' $f
        sed -i 's:MinorVersion=.*redhat-release.*):MinorVersion=$\(get_rhel_MinorVersion\):g' $f
        sed -i 's:rhel_version=.*redhat-release.*):rhel_version=$\(get_rhel_MajorVersion\):g' $f
done    

Fragmentation/re­assembly statistics
# netstat -s
# cat /proc/net/snmp | grep '^Ip:' | cut -f17 -d' '

cisco switch monitro session : https://www.ciscopress.com/articles/article.asp?p=2928194

NX-1(config)# interface Ethernet4/3
NX-1(config-if)# switchport
NX-1(config-if)# switchport monitor
NX-1(config-if)# no shut
NX-1(config)# monitor session 1
NX-1(config-monitor)# source interface Ethernet4/1-2 both
NX-1(config-monitor)# source interface Ethernet5/1 rx
NX-1(config-monitor)# destination interface Ethernet4/3
NX-1(config-monitor)# no shut
NX-1(config-monitor)# exit

juniper port-mirror: https://networkdirection.net/articles/routingandswitching/juniper-routers-and-switches/port-mirroring-in-junos/

edit forwarding-options
edit analyzer MyCapture
set input ingress interface ge-0/0/0
set input egress interface ge-0/0/0
set output interface ge-0/0/23
exit
exit
commit

clear job_scheduler disk:

/home/job_scheduler 6.8G
/usr 2.6G
/var 15G
/var/www/html/job_scheduler/ci/umb/*.log 9.9G. rm 2024-xxxx.log
/var/log/journal 2.9G  rm /var/log/journal/*     keep dir /var/log/journal
/var/lib 1.7G

tmt user:

    auto/liver.englab.brq.redhat.com
    our jobs are submitted under jenkins/baseos-jenkins.rhev-ci-vms.eng.rdu2.redhat.com user

upgrade bnxt FW:

./niccli -i 1 install /root/BCM957508-P2100G.pkg 

upgrade mlx5 FW:

download fw from https://network.nvidia.com/support/firmware/firmware-downloads/
 download mft from https://network.nvidia.com/products/adapter-software/firmware-tools/
 upgrading following https://network.nvidia.com/support/firmware/nic/
 mst start
      mst status (get device name)
      flint -d /dev/mst/mt4119_pciconf0  -i fw-ConnectX5-rel-16_35_1012-MCX516A-CCA_Ax-UEFI-14.28.15-FlexBoot-3.6.804.bin burn