AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-1002290

soldier's questions

Martin Hope
soldier
Asked: 2020-01-06 21:49:26 +0800 CST

用于计算域过期剩余天数的 Bash 脚本

  • 2

您好,我的任务是查找域过期的剩余天数。输出应该是剩余天数(整数)所以我尝试过这种方式我可以将域作为参数传递

例如:- 我的域 - www.xplosa.com

脚本文件:- ./domain-exp.sh

执行方法:- ./domain-exp.sh www.xplosa.com

#!/bin/bash

target=$1

# Get the expiration date
expdate="$(whois $1 | egrep -i 'Registrar Registration Expiration Date:' | head -1)"

# Turn it into seconds (easier to compute with)
expdate=("$expdate" +%s)

# Get the current date in seconds
curdate=$(date +%s)

# Print the difference in days
echo  ($expdate - $curdate) / 86400 

这不是我期望的输出,请帮助我提前解决这个问题。

scripts command-line bash 18.04
  • 1 个回答
  • 1330 Views
Martin Hope
soldier
Asked: 2020-01-02 22:32:38 +0800 CST

Nginx SSL 配置设置

  • 0

我在安装了LEMP的Ubuntu 18.04上使用Nginx,最近我更新了我的 SSL 证书,因此我可以看到一些名为 .

SSL 证书相关文件最后 2 个文件带有 .zip

private.key                  (same as old)

public.crt                   (renewed)

STAR_sellist_com.ca-bundle   (renewed)

STAR_sellist_com.crt         (renewed)

我之前的nginx配置

server {
    listen     443 ssl;

    server_name dev.sellist.com;


    ssl on;
    ssl_certificate     /etc/ssl/nginx/public.crt;
    ssl_certificate_key /etc/ssl/nginx/private.key;

这在我的证书到期之前有效。现在我可以看到这个错误

AWS HTTP error: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

我知道没有在正确的地方设置中间认证,我该怎么做?请告诉我

configuration server ssl nginx certificates
  • 3 个回答
  • 679 Views
Martin Hope
soldier
Asked: 2019-12-26 23:53:35 +0800 CST

用于计算网站中 SSL 证书到期剩余天数的 Bash 脚本

  • 2

我有一个名为的网站xplosa.com,它有一个有效的 SSL 证书,我通过 bash 脚本应该能够计算剩余的到期天数。我知道有很多替代方法可以完成这项工作,但我喜欢使用 Ubuntu bash 。顺便说一句,我正在使用Ubuntu 18.04

这是我的示例逻辑

#!/bin/bash

get_the_cert_expiry_date() {
    # command to retrieve the expiry date
}

currentDate="$(date +%Y-%m-%d)"
website="xplosa.com"
certExpDate="$(get_the_cert_expiry_date)"
count=$((currentDate - certExpDate))

echo "remaining days for expiry: ${count}"
  • 这是一个正确的逻辑吗?
  • 如何实施get_the_cert_expiry_date
scripts command-line bash ssl
  • 2 个回答
  • 5403 Views
Martin Hope
soldier
Asked: 2019-12-12 00:00:42 +0800 CST

xxxx-client 和 xxxx-server 软件包有什么区别?

  • 8

当我要安装软件包或软件时,我可以看到客户端 | 服务器版本。实际上是什么意思?例如:

apt-get install xxxx-client
apt-get install xxxx-server

这些有什么区别?当我们需要安装应用程序或包时,我们如何分类?比方说:

如果我想安装 nginx,我只需输入 安装apt-get install nginx,所以我们没有任何混淆。

当我在寻找 MySQL 时,如何选择我应该安装哪个版本?我对客户端和服务器感到很困惑。

package-management server apt mysql client
  • 4 个回答
  • 2185 Views
Martin Hope
soldier
Asked: 2019-11-18 21:19:44 +0800 CST

apt update docker.com Release 404 未找到

  • 9

我最近尝试使用这种方法安装 docker

curl -fsSL get.docker.com -o get-docker.sh
sh get-docker.sh

但它对我不起作用,可能是损坏的包或其他东西,之后我使用 apt 方法安装了 docker && docker compose,效果很好,但是当我尝试更新或升级我的系统时,我可以看到以下消息,我实际上并不知道是什么是问题吗,请给我一个解决方案,谢谢。

$ sudo apt-get update

Hit:1 http://ppa.launchpad.net/daniruiz/flat-remix/ubuntu bionic InRelease
Hit:2 https://dl.winehq.org/wine-builds/ubuntu bionic InRelease                                    
Hit:3 http://security.ubuntu.com/ubuntu bionic-security InRelease                                  
Ign:4 http://dl.google.com/linux/chrome/deb stable InRelease                                       
Hit:5 http://dl.google.com/linux/chrome/deb stable Release                                         
Hit:6 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease                                  
Hit:7 http://lk.archive.ubuntu.com/ubuntu bionic InRelease                                         
Ign:9 https://download.docker.com/linux/debian bionic InRelease                                    
Hit:10 http://lk.archive.ubuntu.com/ubuntu bionic-updates InRelease                                
Err:11 https://download.docker.com/linux/debian bionic Release                                     
  404  Not Found [IP: 13.35.8.98 443]
Hit:13 http://lk.archive.ubuntu.com/ubuntu bionic-backports InRelease                              
Hit:12 https://packagecloud.io/slacktechnologies/slack/debian jessie InRelease
Reading package lists... Done                                
E: The repository 'https://download.docker.com/linux/debian bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.


$ sudo apt-get upgrade

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  libxml2 libxml2:i386
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

我怎样才能从我的源列表中删除,因为我不再需要它了

updates upgrade apt 18.04
  • 3 个回答
  • 29137 Views
Martin Hope
soldier
Asked: 2019-10-04 19:06:18 +0800 CST

-y 在 apt-get upgrade 命令中是什么意思,我在哪里可以找到命令标志的参考?[复制]

  • -2
这个问题在这里已经有了答案:
apt-get -y install 命令中的 -y 是什么意思? (1 个回答)
2年前关闭。

我见过这样的命令:

sudo apt-get upgrade -y 

我想知道该标志的含义-y以及一般 Linux 命令行标志的参考。

command-line apt documentation
  • 1 个回答
  • 1532 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve