Skip to content

Instantly share code, notes, and snippets.

View thomas11's full-sized avatar

Thomas Kappler thomas11

View GitHub Profile
@thomas11
thomas11 / gist:2909362
Created June 11, 2012 09:52
Log memory usage every n seconds in Go #golang
import (
"runtime"
"time"
)
...
go func() {
for {
var m runtime.MemStats
@thomas11
thomas11 / Stop-AllDockerContainers.ps1
Created November 20, 2017 03:56
Stop all running Docker containers in Powershell
function Stop-AllDockerContainers() {
$containers = docker container ls | Select-Object -Skip 1
if ($containers) {
$containers | Foreach-Object { $_.Split(' ')[0] } | Foreach-Object { docker container stop $_ }
}
}