Skip to content

Instantly share code, notes, and snippets.

View iamnogada's full-sized avatar

seungil han iamnogada

View GitHub Profile
openssl genpkey -algorithm RSA -out nogada.key
in openssl.cnf
[req]
distinguished_name = nogada_distinguished_name
x509_extensions = v3_req
prompt = no
[nogada_distinguished_name]
@iamnogada
iamnogada / gist:e7b5765b8db62afbb45edf3432e3c310
Created November 16, 2020 18:53
fix slow iterm2 pasting
Add the following in .zshrc:
...
plugins=(osx git zsh-autosuggestions zsh-syntax-highlighting zsh-nvm docker kubectl)
...
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
PFX_FILE=....
PASSWD=
1. extract crt from pfx :
openssl pkcs12 -clcerts -nokeys -in $PFX_FILE.pfx -out $PFX_FILE.crt -password pass:"$PASSWD"
2. extract ca from pfx :
openssl pkcs12 -cacerts -nokeys -in $PFX_FILE.pfx -out ca-cert.ca -password pass:"$PASSWD"
curl -u <user_name>:<password> -k https://<local_registry_host_name>:<local_registry_host_port>/v2/_catalog
ip=10.40.89.154::10.40.89.1:255.255.255.0:worker-6.skthcp.skcloud.io:ens192:none
nameserver=10.40.89.159 nameserver=168.126.63.1
coreos.inst.install_dev=sda
coreos.inst.image_url=http://10.40.89.158/install/rhcos-4.3.0-x86_64-metal.raw.gz
coreos.inst.ignition_url=http://10.40.89.158/install/worker6.ign
ADMIN=admin
kubectl create serviceaccount $ADMIN -n kube-system
cat << EOF | kubectl apply -f -
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
namespace: kube-system
curl -k https://default-route-openshift-image-registry.apps.hcp.darumtech.net:5000/v2/_catalog
curl -u mskim:YWv1ufs_eEJ7DoOYnRpdaiY9abodUGx7B4b3ZANyZ50 -k https://default-route-openshift-image-registry.apps.hcp.skcloud.io/v2/_catalog/az-cicd-dev/tags
curl -u admin:passw0rd https://registry.kubepia.net:5000/v2/ocp4/openshift4/tags/list
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
oc adm policy add-scc-to-user anyuid system:serviceaccount:zaction:es-service-account
-z option
curl -u user1:passw0rd -k https://default-route-openshift-image-registry.apps.hcp.darumtech.net/v2/_catalog