Skip to content

Instantly share code, notes, and snippets.

View guidobit's full-sized avatar

Guido Baars guidobit

View GitHub Profile
@hendrixroa
hendrixroa / aws_rotate_key.ts
Created January 18, 2020 22:19
Script to rotate aws keys in Gitlab CI/CD
import * as aws from 'aws-sdk';
import { RequestAPI, RequiredUriUrl } from 'request';
import * as request from 'request-promise-native';
// Update the credentials depending of environment
aws.config.update({
accessKeyId: process.env[`AWS_KEY_${process.env.STAGE}`],
region: process.env.AWS_DEFAULT_REGION,
secretAccessKey: process.env[`AWS_SECRET_${process.env.STAGE}`],
});
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@henriquemenezes
henriquemenezes / curl-upload-file.sh
Last active September 12, 2023 20:19
Using CURL to Upload Files
# curl - Raw upload
curl -X PUT -T image.png https://example.com/upload
# curl - Content-Type: multipart/form-data
curl -F name=logo -F file=@image.png https://example.org/upload
# curl - POST presigned URL (S3)