我正在尝试访问内部静态网站.
公司中的每个人都使用VPN来访问我们的Amazon VPC,因此如果您使用VPN,我希望限制对该站点的访问.
所以我在AWS上发现了这个文档来使用VPC端点,这似乎是我正在寻找的.
所以我用下面的政策创建了一个VPC端点.
{
"Statement": [
{
"Action": "*",
"Effect": "Allow",
"Resource": "*",
"Principal": "*"
}
]
}
Run Code Online (Sandbox Code Playgroud)
在我的S3存储桶上,我验证了我可以从常规Web和VPN访问index.html.
然后我添加了以下存储桶策略以限制仅限VPC端点.
{
"Id": "Policy1435893687892",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1435893641285",
"Action": "s3:*",
"Effect": "Allow",
"Resource": "arn:aws:s3:::mybucket/*",
"Principal": {
"AWS": [
"arn:aws:iam::123456789:user/op"
]
}
},
{
"Sid": "Access-to-specific-VPCE-only",
"Action": "s3:*",
"Effect": "Deny",
"Resource": ["arn:aws:s3:::mybucket/*"],
"Condition": {
"StringNotEquals": {
"aws:sourceVpce": "vpce-1234567"
}
},
"Principal": "*"
}
]
}
Run Code Online (Sandbox Code Playgroud)
现在,常规网络获得了403,但当我落后于公司VPN时,我也获得了403.
我错过了什么吗?
我正在尝试使用多个值查询嵌套属性.
这是一个更清晰的例子.
使用嵌套字段创建索引
curl -X DELETE "http://localhost:9200/testing_nested_query/"
curl -X POST "http://localhost:9200/testing_nested_query/" -d '{
"mappings": {
"class": {
properties: {
title: {"type": "string"},
"students": {
"type": "nested",
"properties": {
"name": {"type": "string"}
}
}
}
}
}
}'
Run Code Online (Sandbox Code Playgroud)
添加一些值
curl -XPUT 'http://localhost:9200/testing_nested_query/class/1' -d '{
"title": "class1",
"students": [{"name": "john"},{"name": "jack"},{"name": "jim"}]
}'
curl -XPUT 'http://localhost:9200/testing_nested_query/class/2' -d '{
"title": "class2",
"students": [{"name": "john"},{"name": "chris"},{"name": "alex"}]
}'
Run Code Online (Sandbox Code Playgroud)
查询john所在的所有类(按预期的2次点击)
curl -XGET 'http://localhost:9200/testing_nested_query/class/_search' -d '{
"query": {
"nested": {
"path":"students",
"query": {
"bool": {
"must": …Run Code Online (Sandbox Code Playgroud) 每个人都在谈论NodeJS,所以我会通过创建一个有用的项目来研究它,但我真的不能想到在NodeJS上构建一些有用的东西,以充分展示它的功能.
你们中有谁有个好主意吗?
我想知道是否可以指定验证器的运行顺序.
目前我写了一个自定义验证器来检查它是否是[a-zA-Z0-9] +以确保登录验证我们的规则和远程验证器以确保登录可用但是当前远程验证器在我的自定义之前被激活验证器.我想仅在元素验证我的自定义验证器时才启动远程验证器.
任何线索?
谢谢阅读
我正在尝试在解析用点分隔的字符串时创建一个数组
$string = "foo.bar.baz";
$value = 5
Run Code Online (Sandbox Code Playgroud)
至
$arr['foo']['bar']['baz'] = 5;
Run Code Online (Sandbox Code Playgroud)
我解析了密钥
$keys = explode(".",$string);
Run Code Online (Sandbox Code Playgroud)
我怎么能这样做?
我正在尝试做一个简单的div切换器,在JQuery中有一些效果,但我仍然坚持一些CSS问题.
基本上我有一个容器,固定宽度为650px&n divs在这个容器内,所有容器都有可变的宽度.
因为我正在做左/右效果我有容器溢出:隐藏,以便我可以隐藏div的内容,因为它们位于屏幕的左侧.
我的问题是,只要容器设置为溢出:隐藏屏幕上不显示任何内容.
这是我的代码
<div class="container">
<div class="somechild">variable height</div>
<div class="somechild">variable height</div>
</div>
Run Code Online (Sandbox Code Playgroud)
和CSS
.container{
position: relative;
width: 650px;
overflow: hidden;
}
.somechild{
position: absolute;
display: none;
}
Run Code Online (Sandbox Code Playgroud)
谢谢
我正在尝试使用C++在文件中的特定位置编写条目
基本上我有
ofstream ofs("file.dat", ios::binary | ios::app);
ofs.seekp(220, ios::beg);
ofs.write((char *)&i, sizeof(i));
Run Code Online (Sandbox Code Playgroud)
但无论我做什么,它总是写在文件的末尾.
我想这与iso::app因为根据文档有关
app (append) Set the stream's position indicator to the end of the stream before each output operation
Run Code Online (Sandbox Code Playgroud)
但是如果我使用ate或no,它总是会删除文件的内容.
任何帮助都会很棒:)
我为jQuery编写了一个插件,但现在我的用户要求能够在同一页面上的各种元素上运行我的插件,所以我试图重写一下.
我的活动有问题.
这是什么工作.
$(".jTagLabels label").live('mouseenter',function(){
$("#"+$(this).attr('rel')).css('opacity',1).find("span").show();
$(".jTagDeleteTag").show();
});
Run Code Online (Sandbox Code Playgroud)
现在我正在尝试在特定的上下文中注册此事件,但它不起作用.
$(".jTagLabels label",container).live('mouseenter',function(){
$("#"+$(this).attr('rel')).css('opacity',1).find("span").show();
$(".jTagDeleteTag",container).show();
});
Run Code Online (Sandbox Code Playgroud)
console.log(container)返回正确的dom元素......
可能很重要的是,当我设置事件时,没有创建jTagLabel,这就是我使用live()函数的原因......