This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import os | |
def curl_to_ab(curl_cmd: list, num: int=200, cur: int=4) -> str: | |
""" | |
Translate a cURL command created by Chrome's developer tools into a | |
command for ``ab``, the ApacheBench HTTP benchmarking tool. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": ["s3:ListBucket" ], | |
"Resource": [ "arn:aws:s3:::BUCKETNAME" ] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ "s3:PutObject", "s3:GetObject", "s3:DeleteObject", "s3:PutObjectAcl"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActionController::Base.asset_host = Proc.new { |source, request| | |
if request.env["REQUEST_PATH"] && request.env["REQUEST_PATH"].include?(".pdf") | |
"file://#{Rails.root.join('public')}" | |
else | |
"#{request.protocol}#{request.host_with_port}" | |
end | |
} |