Skip to content

Instantly share code, notes, and snippets.

@mikegrassotti
Last active October 3, 2016 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikegrassotti/b0bc350dc2a3ec7c8a2c03cb384f970b to your computer and use it in GitHub Desktop.
Save mikegrassotti/b0bc350dc2a3ec7c8a2c03cb384f970b to your computer and use it in GitHub Desktop.
OSX Shell hacks
# Last 10 days
seq 0 10 | xargs -I {} date -v-{}d '+%Y-%m-%d'
# Download last 10 Papertrail archives
seq 0 10 | xargs -I {} date -v-{}d '+%Y-%m-%d' | xargs -I {} curl -g -v --progress-bar -f -o {}.tsv.gz -L -H "X-Papertrail-Token: $PAPERTRAIL_TOKEN" https://papertrailapp.com/api/v1/archives/{}/download
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment