Table of contents
linux
Check the local public network 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 name COMMAND column with square brackets ([ ])
>>> 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.
When ps
the command cannot obtain the parameters of the command, ps
put the command in square brackets.
crontab configuration file
Common crontab commands
Print crontab configuration crontab -l
Modify crontab configuration crontab -e
crontab configuration file directory, each user’s crontab configuration is independent, the directory is as follows, the configuration file is named after the user name(不同操作系统位置稍有差异)
cd /var/spool/cron/crontabs
View page last modified time
document.lastModified
document.lastModified
"05/14/2020 16:37:00"
Open the browser developer tool and enter it under the console. document.lastModified
The return format is: dd/mm/yyyy hh:mm:ss
http returns last-modified in the header
import requests
url = '***'
header = requests.head(url)
print(header.headers.get('Last-Modified'))
>>> Wed, 06 May 2020 12:38:16 GMT
GMT indicates that the return is Greenwich Mean Time, and the conversion to Beijing time will be pushed back by 8 hours
CER certificate to PEM certificate
There are two types of CER certificates, DER (binary), Base64 (base64)
openssl x509 -inform DER -in ***.cer -out ***.pem
PEM certificate
-----BEGIN CERTIFICATE-----
MIIDpjCCAo6gAwIBAgIQNURrpb5HOrVHvbgVThsdqzANBgkqhkiG9w0BAQUFADBF
MRMwEQYKCZImiZPyLGQBGRYDY29tMRYwFAYKCZImiZPyLGQBGRYGNTAwd2FuMRYw
3assMLI4tF/5fy3vdNXWQsmFS4jKVi0w+vs=
-----END CERTIFICATE-----
nginx configuration https certificate
ssl_certificate
Configure and under the server ssl_certificate_key
, where ssl_certificate
is the public key file and ssl_certificate_key
the private key file, the default directory is ./conf
. Configured to restart nginxnginx -s reload
server {
listen 443;
server_name sexyman.com;
ssl on;
ssl_certificate sexyman.com.crt;
ssl_certificate_key sexyman.com.key;
....
}
Verify https certificate public-private key pairing
Openssl extracts the information for accurate comparison, and the output information is consistent, indicating that the pairing is successful
# 对私钥操作
>>> 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 file
form-data
key
Select the type under the column File
, don't forget to enter key
the value, otherwise the server will not get the file content
linux domain name resolution
Bind domain name-ip
configuration file/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
set dns server
configuration file/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