当我lks.sh在我的系统中运行文件时,显示权限被拒绝:
./lks.sh bash: ./lks.sh: Permission denied
Run Code Online (Sandbox Code Playgroud)
我该怎么做才能运行这个shell脚本?
这是我的.sh档案:
lokesh = "wait"
if[$lokesh == "wait"]
echo "$lokesh"
else
sudo shutdown -h now
Run Code Online (Sandbox Code Playgroud) 在Python 3.3中,我想匹配下面的模式,但它仍然失败.
????253
Run Code Online (Sandbox Code Playgroud)
我使用下面的正则表达式.
[^\x00-\x47\x58-\x7F]+
Run Code Online (Sandbox Code Playgroud)
除了数字之外,它不排除所有的ascii吗?
你好我们正在使用simple_html_dom.php来获取一些数据,但我无法抓取图像src.
我的HTML是:
<div class="image">
<a href="http://example.com/post/367327/oikogeneiarxhs" title="Some Title">
<img class="lazy" src="http://example.com/storage/photos/myimage.jpg" data-original="http://example.com/storage/photos/myimage.jpg" alt="Some Title" style="display: inline;"></a>
</div>
Run Code Online (Sandbox Code Playgroud)
我的代码是:
$item['title'] = $article->find('.title', 0)->plaintext;
$item['thumb'] = $article->find('.lazy', 0)->src;
$item['details'] = $article->find('p', 0)->plaintext;
Run Code Online (Sandbox Code Playgroud)
我也尝试过:
$item['thumb'] = $article->find('.image img', 0)->src;
Run Code Online (Sandbox Code Playgroud)
和
$item['thumb'] = $article->find('.lazy img', 0)->src;
Run Code Online (Sandbox Code Playgroud)
我的其余代码非常出色.
我有一个使用Visualize.js的网站,该网站具有简单的登录/注销功能。每次登录时,我都会调用该authenicateUser()函数并注销destroySession()。当我尝试登录然后注销然后再次登录时,当我尝试呈现现有报告时,出现此抛出的错误:
HTTP Status 401 - Full authentication is required to access this resource
Run Code Online (Sandbox Code Playgroud)
功能authenicateUser()和destroySession()如下所示:
function authenticateUser () {
var myConfig = {
auth : {
name : "superuser",
password : "superuser"
}
};
visualize.config( myConfig );
}
function destroySession() {
visualize( function ( v ) {
// Logout form JRS and finish the session.
v.logout().done( function () {
} );
} )
}
Run Code Online (Sandbox Code Playgroud)
我想指出的是,当我第一次登录我的帐户时,不会引发此错误,并且可以完美呈现报告。
为什么注销后又再次登录会发生这种情况?
在我的index.html我有一个元标记:
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
Run Code Online (Sandbox Code Playgroud)
当我运行ionic serve(Ionic 版本为 1.6.1)时,出现以下错误:
拒绝加载脚本“ http://localhost:35729/livereload.js?snipver=1 ”,因为它违反了以下内容安全策略指令:“script-src 'self' 'unsafe-inline' 'unsafe-eval' http //本地主机:8100 “
有谁知道如何解决这个问题?
我有一个自动生成的@timestamp,默认格式.我想要的是提取时间戳的小时/月/工作日将它放在另一个字段中.
例如,现在我的时间戳看起来像这样:
@timestamp: "2015-08-26T09:04:42.284Z"
Run Code Online (Sandbox Code Playgroud)
有没有办法获得以下字段?
我希望它根据连接的小时/天制作kibana4直方图,并带有平均指标.如果有不同的方法来实现这一点,请告诉我!
我已经搜索了所有的网络,但我找不到任何解决方案.我将不胜感激任何帮助.
我在终端中运行以下行:
say "hello, this is the computer talking" --interactive
Run Code Online (Sandbox Code Playgroud)
当我运行此命令时,计算机会说出带引号的单词,并在说出单词时突出显示这些单词。我想做的是获取每个口语的时间。例如:
我想知道是否有任何方法可以编写与行的输出进行交互的bash脚本。
我有一台带Sierra的新笔记本电脑.我使用Time Machine从我的旧Mac上带来了我的应用程序,其中大多数工作正常.然而,Macvim消失了.我试着安装它.我尝试通过安装Homebrew和brew安装macvim来重新安装它.安装看起来很成功,但我仍然找不到也没有使用macvim.我想这又是一个问题,应用程序文件不再在/ usr /但在Library /中,但老实说,我有点迷失如何弄清楚这是否是问题以及如何解决它.
你能帮我解决这个问题吗?
我如何安装Homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Run Code Online (Sandbox Code Playgroud)
我是如何安装Macvim的:
brew install macvim
Run Code Online (Sandbox Code Playgroud) 我想为Swiper滑块JavaScript库添加一个新的自定义效果.
默认组队,探索影响是slide,fade,cube,coverflow或flip
但我想,以添加所有活动我的自定义效果.我怎样才能做到这一点?
我对Kibana和ELK(Elasticsearch,Logstash和Kibana)堆栈比较陌生,并且设置非常好,但是遇到了我认为很奇怪的问题,需要一些帮助来了解正在发生的事情。
我正在使用ELK堆栈处理一些Apache日志,但是我有自己的自定义类型设置。因此,我需要明确指定字段类型,而不是让Logstash(或者是Kibana?)猜测数据映射是什么。
通过阅读Logstash文档,似乎很明显,我可以template在output.elasticsearch此处显示的配置块中设置值:
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "logstash-apache"
document_id => "%{[@metadata][fingerprint]}"
manage_template => false
template => "/path/to/logstash/logstash-apache.json"
template_name => "logstash-apache"
template_overwrite => true
}
stdout {
codec => rubydebug
}
}
Run Code Online (Sandbox Code Playgroud)
100%确认我设置了正确的路径。但是由于某种原因,如果我使用它,启动Logstash并使其完成任务,那么我指定的映射logstash-apache.json就不会显示出来。Kibana中的索引logstash-apache也是如此,所以应该正确吗?
所以我现在要做的是像这样将映射模板直接预加载到Elasticsearch中:
curl -ss -XPUT "http://localhost:9200/_template/logstash-apache/" -H 'Content-Type: application/json' -d @"/path/to/logstash/logstash-apache.json";
Run Code Online (Sandbox Code Playgroud)
而且显然效果很好,并且数据得到了正确的映射…但是,执行此类操作相当麻烦。仅将所有内容都来自logstash-apache.conf我设置的文件会更清洁。
那我在做什么错?如何通过该自定义映射模板使用该模板,logstash-apache.conf而不必跳过curl命令的额外循环?