For more security use -aes512 4096
openssl genrsa -out key.pem -aes256 2048
Extract public key as PEM
#!/bin/bash | |
# more shortcuts at https://www.sslshopper.com/article-most-common-java-keytool-keystore-commands.html | |
# list certificates included in a keystore | |
keytool -list -v -keystore keystore.jks | |
# with specific storetype: | |
keytool -list -v -storetype jceks keystore.jks | |
# check a specific certificate | |
keytool -printcert -v -file mydomain.crt |
# check active connections | |
netstat -ant | grep 4444 | wc -l | |
# only established connections | |
netstat -ant | grep 4444 | grep -i established | wc -l | |
# idle connections | |
netstat -an -f inet | grep -v EST | grep IDLE | wc -l | |
# in loop |
# first, format USB as ExtFAT (using Disk Utility) | |
# convert .iso to .img | |
hdiutil convert -format UDRW -o ./ubuntu-18.04.2-server-amd64.img ubuntu-18.04.2-server-amd64.iso | |
# mac adds .dmg at the end, we need to remove that | |
mv ubuntu-18.04.2-server-amd64.img.dmg ubuntu-18.04.2-server-amd64.img | |
# find out the disk-name: | |
diskutil list |
# How to do updates to your environment | |
# more details to deployments and scaling: | |
# https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ | |
# 1. update the deployment.yml file and run | |
kubectl apply -f <deployment.yml> | |
# 2. update an image: | |
kubectl set image <deployment/nginx-deployment> <nginx>=<nginx:1.9.1> |
# Secrets handling | |
# create secret | |
kubectl create secret generic db-user-pass --from-file=./username.txt --from-file=./password.txt | |
# get Secrets | |
kubectl get secrets | |
# get secret details | |
kubectl get secret mysecret -o yaml | |
# encode secret values | |
echo "asdfghjkl==" | base64 --decode |
# scale to 10 replicas | |
kubectl scale deployment <nginx-deployment> --replicas=10 | |
# auto-Scaling | |
kubectl autoscale deployment <nginx-deployment> --min=2 --max=8 --cpu-percent=80 |
# Documentation: https://kubernetes.io/docs | |
# | |
# get kubernetes version and info | |
kubectl version | |
# get infor on pods | |
kubectl get pods | |
# get info on deployments | |
kubectl get deployments | |
kubectl describe deployments |