Tag Archives: Computer Basics

How to open X Display on the server side (locally operable remote interface)

The problem is this:
processes some photos on the server, and sometimes you want to look directly at the images on the server. But the server is Ubuntu Server, with no graphical interface. If we use feH, or cv2.imshow(), the error will be reported as follows:
Feh ERROR: Can’t open X display. It is running, yeah?
Solutions:
It should be in the server side ~/.bashrc file

export DISPLAY=localhost=10.0
On the server side the /etc/ssh/ssh_config file should be set to :

Host *
ForwardX11 yes

Use the following parameters when sshing to the server.
ssh -CAXY your-server-name@your-server-ip

Cannot assign requested address error resolution

found that a cannot assign requested address error occurred during recent pressure testing of the TCP service and looked up

on the network

for the following reasons:

client side frequently establishes the connection, but the port release is slow, resulting in no available port when establishing the new connection.

you can see many TIME_WAIT state connections

through netstat

netstat -ae | grep TIME_WAIT

server in the presence of a large number of short connections, Linux TCP stacks typically generate a large number of TIME_WAIT state sockets, sometimes surprisingly large. This increase takes up the system kernel, which is not infinite.

solution:

by modifying the following system parameters to solve (/ etc/sysctl. Conf) :

sysctl -w net.ipv4.tcp_fin_timeout=30  #修改系統默认的TIMEOUT时间,默认为60s 
sysctl -w net.ipv4.tcp_timestamps=1    #修改tcp/ip协议配置, 通过配置/proc/sys/net/ipv4/tcp_tw_resue, 默认为0,修改为1,释放TIME_WAIT端口给新连接使用
sysctl -w net.ipv4.tcp_tw_recycle=1     #修改tcp/ip协议配置,快速回收socket资源,默认为0,修改为1:
sysctl -w net.ipv4.tcp_tw_reuse = 1     #允许端口重用

thanks:

https://blog.csdn.net/fzhqcjc/article/details/84924724