小编ken*_*orb的帖子

如何在mailgun API中使用变量?

如何在 mailgun 中使用变量?

在测试电子邮件(test@example.com)中,我添加了以下变量

{"age": 20}
Run Code Online (Sandbox Code Playgroud)

但它并不像创建邮件时使用的那样。

这是发送邮件时的代码。

$mailformat = "CODE HTML :D";
$result = $mgClient->sendMessage($domain, array(
    'from'    => 'Example <example@example.com>',
    'to'      => 'test@example.com',
    'subject' => '%recipient_fname%, testing mail',
    'html'    => $mailformat
));
Run Code Online (Sandbox Code Playgroud)

php api mailgun

3
推荐指数
1
解决办法
5628
查看次数

通过SSH连接两台本地linux计算机

我想知道如何通过SSH连接两台Linux计算机(Ubuntu和OpenSuse)。当我尝试在Suse上运行此命令时:

ssh 192.168.1.37
Run Code Online (Sandbox Code Playgroud)

我得到错误:

ssh:连接到主机192.168.1.37端口22:连接被拒绝。

当我尝试使用相同的命令和Suse的IP从Ubuntu PC连接时,出现“连接超时”错误。

任何帮助,将不胜感激。

linux ssh

3
推荐指数
2
解决办法
9923
查看次数

如何使用unixodbc和freetds在Mac上安装RODBC?

经过相当广泛的搜索后,我注意到很多人都很难找到一个回答这个问题的从头到尾的指南.(至少有一个问题指出存在一个解决方案,但是提出的解决方案并没有解决这样一个事实,即默认情况下,RODBC尝试针对iODBC进行编译,而iostBC并未包含在Yosemite中.)我刚刚完成了这个过程,所以我以为我会在这里记录它,希望它会使其他人受益.我正在连接到SQL Server数据库.

macos unixodbc rodbc osx-yosemite

3
推荐指数
1
解决办法
2728
查看次数

gdb无法在macOS上读取核心转储

我已经在OSX 10.10.5上从Homebrew 安装了gdb公式,以便向weechat的开发人员发送回溯跟踪记录(因为weechat每次安装Homebrew时都会崩溃/exit)。

并在尝试读取核心文件时遇到了这个问题:

gdb /usr/local/bin/weechat /cores/core.70087
GNU gdb (GDB) 7.10
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin14.5.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please …
Run Code Online (Sandbox Code Playgroud)

gdb core lldb

3
推荐指数
1
解决办法
2021
查看次数

如何修复格式错误的 POM:无法识别的标签:“groupId”?

我有一个学校项目,我要更改 CQL(Caasandra 查询语言),完成后我需要创建我的特定 Cassandra Java 驱动程序,问题是我无法在 Eclipse 上运行驱动程序的源代码尝试了很多方法,我在互联网上搜索,但每次遇到此类问题时都不起作用:

[DEBUG] Looking up lifecyle mappings for packaging bundle from ClassRealm[project>com.datastax.cassandra:cassandra-driver-core:2.1.9-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]
[ERROR] The build could not read 1 project -> [Help 1] org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[ERROR] Malformed POM I:\_Cassandra\java-driver-2.1\driver-core\pom.xml: Unrecognised tag: 'groupId' (position: START_TAG seen ...<dependencies>\n  <groupId>... @36:12)  @ I:\_Cassandra\java-driver-2.1\driver-core\pom.xml, line 36, column 12
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:363)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:636)
Run Code Online (Sandbox Code Playgroud)

java maven-2 cql cassandra pom.xml

3
推荐指数
1
解决办法
3万
查看次数

如何使用boto和python3在CloudFront中使对象无效?

我在本页底部找到了与我所需的代码相似的代码。

#!/usr/bin/env python3
from boto.cloudfront import CloudFrontConnection

aws_access_key         = 'BJDJLSMQRWDSC4UPLS6S' # Not real
aws_secret_access_key  = '8xRnWKxRR/93TeQv3pwzMNR222nwe5kjhYweCAij' # Not real
aws_cf_distribution_id = 'foobar35'

objects = [ '/index.html' ]
conn = CloudFrontConnection(aws_access_key, aws_secret_access_key)
print(conn.create_invalidation_request(aws_cf_distribution_id, objects))
Run Code Online (Sandbox Code Playgroud)

运行它时,出现以下错误:

$ ./invalidate.py
Traceback (most recent call last):
  File "./invalidate.py", line 14, in <module>
    print(conn.create_invalidation_request(aws_cf_distribution_id, objects))
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/boto/cloudfront/__init__.py", line 263, in create_invalidation_request
    raise CloudFrontServerError(response.status, response.reason, body)
boto.cloudfront.exception.CloudFrontServerError: CloudFrontServerError: 404 Not Found
<?xml version="1.0"?>
<ErrorResponse xmlns="http://cloudfront.amazonaws.com/doc/2010-11-01/">
  <Error>
    <Type>Sender</Type>
    <Code>NoSuchDistribution</Code>
    <Message>The specified distribution does not exist.</Message>
  </Error> …
