我正在运行Centos6.4盒子.
vagrant up
在Vagrant文件中没有同步文件夹配置运行就可以了.我可以通过主机访问http://localhost:8080
,它显示Apache页面.我可以在/var/www/html
文件夹中创建index.html ,它也显示正常.
但是,在Vagrant文件中添加以下行后,访问该页面会显示403 Forbidden You don't have permission to access / on this server.
错误:
config.vm.synced_folder "./source", "/var/www/html", :extra=>"dmode=777,fmode=777"
Run Code Online (Sandbox Code Playgroud)
进入虚拟机我看到如下权限设置/var/www
:
drwxr-xr-x. 6 root root 4.0K Jul 20 23:15 .
drwxr-xr-x. 18 root root 4.0K Jul 20 23:15 ..
drwxr-xr-x. 2 root root 4.0K May 14 06:12 cgi-bin
drwxr-xr-x. 3 root root 4.0K Jul 20 23:15 error
drwxrwxrwx. 1 vagrant vagrant 102 Jul 21 23:14 html
drwxr-xr-x. 3 root root 4.0K …
Run Code Online (Sandbox Code Playgroud) 此查询grahiql
有效:
mutation {
addSkill(id:"5",name:"Javascript",level:1,type:"frontend") {
status
id
name
level
type
}
}
Run Code Online (Sandbox Code Playgroud)
用post相当于什么axios
?
我已经尝试过了,但是一直收到400
请求响应。
{“ errors”:[{“ message”:“语法错误:未终止的字符串。”,“ locations”:[{“ line”:3,“ column”:82}]}]}}
这是我尝试的:
axios
.post(config.apiendpoint, {
query: `
mutation addSkill($id:String!, $name:String!, $level:Float!, $type:String!) {
mutation addSkill(id:$id, name:$name", level:$level, type:$type) {
status
id
name
level
type
}
}
`,
variables: {
id: String(id),
name: this.form.name,
level: this.form.level,
type: this.form.type,
},
})
.then(res => console.log(res))
.catch(err => console.log(err))
Run Code Online (Sandbox Code Playgroud)
确保中的值variables
正确type
,并且也不为空。
与此类似:使用 Python 从 KML BatchGeo 文件中提取坐标
但我想知道如何检查数据对象,以及如何对其进行迭代,并解析所有Placemark
以获取coordinates
.
下面是 KML 的样子,有多个<Placemark>
标签。
示例 KML 数据:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/kml/2.2 http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd http://www.google.com/kml/ext/2.2 http://code.google.com/apis/kml/schema/kml22gx.xsd">
<Document id="...">
<name>...</name>
<Snippet></Snippet>
<Folder id="...">
<name>...</name>
<Snippet></Snippet>
<Placemark id="...">
<name>....</name>
<Snippet></Snippet>
<description>...</description>
<styleUrl>....</styleUrl>
<Point>
<altitudeMode>...</altitudeMode>
<coordinates> 103.xxx,1.xxx,0</coordinates>
</Point>
</Placemark>
<Placemark id="...">
...
</Placemark>
</Folder>
<Style id="...">
<IconStyle>
<Icon><href>...</href></Icon>
<scale>0.250000</scale>
</IconStyle>
<LabelStyle>
<color>00000000</color>
<scale>0.000000</scale>
</LabelStyle>
<PolyStyle>
<color>ff000000</color>
<outline>0</outline>
</PolyStyle>
</Style>
</Document>
</kml>
Run Code Online (Sandbox Code Playgroud)
这就是我所拥有的,extract.py:
from pykml import …
Run Code Online (Sandbox Code Playgroud) 哪个是我真正的IP?ipconfig/all中显示的那个或者(whatismyip.org)中显示的那个(我简称为WISMIP)?
如果我没错,那么WISMIP中的那个是来自我ISP的代理的IP?
这是否意味着如果站点阻止此IP,它会阻止通过此代理路由的每个人?
最后,当我查看ipconfig/all时,我应该查看IPv4地址?
我的托管服务阻止了我的IP,我应该提供哪个IP,以便他们可以将我从阻止列表中删除?
我正在尝试使用此处的参考来获取设备中可用的相册列表:
到目前为止,我在viewDidLoad中有这个:
// Get albums
NSMutableArray *groups = [NSMutableArray new];
ALAssetsLibrary *library = [ALAssetsLibrary new];
ALAssetsLibraryGroupsEnumerationResultsBlock listGroupBlock = ^(ALAssetsGroup *group, BOOL *stop) {
if (group) {
[groups addObject:group];
}
};
NSUInteger groupTypes = ALAssetsGroupAlbum;
[library enumerateGroupsWithTypes:groupTypes usingBlock:listGroupBlock failureBlock:nil];
NSLog(@"%@", groups);
Run Code Online (Sandbox Code Playgroud)
但是,组数组中没有添加任何内容.我期待看到NSLog中的2个项目.
我正在为我的应用创建一个S3插件.在app/Plugin/S3/Controller/Component/S3Component.php
我有这些:
<?php
App::import('Vendor', 'aws/aws-autoloader');
use Aws\S3\S3Client;
class S3Component extends Component {
public function loadS3 () {
$s3 = S3Client::factory(array(
'key' => '',
'secret' => ''
));
return $s3;
}
}
Run Code Online (Sandbox Code Playgroud)
在我的应用程序的控制器中,我称之为使用 $s3 = $this->S3->loadS3();
它抛出错误 Error: Class 'Aws\S3\S3Client' not found
我尝试将行添加App::uses('Vendor', 'aws/Aws/S3/S3Client');
到组件类中,然后删除use Aws\S3\S3Client;
.表明Error: Class 'S3Client' not found
AWS SDK位于文件夹中 app/Plugin/S3/Vendor/aws
我正在加载S3对象,参考:http://docs.aws.amazon.com/aws-sdk-php/guide/latest/quick-start.html#factory-method
解:
这是我的组件现在在@akirk的帮助下的样子.
<?php
ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'). PATH_SEPARATOR . ROOT .DS . 'app/Plugin/S3/Vendor/aws'); …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用以下内容创建 Docker (LAMP) 映像
Dockerfile:
FROM ubuntu:latest
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
apache2 \
mysql-server \
php7.0 \
php7.0-bcmath \
php7.0-mcrypt
COPY start-script.sh /root/
RUN chmod +x /root/start-script.sh && /root/start-script.sh
Run Code Online (Sandbox Code Playgroud)
启动脚本.sh:
#!/bin/bash
service mysql start
a2enmod rewrite
service apache2 start
Run Code Online (Sandbox Code Playgroud)
我用以下方法构建它:
docker build -t resting/ubuntu .
Run Code Online (Sandbox Code Playgroud)
然后运行它:
docker run -it -p 8000:80 -p 5000:3306 -v $(pwd)/html:/var/www/html resting/ubuntu bash
Run Code Online (Sandbox Code Playgroud)
问题是,MYSQL
和Apache2
服务没有启动。
如果我/root/start-script.sh
在容器中手动运行,端口 80 可以很好地映射到端口 8000,但我无法MYSQL
使用127.0.0.1:5000
.
当我使用映像启动容器并将 …
我已经创建了一个测试分支。构建一个功能有很多微小的承诺。最后,我要进行最后完成的更改,并将其放入master分支中。
master分支不应包含测试分支的历史记录。
测试分支最终将被删除。
实现此目标的最佳方法是什么?
生成补丁并将其应用于master是最好的方法吗?
如果是这样,我如何生成/应用补丁?
我的应用程序允许注册用户登录。
我当前登录用户的实现是sessionid
在服务器的数据库和移动设备本身上注册。如果两者匹配,则他们通过身份验证并登录。
然而,当用户拥有多个设备(iPhone、Android、平板电脑等)时,这会带来问题。因为除非他们从之前的会话中注销,否则服务器的数据库将保留他们当前的会话并阻止他们从其他设备登录。
希望有人可以分享他们的解决方案来处理多设备登录。
使用 Capistrano 时,我注意到当使用 来创建符号链接时current -> /var/www/myapp
,编译需要很长时间。事实上,我等了大约 5 到 10 分钟并取消了该过程。
它挂在这部分:
00:09 deploy:assets:precompile
01 $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
01 yarn install v0.27.5
01 [1/4] Resolving packages...
01 [2/4] Fetching packages...
01 warning fsevents@1.1.2: The platform "linux" is incompatible with this module.
01 info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
01 [3/4] Linking dependencies...
01 [4/4] Building fresh packages...
Run Code Online (Sandbox Code Playgroud)
如果我删除current
符号链接,它仍然需要一段时间,但它会完成。
00:09 deploy:assets:precompile
01 $HOME/.rbenv/bin/rbenv exec bundle exec rake …
Run Code Online (Sandbox Code Playgroud)