Skip to content

Instantly share code, notes, and snippets.

@alexramos1
alexramos1 / dummy-web-server.py
Created November 8, 2017 22:43 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@alexramos1
alexramos1 / CognitoAuthenticationProvider.java
Last active July 30, 2023 07:44
Simplest possible implementation of AWS Cognito username/password authentication on Spring Security.
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nonnull;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;