Run Code Online (Sandbox Code Playgroud)

amazon-s3 python-3.x boto3

3
推荐指数
2
解决办法
2392
查看次数

如何使用XPath选择链接的内部文本?

Scrapy用来抓取数据。

JS浏览器的控制台上,我键入$x('//div[@class="summary"]//div[contains(@class, "tags")]')以获取所需的内容,但需要过滤数据。

下图是$x('//div[@class="summary"]//div[contains(@class, "tags")]')命令结果。

JS控制台结果

我应该如何编写xpath命令以获取绿色框中的数据?我尝试过$x('//div[@class="summary"]//div[contains(@class, "tags")]//a[contains(@class, "post-tag")]'),但这不是我想要的吗?

谢谢!

javascript css xpath href scrapy

3
推荐指数
1
解决办法
551
查看次数

如何执行shell作为后构建操作?

我正在使用Jenkins CI,我想添加一些后期构建操作.

我试图在Jenkins帖子中的post build之后遵循Execute Shell Script中的建议,但我找不到应该允许我执行shell命令的选项(Post build task).我可以选择Execute shell,但仅适用于Build.

以下是我的所有选择:

Jenkins  - 添加构建后操作

成绩单:

添加构建后操作:

  • 汇总下游测试结果
  • 存档工件
  • 建立其他项目
  • 控制台输出(构建日志)解析
  • GitHub PR:添加标签
  • GitHub PR:关闭PR
  • GitHub PR:发表评论
  • GitHub PR:删除标签
  • GitHub PR:设置PR状态
  • 发布HTML报告
  • 发布JUnit测试结果报告
  • 发布Javadoc
  • 记录文件的指纹以跟踪使用情况
  • 使用其他项目的发布者
  • Git Publisher
  • 建立其他项目(手动步骤)
  • 电子邮件通知
  • 可编辑的电子邮件通知
  • 在GitHub提交上设置构建状态[不建议使用]
  • 设置GitHub commit [universal]的状态
  • 触发参数化其他项目的构建
  • 构建完成后删除工作区

我错过了什么?


基本上我需要这个来在销售错误的情况下销毁我的VM实例(例如vagrant destroy -f).

我正在使用Jenkins ver.2.7.1.

jenkins jenkins-plugins

3
推荐指数
1
解决办法
1万
查看次数

AH00072:make_sock:无法绑定到地址[::]:80(13)权限被拒绝

升级到macOS Sierra我的apache后无法启动.

apache的地方error_log:

AH00112: Warning: DocumentRoot [/usr/docs/dummy-host.example.com] does not exist

AH00112: Warning: DocumentRoot [/usr/docs/dummy-host2.example.com] does not exist

AH00557: httpd: apr_sockaddr_info_get() failed for username.local

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message (13)Permission denied:

AH00072: make_sock: could not bind to address [::]:80 (13)Permission denied: 

AH00072: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down*
Run Code Online (Sandbox Code Playgroud)

我已经按照这些说明没有成功:http://digitalshore.io/local-web-development-environment-apache-macos-sierra-10-12/

apache macos-sierra

3
推荐指数
1
解决办法
2万
查看次数

如何检查网络流量并获取资源请求的URL?

我想监视页面的网络并获取JavaScript网络事件的所有URL,类似于PhantomJS page.onResourceRequested正在做的事情,但是我不知道如何使用Google Chrome的Puppeteer做到这一点。

我一直在研究Google Chrome的puppeteer,但是我不知道如何使它工作,因为它的输出看起来像这样:

Page {
    domain: null,
    _events: {
        request: [Function]
    },
    _eventsCount: 1,
    _maxListeners: undefined,
    _client: Session {
        domain: null,
        _events: {
            'Page.frameAttached': [Function],
            'Page.frameNavigated': [Function],
            'Page.frameDetached': [Function],
            'Runtime.executionContextCreated': [Function],
            'Network.requestWillBeSent': [Function: bound _onRequestWillBeSent],
            'Network.requestIntercepted': [Function: bound _onRequestIntercepted],
            'Network.responseReceived': [Function: bound _onResponseReceived],
            'Network.loadingFinished': [Function: bound _onLoadingFinished],
            'Network.loadingFailed': [Function: bound _onLoadingFailed],
            'Page.loadEventFired': [Function],
            'Runtime.consoleAPICalled': [Function],
            'Page.javascriptDialogOpening': [Function],
            'Runtime.exceptionThrown': [Function],
            'Security.certificateError': [Function],
            'Inspector.targetCrashed': [Function]
        },
        _eventsCount: 15,
        _maxListeners: undefined,
        _lastId: 14,
        _callbacks: Map {},
        _connection: Connection …
Run Code Online (Sandbox Code Playgroud)

network-monitoring google-chrome node.js puppeteer

3
推荐指数
1
解决办法
2406
查看次数