运维-离线安装nvidia-docker2
离线安装nvidia-docker2
容器中要用GPU资源,就需要安装NVIDIA Container Toolkit,按照官网的步骤很容易安装,但如果不能连外网,就需要离线安装
[ ] 安装好Docker
[ ] 安装好nvidia driver
查看系统版本
123456root@dncloud-suat:/home/dntech/tools# lsb_release -aNo LSB modules are available.Distributor ID: UbuntuDescription: Ubuntu 18.04.6 LTSRelease: 18.04Codename: bionic
下载安装包
下载安装包libnvidia-container1_1.9.0-1_amd64.deb
libnvidia-container/stable at gh-pages · NVIDIA/libnvidia-container
下载安装包libnvidia-container-tools_1.9.0-1_amd64.deb
libnvidia-container/sta ...
Nginx-headers-more-nginx-module
headers-more-nginx-module
headers-more-nginx-module 模块用于添加、修改或清除 请求/响应头,该模块不是nginx自带的,默认不包含该模块,需要另外安装。
Github地址:
GitHub - openresty/headers-more-nginx-module: Set, add, and clear arbitrary output headers in NGINX http servers
模块主要的指令
more_set_headers 用于添加、修改、清除响应头
more_clear_headers 用于清除响应头
more_set_input_headers 用于添加、修改、清除请求头
more_clear_input_headers 用于清除请求头
2.修改nginx web 服务器版本信息
1234567891011121314server { listen 80; server_name localhost; more_set_headers "Server: Web ...
Nginx-add header
add_header
Adds the specified field to a response header provided that the response code equals 200, 201 (1.3.10), 204, 206, 301, 302, 303, 304,307 (1.1.16, 1.0.13), or 308 (1.13.0).Parameter value can contain variables.
There could be several add_header directives.These directives are inherited from the previous configuration level if and only if there are no add_header directivesdefined on the current level.
官方文档的意思也就是在响应状态码成功时,add_header指令才生效,并且当前“作用域”下没有 add_header指令时,会向上层继承。
作用:使用add_h ...
网络基础(五)-IP协议
参考文献
IP-rfc791
CIDR-rfc4632
趣谈网络协议
IP协议
主要目的是解决寻址和路由问题,以及如何在两点之间传送数据包.
IP协议使用“IP 地址”的概念来定位互联网上的每一台计算机.
不可靠(unreliable)的意思是它不能保证IP数据报能成功地到达目的地.IP仅提供最好的传输服务.如果发生某种错误时,如某个路由器暂时用完了缓冲区,IP有一个简单的错误处理算法:丢弃该数据报,然后发送ICMP消息报给信源端.任何要求的可靠性必须由上层来提供(如TCP).
无连接(connectionless)这个术语的意思是IP并不维护任何关于后续数据报的状态信息. 每个数据报的处理是相互独立的.这也说明,IP数据报可以不按发送顺序接收.如果一信源向相同的信宿发送两个连续的数据报(先是 A,然后是B),每个数据报都是独立地进行路由选择,可能选择不同的路线,因此B可能在A到达之前先到达.
IP地址
IP地址的规则中,网络号和主机号连起来总共32比特.通过子网掩码来区分网络号和主机号
子网掩码为1的部分为网络号,子网掩码为0的部分表示主机号.
IP地址的主机号: ...
网络基础(四)-UDP协议
参考文献
编程必备基础 大话HTTP协议[慕课]
趣谈网络协议
WireShark数据包分析实战(第三版)
TCP-RFC793
TCP/IP详解 卷1: 协议
图解网络-小林coding
UDP-RFC768
UDP
UDP头部格式
123456789101112130 7 8 15 16 23 24 31 +--------+--------+--------+--------+ | Source | Destination | | Port | Port | +--------+--------+--------+--------+ | | | | Length | Checksum | +--------+--------+--------+--------+ | ...
DICOM-dcm4che使用
参考文献
环境说明
依赖以及依赖版本
123456789101112131415161718192021222324252627282930313233343536<properties> <!-- DICOM相关 --> <dcm4che.version>5.23.3</dcm4che.version></properties><dependencyManagement> <dependencies> <dependency> <groupId>org.dcm4che</groupId> <artifactId>dcm4che-core</artifactId> <version>${dcm4che.version}</version> <exclusions&g ...
Nginx-rewrite
nginx rewrite
rewrite模块即ngx_http_rewrite_module模块,主要功能是改写请求URI,是Nginx默认安装的模块。rewrite模块会根据PCRE正则匹配重写URI,然后发起内部跳转再匹配location,或者直接做30x重定向返回客户端。
rewrite 语法
1rewrite regex replacement [flag]
regex:表示正则匹配规则。
replacement:表示跳转后的内容。
flag:表示 rewrite 支持的 flag 标记。
flag标记说明:
last:本条规则匹配完成后,继续向下匹配新的location URL规则,一般用在server和 if 中。
break:本条规则匹配完成即终止,不再匹配后面的任何规则,一般使用在location中。
redirect:返回302临时重定向,浏览器地址会显示跳转后的URL地址。
permanent:返回301永久重定向,浏览器地址栏会显示跳转后的URL地址。
注:last和break最大的不同在于
break 是终止当前lo ...
运维-禁止UbuntuServer自动休眠
参考文献
How To: Disable Sleep on Ubuntu Server
禁止Ubuntu server 自动休眠
IDC机房机器重启20分钟左右会自动断开连接,网络就直接连接不上
查看系统日志
1234567Mar 7 07:30:54 dn-idc102 NetworkManager[1935]: <info> [1646638254.4260] manager: sleep: sleep requested (sleeping: no enabled: yes)Mar 7 07:30:54 dn-idc102 NetworkManager[1935]: <info> [1646638254.4262] manager: NetworkManager state is now ASLEEPMar 7 07:30:54 dn-idc102 ModemManager[2048]: <info> [sleep-monitor] system is about to suspendMar 7 07:30:54 dn- ...
工具-JMH官方示例(一)
参考文献
Simples
官方样例(1~12)
Hello World
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104/* * Copyright (c) 2014, Oracle America, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code mu ...
工具-JMH官方示例(二)
参考文献
Simples
官方样例(13~end)
RunToRun
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129/* * Copyright (c) 2014, Oracle America, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that ...