我对速度非常满意,aws cli但似乎无法找到一种方法来找出文件/文件夹上的权限。
例如我这样做:
$ curl http://my.s3.amazonaws.com/deploy/tool1/license.key -o ./license.key
$ cat license.key | sed 's/></>\n</g'
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>E4D50F0606FFFD48</RequestId>
<HostId>+xxxyyyaaaa=</HostId>
$
$
Run Code Online (Sandbox Code Playgroud)
现在curl http://my.s3.amazonaws.com/deploy/tool1/tool.sh -o ./tool.sh工作正常,我可以得到tool.sh. 所以我怀疑权限license.key是问题所在。
试图在新的python安装上安装pip.我遇到了代理错误.看起来像是一个错误get-pip或urllib3??
问题是我必须经历如此处所述的设置CNTLM的痛苦还是有快捷方式?
get-pip.py文档说使用--proxy="[user:passwd@]proxy.server:port"选项来指定代理和相关的身份验证.但似乎pip传递了整个事物,因为它将urllib3"myusr"解释为url方案,因为':'我想(?).
C:\ProgFiles\Python27>get-pip.py --proxy myusr:mypswd@111.222.333.444:80
Downloading/unpacking pip
Cleaning up...
Exception:
Traceback (most recent call last):
File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\commands\install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\req.py", line 1177, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\index.py", line 194, in find_requirement
page = self._get_page(main_index_url, req)
File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\index.py", line 568, in _get_page
session=self.session,
File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\index.py", line 670, in get_page
resp …Run Code Online (Sandbox Code Playgroud) 我想知道当您拥有包含子资源列表的资源时哪种是最佳实践。例如,您有资源作者,其中包含姓名、ID、生日和书籍列表等信息。此图书列表仅与作者相关。所以,你有以下场景:
解决方案1
我搜索了哪个是正确的设计,发现了多种方法。我想知道是否有一个标准的设计方法。我觉得书上的设计说有以下几个方法:
POST /authors/{authorId}/book/PUT /authors/{authorId}/book/{bookId}DELETE /authors/{authorId}/book/{bookId}解决方案2
我的解决方案是只有一个 PUT 方法可以完成所有这三件事,因为书籍列表仅存在于对象作者内部,而您实际上正在更新作者。就像是:
PUT /authors/{authorId}/updateBookList(并将整个更新的书籍列表发送到作者对象内)
我发现我的场景中有多个错误。例如,从客户端发送更多数据、在客户端上有一些逻辑、对 API 进行更多验证以及依赖客户端拥有最新版本的图书列表。
我的问题是:这样做是反模式吗?
情况 1. 在我的情况下,我的 API 使用另一个 API,而不是数据库。使用的 API 只有一种“updateBookList”方法,因此我猜测在我的 API 中复制此行为也更容易。是否也正确呢?
情况 2。但是,假设我的 API 将使用数据库,那么使用解决方案 1 是否更合适?
另外,如果您可以提供一些可以找到类似信息的文章、书籍。我知道这种设计并不是一成不变的,但一些指导方针会有所帮助。(示例:摘自 REST API 设计规则手册 - Masse - O'Reilly)
我的 databricks python 代码位于github. 我设置了一个基本工作流程来使用flake8. 这会失败,因为当我的脚本在 databricks 上运行时隐式可用的名称(例如spark、、等)在databricks 外部(在 github ubuntu vm 中)进行 lint时不可用。scdbutilsgetArgumentflake8
如何在github使用中检查 databricks 笔记本flake8?
例如我得到的错误:
test.py:1:1: F821 undefined name 'dbutils'
test.py:3:11: F821 undefined name 'getArgument'
test.py:5:1: F821 undefined name 'dbutils'
test.py:7:11: F821 undefined name 'spark'
Run Code Online (Sandbox Code Playgroud)
我的笔记本在github上:
dbutils.widgets.text("my_jdbcurl", "default my_jdbcurl")
jdbcurl = getArgument("my_jdbcurl")
dbutils.fs.ls(".")
df_node = spark.read.format("jdbc")\
.option("driver", "org.mariadb.jdbc.Driver")\
.option("url", jdbcurl)\
.option("dbtable", "my_table")\
.option("user", "my_username")\
.option("password", "my_pswd")\
.load()
Run Code Online (Sandbox Code Playgroud)
我的 .github/workflows/lint.yml
on:
pull_request:
branches: …Run Code Online (Sandbox Code Playgroud) 我是甲骨文诺布.我正在尝试将(expdp/impdp)架构(无数据)从一台机器复制到另一台机器.我不想重新映射.我只想在targetHOST上创建空表结构.我得到的错误是:
ORA-39083: Object type PROCACT_SCHEMA failed to create with error:
ORA-31625: Schema ZABBIX is needed to import this object, but is unaccessible
ORA-01435: user does not exist
Run Code Online (Sandbox Code Playgroud)
我的理解是,如果执行导入的用户具有"IMPORT FULL DATABASE"权限,它将在targetHOST中创建用户/模式.我把它授予'scott'并尝试了同样的错误.
导入错误:
(0)oracle@targetHOST$ sqlplus system/manager
SQL*Plus: Release 11.2.0.1.0 Production on Thu Oct 24 14:27:41 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> select * from session_privs;
PRIVILEGE
----------------------------------------
IMPORT FULL DATABASE
CREATE SESSION
.......200 …Run Code Online (Sandbox Code Playgroud) 我有一个用于Gateway API的自定义授权者。我已经阅读了许多有关如何自定义错误消息和验证或授权错误时返回给最终用户的代码的文章。这似乎是最有用的。
问题是API网关的行为与记录不符。
我的自定义授权者实现(python):
def lambda_handler(event, context):
raise Exception('the sky is falling!')
Run Code Online (Sandbox Code Playgroud)
当我使用curl调用API时:
kash@Laptop$ date; curl -i -X GET -H "Authorization: Bearer 1234abcd`date +%s`" https://xxxx.execute-api.us-west-2.amazonaws.com/prod/ticket
Mon Jun 4 12:27:51 CDT 2018
HTTP/1.1 500 Internal Server Error
Date: Mon, 04 Jun 2018 17:27:53 GMT
Content-Type: application/json
Content-Length: 16
Connection: keep-alive
x-amzn-RequestId: 9cc6d7ce-681c-xxxx-8a4a-23a7616ba4a5
x-amzn-ErrorType: AuthorizerConfigurationException
x-amz-apigw-id: xxxx=
{"message":null}
kash@Laptop$
Run Code Online (Sandbox Code Playgroud)
我如何使其返回HTTP 4xx {"message": "the sky is falling!"}?
用于调试:我通过我的API进入了网关响应,并从以下位置更新了“授权者配置错误(500)”的“正文映射模板”:
{"message":$context.error.messageString}
Run Code Online (Sandbox Code Playgroud)
对此:
{
"errorMessage":"$errorMessage",
"messageString":"$messageString",
"context.errorMessage":"$context.errorMessage",
"context.messageString":"$context.messageString",
"context.error.errorMessage":"$context.error.errorMessage",
"context.error.messageString":"$context.error.messageString",
"context.authorizer.error.errorMessage":"$context.authorizer.error.errorMessage"
"context.authorizer.error.errorMessage":"$context.authorizer.error.errorMessage"
"context.authorizer.errorMessage":"$context.authorizer.errorMessage" …Run Code Online (Sandbox Code Playgroud) java authentication http amazon-web-services aws-api-gateway
我对json说道.在定义我的RESTful API结果的格式(即JSON)时,我觉得将它作为我自己的JSON模式进行记录会更容易.写一篇文章的时候我几乎没有问题:
$schema属性?$schema.[忽略这一行,这是为了让格式化为后面的json ..]
{
"date":{
"type":"object",
"properties":{
"month":{
"type":"integer",
"minimum":1,
"maximum":12
},
"year":{
"type":"integer",
"minimum":0
}
}
},
"personInfo":{
"type":"object",
"properties":{
"name":{
"type":"string"
},
"dateOfBirth":{
"type":"date"
}
}
},
"student":{
"type":"object",
"properties":{
"id":{
"type":"personInfo"
},
"pass_out_year":{
"type":"date"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
而不是在多个地方提供"日期"的属性,如下所示:
{
"personInfo":{
"type":"object",
"properties":{
"name":{
"type":"string"
},
"dateOfBirth":{
"type":"object",
"properties":{
"month":{
"type":"integer",
"minimum":1,
"maximum":12
},
"year":{
"type":"integer",
"minimum":0
}
}
}
}
},
"student":{ …Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一个脚本,在拉取请求中存在的文件上运行pylint,并为linting错误创建内联注释.
我对如何使用PyGithub有所了解.问题是,为了评论pull-request,你必须知道修改文件的提交和补丁中的行号.有关评论评论API的完整文档,请点击此处.
Pylint返回结果文件中的行.我需要从foo/bar.py:30到foo/bar.py中修改第30行的提交,并获取该文件的diff中的实际位置.
有什么东西可以做到这一点,还是我必须在拉取请求中涉及的每个提交中手动搜索@@行?
我正在尝试在我的工作台中参数化一组常用查询.
这有效:
select * from providers where id='112233';
Run Code Online (Sandbox Code Playgroud)
这个
WbVarDef var1=112233;
select * from providers where id='$[var1]';
Run Code Online (Sandbox Code Playgroud)
给出错误
错误代码:1064.您的SQL语法有错误; 查看与您的MariaDB服务器版本对应的手册,以便在第1行的"来自提供商,其中id ='112233''附近使用正确的语法
我的参考是这个.
需要明确的是,这些都在MySQL工作台中,而不是工作台脚本文件或mysql脚本文件.
parallel当我在多台主机上运行相同命令时,是否可以在gnu输出的前面加上前缀?
我在一个工作池中有10台工作计算机,其中任何一台都可以接管工作,我想通过grep在所有日志文件中找出是哪个工作人员接管了:
parallel --nonall -S host1,host2,host3 grep job_id_123 /var/log/my_log.log
Run Code Online (Sandbox Code Playgroud)
打印类似:
initing job_id_123
doing phase1 job_id_123
doing phase2 job_id_123
wrapping up job_id_123
Run Code Online (Sandbox Code Playgroud)
我想要的是
host2: initing job_id_123
host2: doing phase1 job_id_123
host3: doing phase2 job_id_123
host1: wrapping up job_id_123
Run Code Online (Sandbox Code Playgroud)
我知道我可以这样做:
parallel --nonall -S host1,host2,host3 "hostname && grep job_id_123 /var/log/my_log.log"
Run Code Online (Sandbox Code Playgroud)
但是前缀是我所希望的。
我使用GNU parallel 20160422上Ubuntu precise (12.04.5 LTS)
python ×3
github ×2
sql ×2
amazon-s3 ×1
apache-spark ×1
api ×1
api-design ×1
databricks ×1
export ×1
flake8 ×1
git ×1
gnu ×1
gnu-parallel ×1
http ×1
http-verbs ×1
import ×1
java ×1
json ×1
jsonschema ×1
mysql ×1
oracle ×1
oracle11g ×1
permissions ×1
pip ×1
pylint ×1
pypi ×1
rest ×1
restful-url ×1
ubuntu ×1
urllib ×1
urllib3 ×1