2024年6月22日星期六

chrome socks5 proxy from cmd

 https://www.chromium.org/developers/design-documents/network-stack/socks-proxy/

To configure chrome to proxy traffic through the SOCKS v5 proxy server myproxy:8080, launch chrome with these two command-line flags:


--proxy-server="socks5://myproxy:8080"


--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE myproxy"


Explanation


The --proxy-server="socks5://myproxy:8080" flag tells Chrome to send all http:// and https:// URL requests through the SOCKS proxy server "myproxy:8080", using version 5 of the SOCKS protocol. The hostname for these URLs will be resolved by the proxy server, and not locally by Chrome.


NOTE: proxying of ftp:// URLs through a SOCKS proxy is not yet implemented.

The --proxy-server flag applies to URL loads only. There are other components of Chrome which may issue DNS resolves directly and hence bypass this proxy server. The most notable such component is the "DNS prefetcher".Hence if DNS prefetching is not disabled in Chrome then you will still see local DNS requests being issued by Chrome despite having specified a SOCKS v5 proxy server.


Disabling DNS prefetching would solve this problem, however it is a fragile solution since once needs to be aware of all the areas in Chrome which issue raw DNS requests. To address this, the next flag, --host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE myproxy", is a catch-all to prevent Chrome from sending any DNS requests over the network. It says that all DNS resolves are to be simply mapped to the (invalid) address 0.0.0.0. The "EXCLUDE" clause make an exception for "myproxy", because otherwise Chrome would be unable to resolve the address of the SOCKS proxy server itself, and all requests would necessarily fail with PROXY_CONNECTION_FAILED.

2024年6月21日星期五

nvidia-smi, not enough memory for the allocation

 [ 1484.096449] __vm_enough_memory: pid: 2966, comm: nvidia-smi, not enough memory for the allocation

[ 1484.096456] __vm_enough_memory: pid: 2966, comm: nvidia-smi, not enough memory for the allocation

[ 1484.096457] __vm_enough_memory: pid: 2966, comm: nvidia-smi, not enough memory for the allocation

[ 1500.015549] __vm_enough_memory: pid: 2967, comm: nvidia-smi, not enough memory for the allocation

[ 1500.015558] __vm_enough_memory: pid: 2967, comm: nvidia-smi, not enough memory for the allocation

[ 1500.015560] __vm_enough_memory: pid: 2967, comm: nvidia-smi, not enough memory for the allocation

[ 1520.960394] __vm_enough_memory: pid: 2970, comm: nvidia-smi, not enough memory for the allocation

[ 1520.960402] __vm_enough_memory: pid: 2970, comm: nvidia-smi, not enough memory for the allocation

[ 1520.960403] __vm_enough_memory: pid: 2970, comm: nvidia-smi, not enough memory for the allocation

[ 1732.930913] __vm_enough_memory: pid: 3027, comm: nvidia-smi, not enough memory for the allocation

[ 1732.930919] __vm_enough_memory: pid: 3027, comm: nvidia-smi, not enough memory for the allocation

[ 1732.930921] __vm_enough_memory: pid: 3027, comm: nvidia-smi, not enough memory for the allocation

2024年6月12日星期三

ogr2ogr 使用sql 从 gpkg 中导出属性表

 ogr2ogr   -f   CSV  aa.csv    mdf.gpkg  -sql "select x, y, '1' as code from table002"

ogr2ogr -f CSV out.csv  -sql "select st_x(pt.geom), st_y(pt.geom), '1' as code from Vertices as pt" in.gpkg

ogr2ogr -f CSV out.csv  -sql "select st_x(pt.geom), st_y(pt.geom), pt.marker as code from Vertices as pt" in.gpkg

输出的csv文件中,最后一列,总是被双引号包起来,怎么去掉呢?

添加选项   -lco STRING_QUOTING=IF_NEEDED

https://gis.stackexchange.com/questions/470855

2024年6月11日星期二

qgis 算法

 QGIS/src/analysis/processing/qgsalgorithmlineintersection.cpp



2024年5月25日星期六

禁用chrome的缓存

 通过wireguard访问webserver,chrome浏览器有的网页能打开,有的打不开,以为网络有问题,反复尝试,都没找到原因。最后发现是wireguard连接不成功,chrome用的竟然是缓存的页面!!!

2024年3月7日星期四

Check Python version

>>> import sys

>>> print(sys.version)

3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]


python3   --version