Skip to content

Instantly share code, notes, and snippets.

policies required:

{ "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt1469172280000", "Effect": "Allow", "Action": [ "cloudformation:*"

@bastman
bastman / aws-cli-cognito-get-open-id-token-for-developer-identity.md
Last active May 2, 2021 15:43
aws cognito examples (bash / php): custom auth provider

Aws Cognito: Custom Auth (Developer Authenticated Identities)

How to get OpenID Token & IdentityId from AWS Cognito?

  • example: using bash (aws cli sdk)
  • example: using php (aws php sdk v3.*)

note

  • you need to add example.com as custom auth provider in aws console (cognito/federated)
@bastman
bastman / php-mysql-upgrade-oldpasswords.md
Created May 3, 2016 14:12
How to solve PDOException: SQLSTATE[HY000] [2000] mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication.
@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

@bastman
bastman / docker_resize_vm.txt
Created March 30, 2016 09:25
docker_resize_vm
docker-machine create --driver virtualbox --virtualbox-disk-size "40000" default
@bastman
bastman / remove_docker_volumes.txt
Created March 29, 2016 12:08
remove_docker_volumes.txt
// 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
@bastman
bastman / docker_remove_networks.txt
Created March 24, 2016 16:18
remove all docker networks
docker network rm $(docker network ls | grep "foo" | awk '/ / { print $1 }')
@bastman
bastman / remove_docker_images.txt
Last active March 30, 2016 06:15
remove_docker_images
docker rmi $(docker images | grep "foo" | awk '/ / { print $3 }')
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
docker rm $(docker ps -qa --no-trunc --filter "status=exited")
and: http://stackoverflow.com/questions/32723111/how-to-remove-old-and-unused-docker-images
@bastman
bastman / composer.json
Created March 16, 2016 14:21
Typo3 Source Artifact Downloader (composer)
{
"name": "meteogroup/typo3-sources",
"description": "see: https://get.typo3.org/json",
"version": "1.0.0",
"license": "proprietary",
"keywords": [
],
@bastman
bastman / README.md
Last active May 11, 2023 07:55
parse erb templates from command line (standalone, cli, json)

Goal

  • provide cli command to render erb template
  • template params (bindings) to be provided using json format
  • use inputs from file (template.erb, params.json)
  • use inputs from cli options / parameters
  • render output to stdout OR to file

Why ?