Skip to content

Instantly share code, notes, and snippets.

@CrispyBaguette
CrispyBaguette / gist:63c903b91c092a220202ab424b9f6b05
Created November 30, 2021 11:13
Regex for rudimentary parsing of InfluxDB line protocol
/^(?<measurement>\w+),(?<tags>(?:\w+=\w+,?)+)+\s(?<fields>(?:\w+=(?:"\w+"|\w+),?)+)\s(?<ts>[0-9]+)$/
@CrispyBaguette
CrispyBaguette / docker_swarm_config_cleanup.py
Created November 6, 2021 13:38
Docker Swarm: delete unused configs
import docker
client = docker.client.from_env()
def get_configs_for_service(service):
return [
*get_configs_from_current_spec(service),
*get_configs_from_previous_spec(service)
]
#!/bin/bash
# Create the target dir
mkdir Completed
for mkvFile in *.mkv; do
# Get the file name without the extension
filename=$(basename -- "$mkvFile")
filename="${filename%.*}"