Compile gdb

1
2
3
4
./configure --prefix=`pwd`/installed --with-python=/usr/bin/python3
make -j 16
make install
cp -Rf /usr/share/gdb/auto-load `pwd`/installed/share/gdb/

Remote desktop between Ubuntus

1
2
3
4
5
sudo apt install tigervnc-common
sudo apt install tigervnc-standalone-server
#vncpasswd
vncserver -localhost no -geometry 1280x720 :1
vncserver -list

Authentication required?

Empty ~/.vnc/passwd and

1
2
#/etc/xdg/autostart$ sudo vi org.gnome.SettingsDaemon.Color.desktop
X-GNOME-Autostart-enabled=false

then reboot the server.

refer to:
https://blog.csdn.net/Naisu_kun/article/details/123007055

Precision of time_since_epoch

1
2
#include <chrono>
uint64_t timestamp = std::chrono::system_clock::now().time_since_epoch().count();

'timestamp' is in ns, not in us(μs or microsecond).

1
2
3
4
5
6
1 s = 1000 ms
1 ms = 1000 μs
1 μs = 1000 ns
1 ns = 1000 ps
 
2 GHz = 2 x 10^9 Hz, its 1 circle has 0.5 ns long.

Cpu Affinity

from 宋宝华:
https://www.toutiao.com/article/6937097613720191520/

1
2
3
4
5
6
7
8
9
10
11
12
# grub.cfg, cpu order number starts from 0.
	linux ... isolcpus=2
 
# bash
taskset -cp 2 662
cat /proc/interrupts
cat /proc/irq/44/smp_affinity
 
# make menuconfig
NO_HZ_FULL
NO_HZ_IDLE
Documentation/timers/no_hz.rst

Could NOT find CARES

When I built wireshark in ubuntu, it emitted this error.

The correct packages to install are

1
2
3
4
sudo apt install libgcrypt20-dev libc-ares-dev libpcap-dev
mkdir bld
cd bld
cmake .. -DCMAKE_INSTALL_PREFIX=`pwd`/installed -DCMAKE_PREFIX_PATH=/home/work/3rdParty/qt/5.15.2/gcc_64