Skip to content

Instantly share code, notes, and snippets.

View jeffmeyers's full-sized avatar

Jeff Meyers jeffmeyers

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jeffmeyers on github.
  • I am jmeyers (https://keybase.io/jmeyers) on keybase.
  • I have a public key ASAgFGlb6wVPH1xc5_8eeXfRiIVx2xeqFjNZU2IJa9KARwo

To claim this, I am signing this object:

@jeffmeyers
jeffmeyers / remove_empty_s3_files.rb
Created September 19, 2017 16:08
Delete empty files in S3 bucket
require 'aws-sdk'
client = Aws::S3::Client.new
bucket = Aws::S3::Bucket.new({
name: "bucketz",
client: client
})
empty = bucket.objects.select { |obj| obj.size == 0 }
empty_count = empty.length
@jeffmeyers
jeffmeyers / gist:7b9d1ed2f59812b26bef9a4c36503948
Created September 18, 2017 21:19
Get number of objects in an S3 bucket
aws s3 ls s3://mybucket/ --recursive | wc -l
@jeffmeyers
jeffmeyers / dups.sql
Created September 12, 2017 16:40
Delete dups in Postgres
DELETE FROM dups a USING (
SELECT MIN(ctid) as ctid, key
FROM dups
GROUP BY key HAVING COUNT(*) > 1
) b
WHERE a.key = b.key
AND a.ctid <> b.ctid
location ~ /your-endpoint {
resolver 8.8.8.8;
proxy_ssl_server_name on;
set $proxy_pass_1 'API_GATEWAY_URL';
proxy_pass $proxy_pass_1?$args;
}