Skip to content

Instantly share code, notes, and snippets.

View Sporky023's full-sized avatar

Luke Griffiths Sporky023

View GitHub Profile
@Sporky023
Sporky023 / docker-cleanup-resources.md
Last active November 26, 2018 23:13 — forked from bastman/docker-cleanup-resources.md
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

function gmailAutoarchive() {
var delayDays = 2; // will only impact emails more than 48h old
var maxDate = new Date((new Date).getTime() - delayDays * 24 * 3600 * 1000);
// Get all the threads labelled 'autoarchive'
var label = GmailApp.getUserLabelByName("autoarchive");
var threads = label.getThreads(0, 400);