我有以下命令让OpenSSL生成私钥和公钥:
openssl genrsa –aes-128-cbc –out priv.pem –passout pass:[privateKeyPass] 2048
Run Code Online (Sandbox Code Playgroud)
和
openssl req –x509 –new –key priv.pem –passin pass:[privateKeyPass] -days 3650 –out cert.cer
Run Code Online (Sandbox Code Playgroud)
但是没有为第一个命令工作我得到以下错误:
usage: genrsa [args] [numbits]
-des encrypt the generated key with DES in cbc mode
-des3 encrypt the generated key with DES in ede cbc mode (168 bit key)
-seed
encrypt PEM output with cbc seed
-aes128, -aes192, -aes256
encrypt PEM output with cbc aes
-camellia128, -camellia192, -camellia256
encrypt PEM output with cbc camellia
-out file output the …Run Code Online (Sandbox Code Playgroud) 我使用certbot-auto来部署Let的加密SSL证书,并使用crontab -e更新证书,如下所示:
* 01 * * 1 /home/myname/certbot-auto --quiet
它有如下错误消息:
Bootstrapping dependencies for RedHat-based OSes...
yum is /usr/bin/yum
To use Certbot, packages from the EPEL repository need to be installed.
Please enable this repository and try running Certbot again.
我无法解决这个错误.请帮我!
我有2个对象,我想合并,但似乎我找不到解决方案
Messages Name Error
-------- ---- -----
{\\APPS-EUAUTO1\C$\Users\xautosqa\AppDa... test 1 True
{[APPS-EUAUTO1] [prep] Setting agent op... test 2 False
TestPlan Script TestCase TestData ErrorCount ErrorText DateTime Elapsed
-------- ------ -------- -------- ---------- --------- -------- -------
D:\XHostMach... D:\XHostMach... rt1 1,\a\"" 1 [#ERROR#][AP... 2014-03-28 1... 0:00:18
D:\XHostMach... D:\XHostMach... rt2 1,\a\"" 0 2014-03-28 1... 0:00:08
Run Code Online (Sandbox Code Playgroud)
我试过了 :
function Join-Object {
Param(
[Parameter(Position=0)]
$First
,
[Parameter(Position=1,ValueFromPipeline=$true)]
$Second
)
BEGIN {
[string[]] $p1 = $First | gm -type Properties | select -expand Name
}
Process …Run Code Online (Sandbox Code Playgroud) 当我使用NFSv3时,我可以使用showmount命令列出卷:
NAME showmount - 显示NFS服务器的安装信息
大纲/ usr/sbin/showmount [-adehv] [--all] [--directories] [--exports] [ - help] [--version] [host]
说明showmount在远程主机上查询mount守护程序,以获取有关该计算机上NFS服务器状态的信息.如果没有选项,showmount将列出从该主机挂载的客户端集.showmount的输出设计为看起来好像是通过''sort -u''处理的.
但是,似乎不会列出NFSv4卷.如何获取从远程主机导出的NFSv4卷列表?
我正在使用Mail gem发送电子邮件.这是我的代码:
require 'mail'
require 'net/smtp'
Mail.defaults do
delivery_method :smtp, { :address => "smtp.arrakis.es",
:port => 587,
:domain => 'webmail.arrakis.com',
:user_name => 'myname@domain.com',
:password => 'pass',
:authentication => 'plain',
:enable_starttls_auto => true }
end
Mail::ContentTypeField.new("text/html") #this doesnt work
msgstr= File.read('text2.txt')
list.each do |entity|
begin
Mail.deliver do
from 'myname@domain.com'
to "#{entity}"
subject 'a good subject'
body msgstr
end
rescue => e
end
end
end
Run Code Online (Sandbox Code Playgroud)
我不知道如何设置内容类型,以便我可以将我的电子邮件格式化为html.虽然我实际上只是希望能够像我的电子邮件客户端那样定义粗体文本:粗体文本.有没有人知道我需要指定哪种内容类型才能实现这一目标,以及如何使用邮件实现它?
只需注意,上面的代码适用于发送纯文本电子邮件.
我试图在CentOS 6的PHP 5.3.3上安装Soap模块(来自webtatic PHP 5.6)。当我运行yum命令yum install php56w-soap进行安装时,我得到以下消息:
错误:用php-共5.3.3-49.el6.x86_64 php56w常见冲突,
你可以尝试使用--skip-破要解决这个问题
,您可以尝试运行:RPM -Va --nofiles --nodigest
我有什么解决方案?我应该只运行--skip-broken,还有其他选择吗?
我在VPS上运行php 5.6.3和CentOS 6
自 1995 年以来,我们使用了一种更新机制
虽然我们知道 terraform 已经开始在没有任何这些功能的情况下勇敢地重新发明那个轮子,但我们希望完全禁用它。我们当前的套件仅包含一个插件:
terraform-0.13.0-1.el7.harbottle.x86_64
golang-github-terraform-provider-vsphere-1.13.0-0.1.x86_64
Run Code Online (Sandbox Code Playgroud)
目标是
我将非常感谢为此提供好的建议。是否有我忽略的设置,或者我们可以通过告诉它看起来某个地方是空的来伪造它吗?是否有 -stay-in-your-lane 开关?
澄清:
/usr/bin/terraform-provider-vsphere而不是其他任何东西。这对于所有以前的化身都非常有效,并且可能只是在 v13 中才开始起作用。更新:这些事情失败了:
terraform init -plugin-dir=/dev/shmterraform init -get-plugins=falseterraform init -get=falseterraform::required_providers::vsphere::source=""echo "disable_checkpoint = true" > ~/.terraformrc$ terraform init -get-plugins=false
Initializing the backend...
Initializing provider plugins...
- Finding latest version of -/vsphere...
- Finding latest version of hashicorp/vsphere...
Run Code Online (Sandbox Code Playgroud)
更新:我还是有点不对劲:
rpm -qlp golang-github-terraform-provider-vsphere
/usr/share/terraform/plugins/registry.terraform.io/hashicorp/vsphere/1.14.0/linux_amd64/terraform-provider-vsphere
Run Code Online (Sandbox Code Playgroud)
我觉得我真的很亲近。/usr/share/ 在 XDG 默认搜索路径中,它似乎确实找到了该位置,但它似乎首先/根本检查了注册表,这出乎意料。
Initializing provider plugins...
- Finding latest …Run Code Online (Sandbox Code Playgroud) 我正在尝试对资源资源“aws_servicecatalog_provisioned_product”中的参数应用生命周期ignore_changes规则,如下所示。
\nresource "aws_servicecatalog_provisioned_product" "example" {\n name = "example"\n product_name = "Example product"\n provisioning_artifact_name = "Example version"\n\n provisioning_parameters {\n key = "foo"\n value = "bar"\n }\n\n provisioning_parameters {\n key = "key2"\n value = lookup(var.parameter_group, "key2", "test2")\n }\n\n provisioning_parameters {\n key = "key3"\n value = "test3"\n }\n\n tags = {\n foo = "bar"\n }\n\n lifecycle {\n ignore_changes = [\n tags["foo"],\n aws_servicecatalog_provisioned_product.provisioning_parameters.example["key2"]\n ]\n }\n \n}\nRun Code Online (Sandbox Code Playgroud)\nvariable parameter_group {\n description = "Parameters map required for modules. \n type = map(any)\n default = …Run Code Online (Sandbox Code Playgroud) 仍然无法在 Terraform v0.12.6 中使用变量提供程序吗?在 *.tfvars 中,我列出了变量 供应商
supplier = ["azurerm.core-prod","azurerm.core-nonprod"]
Run Code Online (Sandbox Code Playgroud)
和 provider.tf 中定义的提供者:
provider "azurerm" {
...
alias = "core-prod"
}
provider "azurerm" {
...
alias = "core-nonprod"
Run Code Online (Sandbox Code Playgroud)
然后我想在 *.tf 中引用它。下面的例子是“数据”,但同样适用于“资源”
data "azurerm_public_ip" "pip" {
count = "${var.count}"
....
provider = "${var.supplier[count.index]}"
}
Run Code Online (Sandbox Code Playgroud)
什么是解决方法?错误:无效的提供者配置引用,显示提供者参数需要提供者类型名称,可选后跟一个句点,然后是配置别名。
请考虑我的食谱末尾的这段代码deploy_to_tomcat:
unless Chef::Config[:solo]
chat_message "Deployed #{artifact_name} `#{Time.new.strftime("%Y-%m-%d %H:%M")}`"
end
Run Code Online (Sandbox Code Playgroud)
它发布一条消息进行聊天:部署了 my-web-app 2016-11-03 12:31
但是,我注意到时间戳有点Time.new过时 - 它似乎是编译配方时的时间戳,而不是几分钟后资源覆盖并运行时的时间戳。
所以我尝试了这个,但它不起作用(timeNow 仍然是undefined发布消息聊天时的时间)
timeNow = "undefined"
ruby_block "set-time-now" do
block do
timeNow = Time.new.strftime("%Y-%m-%d %H:%M:%S")
end
end
unless Chef::Config[:solo]
chat_message "Deployed #{artifact_name} `#{timeNow}`"
end
Run Code Online (Sandbox Code Playgroud)
有没有更简单的方法让我的时间戳反映实际时间(而不是食谱开始时)?
我在将使用 gitlab-runner 构建的映像推送到 gitlab 存储库时遇到问题。
我的 gitlab-ci.yml:
image: docker:latest
services:
- docker:dind
stages:
- build
- release
variables:
TEST_IMAGE: registry.gitlab.com/myhost/haproxy:$CI_COMMIT_REF_NAME
RELEASE_IMAGE: registry.gitlab.com/myhost/haproxy:latest
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN gitlab.com
build:
stage: build
script:
- docker build --pull -t $TEST_IMAGE .
- docker push $TEST_IMAGE
release:
stage: release
script:
- docker pull $TEST_IMAGE
- docker tag $TEST_IMAGE $RELEASE_IMAGE
- docker push $RELEASE_IMAGE
only:
- master
Run Code Online (Sandbox Code Playgroud)
docker 登录有效 - 我得到“登录成功” - 但当涉及到推送操作时,我得到:
$ docker push $TEST_IMAGE
The push refers to …Run Code Online (Sandbox Code Playgroud) 在Python中,我使用knife来启动服务器。
例如
knife ec2 server create -r "role[nginx_server]" --region ap-southeast-1 -Z ap-southeast-1a -I ami-ae1a5dfc --flavor t1.micro -G nginx -x ubuntu -S sg_development -i /home/ubuntu/.ec2/sg_development.pem -N webserver1
Run Code Online (Sandbox Code Playgroud)
然后,我将使用 Chef-server api 检查引导程序何时完成,以便我可以使用 boto 和其他工具来配置新创建的服务器。伪代码将如下所示:
cmd = """knife ec2 server create -r "role[nginx_server]...."""
os.system(cmd)
boot = False
while boot==False:
chefTrigger = getStatusFromChefApi()
if chefTrigger==True:
boot=True
continue with code for further proccessing
Run Code Online (Sandbox Code Playgroud)
我的问题是:厨师服务器中指示厨师何时完全处理节点的触发器是什么?请注意,我使用 -N 来命名服务器并将查询其属性,但我要查找什么?有布尔吗?一个状态?
谢谢
terraform ×3
centos ×2
chef-infra ×2
ruby ×2
centos7 ×1
certbot ×1
chatops ×1
convergence ×1
cron ×1
date ×1
email ×1
gitlab-ci ×1
hcl ×1
html ×1
lets-encrypt ×1
linux ×1
mime-types ×1
mount ×1
nfs ×1
openssl ×1
out-of-band ×1
php ×1
php-5.6 ×1
powershell ×1
private-key ×1
public-key ×1
python ×1
rsa ×1
ssl ×1