Skip to content

Instantly share code, notes, and snippets.

@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

@Arnold1
Arnold1 / main.cpp
Last active January 12, 2019 21:40
screen recording
#include "ScreenCapture.h"
#include <algorithm>
#include <atomic>
#include <chrono>
#include <iostream>
#include <locale>
#include <string>
#include <thread>
#include <vector>
#include <queue>
@k33g
k33g / project-create.sh
Last active November 28, 2018 14:14 — forked from francoisromain/project-create.sh
A bash script to create a Git post-receive hook to deploy after a Git push
#!/bin/sh
# Call this file with `bash ./project-create.sh project-name [service-name]`
# project-name is mandatory
# service-name is optional
# This will creates 3 directories and a git `post-receive` hook.
# - $GIT: a git repo
# - $TMP: a temporary directory for deployment
# - $WWW: a directory for the actual production files
import hudson.model.*;
import jenkins.model.*;
import hudson.plugins.ec2.*;
import com.amazonaws.services.ec2.model.InstanceType
import com.amazonaws.services.ec2.model.KeyPair
if ( Jenkins.instance.pluginManager.activePlugins.find { it.shortName == "ec2" } != null ) {
println "--> setting ec2 plugin"
EC2Cloud cloud = Jenkins.instance.clouds.find { it instanceof EC2Cloud }
@yen3
yen3 / Caddyfile
Last active March 10, 2022 07:06
Example for https docker-gitlab under reversed proxy environment - Caddy http server
https://gitlab.example.com {
proxy / https://localhost:10443 {
insecure_skip_verify
transparent
}
tls {
dns gandiv5
}
}
@SijmenHuizenga
SijmenHuizenga / main.go
Created April 8, 2020 22:57
Zip a directory in Golang with error handling, ignoring symlinks and file checking
func zipDirectory(zipfilename string) error {
outFile, err := os.Create(zipfilename)
if err != nil {
return err
}
w := zip.NewWriter(outFile)
if err := addFilesToZip(w, zipfilename, ""); err != nil {
_ = outFile.Close()