Skip to content

Instantly share code, notes, and snippets.

aws s3 ls --summarize --recursive s3://ooni-data/autoclaved/jsonl.tar.lz4/2018 | \
awk '{print $3}' | \
paste -sd+ - | \
sed 's/\++/+/g' | \
bc
=> 4413049840600
@aq
aq / aws_s3_sender.rb
Created May 22, 2018 12:38
Utility to execute queries and put them on gist/slack/...
#!/usr/bin/env ruby
require 'aws-sdk-resources'
require 'thor'
require 'fileutils'
require 'slack/post'
%w(aws_aki aws_sak aws_bucket aws_region postgres_url).each do |env_variable|
raise "Missing env variable: #{env_variable}" if ENV[env_variable].nil?
end
@aq
aq / autoscaling.config.yml
Last active March 25, 2016 09:46
Sample of an Elasticbeanstalk config file used by eb cli to create an autoscaled worker based on an SQS queue .ebextension/autoscaling.config
# The name of this file is autoscaling.config. .yml has been added for syntax highlighting.
# References:
# http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-general.html#command-options-general-elasticbeanstalksqsd
# http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
# http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-resources.html
# Create manually first those 2 resources:
# * the SQS queue, here its name is: my-sqs-queue
# * the RDS Postgres database