系统环境 Centos7.91.安装docker,安装 Docker Compose：# 1、（可选）更新系统的软件包 yum update -y # 2、安装 docker 依赖的软件包 yum install -y yum-utils device-mapper-persistent-data lvm2 # 3、添加 docker 的 yum 源 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo # 4、通过 yum 安装 docker sudo yum install docker-ce docker-ce-cli containerd.io # 如上述命令出错，可能是系统上已有旧版本 Docker，需要先卸载旧版本 # 卸载命令：yum remove docker docker-common docker-selinux docker-engine docer-io # 5、启动 Docker 服务并设置开机启动 sudo systemctl start docker sudo systemctl enable docker # 6、测试 docker 是否安装成功 (查看版本号) docker version # 有 client 和 service 两部分表示 docker 安装并启动成功了（有部分错误不用管） # 7、首先前往 https://github.com/docker/compose/releases/latest 查看最新的 docker-compose 版本号，比如截稿时最新版本为 2.1.1。 # 8、下载最新版本的 docker-compose，你需要将下面的 2.1.1 替换成最新的版本号 sudo curl -L "https://github.com/docker/compose/releases/download/2.1.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose # 9、授予可执行权限 sudo chmod +x /usr/local/bin/docker-compose # 10、测试是否安装成功（可能需要重启系统） docker-compose -v # 安装成功会显示 docker-compose 版本 2.部署services: vaultwarden: container_name: vaultwarden image: vaultwarden/server:latest ports: - "8787:80" - "3012:3012" environment: - DOMAIN=https://xxxx.com:8443 # 这里记得改 - ADMIN_TOKEN=some_random_token # 密码存好 - LOGIN_RATELIMIT_MAX_BURST=10 - LOGIN_RATELIMIT_SECONDS=60 - ADMIN_RATELIMIT_MAX_BURST=10 - ADMIN_RATELIMIT_SECONDS=60 - ADMIN_SESSION_LIFETIME=20 - SENDS_ALLOWED=true - EMERGENCY_ACCESS_ALLOWED=true - WEB_VAULT_ENABLED=true - SIGNUPS_ALLOWED=true # 后面可改成 false，禁止新用户注册 volumes: - "/data/vaultwarden/data:/data" restart: unless-stopped 3.反代 server { listen 80; # listen [::]:80; server_name vault.yourdomain.com; index index.html index.htm index.php default.html default.htm default.php; root /home/wwwroot/vault.yourdomain.com; return 301 https://$server_name$request_uri; #设置 http 跳转到 https include rewrite/none.conf; # error_page 404 /404.html; # Deny access to PHP files in specific directory # location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; } include enable-php.conf; access_log off; } server { listen 443 ssl http2; # listen [::]:443 ssl http2; server_name vault.yourdomain.com; index index.html index.htm index.php default.html default.htm default.php; root /home/wwwroot/vault.yourdomain.comn; ssl_certificate /usr/local/nginx/conf/ssl/vault.yourdomain.com/fullchain.cer; ssl_certificate_key /usr/local/nginx/conf/ssl/vault.yourdomain.com/vault.bitwarden.in.key; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; ssl_prefer_server_ciphers on; ssl_ciphers "TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5"; ssl_session_cache builtin:1000 shared:SSL:10m; # openssl dhparam -out /usr/local/nginx/conf/ssl/dhparam.pem 2048 ssl_dhparam /usr/local/nginx/conf/ssl/dhparam.pem; include rewrite/none.conf; # error_page 404 /404.html; # Deny access to PHP files in specific directory # location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; } include enable-php.conf; # ==设置反向代理开始== # client_max_body_size 128M; #允许大型附件 location / { proxy_pass http://127.0.0.1:8443; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } location /notifications/hub { proxy_pass http://127.0.0.1:3012; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location /notifications/hub/negotiate { proxy_pass http://127.0.0.1:8443; } location /admin { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://127.0.0.1:8443; } # ==设置反向代理结束== # location ~ /.well-known { allow all; } location ~ /\. { deny all; } access_log off; } 参考链接:https://host.ppgg.in/deploying-and-using-of-vaultwarden/prepareinghttps://www.iplaysoft.com/bitwarden-self-host.html
TCP/IP 的默认动态端口范围可以使用以下命令 netsh 查看计算机上的动态端口范围：netsh int ipv4 show dynamicport tcp netsh int ipv4 show dynamicport udp 为每个传输 (TCP 或 UDP) 单独设置范围netsh int <ipv4|ipv6> set dynamic <tcp|udp> start=number num=range 起始端口为数字，端口总数为范围。 下面是示例命令：netsh int ipv4 set dynamicport tcp start=10000 num=1000 netsh int ipv4 set dynamicport udp start=10000 num=1000 这些示例命令将动态端口范围设置为从端口 10000 开始，在端口 10999 结束， (1000 个端口) 。 可设置的最小端口范围为 255。 可设置的最小启动端口为 1025。 根据配置的范围) 的最大结束端口 (不能超过 65535。 若要复制 Windows Server 2003 的默认行为，请使用 1025 作为起始端口，然后使用 3976 作为 TCP 和 UDP 的范围。 此使用模式导致开始端口 1025 和结束端口 5000。排查端口耗尽问题从服务器收集 netstat -anob 输出。 netstat 输出将显示单个 PID TIME_WAIT状态的大量条目。正常关闭或会话突然关闭后，经过 4 分钟 (默认) ，进程或应用程序使用的端口将释放回可用池。 在这 4 分钟内，TCP 连接状态将TIME_WAIT状态。 在怀疑端口耗尽的情况下，应用程序或进程将无法释放它已使用的所有端口，并且将保持TIME_WAIT状态。可能还会在同一输出中看到CLOSE_WAIT状态连接;但是，CLOSE_WAIT状态是 TCP 对等方的一端没有更多数据要发送 (FIN 发送) 但能够接收来自另一端的数据的状态。 此状态不一定表示端口耗尽。在管理员模式下打开命令提示符，并运行以下命令。Netsh trace start scenario=netconnection capture=yes tracefile=c:\Server.etl首先查看 netstat 输出。 如果使用 Windows 10 或 Windows Server 2016，则可以运行 命令netstat -anobq，并检查包含最大条目作为 BOUND 的进程 ID。 或者，还可以运行以下 PowerShell 命令来标识进程：Get-NetTCPConnection | Group-Object -Property State, OwningProcess | Select -Property Count, Name, @{Name="ProcessName";Expression={(Get-Process -PID ($_.Name.Split(',')[-1].Trim(' '))).Name}}, Group | Sort Count -Descending
flutter doctor报网络错误 [!] Network resources X A cryptographic error occurred while checking "https://maven.google.com/": Connection terminated during handshake You may be experiencing a man-in-the-middle attack, your network may be compromised, or you may have malware installed on your computer. 解决步骤：打开/path-to-flutter-sdk/packages/flutter_tools/lib/src/http_host_validator.dart文件 修改https://maven.google.com/为 google maven 的国内镜像 如https://maven.aliyun.com/repository/google/ 删除/path-to-flutter-sdk/bin/cache 文件夹 重新执行flutter doctor
Mac Android toolchain - develop for Android devices (the doctor check crashed)
折腾了半天，发现是没有配置真机设备导致没有通过。真机设备配置
一行代码解决selenium爬虫老遇到谷歌人机验证问题
直接上代码x = input("随便输点啥") 哈哈，是的，在百度了半天试了各种解决方法都不行之后，最后还是通过自己随便想的一个方法来简单粗暴地解决问题了。我的任务是给一堆谷歌学术的链接，然后挨个打开连接，把里面的文章题目和url爬下来。使用selenium的chrome引擎的时候，不知道为啥，只要这个链接打开没有人机验证，后续翻页也不会有，而如果打开就有人机验证，我还没点完就循环到下一个连接了。为了解决这个问题，最后想到加入上面那个代码。在执行driver.get(url)之后，加入输入等待，如果这时有人机验证，等我点完，再随便输入点啥，然后开始这个链接的爬取，然后爬完了等下一个连接看是不是会有人机验证。缺点是不能完全自动，适合一些工作量不大的爬虫任务，可以玩着手机随时看两眼。...for url in urls:... driver.get(url) x = input("随便输点啥") ...
本篇总结一下RMAN命令中的DELETE操作，DELETE命令用于删除RMAN备份记录以及相应的物理文件。To delete physical backups and copies as well as do the following:1： Update their repository records in the target control file to status DELETED2： Remove their repository records from the recovery catalog (if you use a catalog)When running RMAN interactively, DELETE displays a list of the files and promptsyou for confirmation before deleting any file in the list. When reading commands froma command file, RMAN will not prompt for confirmation.DELETE removes the physical files from the backup media, deletes the record ofthe backup from the recovery catalog (if RMAN is connected to a recovery catalog),and updates the records of these backups in the control file to status DELETED删除归档日志删除某个Sequence之前（包含该Sequence）的归档日志RMAN>delete archivelog until sequence xxx;RMAN>delete archivelog from sequence xxx until sequence xxx;删除系统时间1天以前的归档日志，不会删除闪回区有效的归档日志(可以指定删除多久日志)RMAN>delete archivelog all completed before 'sysdate-1';force参数表示会删除有效归档日志RMAN>delete force archivelog all completed before 'sysdate-1';删除某个时间段的归档日志，例如删除20天前到2天前的归档日志。RMAN>delete archivelog from time 'sysdate-20' until time 'sysdate-2';RMAN>delete archivelog from time 'sysdate-1';注意：此命令会删除闪回区的有效归档日志。删除所有的归档日志。RMAN>delete noprompt archivelog all; RMAN>delete noprompt archivelog all completed before 'sysdate'; RMAN> delete expired archivelog all;注意：delete expired archivelog all 实际上此命令不会真正删除归档日志，它删除的是那些本来RMAN以为存在但是实际上在磁盘或者磁带上已经被删除了文件的信息，实际删除的只是RMAN资料库或控制文件中的记录；RMAN> delete obsolete;RMAN> delete noprompt obsolete;注意：delete obsolete这个是清理过期备份，它也会删除过期的归档日志。但是特殊情况下，除闪回区有效的归档日志不会删除。上面都是使用RMAN命令删除归档日志，最后一种方式，也是最不推荐的一种方式就是使用命令从系统系统删除归档日志，使用rm删除了备份文件后，需要执行crosscheck archivelog all命令校检归档日志是否失效。删除备份删除过期备份删除过期备份，RMAN会根据备份冗余策略确定备份是否过期。然后删除过期的备份。RMAN> report obsolete;RMAN> delete obsolete;RMAN retention policy will be applied to the commandRMAN retention policy is set to redundancy 1using channel ORA_DISK_1Deleting the following obsolete backups and copies:Type Key Completion Time Filename/HandleBackup Set 1 18-MAY-17 Backup Piece 1 18-MAY-17 /u03/backup/backupsets/ora_df944345823_s1_s1Control File Copy 1 18-MAY-17 /u03/backup/backupsets/controlfile.copyDo you really want to delete the above objects (enter YES or NO)? yesdeleted backup piecebackup piece handle=/u03/backup/backupsets/ora_df944345823_s1_s1 recid=1 stamp=944345824deleted control file copycontrol file copy filename=/u03/backup/backupsets/controlfile.copy recid=1 stamp=944347366Deleted 2 objects删除无效备份RMAN> delete expired backup;关于delete obsolete 与delete expired backup的区别：备份集有两种状态A(Available,RMAN认为该项存在于备份介质上)， X(Expired，备份存在于控制文件或恢复目录中，但是并没有物理存在于备份介质上），一般要运行CROSSCHECK才能检查，关于delete expired与delete obsolete的区别delete obsolete 会删除旧于备份保留策略定义的备份数据同时也更新RMAN资料库以及控制文件。delete expired 删除的是那些本来RMAN以为存在但是实际上在磁盘或者磁带上已经被删除了的信息，删除的只是RMAN资料库中的记录信息，也就是说delete expired是不会删除备份集文件的。英文相关资料资料如下：RMAN> delete obsolete;Removes only files whose status in the repository is EXPIRED. RMAN marks backups and copies as expired when you run a CROSSCHECK command and the files are absent or inaccessible. To determine which files are expired, run a LIST EXPIRED command.RMAN> delete obsolete;Deletes data file backups and copies recorded in the RMAN repository that are obsolete, that is, no longer needed (see Example 2-66). RMAN also deletes obsolete archived redo log files and log backups.RMAN determines which backups and copies of data files are no longer needed, which in turn determines when logs (and backups of logs) are no longer needed. RMAN considers the creation of a data file as a backup when deciding which logs to keep.RMAN first uses the options specified with obsOperandList to determine which files are obsolete. If you do not specify options in obsOperandList, then RMAN uses the options specified in CONFIGURE RETENTION POLICY.Note: DELETE OBSOLETE considers only the backup retention policy and does not use the configured archived log deletion policy to determine which logs are obsolete. In contrast, DELETE ARCHIVELOG ALL considers only the configured archived log deletion policy.Note: If you make a backup with the KEEP UNTIL TIME clause, then this backup becomes obsolete after the specified KEEP time passes and is removed by DELETE OBSOLETE. RMAN does not consider the backup retention policy for archival backups whose KEEP time has expired.删除EXPIRED副本RMAN> delete expired copy;删除特定印象副本RMAN> delete datafile copy 'xxxxxxxxxxx';删除特定备份集RMAN> delete backupset 24;using channel ORA_DISK_1List of Backup PiecesBP Key BS Key Pc# Cp# Status Device Type Piece Name24 24 1 1 AVAILABLE DISK /u01/app/oracle/flash_recovery_area/GSP/backupset/kerryfull_GSP_20170520_25Do you really want to delete the above objects (enter YES or NO)? yesdeleted backup piecebackup piece handle=/u01/app/oracle/flash_recovery_area/GSP/backupset/kerryfull_GSP_20170520_25 RECID=24 STAMP=944472557Deleted 1 objects删除特定备份片RMAN> delete backuppiece '/u01/app/oracle/flash_recovery_area/GSP/backupset/kerryfull_GSP_20170520_26';using channel ORA_DISK_1List of Backup PiecesBP Key BS Key Pc# Cp# Status Device Type Piece Name25 25 1 1 AVAILABLE DISK /u01/app/oracle/flash_recovery_area/GSP/backupset/kerryfull_GSP_20170520_26Do you really want to delete the above objects (enter YES or NO)? yesdeleted backup piecebackup piece handle=/u01/app/oracle/flash_recovery_area/GSP/backupset/kerryfull_GSP_20170520_26 RECID=25 STAMP=944472653Deleted 1 objects删除所有备份集RMAN> delete backup;RMAN> delete noprompt backup;删除所有备份文件副本RMAN> delete datafilecopy all;删除某个备份文件副本RMAN> delete datafilecopy xxx;