Skip to content

Instantly share code, notes, and snippets.

Avatar

Filipe Freire filfreire

View GitHub Profile
@filfreire
filfreire / sample-ssl-client-server-cert.sh
Created Nov 18, 2022
Create sample SSL Client and Server Certificates
View sample-ssl-client-server-cert.sh
#!/usr/bin/env bash
openssl genrsa -aes256 -passout pass:changeme -out ca.pass.key 4096
openssl rsa -passin pass:changeme -in ca.pass.key -out ca.key
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
openssl genrsa -aes256 -passout pass:changeme -out server.pass.key 4096
openssl rsa -passin pass:changeme -in server.pass.key -out server.key
openssl req -new -key server.key -out server.csr
openssl x509 -CAcreateserial -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key -out server.crt
openssl genrsa -aes256 -passout pass:changeme -out client.pass.key 4096
View grep_json_field.sh
# quick hack alternative to using 'jq -r .some_field'
grep -o '"some_field": *"[^"]*' experiment.json | grep -o '[^"]*$'