- First script can only update the storage class of files smaller than 5GB
- Second one uses multipart_copy to split files in 10MB parts and copy them one by one
- Third script tries to do the multipart_copy with a pool of threads. this one is not fully tested as Lambda does not give access to /dev/shm
This file contains hidden or 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
const { chromium } = require('playwright'); | |
if (process.argv.length !== 3) { | |
console.error('Expected exactly one argument!'); | |
process.exit(1); | |
} | |
(async () => { | |
const browser = await chromium.launch(); | |
const context = await browser.newContext(); |
This file contains hidden or 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/python3 | |
# Checkly API reference: https://www.checklyhq.com/docs/api | |
import datetime | |
import dateutil.parser as dp | |
import time | |
import numpy as np | |
import requests |
This file contains hidden or 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 bash | |
set -eEo pipefail | |
FILTER_VALUE="${1}" | |
INSTANCE_ATTRIBUTE="${2:-InstanceId}" | |
aws ec2 describe-instances --filters "Name=tag:Name,Values=$FILTER_VALUE" | jq -r ".Reservations[].Instances[].$INSTANCE_ATTRIBUTE" |
This file contains hidden or 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 bash | |
set -eEo pipefail | |
verify_mfa_arn () { | |
local MFA_ARN="$1" | |
if [ -z "$MFA_ARN" ]; | |
then | |
echo "You need to configure your MFA device for '$AWS_CLI_PROFILE' profile" | |
read -p "Enter the ARN of your MFA device: " MFA_ARN |
This file contains hidden or 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
# The name of our algorithm | |
algorithm_name=rmars | |
#set -e # stop if anything fails | |
account=$(aws sts get-caller-identity --query Account --output text) | |
# Get the region defined in the current configuration (default to us-west-2 if none defined) | |
region=$(aws configure get region) | |
region=${region:-us-west-2} |
This file contains hidden or 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
# DOMContentLoaded | |
# Defined by the HTML specification: | |
# | |
# "The DOMContentLoaded reports the time when the initial HTML document has been completely loaded and parsed, | |
# without waiting for stylesheets, images, and subframes to finish loading." - MDN. | |
SELECT | |
SUM(fcp.density) | |
FROM | |
`chrome-ux-report.chrome_ux_report.201710`, |
This file contains hidden or 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
apt-get update && \ | |
apt-get install -y \ | |
ffmpeg \ | |
scons \ | |
wget \ | |
git \ | |
binutils \ | |
cpp-5 \ | |
language-pack-en-base \ | |
libacl1 \ |
This file contains hidden or 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
VERSION=0.9.2 | |
NAME=consul | |
.PHONY: package build download cleanup verify prepare | |
build: package cleanup | |
download: prepare | |
wget -O consul_$(VERSION)_SHA256SUMS https://releases.hashicorp.com/consul/$(VERSION)/consul_$(VERSION)_SHA256SUMS | |
wget -O consul_$(VERSION)_linux_amd64.zip https://releases.hashicorp.com/consul/$(VERSION)/consul_$(VERSION)_linux_amd64.zip |
These scripts will help get the best from wg/wrk (https://github.com/wg/wrk)
Example:
$ head useragents.lst
Mozilla/5.0 (PLAYSTATION 3; 3.55)
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0; Xbox; Xbox One)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; Xbox; Xbox One) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586
Mozilla/5.0 (PlayStation 4 1.51) AppleWebKit/536.26 (KHTML, like Gecko)
NewerOlder