Skip to content

Instantly share code, notes, and snippets.

View hugoheden's full-sized avatar

Hugo Heden hugoheden

View GitHub Profile
@hugoheden
hugoheden / swagger-ui-just-show-my-api.sh
Last active February 21, 2022 15:25
One-off: Fire up swagger-ui (docker) and let it render my OpenAPI yaml, so that I can see it on localhost:8080
docker run --rm -it -p 8080:8080 -e SWAGGER_JSON=/foo/api.yaml -v $(pwd):/foo swaggerapi/swagger-ui
@hugoheden
hugoheden / kubectl-network-multitool.sh
Created February 7, 2022 12:32
One-off kubectl: Run a temporary pod, useful for diagnostics
kubectl run --rm -it --restart=Never network-multitool --image=wbitt/network-multitool:alpine-extra -- bash
@hugoheden
hugoheden / nginx-serve-file.sh
Last active February 7, 2022 14:34
A simple one-off nginx: Use nginx in docker to serve a single file without any special configuration.
# This should make your file accessible on http://localhost:9080
# File is given as command line parameter. Expects relative path from current directory.
THE_FILE=$1
# File is served on port 9080.
docker run -it --rm -p 9080:80 -v "$(pwd)/$THE_FILE":"/usr/share/nginx/html/$THE_FILE" nginx:latest
@hugoheden
hugoheden / flyway_cmdline_examples.sh
Last active November 24, 2021 17:32
One off Flyway command line examples
# Flyway command line examples
#
# Print some info about the migrations applied (or not) in the DB, relating to the migration scripts in some directory
flyway -X -url='jdbc:mariadb://localhost:3306/my_db?currentSchema=my_schema' \
-user='my_db_user' -password='my_db_passwd' \
-locations=filesystem:./src/main/resources/db/migration \
info
# Migrate the DB using the files in the directory, but only up to version 1.2