Skip to content

Instantly share code, notes, and snippets.

@constantlycoding
constantlycoding / OpenSSL
Last active September 20, 2020 19:36
OpenSSL and certificates
.csr - Certificate Signing Request
.pem - certificate container
-----BEGIN CERTIFICATE REQUEST----- and -----END CERTIFICATE REQUEST----- show a CSR in PEM format.
-----BEGIN RSA PRIVATE KEY----- and -----END RSA PRIVATE KEY----- show a private key in PEM format.
-----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- show a certificate file in PEM format.
.key - PEM formatted file containing just private-key
.p12 - Passworded certificate container that contains both public and private certificate pairs
.der - a .pem file is just a Base64 encoded .der file
.crt - a .pem (or rarely .der) file recognized by Windows
#-------------------------------------------------------------------------------------
# Create Self signed root certificate
# -dnsname -DnsName domain.example.com,anothersubdomain.example.com
# -Subject "CN=Patti Fuller,OU=UserAccounts,DC=corp,DC=contoso,DC=com"
$cert = New-SelfSignedCertificate -Type Custom -KeySpec Signature `
-Subject "CN=P2SRootCert" `
-KeyExportPolicy Exportable `
-HashAlgorithm sha256 -KeyLength 4096 `
-CertStoreLocation "Cert:\CurrentUser\My" `
-KeyUsageProperty Sign `
if has('gui_running')
set go-=T " no toolbar
set lines=60 columns=108 linespace=0
set gfn=Consolas:h12:cANSI
endif
set nocp
set nu
colo morning
@constantlycoding
constantlycoding / my-cka-study.md
Last active July 16, 2019 01:56
My CKA Study Guide

Core Concepts 19%

Cluster Architecture

etcd

cat /etc/systemd/system/etcd.service
cat /etc/kubernetes/manifests/etcd.yaml (kubeadm)
ps -fC etcd | cat

kube-api

@constantlycoding
constantlycoding / my-cka-tips.md
Last active July 25, 2022 08:04
My CKA tips

Autocomplete

alias k=kubectl
complete -F __start_kubectl k

Namespace

# Create
k create ns dev

Create load balancer

gcloud compute forwarding-rules create nginx-lb \
         --region us-central1 \
         --ports=80 \
         --target-pool nginx-pool

Check

gcloud compute forwarding-rules list
@constantlycoding
constantlycoding / my-kubernetes-bootcamp.md
Last active July 5, 2019 17:00
My Kubernetes bootcamp

Aliases

alias ka='kubectl api-resources'
alias kap='kubectl apply'
alias kc='kubectl cluster-info'
alias kd='kubectl describe'
alias kdl='kubectl delete'
alias ke='kubectl exec'
alias kex='kubectl explain'
alias kep='kubectl expose'
@constantlycoding
constantlycoding / install-web.sh
Last active July 3, 2019 08:41
Configure a firewall and a startup script with Deployment Manager
#!/bin/bash
apt-get update
@constantlycoding
constantlycoding / git-config.txt
Created March 19, 2019 13:31
Git config name and email
git config user.name "Azmi Kamis"
git config user.email "[email protected]"
@constantlycoding
constantlycoding / kubetools.txt
Last active March 11, 2019 14:49
Kubernetes tools
cd /d C:\Program Files\Docker\Docker\resources\bin
aria2c https://github.com/thomasliddledba/kubenswin/raw/master/bin/kubenswin.exe
aria2c https://github.com/thomasliddledba/kubectxwin/raw/master/bin/kubectxwin.exe
ren kubectxwin.exe kubectx.exe
ren kubenswin.exe kubens.exe