Skip to content

Instantly share code, notes, and snippets.

View avillegasn's full-sized avatar

Antonio Villegas avillegasn

View GitHub Profile
@mkjsix
mkjsix / set-retention.sh
Last active January 31, 2020 08:57
Set retention policies for AWS CloudWatch Log Groups, for a profile and a region
#!/bin/bash
# Example - to set the logs retention policy for your default AWS account in region eu-west-1 to 5 days, execute the command:
# set-retention.sh default eu-west-1 5
export AWS_PROFILE=$1
export AWS_REGION=$2
RETENTION_DAYS=${3:-30}
echo "AWS_PROFILE=$AWS_PROFILE, AWS_REGION=$AWS_REGION, RETENTION_DAYS=$RETENTION_DAYS"
while read -r i;
do (aws logs put-retention-policy --region "$AWS_REGION" --log-group-name "$i" --retention-in-days "$RETENTION_DAYS" );
done < <(aws logs describe-log-groups --region "$AWS_REGION" --query 'logGroups[*].[logGroupName]' | grep / | sed 's/"//g')
@markgoodyear
markgoodyear / 01-gulpfile.js
Last active May 5, 2023 03:21
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),