# Delete all containers
docker rm $(docker ps -aq)
# Delete all images
docker rmi $(docker images -q)
# Delete all untagged images
docker rmi $(docker images -q --filter "dangling=true")References:
| <?php | |
| class KubernetesLeaderElection | |
| { | |
| private string $apiServer; | |
| private ?string $token = null; | |
| private string $namespace; | |
| private string $leaseName; | |
| private string $identity; | |
| private int $leaseDuration; |
| ### PowerShell Example | |
| # set variables | |
| $OMADA_URL = "https://omada.example.com:8043" | |
| $USERNAME = "admin" | |
| $PASSWORD = "test12345" | |
| # get controller id from the API | |
| $CONTROLLER_ID = (Invoke-RestMethod -Uri "${OMADA_URL}/api/info" -Method Get -UseBasicParsing).result.omadacId | |
| # set the login request body as json |
| #!/bin/bash | |
| function prompt_for_multiselect { | |
| # little helpers for terminal print control and key input | |
| GREEN='\033[00;32m' | |
| YELLOW='\033[00;33m' | |
| RESTORE='\033[0m' | |
| ESC=$( printf "\033") | |
| cursor_blink_on() { printf "$ESC[?25h"; } |
| import ( | |
| "github.com/aws/aws-sdk-go/aws" | |
| "github.com/aws/aws-sdk-go/aws/credentials" | |
| "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" | |
| "github.com/aws/aws-sdk-go/aws/credentials/stscreds" | |
| "github.com/aws/aws-sdk-go/aws/ec2metadata" | |
| "github.com/aws/aws-sdk-go/aws/session" | |
| ) | |
| func buildConfig() { |
| /* | |
| PUT THIS FILE IN ~/Library/KeyBindings/DefaultKeyBinding.dict | |
| This file remaps the key bindings of a single user on Mac OS X 10.5 to more closely | |
| match default behavior on Windows systems. This particular mapping assumes | |
| that you have also switched the Control and Command keys already. | |
| This key mapping is more appropriate after switching Ctrl for Command in this menu: | |
| Apple->System Preferences->Keyboard & Mouse->Keyboard->Modifier Keys...-> | |
| Change Control Key to Command | |
| Change Command key to Control |
# Delete all containers
docker rm $(docker ps -aq)
# Delete all images
docker rmi $(docker images -q)
# Delete all untagged images
docker rmi $(docker images -q --filter "dangling=true")References:
| package server | |
| import ( | |
| "context" | |
| "os" | |
| "os/signal" | |
| "syscall" | |
| "time" | |
| "golang.org/x/sync/errgroup" |
| #!/usr/bin/python | |
| from __future__ import print_function | |
| import base64 | |
| import commands | |
| import json | |
| import sys | |
| import uuid | |
| import xmltodict |
| package main | |
| import "fmt" | |
| func addName(name string, callback func(string)) { | |
| callback(name) | |
| } | |
| func main() { | |
| addName("lamar", func(nm string) { |