$(gcloud info --format='value(config.project)')
Quick way to get project vars
logs in cli
gcloud logging read "SOME FILTER" --project SOME-PROJECT --format json | jq 'reverse[] | .textPayload ' --raw-output -j
Give yourself cluster admin role
kubectl create clusterrolebinding "cluster-admin-$(whoami)" \
--clusterrole=cluster-admin \
--user="$(gcloud config get-value core/account)"
Portforwarding RDP or anything else via SSH
ssh -L 33899:[SERVER_IP]:3389 [BASTION-HOST]
Utility pods
DB DEBUG
kubectl run psqlclient --rm --tty -i --image bitnami/postgresql --command -- psql --host postgres-proxy -U [USER] --password [PASSWORD]
Find subjects of all CAs
awk -v cmd='openssl x509 -noout -subject' '
/BEGIN/{close(cmd)};{print | cmd}' < /etc/ssl/certs/ca-certificates.crt
Display Contents of a Cert
openssl x509 -in [CERT] -text -noout
Cert gen + Sign
openssl ecparam -out privatekey.key -name prime256v1 -genkey
openssl req -new -x509 -days 365 -key ca.key -subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=Acme Root CA" -out ca.crt
openssl req -newkey rsa:2048 -nodes -keyout server.key -subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=[HOSTNAME]" -out server.csr
openssl x509 -req -extfile <(printf "subjectAltName=DNS:[HOSTNAME]") -days 365 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt
Google Service Account Generation, paste the output to an Env variable and select don't display it.
base64 --wrap=0 FILENAME.json
git update-index --chmod=+x [PATH]
dig +qr +short txt `dig +short TXT _spf.google.com | grep -oE 'include:\S*' | cut -d':' -f2 | xargs` | grep -oE 'ip[46]:\S*' | sort | uniq`