Skip to content

Instantly share code, notes, and snippets.

View magick93's full-sized avatar
💩
Focusing

magick93

💩
Focusing
View GitHub Profile
@magick93
magick93 / docker-cleanup-resources.md
Created October 16, 2017 22:42 — 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

{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"raw_mimetype": "text/html",
"slideshow": {
"slide_type": "slide"
}
},
@magick93
magick93 / docker-clean.sh
Created October 1, 2017 06:37 — forked from mugifly/docker-clean.sh
Cleanup Script for Docker Images and Containers
#!/bin/sh
echo -e "-- Removing exited containers --\n"
docker ps --all --quiet --filter="status=exited" | xargs --no-run-if-empty docker rm --volumes
echo -e "\n\n-- Removing untagged images --\n"
docker rmi --force $(docker images | awk '/^<none>/ { print $3 }')
echo -e "\n\n-- Removing volume directories --\n"
docker volume rm $(docker volume ls --quiet --filter="dangling=true")
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.4.0/protoc-3.4.0-linux-x86_64.zip
# Unzip
unzip protoc-3.4.0-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
@magick93
magick93 / IFMLCodeGenerator-Main.xtend
Created April 27, 2017 21:24 — forked from acerosalazar/IFMLCodeGenerator-Main.xtend
A template for creating an Xtend based CodeGenerator using the Ecore implementation of the IFML metamodel and a sample model.
package generator
// This code is based on this stackoverflow answer:http://stackoverflow.com/questions/12458852/load-emf-model-instance-in-xtend
import org.eclipse.emf.common.util.URI
import org.eclipse.emf.ecore.resource.Resource
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl
import org.eclipse.emf.ecore.EPackage