nmcli

nmcli usage 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 # nmcli dev status DEVICE TYPE STATE CONNECTION eth0 ethernet connected System eth0 eth1 ethernet unmanaged -- eth2 ethernet unmanaged -- lo loopback unmanaged -- # nmcli dev set eth1 managed yes # nmcli dev set eth2 managed yes # nmcli con add type ethernet con-name eth2 ifname eth2 # nmcli con add type ethernet con-name eth1 ifname eth1 # nmcli dev status DEVICE TYPE STATE CONNECTION eth0 ethernet connected eth0 eth1 ethernet connecting (getting IP configuration) eth1 eth2 ethernet connecting (getting IP configuration) eth2 lo loopback unmanaged -- # nmcli con show NAME UUID TYPE DEVICE eth0 8c9f74d3-8b59-4331-a690-6467d44d1da8 ethernet eth0 eth1 13b1d0d6-8b59-4eec-a65c-1cde9116b73b ethernet eth1 eth2 8349d843-45fe-4fbb-ad5d-9b3932744806 ethernet eth2 # nmcli connection add type bond con-name bond0 ifname bond0 bond.

libguestfs

libguestfs is a tools for accessing and modifying virtual machine disk images. and virt-builder is a very useful tool to build a virtual image. Installation and Usage 1 2 3 sudo dnf install libguestfs-tools virt-builder -l virt-builder fedora-31 -o /home/fedora-31.qcow2 --size 32G --format qcow2 --arch x86_64 --root-password password:redhat --ssh-inject root --install dnf,wget,vim,git,openssl,iproute Issues Q: When run virt-builder -l, got failure virt-builder: error: external command ‘‘curl’ -q –config … exited with error 56 A: some link was baned by China, comment archive.

struct xdp_buff xdp_frame

struct xdp_buff 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 include/net/xdp.h struct xdp_mem_info { u32 type; /* enum xdp_mem_type, but known size type */ u32 id; }; struct xdp_rxq_info { struct net_device *dev; u32 queue_index; u32 reg_state; struct xdp_mem_info mem; } ____cacheline_aligned; /* perf critical, avoid false-sharing */ struct xdp_txq_info { struct net_device *dev; }; struct xdp_buff { void *data; void *data_end; void *data_meta; void *data_hard_start; struct xdp_rxq_info *rxq; struct xdp_txq_info *txq; u32 frame_sz; /* frame size to deduce data_hard_end/reserved tailroom*/ }; #define xdp_data_hard_end(xdp) \ ((xdp)->data_hard_start + (xdp)->frame_sz - \ SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) |-------| <- data_hard_start | | |-------| <- data_meta | | |-------| <- data | | | | | | |-------| <- data_end | | |-------| <- data_hard_end struct xdp_frame 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 struct xdp_frame { void *data; u16 len; u16 headroom; u32 metasize:8; u32 frame_sz:24; /* Lifetime of xdp_rxq_info is limited to NAPI/enqueue time, * while mem info is valid on remote CPU.

mongodb

install mongodb 1 2 3 4 5 6 7 8 9 10 11 cat /etc/yum.repos.d/mongodb.repo [mongodb] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/9Server/mongodb-org/6.0/x86_64/ gpgcheck=0 enabled=1 sudo dnf install mongodb-org mongodb-org-server sudo systemctl enable mongod.service sudo systemctl start mongod.service edit config 1 2 3 4 5 6 7 8 9 vim /etc/mongod.conf systemctl restart mongod # enable internal connection bindIp: 0.0.0.0 # enable auth security: authorization: enabled add users 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 $ mongo > use admin > db.

gpg

Usage Create gpg gpg --gen-key list gpg gpg --list-keys, gpg --list-keys --keyid-format SHORT export public key gpg --export key-id -o file.key, --armor means use assic txt, not binary file. key-id is the email address or the number in pub line import key gpg --import file.key encrypt file gpg --encrypt -r key-id file decrypt file gpg --decrypt file Issues Why it shows ‘unknown’ in uid? It’s because gpg do not trust if the email address own the public key.