Skip to content

Instantly share code, notes, and snippets.

@tonybaines
tonybaines / SSL Auth service response
Last active October 22, 2019 14:18
envoy.client_ssl_auth plus ext_authz
{
"certificates": [
{
"fingerprint_sha256": "360458fd929de8b0ffc2a93fcc034f391bd78af2fdd9f071b56dc524608c3290"
},
{
"fingerprint_sha256": "204e569af575fe96f0ab570d4307cc2b4658689b83f6e336f20d367f04922b15"
}
]
}
@tonybaines
tonybaines / make_ca
Created October 22, 2019 13:58
openssl commands for public key stuff without interaction
openssl req -newkey rsa:4096 -nodes -keyform PEM \
-subj "/C=GB/ST=Suffolk/L=Ipswich/O=foobar/CN=trust.foobar.com" \
-keyout etc/CA.key -x509 -days 9999 -outform PEM -out etc/CA.pem
import java.util.stream.IntStream;
class Scratch {
public static void main(String[] args) {
int lowerBound = 100;
int upperBound = 999;
System.out.println(
val lowerBound = 100
val upperBound = 999
val Int.isPalindrome: Boolean
get() = this.toString() == this.toString().reversed()
println((lowerBound..upperBound).flatMap { x ->
(lowerBound..upperBound).map { y -> x * y }
.filter { it.isPalindrome }
}.max())
@tonybaines
tonybaines / clear_ca.bash
Created December 18, 2018 09:19
Openssl hacks for dev
#!/usr/bin/env bash
read -r -p "Are You Sure You Want to Remove the Certificate Authority? [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
rm -f certs/ca.cert.pem private/ca.key.pem
;;
*)
echo "Quitting"
@tonybaines
tonybaines / IntelliJ-Elm-Setup.md
Last active January 5, 2019 19:41
IntelliJ IDEA Elm Setup

Configuring and Using IntelliJ IDEA for basic Elm development

Assumes an elm toolchain installed through NPM

npm install -g elm elm-test elm-format

Versions

  • Elm 0.18
  • IntelliJ IDEA 2017.3.4
@tonybaines
tonybaines / logging.sh
Created December 23, 2015 08:25
Useful bash scripting functions
# foundation function for the actual log-functions to build on
function _log {
echo "[$(date +%Y%m%d-%T)] $1"
}
# functions for the different log levels
function log_debug {
# debug messages need to be enabled through an environment varaible
if [ $DEBUG ]
then