目录
linux
查本机公网ip
- curl ifconfig.me
[service@yfb-105-13-tx log]$ curl ifconfig.me
***.***.***.***
- curl cip.cc
[service@yfb-105-13-tx log]$ curl cip.cc
IP : ***.***.***.***
地址 : 中国 中国
数据二 : 北京市海淀区 | ***(北京)科技有限公司
数据三 : 中国北京北京 | 电信
URL : http://www.cip.cc/106.52.177.102
ps aux名COMMAND列带中括号([ ])
>>> ps aux
USE PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.1 194960 9412 ? Ss 2019 9:12 /opt/gitlab/embedded/sbin/nginx -p /var/opt/gitlab/nginx
root 2 0.0 0.0 0 0 ? S 2019 0:00 [kthreadd]
>>> man ps
args COMMAND command with all its arguments as a string. Modifications to the
arguments may be shown. The output in this column may contain
spaces. A process marked <defunct> is partly dead, waiting to be
fully destroyed by its parent. Sometimes the process args will be
unavailable; when this happens, ps will instead print the executable
name in brackets. (alias cmd, command). See also the comm format
keyword, the -f option, and the c option. When specified last, this
column will extend to the edge of the display. If ps can not
determine display width, as when output is redirected (piped) into
a file or another command, the output width is undefined (it may be
80, unlimited, determined by the TERM variable, and so on). The
COLUMNS environment variable or --cols option may be used to exactly
determine the width in this case. The w or -w option may be also
be used to adjust width.
当ps
命令获取不到指令的参数时,ps
把命令放到中括号里面。
crontab配置文件
crontab常用命令
打印crontab配置crontab -l
修改crontab配置crontab -e
crontab配置文件目录,每个用户的crontab配置独立,目录如下,配置文件以用户名命名(不同操作系统位置稍有差异)
cd /var/spool/cron/crontabs
查看网页最后修改时间
document.lastModified
document.lastModified
"05/14/2020 16:37:00"
打开浏览器开发者工具,在console下输入document.lastModified
返回格式是:dd/mm/yyyy hh:mm:ss
http返回头里的last-modified
import requests
url = '***'
header = requests.head(url)
print(header.headers.get('Last-Modified'))
>>> Wed, 06 May 2020 12:38:16 GMT
GMT表示返回的是格林尼治时间,转换成北京时间要往后推8小时
CER证书转PEM证书
CER证书有两种,DER(二进制),Base64(base64)
openssl x509 -inform DER -in ***.cer -out ***.pem
PEM证书
-----BEGIN CERTIFICATE-----
MIIDpjCCAo6gAwIBAgIQNURrpb5HOrVHvbgVThsdqzANBgkqhkiG9w0BAQUFADBF
MRMwEQYKCZImiZPyLGQBGRYDY29tMRYwFAYKCZImiZPyLGQBGRYGNTAwd2FuMRYw
3assMLI4tF/5fy3vdNXWQsmFS4jKVi0w+vs=
-----END CERTIFICATE-----
nginx配置https证书
在server下配置ssl_certificate
和ssl_certificate_key
,其中ssl_certificate
是公钥文件,ssl_certificate_key
是私钥文件,缺省目录为./conf
。配置好重启nginxnginx -s reload
server {
listen 443;
server_name sexyman.com;
ssl on;
ssl_certificate sexyman.com.crt;
ssl_certificate_key sexyman.com.key;
....
}
校验https证书公私钥配对
openssl提取信息进行精准对比,输出信息一致则表示配对成功
# 对私钥操作
>>> openssl rsa -pubout -in sexyman.com.key
writing RSA key
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjGUZ/qbA85Y+oEYZdJeY
ItIB+8RQtX/MGvpPEVejQuB5fGFNgamH0Z1lwb524b5cVvinF9b3yQ0Hf4o1HkT6
MKki1UzZHqFoR7ZZ4eqs97qiryHHw6W4LUa3nONo6W3T2UxcENRqh3FU/hB/Tktu
ewIDAQAB
-----END PUBLIC KEY-----
# 对公钥操作
>>> openssl x509 -pubkey -noout -in sexyman.com.crt
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjGUZ/qbA85Y+oEYZdJeY
ItIB+8RQtX/MGvpPEVejQuB5fGFNgamH0Z1lwb524b5cVvinF9b3yQ0Hf4o1HkT6
MKki1UzZHqFoR7ZZ4eqs97qiryHHw6W4LUa3nONo6W3T2UxcENRqh3FU/hB/Tktu
ewIDAQAB
postman post文件
form-data
栏下key
类型选择File
,不要忘记输入key
的值,否则服务器获取不到文件内容
linux域名解析
绑定域名-ip
配置文件/etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.0.1.31 ews.500.com
10.0.0.228 ets.500.com
设置dns服务器
配置文件/etc/resolv.conf
; generated by /sbin/dhclient-script
search openstacklocal
nameserver 114.114.114.114 # 移动、联通、电信通用dns
nameserver 8.8.8.8 # google dns
nameserver 180.76.76.76 # 百度dns
nameserver 223.5.5.5 # 阿里dns
nameserver 223.6.6.6. # 阿里dns