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


devlink -v dev flash pci/0000:5e:00.0 file E810_XXV4T_O_SEC_FW_1p7p8p2_NVM_4p80_PLDMoMCTP_0.01_8002066F.bin
devlink dev reload pci/0000:5e:00.0 action fw_activate

virtual display

# Install Xvfb (Debian/Ubuntu)
sudo apt-get install xvfb
# no fedora
dnf -y install xorg-x11-server-Xvfb-21.1.16-1.fc41.x86_64

# Start a virtual display (display number 99)
Xvfb :99 -screen 0 1024x768x24 &

# Set the DISPLAY environment variable
export DISPLAY=:99

# Now run your GUI application (e.g., a GTK-based program)
./your_gtk_program

gcov

# gcov 
remove GCOV_KERNEL_PATH  and USE_NFS_SERVER then add --param=KG_SERVER=netqe-bj.usersys.redhat.com

--param=GCOV_KERNEL_PATH=netqe-bj.usersys.redhat.com/share/gcov-kernels/5.14.0-570.15.1.gcov.el9_6 --param=K_NAME=kernel --param=GCOV_KERNEL_VR=5.14.0-570.15.1.gcov.el9_6 --param=USE_NFS_SERVER=netqe-bj.usersys.redhat.com --param=KG_SHARE_CODECOVERAGE_RAW=/home/kdump/vmcore/liali/gcov --param=TEST_TYPE=NETCORE96 --param=USE_DEBUG_DEVEL=1 --param=KILLTIMEOVERRIDE=432000

--param=GCOV_KERNEL_PATH=netqe-bj.usersys.redhat.com/share/gcov-kernels/6.12.0-55.11.1.gcov.el10_0 --param=K_NAME=kernel --param=GCOV_KERNEL_VR=6.12.0-55.11.1.gcov.el10_0 --param=USE_NFS_SERVER=netqe-bj.usersys.redhat.com --param=KG_SHARE_CODECOVERAGE_RAW=/home/kdump/vmcore/liali/gcov --param=TEST_TYPE=NETCORE100 --param=USE_DEBUG_DEVEL=1 --param=KILLTIMEOVERRIDE=432000

GCOV_RAW_SERVER_PATH="home/kdump/vmcore/liali/gcov"
GCOV_RAW_HTTP_PATH="vmcore/liali/gcov"
FILTER="
*dpll*
*drivers/net*
*drivers/ptp*
*net/*"

# need to execute this on the system with the same gcov kernel version
./gen_gcov_report.sh -t NETCORE96 -s net_core kernel-5.14.0-570.15.1.gcov.el9_6.x86_64
./gen_gcov_report.sh -t NETCORE100 -s net_core kernel-6.12.0-55.11.1.gcov.el10_0.x86_64

--param=GCOV_KERNEL_VR=6.12.0-55.9.1.gcov.el10_0 
--param=KG_SERVER=netqe-bj.usersys.redhat.com 
--param=KG_SHARE_CODECOVERAGE_RAW=/home/share/code-coverage 
--param=TEST_TYPE=NETWORK 
--param=USE_DEBUG_DEVEL=1

https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=67450784
https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=67451140
https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=67462878


# build kernel
sudo yum install krb5-server krb5-libs krb5-workstation
source kernel-master/networking/common/tools/brewkoji_install.sh 
brew list-targets | grep pesign
mount netqe-bj.usersys.redhat.com:/home/share mnt
git clone https://gitlab.com/redhat/rhel/src/kernel/rhel-9  
git describe --tags --abbrev=0
make dist-srpm-gcov -j8
brew build --scratch rhel-9.4.0-test-pesign redhat/rpm/SRPMS/kernel-5.14.0-427.32.1.gcov.el9_4.src.rpm
brew download-task 63405418

# copy kernel to server
kernel-6.12.0-55.gcov.el10_0.src.rpm need exist in noarch and root dir

macos mount

hdiutil mount ~/Documents/case-sensitive-volume.dmg

UMB

the messages contain various numbers like the MR id, pipeline ID, DW ID, 
so when digging through datagrepper putting these things into the contains=... should work to find what you are looking for
I think it(delta) tells datagrepper how far back to go

https://datagrepper.engineering.redhat.com/raw?topic=/topic/VirtualTopic.eng.cki.ready_for_test&delta=4728000&contains=1621894468

copy_sheet

如果想创建新文档,到tools/job_scheduler/目录系执行:python -c "from Tools import *; copy_sheet('your_doc_name','your_sheet_name','RHEL_Test_Report_Template','Template')"