This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # generate rsa keypair | |
| openssl genrsa -out keypair.pem 4096 | |
| # display public key | |
| openssl rsa -in keypair.pem -pubout | |
| # encrypt plain text | |
| openssl rsautl -encrypt -pubin -inkey alice-public.pem -in plain.txt | base64 > encrypted.txt | |
| # decrypt encrypted test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [ -n "$1" ]; then | |
| BASE_DIR="$1" | |
| if [ ! -d "$BASE_DIR" ]; then | |
| echo "$BASE_DIR does not exist and will be created" | |
| mkdir -p -v $BASE_DIR | |
| fi | |
| else | |
| BASE_DIR="." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Commit Id of HEAD | |
| git rev-parse HEAD | |
| # Find all children of HEAD | |
| git rev-list --children --all | grep $(git rev-parse HEAD) | head -1 | |
| # Find first child of HEAD (children[1] is the Commit Id of HEAD) | |
| git rev-list --children --all | grep $(git rev-parse HEAD) | head -1 | awk '{split($0,children," "); print children[2]}' | |
| # Checkout fist child commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # create cluster via website | |
| doctl kubernetes cluster kubeconfig save [clustername] | |
| kubectl cluster-info | |
| # install cert-manager | |
| kubectl apply --validate=false -f https://raw.githubusercontent.com/jetstack/cert-manager/v0.13.0/deploy/manifests/00-crds.yaml | |
| kubectl create namespace cert-manager | |
| helm repo add jetstack https://charts.jetstack.io | |
| helm repo update | |
| helm install cert-manager jetstack/cert-manager --namespace cert-manager --version v0.13.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # see also https://brew.sh/ | |
| # fetch the newest version of Homebrew | |
| brew update | |
| # upgrade outdated, unpinned formulae using the same options they were originally installed with | |
| brew upgrade |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git remote add other /path/to/XXX | |
| git fetch other | |
| git checkout -b ZZZ other/master | |
| mkdir ZZZ | |
| git mv stuff ZZZ/stuff # repeat as necessary for each file/dir | |
| git commit -m "Moved stuff to ZZZ" | |
| git checkout master | |
| git merge ZZZ --allow-unrelated-histories # should add ZZZ/ to master | |
| git commit | |
| git remote rm other |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function doGet(request) { | |
| if (request.parameters.url != undefined && request.parameters.url != "") { | |
| var imageBlob = UrlFetchApp.fetch(request.parameters.url).getBlob(); | |
| var resource = { | |
| title: imageBlob.getName(), | |
| mimeType: imageBlob.getContentType() | |
| }; | |
| var options = { | |
| ocr: true | |
| }; |