Skip to content

Instantly share code, notes, and snippets.

View aschober's full-sized avatar

Allen Schober aschober

View GitHub Profile
@aschober
aschober / aws-cli-recursive.sh
Last active July 9, 2019 00:07
Recursive AWS CLI S3 put-object-legal-hold Command
# command using s3 and s3api to recursively go through each file in a bucket and update the legal hold flag
# https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object-legal-hold.html
# https://stackoverflow.com/a/53696774
aws s3 ls s3://<bucket-location> --recursive > files.txt && cat files.txt | awk '{cmd="aws s3api put-object-legal-hold --legal-hold Status=OFF --bucket <bucket-location> --key "$4;system(cmd)}'

Keybase proof

I hereby claim:

  • I am aschober on github.
  • I am allenschober (https://keybase.io/allenschober) on keybase.
  • I have a public key whose fingerprint is 647A E53D 099C CA4F 6A3A FFE1 B957 B717 500D DF8E

To claim this, I am signing this object:

@aschober
aschober / gitversioning
Created March 27, 2013 19:36
XCode script to automatically create Version and Build values from Git repo description. Based on multiple sources.
#!/bin/bash
# This script automatically sets the version and short version string of
# an Xcode project from the Git repository containing the project.
#
# To use this script in Xcode 4, add the contents to a "Run Script" build
# phase for your application target.
set -o errexit
set -o nounset