Debian (bash)

OpenSSL

Inspect SSL certificates:

# Display all info
openssl x509 -text -in certificate.crt

# Display only subject and validity info 
openssl x509 -subject -dates -in certificate.crt

Generate SSL key and certificate request:

# Generate a key
openssl genrsa -out user.key 2048

# Generate a CSR with a minimal config
openssl req -new -key user.key -out user.csr -subj "/CN=user/O=admins/O=learning.lab"

# Generate a CSR with config from a file
openssl req -new -key user.key -out user.csr -config ssl_conf.conf

VIM

Search and replace:

# All instance in current line
:s/original/replaced/g

# All instances in all lines
:%s/original/replaced/g

# All instances in all lines, asks for confirmation
:%s/original/replaced/gc

K8s utilities

Kubeseal

Retrieve the public certificate of the controller:

kubeseal --controler-namespace <NAMESPACE> --controller-name sealed-secrets --fetch-cert >mycert.pem